arkana 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce80a9e65c8e5657c8b6a911369535704cd614be0933aba04972b0ff593adedf
4
- data.tar.gz: 00b7213a6d42eb9ccd3acd3970a8cd520a3452306f60898d02fa3fba22adcb13
3
+ metadata.gz: 22608014d403cf3e16f5d5f13d92cbab02691de72f98492de289c0a1cb53ed64
4
+ data.tar.gz: ba1209829e1ac32b881febadcfc74dca440cdaab81a259dc7d034c1ab3363306
5
5
  SHA512:
6
- metadata.gz: bbfcc870b444b746a44c0ae611d92ea7fd62a72c45bc563a9217c1d4a84bfd4eb249ff8a612cb76d1911200f664195a35efb2bb6bf90f75998ddbd4fde039cfa
7
- data.tar.gz: e8e57f955a70b2d03b58cc0566cfef9633ce9a78e765d135786c49892880c44ca171a3e2991b5399348c3bd5650b69c52fb2728c80e79eaf06da7ed8c1f93168
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
- <%= @salt.formatted %>
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
@@ -10,6 +10,8 @@ let package = Package(
10
10
  platforms: [
11
11
  .macOS(.v11),
12
12
  .iOS(.v11),
13
+ .tvOS(.v11),
14
+ .watchOS(.v4),
13
15
  ],
14
16
  products: [
15
17
  .library(
@@ -10,6 +10,8 @@ let package = Package(
10
10
  platforms: [
11
11
  .macOS(.v11),
12
12
  .iOS(.v11),
13
+ .tvOS(.v11),
14
+ .watchOS(.v4),
13
15
  ],
14
16
  products: [
15
17
  .library(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arkana
4
- VERSION = "1.3.1"
4
+ VERSION = "1.4.0"
5
5
  end
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.3.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-02-12 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv