arkana 1.3.0 → 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: 3242744410abe76a55179b7b5b96f439954ab12ba5e7ff158f6246632638fe82
4
- data.tar.gz: 1d4f26ecd3620042a7b8766760e294565bee9d16dd21f2784fe493e82745bc14
3
+ metadata.gz: 22608014d403cf3e16f5d5f13d92cbab02691de72f98492de289c0a1cb53ed64
4
+ data.tar.gz: ba1209829e1ac32b881febadcfc74dca440cdaab81a259dc7d034c1ab3363306
5
5
  SHA512:
6
- metadata.gz: 1a9ebab8bb7034af9b9a754f1b808f77a7d56ead4220a96037411103512a0accb5774989cf86aedf6b31f2c8426798826cab243c100c104386beae8104c36603
7
- data.tar.gz: d8d6b424743d72b83f349078febc04bcb08621f8472211a69ec594e35ecb32c4dde96cb72ead008766f3bc5381c12f3170d356275403ac0a69c676d2fcf501e9
6
+ metadata.gz: 58de3a4b5cf38c589de28dfb656a84f8b9c8e1464996eed8573acd119d6468fb2ec8c3cf0c5fea7df76a57b1cf099b58aa69bf1804a301176ac2b5af583e2c6c
7
+ data.tar.gz: 4591ab624fdf27570fbf78b084124b131ed8af389be6dba34ed2a3d81f456f093825ae436c4af6bab5f6250453a4aa6ac6aed7ba7f42013a11c18338f75a1712
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "logger"
4
- require "colorize"
4
+ require "rainbow/refinement"
5
+ using Rainbow
5
6
 
6
7
  # Contains utilities related to display information to the user on the Terminal (the user's interface).
7
8
  module UI
@@ -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.0"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arkana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
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: 2022-11-08 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
- name: colorize
14
+ name: dotenv
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
19
+ version: '2.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.8'
26
+ version: '2.7'
27
27
  - !ruby/object:Gem::Dependency
28
- name: dotenv
28
+ name: rainbow
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.7'
33
+ version: 3.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.7'
40
+ version: 3.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: yaml
43
43
  requirement: !ruby/object:Gem::Requirement