arkana 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkana/templates/arkana.podspec.erb +3 -0
- data/lib/arkana/templates/arkana_tests.swift.erb +51 -3
- data/lib/arkana/templates/interfaces.podspec.erb +3 -0
- data/lib/arkana/templates/interfaces_package.swift.erb +2 -0
- data/lib/arkana/templates/package.swift.erb +2 -0
- data/lib/arkana/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22608014d403cf3e16f5d5f13d92cbab02691de72f98492de289c0a1cb53ed64
|
4
|
+
data.tar.gz: ba1209829e1ac32b881febadcfc74dca440cdaab81a259dc7d034c1ab3363306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58de3a4b5cf38c589de28dfb656a84f8b9c8e1464996eed8573acd119d6468fb2ec8c3cf0c5fea7df76a57b1cf099b58aa69bf1804a301176ac2b5af583e2c6c
|
7
|
+
data.tar.gz: 4591ab624fdf27570fbf78b084124b131ed8af389be6dba34ed2a3d81f456f093825ae436c4af6bab5f6250453a4aa6ac6aed7ba7f42013a11c18338f75a1712
|
@@ -12,6 +12,9 @@ Pod::Spec.new do |spec|
|
|
12
12
|
spec.source = { path: "./" }
|
13
13
|
spec.source_files = 'Sources/**/*.swift'
|
14
14
|
spec.ios.deployment_target = '11.0'
|
15
|
+
spec.osx.deployment_target = '11.0'
|
16
|
+
spec.tvos.deployment_target = '11.0'
|
17
|
+
spec.watchos.deployment_target = '4.0'
|
15
18
|
spec.swift_version = '5.0'
|
16
19
|
|
17
20
|
spec.dependency '<%= @pod_name %>Interfaces', '~> 1.0.0'
|
@@ -2,15 +2,29 @@
|
|
2
2
|
// Automatically generated by Arkana (https://github.com/rogerluan/arkana)
|
3
3
|
|
4
4
|
import Foundation
|
5
|
+
import <%= @import_name %>Interfaces
|
5
6
|
import XCTest
|
6
7
|
@testable import <%= @import_name %>
|
7
8
|
|
8
9
|
|
9
10
|
final class <%= @namespace %>Tests: XCTestCase {
|
10
|
-
private var salt: [UInt8]
|
11
|
-
|
11
|
+
private var salt: [UInt8]!
|
12
|
+
private var globalSecrets: <%= @namespace %>GlobalProtocol!
|
12
13
|
|
13
|
-
|
14
|
+
override func setUp() {
|
15
|
+
super.setUp()
|
16
|
+
salt = [
|
17
|
+
<%= @salt.formatted %>
|
18
|
+
|
19
|
+
]
|
20
|
+
globalSecrets = <%= @namespace %>.Global()
|
21
|
+
}
|
22
|
+
|
23
|
+
override func tearDown() {
|
24
|
+
globalSecrets = nil
|
25
|
+
salt = nil
|
26
|
+
super.tearDown()
|
27
|
+
}
|
14
28
|
|
15
29
|
func test_decodeRandomHexKey_shouldDecode() {
|
16
30
|
<% hex_key = SecureRandom.hex(64) %>
|
@@ -71,4 +85,38 @@ final class <%= @namespace %>Tests: XCTestCase {
|
|
71
85
|
]
|
72
86
|
XCTAssertEqual(<%= @namespace %>.decode(encoded: encoded, cipher: salt), 42)
|
73
87
|
}
|
88
|
+
|
89
|
+
func test_encodeAndDecodeValueWithDollarSign_shouldDecode() {
|
90
|
+
<% dollar_sign_key = "real_$lim_shady" %>
|
91
|
+
<% secret = generate_test_secret(key: dollar_sign_key) %>
|
92
|
+
let encoded: [UInt8] = [
|
93
|
+
<%= secret.encoded_value %>
|
94
|
+
|
95
|
+
]
|
96
|
+
XCTAssertEqual(<%= @namespace %>.decode(encoded: encoded, cipher: salt), "real_$lim_shady")
|
97
|
+
}
|
98
|
+
|
99
|
+
func test_decodeEnvVarFromDotfile_withDollarSign__andEscaped_andNoQuotes_shouldDecode() {
|
100
|
+
XCTAssertEqual(globalSecrets.secretWithDollarSignEscapedAndAndNoQuotesKey, "real_$lim_shady")
|
101
|
+
}
|
102
|
+
|
103
|
+
func test_decodeEnvVarFromDotfile_withDollarSign__andEscaped_andDoubleQuotes_shouldDecode() {
|
104
|
+
XCTAssertEqual(globalSecrets.secretWithDollarSignEscapedAndDoubleQuoteKey, "real_$lim_shady")
|
105
|
+
}
|
106
|
+
|
107
|
+
func test_decodeEnvVarFromDotfile_withDollarSign__andNotEscaped_andSingleQuotes_shouldDecode() {
|
108
|
+
XCTAssertEqual(globalSecrets.secretWithDollarSignNotEscapedAndSingleQuoteKey, "real_$lim_shady")
|
109
|
+
}
|
110
|
+
|
111
|
+
func test_decodeEnvVarFromDotfile_withDollarSign__andNotEscaped_andDoubleQuotes_shouldDecodeWithUnexpectedValue() {
|
112
|
+
XCTAssertNotEqual(globalSecrets.secretWithDollarSignNotEscapedAndDoubleQuotesKey, "real_$lim_shady")
|
113
|
+
}
|
114
|
+
|
115
|
+
func test_decodeEnvVarFromDotfile_withDollarSign__andNotEscaped_andNoQuotes_shouldDecodeWithUnexpectedValue() {
|
116
|
+
XCTAssertNotEqual(globalSecrets.secretWithDollarSignNotEscapedAndNoQuotesKey, "real_$lim_shady")
|
117
|
+
}
|
118
|
+
|
119
|
+
func test_decodeEnvVarFromDotfile_withWeirdCharacters_shouldDecode() {
|
120
|
+
XCTAssertEqual(globalSecrets.secretWithWeirdCharactersKey, "` ~ ! @ # % ^ & * ( ) _ - + = { [ } } | : ; ' < , > . ? /")
|
121
|
+
}
|
74
122
|
}
|
@@ -12,5 +12,8 @@ Pod::Spec.new do |spec|
|
|
12
12
|
spec.source = { path: "./" }
|
13
13
|
spec.source_files = 'Sources/**/*.swift'
|
14
14
|
spec.ios.deployment_target = '11.0'
|
15
|
+
spec.osx.deployment_target = '11.0'
|
16
|
+
spec.tvos.deployment_target = '11.0'
|
17
|
+
spec.watchos.deployment_target = '4.0'
|
15
18
|
spec.swift_version = '5.0'
|
16
19
|
end
|
data/lib/arkana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arkana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Oba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|