daffy_lib 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +64 -0
- data/.github/pull_request_template.md +19 -0
- data/.gitignore +19 -0
- data/.rspec +1 -0
- data/.rubocop.yml +60 -0
- data/CODEOWNERS +15 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +266 -0
- data/README.md +116 -0
- data/Rakefile +8 -0
- data/SECURITY.MD +5 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/daffy_lib.gemspec +43 -0
- data/lib/daffy_lib.rb +15 -0
- data/lib/daffy_lib/caching_encryptor.rb +114 -0
- data/lib/daffy_lib/concerns/has_encrypted_attributes.rb +28 -0
- data/lib/daffy_lib/concerns/has_guid.rb +62 -0
- data/lib/daffy_lib/concerns/partition_provider.rb +59 -0
- data/lib/daffy_lib/models/application_record.rb +9 -0
- data/lib/daffy_lib/models/encryption_key.rb +16 -0
- data/lib/daffy_lib/railtie.rb +12 -0
- data/lib/daffy_lib/services/key_management_service.rb +106 -0
- data/lib/daffy_lib/validators/string_validator.rb +18 -0
- data/lib/daffy_lib/version.rb +5 -0
- data/lib/tasks/db_tasks.rake +29 -0
- metadata +362 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bfb79b6e65591c6715f7080e01034c9e1fed2badbe039916fe841c588cafb066
|
4
|
+
data.tar.gz: c61a0784c8affbfc901ad7f150916409ab4d86d922c356ae854799a886d0940b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0b551da929e73c9e5cbf5a86ffbad67f872b23a8b58d3746095ce327bfa30d2cb5961dde8c20ad61a6100373c674adaa8bfb692c434f70261b77689a8ae10e1e
|
7
|
+
data.tar.gz: b448bcdf31e40c3a1169725a9a0b0cb553601191323118dfb67df9ba92e592f7dee0481e0d1c1d5c67c3663ab72dc73fb56130e6c02b645fd6c44f83cad04fdd
|
@@ -0,0 +1,64 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
parallelism: 1
|
5
|
+
working_directory: ~/daffy_lib
|
6
|
+
docker:
|
7
|
+
- image: circleci/ruby:2.6.5
|
8
|
+
|
9
|
+
steps:
|
10
|
+
- checkout
|
11
|
+
|
12
|
+
- restore_cache:
|
13
|
+
name: Restore bundle cache
|
14
|
+
keys:
|
15
|
+
- daffy_lib-bundle-{{ checksum "Gemfile.lock" }}
|
16
|
+
- daffy_lib-bundle-
|
17
|
+
|
18
|
+
- run:
|
19
|
+
name: Install latest bundler
|
20
|
+
command: gem install bundler
|
21
|
+
|
22
|
+
- run:
|
23
|
+
name: Update bundler
|
24
|
+
command: bundle update --bundler
|
25
|
+
|
26
|
+
- run:
|
27
|
+
name: Bundle Install
|
28
|
+
command: bundle install
|
29
|
+
|
30
|
+
- save_cache:
|
31
|
+
name: Store bundle cache
|
32
|
+
key: daffy_lib-bundle-{{ checksum "Gemfile.lock" }}
|
33
|
+
paths:
|
34
|
+
- vendor/bundle
|
35
|
+
|
36
|
+
- run:
|
37
|
+
name: Run rubocop
|
38
|
+
command: |
|
39
|
+
bundle exec rubocop --out test_results/rubocop.txt --format fuubar --require rubocop-rspec --config .rubocop.yml
|
40
|
+
|
41
|
+
- run:
|
42
|
+
name: Run bundle-audit
|
43
|
+
command: |
|
44
|
+
bundle exec bundle-audit check --update
|
45
|
+
|
46
|
+
- run:
|
47
|
+
name: Run rspec tests
|
48
|
+
command: |
|
49
|
+
bundle exec rspec \
|
50
|
+
--profile 10 \
|
51
|
+
--format RspecJunitFormatter \
|
52
|
+
--out test_results/rspec.xml \
|
53
|
+
--format progress
|
54
|
+
|
55
|
+
- store_test_results:
|
56
|
+
path: test_results
|
57
|
+
|
58
|
+
- store_artifacts:
|
59
|
+
path: test_results
|
60
|
+
prefix: tests
|
61
|
+
|
62
|
+
- store_artifacts:
|
63
|
+
path: coverage
|
64
|
+
prefix: coverage
|
@@ -0,0 +1,19 @@
|
|
1
|
+
*Related Issue(s) or Task(s)*
|
2
|
+
|
3
|
+
List the issues or tasks that are related to this pull request.
|
4
|
+
|
5
|
+
*Why?*
|
6
|
+
|
7
|
+
Explain the high-level reason(s) why this change is required.
|
8
|
+
|
9
|
+
*How?*
|
10
|
+
|
11
|
+
Explain the development-level approach you are using in this solution.
|
12
|
+
|
13
|
+
*Risks*
|
14
|
+
|
15
|
+
Explain the risks that are involved with making this change, if any.
|
16
|
+
|
17
|
+
*Requested Reviewers*
|
18
|
+
|
19
|
+
List the developers that should review this pull request.
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-performance
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
Exclude:
|
7
|
+
- bin/*
|
8
|
+
- db/**/*.rb
|
9
|
+
- node_modules/**/*
|
10
|
+
- output/**/*
|
11
|
+
- vendor/**/*
|
12
|
+
TargetRubyVersion: 2.6.5
|
13
|
+
RSpec:
|
14
|
+
Patterns:
|
15
|
+
- _spec.rb
|
16
|
+
- "(?:^|/)spec/"
|
17
|
+
SpecTypes:
|
18
|
+
Feature: 'spec/features/**/*'
|
19
|
+
|
20
|
+
Style/Documentation:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Security/MarshalLoad:
|
24
|
+
Enabled: true
|
25
|
+
|
26
|
+
Security/Eval:
|
27
|
+
Enabled: true
|
28
|
+
|
29
|
+
Security/YAMLLoad:
|
30
|
+
Enabled: true
|
31
|
+
|
32
|
+
Security/JSONLoad:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
Layout/LineLength:
|
36
|
+
Max: 160
|
37
|
+
|
38
|
+
Metrics/ClassLength:
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
Metrics/BlockLength:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Metrics/AbcSize:
|
45
|
+
Max: 50
|
46
|
+
|
47
|
+
Metrics/MethodLength:
|
48
|
+
Max: 50
|
49
|
+
|
50
|
+
Style/StringLiterals:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Style/ClassAndModuleChildren:
|
54
|
+
EnforcedStyle: compact
|
55
|
+
|
56
|
+
RSpec/MultipleExpectations:
|
57
|
+
Max: 5
|
58
|
+
|
59
|
+
RSpec/ExampleLength:
|
60
|
+
Max: 10
|
data/CODEOWNERS
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# For help consult: https://help.github.com/articles/about-codeowners/
|
2
|
+
|
3
|
+
# Lines starting with '#' are comments.
|
4
|
+
# Each line is a file pattern followed by one or more owners.
|
5
|
+
|
6
|
+
# These owners will be the default owners for everything in the repo.
|
7
|
+
* @Zetatango/security
|
8
|
+
|
9
|
+
# Order is important. The last matching pattern has the most precedence.
|
10
|
+
# So if a pull request only touches javascript files, only these owners
|
11
|
+
# will be requested to review.
|
12
|
+
# *.js @octocat @github/js
|
13
|
+
|
14
|
+
# You can also use email addresses if you prefer.
|
15
|
+
# docs/* docs@example.com
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,266 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
daffy_lib (0.1.0)
|
5
|
+
porky_lib
|
6
|
+
rails
|
7
|
+
redis
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actioncable (6.0.2.1)
|
13
|
+
actionpack (= 6.0.2.1)
|
14
|
+
nio4r (~> 2.0)
|
15
|
+
websocket-driver (>= 0.6.1)
|
16
|
+
actionmailbox (6.0.2.1)
|
17
|
+
actionpack (= 6.0.2.1)
|
18
|
+
activejob (= 6.0.2.1)
|
19
|
+
activerecord (= 6.0.2.1)
|
20
|
+
activestorage (= 6.0.2.1)
|
21
|
+
activesupport (= 6.0.2.1)
|
22
|
+
mail (>= 2.7.1)
|
23
|
+
actionmailer (6.0.2.1)
|
24
|
+
actionpack (= 6.0.2.1)
|
25
|
+
actionview (= 6.0.2.1)
|
26
|
+
activejob (= 6.0.2.1)
|
27
|
+
mail (~> 2.5, >= 2.5.4)
|
28
|
+
rails-dom-testing (~> 2.0)
|
29
|
+
actionpack (6.0.2.1)
|
30
|
+
actionview (= 6.0.2.1)
|
31
|
+
activesupport (= 6.0.2.1)
|
32
|
+
rack (~> 2.0, >= 2.0.8)
|
33
|
+
rack-test (>= 0.6.3)
|
34
|
+
rails-dom-testing (~> 2.0)
|
35
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
36
|
+
actiontext (6.0.2.1)
|
37
|
+
actionpack (= 6.0.2.1)
|
38
|
+
activerecord (= 6.0.2.1)
|
39
|
+
activestorage (= 6.0.2.1)
|
40
|
+
activesupport (= 6.0.2.1)
|
41
|
+
nokogiri (>= 1.8.5)
|
42
|
+
actionview (6.0.2.1)
|
43
|
+
activesupport (= 6.0.2.1)
|
44
|
+
builder (~> 3.1)
|
45
|
+
erubi (~> 1.4)
|
46
|
+
rails-dom-testing (~> 2.0)
|
47
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
48
|
+
activejob (6.0.2.1)
|
49
|
+
activesupport (= 6.0.2.1)
|
50
|
+
globalid (>= 0.3.6)
|
51
|
+
activemodel (6.0.2.1)
|
52
|
+
activesupport (= 6.0.2.1)
|
53
|
+
activerecord (6.0.2.1)
|
54
|
+
activemodel (= 6.0.2.1)
|
55
|
+
activesupport (= 6.0.2.1)
|
56
|
+
activestorage (6.0.2.1)
|
57
|
+
actionpack (= 6.0.2.1)
|
58
|
+
activejob (= 6.0.2.1)
|
59
|
+
activerecord (= 6.0.2.1)
|
60
|
+
marcel (~> 0.3.1)
|
61
|
+
activesupport (6.0.2.1)
|
62
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
63
|
+
i18n (>= 0.7, < 2)
|
64
|
+
minitest (~> 5.1)
|
65
|
+
tzinfo (~> 1.1)
|
66
|
+
zeitwerk (~> 2.2)
|
67
|
+
ast (2.4.0)
|
68
|
+
attr_encrypted (3.1.0)
|
69
|
+
encryptor (~> 3.0.0)
|
70
|
+
aws-eventstream (1.0.3)
|
71
|
+
aws-partitions (1.263.0)
|
72
|
+
aws-sdk-core (3.89.0)
|
73
|
+
aws-eventstream (~> 1.0, >= 1.0.2)
|
74
|
+
aws-partitions (~> 1, >= 1.239.0)
|
75
|
+
aws-sigv4 (~> 1.1)
|
76
|
+
jmespath (~> 1.0)
|
77
|
+
aws-sdk-kms (1.27.0)
|
78
|
+
aws-sdk-core (~> 3, >= 3.71.0)
|
79
|
+
aws-sigv4 (~> 1.1)
|
80
|
+
aws-sdk-s3 (1.60.1)
|
81
|
+
aws-sdk-core (~> 3, >= 3.83.0)
|
82
|
+
aws-sdk-kms (~> 1)
|
83
|
+
aws-sigv4 (~> 1.1)
|
84
|
+
aws-sigv4 (1.1.0)
|
85
|
+
aws-eventstream (~> 1.0, >= 1.0.2)
|
86
|
+
builder (3.2.4)
|
87
|
+
bundler-audit (0.6.1)
|
88
|
+
bundler (>= 1.2.0, < 3)
|
89
|
+
thor (~> 0.18)
|
90
|
+
codecov (0.1.16)
|
91
|
+
json
|
92
|
+
simplecov
|
93
|
+
url
|
94
|
+
concurrent-ruby (1.1.5)
|
95
|
+
crass (1.0.5)
|
96
|
+
diff-lcs (1.3)
|
97
|
+
docile (1.3.2)
|
98
|
+
encryptor (3.0.0)
|
99
|
+
erubi (1.9.0)
|
100
|
+
factory_bot (5.1.1)
|
101
|
+
activesupport (>= 4.2.0)
|
102
|
+
factory_bot_rails (5.1.1)
|
103
|
+
factory_bot (~> 5.1.0)
|
104
|
+
railties (>= 4.2.0)
|
105
|
+
ffi (1.11.3)
|
106
|
+
globalid (0.4.2)
|
107
|
+
activesupport (>= 4.2.0)
|
108
|
+
i18n (1.7.1)
|
109
|
+
concurrent-ruby (~> 1.0)
|
110
|
+
jaro_winkler (1.5.4)
|
111
|
+
jmespath (1.4.0)
|
112
|
+
json (2.3.0)
|
113
|
+
loofah (2.4.0)
|
114
|
+
crass (~> 1.0.2)
|
115
|
+
nokogiri (>= 1.5.9)
|
116
|
+
mail (2.7.1)
|
117
|
+
mini_mime (>= 0.1.1)
|
118
|
+
marcel (0.3.3)
|
119
|
+
mimemagic (~> 0.3.2)
|
120
|
+
method_source (0.9.2)
|
121
|
+
mimemagic (0.3.3)
|
122
|
+
mini_mime (1.0.2)
|
123
|
+
mini_portile2 (2.4.0)
|
124
|
+
minitest (5.13.0)
|
125
|
+
msgpack (1.3.1)
|
126
|
+
nio4r (2.5.2)
|
127
|
+
nokogiri (1.10.7)
|
128
|
+
mini_portile2 (~> 2.4.0)
|
129
|
+
parallel (1.19.1)
|
130
|
+
parser (2.7.0.2)
|
131
|
+
ast (~> 2.4.0)
|
132
|
+
porky_lib (0.9.5)
|
133
|
+
aws-sdk-kms
|
134
|
+
aws-sdk-s3
|
135
|
+
msgpack
|
136
|
+
rbnacl (= 5.0.0)
|
137
|
+
rbnacl-libsodium
|
138
|
+
rack (2.0.8)
|
139
|
+
rack-test (1.1.0)
|
140
|
+
rack (>= 1.0, < 3)
|
141
|
+
rails (6.0.2.1)
|
142
|
+
actioncable (= 6.0.2.1)
|
143
|
+
actionmailbox (= 6.0.2.1)
|
144
|
+
actionmailer (= 6.0.2.1)
|
145
|
+
actionpack (= 6.0.2.1)
|
146
|
+
actiontext (= 6.0.2.1)
|
147
|
+
actionview (= 6.0.2.1)
|
148
|
+
activejob (= 6.0.2.1)
|
149
|
+
activemodel (= 6.0.2.1)
|
150
|
+
activerecord (= 6.0.2.1)
|
151
|
+
activestorage (= 6.0.2.1)
|
152
|
+
activesupport (= 6.0.2.1)
|
153
|
+
bundler (>= 1.3.0)
|
154
|
+
railties (= 6.0.2.1)
|
155
|
+
sprockets-rails (>= 2.0.0)
|
156
|
+
rails-dom-testing (2.0.3)
|
157
|
+
activesupport (>= 4.2.0)
|
158
|
+
nokogiri (>= 1.6)
|
159
|
+
rails-html-sanitizer (1.3.0)
|
160
|
+
loofah (~> 2.3)
|
161
|
+
railties (6.0.2.1)
|
162
|
+
actionpack (= 6.0.2.1)
|
163
|
+
activesupport (= 6.0.2.1)
|
164
|
+
method_source
|
165
|
+
rake (>= 0.8.7)
|
166
|
+
thor (>= 0.20.3, < 2.0)
|
167
|
+
rainbow (3.0.0)
|
168
|
+
rake (13.0.1)
|
169
|
+
rbnacl (5.0.0)
|
170
|
+
ffi
|
171
|
+
rbnacl-libsodium (1.0.16)
|
172
|
+
rbnacl (>= 3.0.1)
|
173
|
+
redis (4.1.3)
|
174
|
+
rspec (3.9.0)
|
175
|
+
rspec-core (~> 3.9.0)
|
176
|
+
rspec-expectations (~> 3.9.0)
|
177
|
+
rspec-mocks (~> 3.9.0)
|
178
|
+
rspec-collection_matchers (1.2.0)
|
179
|
+
rspec-expectations (>= 2.99.0.beta1)
|
180
|
+
rspec-core (3.9.1)
|
181
|
+
rspec-support (~> 3.9.1)
|
182
|
+
rspec-expectations (3.9.0)
|
183
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
184
|
+
rspec-support (~> 3.9.0)
|
185
|
+
rspec-mocks (3.9.1)
|
186
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
187
|
+
rspec-support (~> 3.9.0)
|
188
|
+
rspec-rails (3.9.0)
|
189
|
+
actionpack (>= 3.0)
|
190
|
+
activesupport (>= 3.0)
|
191
|
+
railties (>= 3.0)
|
192
|
+
rspec-core (~> 3.9.0)
|
193
|
+
rspec-expectations (~> 3.9.0)
|
194
|
+
rspec-mocks (~> 3.9.0)
|
195
|
+
rspec-support (~> 3.9.0)
|
196
|
+
rspec-support (3.9.2)
|
197
|
+
rspec_junit_formatter (0.4.1)
|
198
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
199
|
+
rubocop (0.79.0)
|
200
|
+
jaro_winkler (~> 1.5.1)
|
201
|
+
parallel (~> 1.10)
|
202
|
+
parser (>= 2.7.0.1)
|
203
|
+
rainbow (>= 2.2.2, < 4.0)
|
204
|
+
ruby-progressbar (~> 1.7)
|
205
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
206
|
+
rubocop-performance (1.5.2)
|
207
|
+
rubocop (>= 0.71.0)
|
208
|
+
rubocop-rspec (1.37.1)
|
209
|
+
rubocop (>= 0.68.1)
|
210
|
+
rubocop_runner (2.2.0)
|
211
|
+
ruby-progressbar (1.10.1)
|
212
|
+
simplecov (0.17.1)
|
213
|
+
docile (~> 1.1)
|
214
|
+
json (>= 1.8, < 3)
|
215
|
+
simplecov-html (~> 0.10.0)
|
216
|
+
simplecov-html (0.10.2)
|
217
|
+
sprockets (4.0.0)
|
218
|
+
concurrent-ruby (~> 1.0)
|
219
|
+
rack (> 1, < 3)
|
220
|
+
sprockets-rails (3.2.1)
|
221
|
+
actionpack (>= 4.0)
|
222
|
+
activesupport (>= 4.0)
|
223
|
+
sprockets (>= 3.0.0)
|
224
|
+
sqlite3 (1.4.2)
|
225
|
+
thor (0.20.3)
|
226
|
+
thread_safe (0.3.6)
|
227
|
+
timecop (0.9.1)
|
228
|
+
tzinfo (1.2.6)
|
229
|
+
thread_safe (~> 0.1)
|
230
|
+
unicode-display_width (1.6.0)
|
231
|
+
url (0.3.2)
|
232
|
+
websocket-driver (0.7.1)
|
233
|
+
websocket-extensions (>= 0.1.0)
|
234
|
+
websocket-extensions (0.1.4)
|
235
|
+
zeitwerk (2.2.2)
|
236
|
+
|
237
|
+
PLATFORMS
|
238
|
+
ruby
|
239
|
+
|
240
|
+
DEPENDENCIES
|
241
|
+
attr_encrypted
|
242
|
+
bundler
|
243
|
+
bundler-audit
|
244
|
+
codecov
|
245
|
+
daffy_lib!
|
246
|
+
factory_bot_rails
|
247
|
+
porky_lib
|
248
|
+
rake
|
249
|
+
rspec
|
250
|
+
rspec-collection_matchers
|
251
|
+
rspec-mocks
|
252
|
+
rspec-rails
|
253
|
+
rspec_junit_formatter
|
254
|
+
rubocop
|
255
|
+
rubocop-performance
|
256
|
+
rubocop-rspec
|
257
|
+
rubocop_runner
|
258
|
+
simplecov
|
259
|
+
sqlite3
|
260
|
+
timecop
|
261
|
+
|
262
|
+
RUBY VERSION
|
263
|
+
ruby 2.6.5p114
|
264
|
+
|
265
|
+
BUNDLED WITH
|
266
|
+
2.0.2
|