porky_lib 0.10.0 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 568cf3209e11d99fee524612407bafd881f4d9e89e3386a72d5289f53e662e68
4
- data.tar.gz: 7c81973288046c5b7e604b50f4d25af8a3ce8412090b1cc9bf81e651b95c5cdd
3
+ metadata.gz: 3bc35f40c3051550885d77c4cb5edb2d2da78eee3ec7a353b2c294c2ebe07850
4
+ data.tar.gz: 1ac84fd0d9f72af5dc8ee7884ca3c6110890ead4e5df59d1afd98f460c3d7196
5
5
  SHA512:
6
- metadata.gz: fe5165454793c9fbd9a74b0a4f9adf8cae0a65b8e8ae1bd190c45c5b770cd6535da21ffdb9f52e71f2a6f59ba3f4a21049cf523ed60329ed75f642bfc8102936
7
- data.tar.gz: 46f45d303ce3f1d3991ec6c3de254218e4c311843ec5d11a6aac9a05b03cb40d0a8bb9a78ff353d77985aceb2f1f51d4752edc3b501132f773436725570873c5
6
+ metadata.gz: a224c539cc3fcccbdb041102f2c9cc438a61fbc12fe41611c7265f0e55070cad20592b27d8d0a53c39e39663987cb6acd3e944e819273f210e5006a8c40fe87e
7
+ data.tar.gz: cef34d7e95e2fa9d959c9d0bc1eb41d17289f5ee477faf8e32634dd5ff713d8828e01fce0b2b471e94781c90d15f0f5d7f75b8993872418be9af9ff265be7833
data/.circleci/config.yml CHANGED
@@ -4,7 +4,7 @@ jobs:
4
4
  parallelism: 1
5
5
  working_directory: ~/porky_lib
6
6
  docker:
7
- - image: circleci/ruby:2.7.0
7
+ - image: circleci/ruby:3.0.2
8
8
 
9
9
  steps:
10
10
  - checkout
@@ -27,6 +27,10 @@ jobs:
27
27
  name: Bundle Install
28
28
  command: bundle install
29
29
 
30
+ - run:
31
+ name: Install libsodium
32
+ command: sudo apt-get install libsodium-dev
33
+
30
34
  - save_cache:
31
35
  name: Store bundle cache
32
36
  key: porky_lib-bundle-{{ checksum "Gemfile.lock" }}
@@ -0,0 +1,46 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ open-pull-requests-limit: 10
9
+ reviewers:
10
+ - weiyunlu
11
+ assignees:
12
+ - weiyunlu
13
+ ignore:
14
+ - dependency-name: aws-sdk-s3
15
+ versions:
16
+ - 1.88.1
17
+ - 1.88.2
18
+ - 1.89.0
19
+ - 1.90.0
20
+ - 1.92.0
21
+ - 1.93.1
22
+ - dependency-name: rubocop
23
+ versions:
24
+ - 1.10.0
25
+ - 1.12.0
26
+ - 1.12.1
27
+ - 1.9.0
28
+ - dependency-name: codecov
29
+ versions:
30
+ - 0.5.0
31
+ - dependency-name: rubocop-performance
32
+ versions:
33
+ - 1.10.0
34
+ - dependency-name: timecop
35
+ versions:
36
+ - 0.9.2
37
+ - 0.9.3
38
+ - dependency-name: aws-sdk-kms
39
+ versions:
40
+ - 1.42.0
41
+ - dependency-name: rubocop-rspec
42
+ versions:
43
+ - 1.44.1
44
+ - dependency-name: msgpack
45
+ versions:
46
+ - 1.4.1
data/.rubocop.yml CHANGED
@@ -3,6 +3,7 @@ require:
3
3
  - rubocop-performance
4
4
 
5
5
  AllCops:
6
+ NewCops: enable
6
7
  Exclude:
7
8
  - bin/*
8
9
  - db/**/*.rb
@@ -10,7 +11,7 @@ AllCops:
10
11
  - output/**/*
11
12
  - vendor/**/*
12
13
  - spec/porky_lib/data/*
13
- TargetRubyVersion: 2.7.0
14
+ TargetRubyVersion: 2.7.2
14
15
  RSpec:
15
16
  Patterns:
16
17
  - _spec.rb
@@ -33,7 +34,7 @@ Security/YAMLLoad:
33
34
  Security/JSONLoad:
34
35
  Enabled: true
35
36
 
36
- Metrics/LineLength:
37
+ Layout/LineLength:
37
38
  Max: 160
38
39
 
39
40
  Metrics/ClassLength:
@@ -59,3 +60,144 @@ RSpec/MultipleExpectations:
59
60
 
60
61
  RSpec/ExampleLength:
61
62
  Max: 10
63
+
64
+ RSpec/MultipleMemoizedHelpers:
65
+ Enabled: false
66
+
67
+ Style/HashEachMethods:
68
+ Enabled: true
69
+
70
+ Style/HashTransformKeys:
71
+ Enabled: true
72
+
73
+ Style/HashTransformValues:
74
+ Enabled: true
75
+
76
+ Lint/RaiseException:
77
+ Enabled: true
78
+
79
+ Lint/StructNewOverride:
80
+ Enabled: true
81
+
82
+ Layout/SpaceAroundMethodCallOperator:
83
+ Enabled: true
84
+
85
+ Layout/EmptyLineBetweenDefs:
86
+ Enabled: false
87
+
88
+ Style/ExponentialNotation:
89
+ Enabled: true
90
+
91
+ Layout/EmptyLinesAroundAttributeAccessor:
92
+ Enabled: true
93
+
94
+ Lint/DeprecatedOpenSSLConstant:
95
+ Enabled: true
96
+
97
+ Style/SlicingWithRange:
98
+ Enabled: true
99
+
100
+ Lint/MixedRegexpCaptureTypes:
101
+ Enabled: true
102
+
103
+ Style/RedundantRegexpCharacterClass:
104
+ Enabled: true
105
+
106
+ Style/RedundantRegexpEscape:
107
+ Enabled: true
108
+
109
+ Style/RedundantFetchBlock:
110
+ Enabled: true
111
+
112
+ Style/AccessorGrouping:
113
+ Enabled: true
114
+
115
+ Style/BisectedAttrAccessor:
116
+ Enabled: true
117
+
118
+ Style/RedundantAssignment:
119
+ Enabled: true
120
+
121
+ Performance/AncestorsInclude:
122
+ Enabled: true
123
+
124
+ Performance/BigDecimalWithNumericArgument:
125
+ Enabled: true
126
+
127
+ Performance/RedundantSortBlock:
128
+ Enabled: true
129
+
130
+ Performance/RedundantStringChars:
131
+ Enabled: true
132
+
133
+ Performance/ReverseFirst:
134
+ Enabled: true
135
+
136
+ Performance/SortReverse:
137
+ Enabled: true
138
+
139
+ Performance/Squeeze:
140
+ Enabled: true
141
+
142
+ Performance/StringInclude:
143
+ Enabled: true
144
+
145
+ Lint/DuplicateElsifCondition:
146
+ Enabled: true
147
+
148
+ Style/ArrayCoercion:
149
+ Enabled: true
150
+
151
+ Style/CaseLikeIf:
152
+ Enabled: true
153
+
154
+ Style/HashAsLastArrayItem:
155
+ Enabled: true
156
+
157
+ Style/HashLikeCase:
158
+ Enabled: true
159
+
160
+ Style/RedundantFileExtensionInRequire:
161
+ Enabled: true
162
+
163
+ Lint/BinaryOperatorWithIdenticalOperands:
164
+ Enabled: true
165
+
166
+ Lint/DuplicateRescueException:
167
+ Enabled: true
168
+
169
+ Lint/EmptyConditionalBody:
170
+ Enabled: true
171
+
172
+ Lint/FloatComparison:
173
+ Enabled: true
174
+
175
+ Lint/MissingSuper:
176
+ Enabled: true
177
+
178
+ Lint/OutOfRangeRegexpRef:
179
+ Enabled: true
180
+
181
+ Lint/SelfAssignment:
182
+ Enabled: true
183
+
184
+ Lint/TopLevelReturnWithArgument:
185
+ Enabled: true
186
+
187
+ Lint/UnreachableLoop:
188
+ Enabled: true
189
+
190
+ Style/ExplicitBlockArgument:
191
+ Enabled: true
192
+
193
+ Style/GlobalStdStream:
194
+ Enabled: true
195
+
196
+ Style/OptionalBooleanParameter:
197
+ Enabled: true
198
+
199
+ Style/SingleArgumentDig:
200
+ Enabled: true
201
+
202
+ Style/StringConcatenation:
203
+ Enabled: true
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ruby '2.7.0'
3
+ ruby '3.0.2'
4
4
 
5
5
  source "https://rubygems.org"
6
6
 
data/Gemfile.lock CHANGED
@@ -1,99 +1,100 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- porky_lib (0.10.0)
4
+ porky_lib (0.11.1)
5
5
  aws-sdk-kms
6
6
  aws-sdk-s3
7
7
  msgpack
8
- rbnacl (= 5.0.0)
9
- rbnacl-libsodium
8
+ rbnacl (= 7.1.1)
10
9
 
11
10
  GEM
12
11
  remote: https://rubygems.org/
13
12
  specs:
14
- ast (2.4.0)
15
- aws-eventstream (1.0.3)
16
- aws-partitions (1.272.0)
17
- aws-sdk-core (3.90.0)
18
- aws-eventstream (~> 1.0, >= 1.0.2)
19
- aws-partitions (~> 1, >= 1.239.0)
13
+ ast (2.4.2)
14
+ aws-eventstream (1.2.0)
15
+ aws-partitions (1.673.0)
16
+ aws-sdk-core (3.168.3)
17
+ aws-eventstream (~> 1, >= 1.0.2)
18
+ aws-partitions (~> 1, >= 1.651.0)
19
+ aws-sigv4 (~> 1.5)
20
+ jmespath (~> 1, >= 1.6.1)
21
+ aws-sdk-kms (1.61.0)
22
+ aws-sdk-core (~> 3, >= 3.165.0)
20
23
  aws-sigv4 (~> 1.1)
21
- jmespath (~> 1.0)
22
- aws-sdk-kms (1.29.0)
23
- aws-sdk-core (~> 3, >= 3.71.0)
24
- aws-sigv4 (~> 1.1)
25
- aws-sdk-s3 (1.60.2)
26
- aws-sdk-core (~> 3, >= 3.83.0)
24
+ aws-sdk-s3 (1.117.2)
25
+ aws-sdk-core (~> 3, >= 3.165.0)
27
26
  aws-sdk-kms (~> 1)
28
- aws-sigv4 (~> 1.1)
29
- aws-sigv4 (1.1.0)
30
- aws-eventstream (~> 1.0, >= 1.0.2)
31
- bundler-audit (0.6.1)
27
+ aws-sigv4 (~> 1.4)
28
+ aws-sigv4 (1.5.2)
29
+ aws-eventstream (~> 1, >= 1.0.2)
30
+ bundler-audit (0.9.1)
32
31
  bundler (>= 1.2.0, < 3)
33
- thor (~> 0.18)
34
- byebug (11.1.1)
32
+ thor (~> 1.0)
33
+ byebug (11.1.3)
35
34
  codacy-coverage (2.2.1)
36
35
  simplecov
37
- codecov (0.1.16)
38
- json
39
- simplecov
40
- url
41
- diff-lcs (1.3)
42
- docile (1.3.2)
43
- ffi (1.12.2)
44
- jaro_winkler (1.5.4)
45
- jmespath (1.4.0)
46
- json (2.3.0)
47
- msgpack (1.3.3)
48
- parallel (1.19.1)
49
- parser (2.7.0.2)
50
- ast (~> 2.4.0)
51
- rainbow (3.0.0)
52
- rake (13.0.1)
53
- rbnacl (5.0.0)
36
+ codecov (0.6.0)
37
+ simplecov (>= 0.15, < 0.22)
38
+ diff-lcs (1.5.0)
39
+ docile (1.4.0)
40
+ ffi (1.15.4)
41
+ jmespath (1.6.2)
42
+ json (2.6.3)
43
+ msgpack (1.6.0)
44
+ parallel (1.22.1)
45
+ parser (3.1.3.0)
46
+ ast (~> 2.4.1)
47
+ rainbow (3.1.1)
48
+ rake (13.0.6)
49
+ rbnacl (7.1.1)
54
50
  ffi
55
- rbnacl-libsodium (1.0.16)
56
- rbnacl (>= 3.0.1)
57
- rexml (3.2.4)
58
- rspec (3.9.0)
59
- rspec-core (~> 3.9.0)
60
- rspec-expectations (~> 3.9.0)
61
- rspec-mocks (~> 3.9.0)
51
+ regexp_parser (2.6.1)
52
+ rexml (3.2.5)
53
+ rspec (3.10.0)
54
+ rspec-core (~> 3.10.0)
55
+ rspec-expectations (~> 3.10.0)
56
+ rspec-mocks (~> 3.10.0)
62
57
  rspec-collection_matchers (1.2.0)
63
58
  rspec-expectations (>= 2.99.0.beta1)
64
- rspec-core (3.9.1)
65
- rspec-support (~> 3.9.1)
66
- rspec-expectations (3.9.0)
59
+ rspec-core (3.10.2)
60
+ rspec-support (~> 3.10.0)
61
+ rspec-expectations (3.10.1)
67
62
  diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.9.0)
69
- rspec-mocks (3.9.1)
63
+ rspec-support (~> 3.10.0)
64
+ rspec-mocks (3.10.3)
70
65
  diff-lcs (>= 1.2.0, < 2.0)
71
- rspec-support (~> 3.9.0)
72
- rspec-support (3.9.2)
73
- rspec_junit_formatter (0.4.1)
66
+ rspec-support (~> 3.10.0)
67
+ rspec-support (3.10.3)
68
+ rspec_junit_formatter (0.6.0)
74
69
  rspec-core (>= 2, < 4, != 2.12.0)
75
- rubocop (0.80.0)
76
- jaro_winkler (~> 1.5.1)
70
+ rubocop (1.40.0)
71
+ json (~> 2.3)
77
72
  parallel (~> 1.10)
78
- parser (>= 2.7.0.1)
73
+ parser (>= 3.1.2.1)
79
74
  rainbow (>= 2.2.2, < 4.0)
80
- rexml
75
+ regexp_parser (>= 1.8, < 3.0)
76
+ rexml (>= 3.2.5, < 4.0)
77
+ rubocop-ast (>= 1.23.0, < 2.0)
81
78
  ruby-progressbar (~> 1.7)
82
- unicode-display_width (>= 1.4.0, < 1.7)
83
- rubocop-performance (1.5.2)
84
- rubocop (>= 0.71.0)
85
- rubocop-rspec (1.38.1)
86
- rubocop (>= 0.68.1)
87
- rubocop_runner (2.2.0)
88
- ruby-progressbar (1.10.1)
89
- simplecov (0.18.2)
79
+ unicode-display_width (>= 1.4.0, < 3.0)
80
+ rubocop-ast (1.24.0)
81
+ parser (>= 3.1.1.0)
82
+ rubocop-performance (1.15.1)
83
+ rubocop (>= 1.7.0, < 2.0)
84
+ rubocop-ast (>= 0.4.0)
85
+ rubocop-rspec (2.16.0)
86
+ rubocop (~> 1.33)
87
+ rubocop_runner (2.2.1)
88
+ ruby-progressbar (1.11.0)
89
+ simplecov (0.21.2)
90
90
  docile (~> 1.1)
91
91
  simplecov-html (~> 0.11)
92
- simplecov-html (0.12.0)
93
- thor (0.20.3)
94
- timecop (0.9.1)
95
- unicode-display_width (1.6.1)
96
- url (0.3.2)
92
+ simplecov_json_formatter (~> 0.1)
93
+ simplecov-html (0.12.3)
94
+ simplecov_json_formatter (0.1.3)
95
+ thor (1.2.1)
96
+ timecop (0.9.6)
97
+ unicode-display_width (2.3.0)
97
98
 
98
99
  PLATFORMS
99
100
  ruby
@@ -109,8 +110,7 @@ DEPENDENCIES
109
110
  msgpack
110
111
  porky_lib!
111
112
  rake
112
- rbnacl (= 5.0.0)
113
- rbnacl-libsodium
113
+ rbnacl (= 7.1.1)
114
114
  rspec
115
115
  rspec-collection_matchers
116
116
  rspec-mocks
@@ -123,7 +123,7 @@ DEPENDENCIES
123
123
  timecop
124
124
 
125
125
  RUBY VERSION
126
- ruby 2.7.0p0
126
+ ruby 3.0.2p107
127
127
 
128
128
  BUNDLED WITH
129
- 2.1.4
129
+ 2.2.22
data/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2020 Thinking Capital Financial Corporation
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md CHANGED
@@ -273,13 +273,19 @@ the likelihood of the pull request being accepted.
273
273
 
274
274
  This application requires:
275
275
 
276
- * Ruby version: 2.7.0
276
+ * Ruby version: 2.7.2
277
+
278
+ Ruby 2.7.2 and greater requires OpenSSL 1.1+. To link to Homebrew's upgraded version of OpenSSL, add the following to your bash profile
279
+
280
+ ```shell script
281
+ export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
282
+ ```
277
283
 
278
284
  If you do not have Ruby installed, it is recommended you use ruby-install and chruby to manage Ruby versions.
279
285
 
280
286
  ```bash
281
287
  brew install ruby-install chruby
282
- ruby-install ruby 2.7.0
288
+ ruby-install ruby 2.7.2
283
289
  ```
284
290
 
285
291
  Add the following lines to ~/.bash_profile:
@@ -289,11 +295,11 @@ source /usr/local/opt/chruby/share/chruby/chruby.sh
289
295
  source /usr/local/opt/chruby/share/chruby/auto.sh
290
296
  ```
291
297
 
292
- Set Ruby version to 2.7.0:
298
+ Set Ruby version to 2.7.2:
293
299
 
294
300
  ```bash
295
301
  source ~/.bash_profile
296
- chruby 2.7.0
302
+ chruby 2.7.2
297
303
  ```
298
304
 
299
305
  ### Running Tests
@@ -72,7 +72,7 @@ class Aws::KMS::Client
72
72
 
73
73
  def decrypt(ciphertext_blob:, encryption_context: nil)
74
74
  key_id, decoded_context, plaintext = MessagePack.unpack(ciphertext_blob.reverse)
75
- decoded_context = Hash[decoded_context.map { |k, v| [k.to_sym, v] }] if decoded_context
75
+ decoded_context = decoded_context.transform_keys(&:to_sym) if decoded_context
76
76
  raise Aws::KMS::Errors::InvalidCiphertextException.new(nil, nil) unless decoded_context == encryption_context
77
77
 
78
78
  Aws::KMS::Types::DecryptResponse.new(
@@ -38,7 +38,7 @@ class PorkyLib::Config
38
38
  end
39
39
 
40
40
  def self.logger
41
- @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
41
+ @logger ||= defined?(Rails) ? Rails.logger : Logger.new($stdout)
42
42
  @logger
43
43
  end
44
44
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'aws-sdk-kms'
4
- require 'rbnacl/libsodium'
4
+ require 'rbnacl'
5
5
  require 'singleton'
6
6
  require 'benchmark'
7
7
 
@@ -12,11 +12,15 @@ class PorkyLib::Symmetric
12
12
  CMK_KEY_USAGE = 'ENCRYPT_DECRYPT'
13
13
  SYMMETRIC_KEY_SPEC = 'AES_256'
14
14
 
15
+ EncryptedText = Struct.new(:ciphertext, :nonce, :statistics)
16
+ DecryptedText = Struct.new(:plaintext, :statistics)
17
+
15
18
  def client
16
19
  require 'porky_lib/aws/kms/client' if PorkyLib::Config.config[:aws_client_mock]
17
20
  @client ||= Aws::KMS::Client.new
18
21
  end
19
22
 
23
+ # rubocop:disable Style/OptionalBooleanParameter
20
24
  def create_key(tags, key_alias = nil, key_rotation_enabled = true)
21
25
  resp = client.create_key(key_usage: CMK_KEY_USAGE, origin: CMK_KEY_ORIGIN, tags: tags)
22
26
  key_id = resp.to_h[:key_metadata][:key_id]
@@ -29,6 +33,7 @@ class PorkyLib::Symmetric
29
33
 
30
34
  key_id
31
35
  end
36
+ # rubocop:enable Style/OptionalBooleanParameter
32
37
 
33
38
  def cmk_alias_exists?(key_alias)
34
39
  alias_list = client.list_aliases.to_h[:aliases]
@@ -203,12 +208,7 @@ class PorkyLib::Symmetric
203
208
  # Encrypt a message with SecretBox
204
209
  ciphertext = secret_box.encrypt(nonce, plaintext)
205
210
 
206
- result = OpenStruct.new
207
-
208
- result.ciphertext = ciphertext
209
- result.nonce = nonce
210
-
211
- result
211
+ EncryptedText.new(ciphertext, nonce, nil)
212
212
  end
213
213
 
214
214
  def decrypt_with_key(ciphertext, plaintext_key, nonce)
@@ -218,11 +218,7 @@ class PorkyLib::Symmetric
218
218
  # Decrypt the message
219
219
  plaintext = secret_box.decrypt(nonce, ciphertext)
220
220
 
221
- result = OpenStruct.new
222
-
223
- result.plaintext = plaintext
224
-
225
- result
221
+ DecryptedText.new(plaintext, nil)
226
222
  end
227
223
 
228
224
  def encrypt_with_key_with_benchmark(plaintext, plaintext_key)
@@ -243,13 +239,7 @@ class PorkyLib::Symmetric
243
239
  [nonce, ciphertext]
244
240
  end
245
241
 
246
- result = OpenStruct.new
247
-
248
- result.ciphertext = ciphertext
249
- result.nonce = nonce
250
- result.statistics = encryption_statistics
251
-
252
- result
242
+ EncryptedText.new(ciphertext, nonce, encryption_statistics)
253
243
  end
254
244
 
255
245
  def decrypt_with_key_with_benchmark(ciphertext, plaintext_key, nonce)
@@ -264,12 +254,7 @@ class PorkyLib::Symmetric
264
254
  plaintext
265
255
  end
266
256
 
267
- result = OpenStruct.new
268
-
269
- result.plaintext = plaintext
270
- result.statistics = encryption_statistics
271
-
272
- result
257
+ DecryptedText.new(plaintext, encryption_statistics)
273
258
  end
274
259
 
275
260
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PorkyLib
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.2"
5
5
  end
data/lib/tasks/file.rake CHANGED
@@ -8,15 +8,15 @@ namespace :file do
8
8
  # Optional arguments
9
9
  use_mock_client = ENV.fetch('AWS_S3_MOCK_CLIENT', 'true') == 'true'
10
10
  max_file_size = ENV.fetch('AWS_S3_MAX_FILE_SIZE', 1_048_576).to_i
11
- destination = ENV.fetch('DESTINATION', ENV['FILE_KEY'])
11
+ destination = ENV.fetch('DESTINATION', ENV.fetch('FILE_KEY', nil))
12
12
 
13
13
  # Required arguments
14
14
  arguments = {
15
- file_key: ENV['FILE_KEY'],
16
- aws_s3_bucket: ENV['AWS_S3_BUCKET'],
17
- aws_region: ENV['AWS_REGION'],
18
- aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
19
- aws_access_key: ENV['AWS_ACCESS_KEY']
15
+ file_key: ENV.fetch('FILE_KEY', nil),
16
+ aws_s3_bucket: ENV.fetch('AWS_S3_BUCKET', nil),
17
+ aws_region: ENV.fetch('AWS_REGION', nil),
18
+ aws_access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID', nil),
19
+ aws_access_key: ENV.fetch('AWS_ACCESS_KEY', nil)
20
20
  }
21
21
 
22
22
  # Checks presence of required arguments and configures porky_lib
@@ -42,12 +42,12 @@ namespace :file do
42
42
 
43
43
  # Required arguments
44
44
  arguments = {
45
- file_path: ENV['FILE_PATH'],
46
- cmk_key_id: ENV['CMK_KEY_ID'],
47
- aws_s3_bucket: ENV['AWS_S3_BUCKET'],
48
- aws_region: ENV['AWS_REGION'],
49
- aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
50
- aws_access_key: ENV['AWS_ACCESS_KEY']
45
+ file_path: ENV.fetch('FILE_PATH', nil),
46
+ cmk_key_id: ENV.fetch('CMK_KEY_ID', nil),
47
+ aws_s3_bucket: ENV.fetch('AWS_S3_BUCKET', nil),
48
+ aws_region: ENV.fetch('AWS_REGION', nil),
49
+ aws_access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID', nil),
50
+ aws_access_key: ENV.fetch('AWS_ACCESS_KEY', nil)
51
51
  }
52
52
 
53
53
  # Checks presence of required arguments and configures porky_lib
data/porky_lib.gemspec CHANGED
@@ -13,7 +13,9 @@ Gem::Specification.new do |spec|
13
13
  spec.summary = 'A library for cryptographic services using AWS KMS and RbNaCl'
14
14
  spec.homepage = 'https://github.com/Zetatango/porky_lib'
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
+ spec.required_ruby_version = '>= 2.7.2'
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
19
  f.match(%r{^(test|spec|features)/})
18
20
  end
19
21
  spec.bindir = 'exe'
@@ -29,12 +31,11 @@ Gem::Specification.new do |spec|
29
31
  spec.add_development_dependency 'codecov'
30
32
  spec.add_development_dependency 'msgpack'
31
33
  spec.add_development_dependency 'rake'
32
- spec.add_development_dependency 'rbnacl', '=5.0.0'
33
- spec.add_development_dependency 'rbnacl-libsodium'
34
+ spec.add_development_dependency 'rbnacl', '=7.1.1'
34
35
  spec.add_development_dependency 'rspec'
35
36
  spec.add_development_dependency 'rspec-collection_matchers'
36
- spec.add_development_dependency 'rspec-mocks'
37
37
  spec.add_development_dependency 'rspec_junit_formatter'
38
+ spec.add_development_dependency 'rspec-mocks'
38
39
  spec.add_development_dependency 'rubocop'
39
40
  spec.add_development_dependency 'rubocop-performance'
40
41
  spec.add_development_dependency 'rubocop-rspec'
@@ -45,6 +46,8 @@ Gem::Specification.new do |spec|
45
46
  spec.add_dependency 'aws-sdk-kms'
46
47
  spec.add_dependency 'aws-sdk-s3'
47
48
  spec.add_dependency 'msgpack'
48
- spec.add_dependency 'rbnacl', '=5.0.0'
49
- spec.add_dependency 'rbnacl-libsodium'
49
+ spec.add_dependency 'rbnacl', '=7.1.1'
50
+ spec.metadata = {
51
+ 'rubygems_mfa_required' => 'true'
52
+ }
50
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: porky_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Fletcher
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-20 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms
@@ -142,28 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 5.0.0
145
+ version: 7.1.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 5.0.0
153
- - !ruby/object:Gem::Dependency
154
- name: rbnacl-libsodium
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
152
+ version: 7.1.1
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: rspec
169
155
  requirement: !ruby/object:Gem::Requirement
@@ -193,7 +179,7 @@ dependencies:
193
179
  - !ruby/object:Gem::Version
194
180
  version: '0'
195
181
  - !ruby/object:Gem::Dependency
196
- name: rspec-mocks
182
+ name: rspec_junit_formatter
197
183
  requirement: !ruby/object:Gem::Requirement
198
184
  requirements:
199
185
  - - ">="
@@ -207,7 +193,7 @@ dependencies:
207
193
  - !ruby/object:Gem::Version
208
194
  version: '0'
209
195
  - !ruby/object:Gem::Dependency
210
- name: rspec_junit_formatter
196
+ name: rspec-mocks
211
197
  requirement: !ruby/object:Gem::Requirement
212
198
  requirements:
213
199
  - - ">="
@@ -352,29 +338,15 @@ dependencies:
352
338
  requirements:
353
339
  - - '='
354
340
  - !ruby/object:Gem::Version
355
- version: 5.0.0
341
+ version: 7.1.1
356
342
  type: :runtime
357
343
  prerelease: false
358
344
  version_requirements: !ruby/object:Gem::Requirement
359
345
  requirements:
360
346
  - - '='
361
347
  - !ruby/object:Gem::Version
362
- version: 5.0.0
363
- - !ruby/object:Gem::Dependency
364
- name: rbnacl-libsodium
365
- requirement: !ruby/object:Gem::Requirement
366
- requirements:
367
- - - ">="
368
- - !ruby/object:Gem::Version
369
- version: '0'
370
- type: :runtime
371
- prerelease: false
372
- version_requirements: !ruby/object:Gem::Requirement
373
- requirements:
374
- - - ">="
375
- - !ruby/object:Gem::Version
376
- version: '0'
377
- description:
348
+ version: 7.1.1
349
+ description:
378
350
  email:
379
351
  - greg.fletcher@zetatango.com
380
352
  executables: []
@@ -382,14 +354,17 @@ extensions: []
382
354
  extra_rdoc_files: []
383
355
  files:
384
356
  - ".circleci/config.yml"
357
+ - ".github/dependabot.yml"
385
358
  - ".github/pull_request_template.md"
386
359
  - ".gitignore"
387
360
  - ".hound.yml"
388
361
  - ".rspec"
389
362
  - ".rubocop.yml"
363
+ - ".ruby-version"
390
364
  - CODEOWNERS
391
365
  - Gemfile
392
366
  - Gemfile.lock
367
+ - LICENSE
393
368
  - README.md
394
369
  - Rakefile
395
370
  - SECURITY.md
@@ -408,8 +383,9 @@ files:
408
383
  - porky_lib.gemspec
409
384
  homepage: https://github.com/Zetatango/porky_lib
410
385
  licenses: []
411
- metadata: {}
412
- post_install_message:
386
+ metadata:
387
+ rubygems_mfa_required: 'true'
388
+ post_install_message:
413
389
  rdoc_options: []
414
390
  require_paths:
415
391
  - lib
@@ -417,15 +393,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
417
393
  requirements:
418
394
  - - ">="
419
395
  - !ruby/object:Gem::Version
420
- version: '0'
396
+ version: 2.7.2
421
397
  required_rubygems_version: !ruby/object:Gem::Requirement
422
398
  requirements:
423
399
  - - ">="
424
400
  - !ruby/object:Gem::Version
425
401
  version: '0'
426
402
  requirements: []
427
- rubygems_version: 3.1.2
428
- signing_key:
403
+ rubygems_version: 3.2.22
404
+ signing_key:
429
405
  specification_version: 4
430
406
  summary: A library for cryptographic services using AWS KMS and RbNaCl
431
407
  test_files: []