porky_lib 0.9.3 → 0.9.4
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 +4 -4
- data/.rubocop.yml +14 -2
- data/Gemfile.lock +11 -11
- data/lib/porky_lib/file_service.rb +2 -4
- data/lib/porky_lib/file_service_helper.rb +0 -9
- data/lib/porky_lib/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: 3fdbc4311ca319836e44898d3ad018416d03decf224941ae3f24a37ea1de9bad
|
|
4
|
+
data.tar.gz: bf572e33f77188a0a5b057c77bc91034e98044ba1b8e5f54d0a59d1561557948
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f25cc53a69235ee25eca951ac3fe6fcce8317baf99e7188a7a83d880d13545eeb73d6f68572999361d6e595087013b322e90b3a513815a448083b9090aab9d1f
|
|
7
|
+
data.tar.gz: cbf5794b8098c9a0fbb6562fa6c9e3d1cceed6e24798f1133eab5cee5f776797f82676a1bd6c8356a37046b642d8d7907c3e7cf2657d9c75018a45dff58b9a0c
|
data/.rubocop.yml
CHANGED
|
@@ -10,7 +10,7 @@ AllCops:
|
|
|
10
10
|
- output/**/*
|
|
11
11
|
- vendor/**/*
|
|
12
12
|
- spec/porky_lib/data/*
|
|
13
|
-
TargetRubyVersion: 2.
|
|
13
|
+
TargetRubyVersion: 2.6.5
|
|
14
14
|
RSpec:
|
|
15
15
|
Patterns:
|
|
16
16
|
- _spec.rb
|
|
@@ -18,9 +18,21 @@ AllCops:
|
|
|
18
18
|
SpecTypes:
|
|
19
19
|
Feature: 'spec/features/**/*'
|
|
20
20
|
|
|
21
|
-
Documentation:
|
|
21
|
+
Style/Documentation:
|
|
22
22
|
Enabled: false
|
|
23
23
|
|
|
24
|
+
Security/MarshalLoad:
|
|
25
|
+
Enabled: true
|
|
26
|
+
|
|
27
|
+
Security/Eval:
|
|
28
|
+
Enabled: true
|
|
29
|
+
|
|
30
|
+
Security/YAMLLoad:
|
|
31
|
+
Enabled: true
|
|
32
|
+
|
|
33
|
+
Security/JSONLoad:
|
|
34
|
+
Enabled: true
|
|
35
|
+
|
|
24
36
|
Metrics/LineLength:
|
|
25
37
|
Max: 160
|
|
26
38
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
porky_lib (0.9.
|
|
4
|
+
porky_lib (0.9.4)
|
|
5
5
|
aws-sdk-kms
|
|
6
6
|
aws-sdk-s3
|
|
7
7
|
msgpack
|
|
@@ -13,17 +13,17 @@ GEM
|
|
|
13
13
|
specs:
|
|
14
14
|
ast (2.4.0)
|
|
15
15
|
aws-eventstream (1.0.3)
|
|
16
|
-
aws-partitions (1.
|
|
17
|
-
aws-sdk-core (3.
|
|
16
|
+
aws-partitions (1.243.0)
|
|
17
|
+
aws-sdk-core (3.80.0)
|
|
18
18
|
aws-eventstream (~> 1.0, >= 1.0.2)
|
|
19
|
-
aws-partitions (~> 1, >= 1.
|
|
19
|
+
aws-partitions (~> 1, >= 1.239.0)
|
|
20
20
|
aws-sigv4 (~> 1.1)
|
|
21
21
|
jmespath (~> 1.0)
|
|
22
22
|
aws-sdk-kms (1.25.0)
|
|
23
23
|
aws-sdk-core (~> 3, >= 3.71.0)
|
|
24
24
|
aws-sigv4 (~> 1.1)
|
|
25
|
-
aws-sdk-s3 (1.
|
|
26
|
-
aws-sdk-core (~> 3, >= 3.
|
|
25
|
+
aws-sdk-s3 (1.57.0)
|
|
26
|
+
aws-sdk-core (~> 3, >= 3.77.0)
|
|
27
27
|
aws-sdk-kms (~> 1)
|
|
28
28
|
aws-sigv4 (~> 1.1)
|
|
29
29
|
aws-sigv4 (1.1.0)
|
|
@@ -39,15 +39,15 @@ GEM
|
|
|
39
39
|
diff-lcs (1.3)
|
|
40
40
|
docile (1.3.2)
|
|
41
41
|
ffi (1.10.0)
|
|
42
|
-
jaro_winkler (1.5.
|
|
42
|
+
jaro_winkler (1.5.4)
|
|
43
43
|
jmespath (1.4.0)
|
|
44
44
|
json (2.2.0)
|
|
45
45
|
msgpack (1.3.1)
|
|
46
|
-
parallel (1.
|
|
46
|
+
parallel (1.19.1)
|
|
47
47
|
parser (2.6.5.0)
|
|
48
48
|
ast (~> 2.4.0)
|
|
49
49
|
rainbow (3.0.0)
|
|
50
|
-
rake (13.0.
|
|
50
|
+
rake (13.0.1)
|
|
51
51
|
rbnacl (5.0.0)
|
|
52
52
|
ffi
|
|
53
53
|
rbnacl-libsodium (1.0.16)
|
|
@@ -76,9 +76,9 @@ GEM
|
|
|
76
76
|
rainbow (>= 2.2.2, < 4.0)
|
|
77
77
|
ruby-progressbar (~> 1.7)
|
|
78
78
|
unicode-display_width (>= 1.4.0, < 1.7)
|
|
79
|
-
rubocop-performance (1.5.
|
|
79
|
+
rubocop-performance (1.5.1)
|
|
80
80
|
rubocop (>= 0.71.0)
|
|
81
|
-
rubocop-rspec (1.
|
|
81
|
+
rubocop-rspec (1.37.0)
|
|
82
82
|
rubocop (>= 0.68.1)
|
|
83
83
|
rubocop_runner (2.2.0)
|
|
84
84
|
ruby-progressbar (1.10.1)
|
|
@@ -91,11 +91,10 @@ class PorkyLib::FileService
|
|
|
91
91
|
file_key
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
-
def overwrite_file(
|
|
95
|
-
raise FileServiceError, 'Invalid input. One or more input values is nil' if overwrite_input_invalid?(
|
|
94
|
+
def overwrite_file(data, file_key, bucket_name, key_id, options = {})
|
|
95
|
+
raise FileServiceError, 'Invalid input. One or more input values is nil' if overwrite_input_invalid?(data, file_key, bucket_name, key_id)
|
|
96
96
|
raise FileServiceError, 'Invalid input. file_key cannot be nil if overwriting an existing file' if file_key.nil?
|
|
97
97
|
|
|
98
|
-
data = file_data(file)
|
|
99
98
|
raise FileSizeTooLargeError, "File size is larger than maximum allowed size of #{max_file_size}" if data_size_invalid?(data)
|
|
100
99
|
|
|
101
100
|
tempfile = encrypt_file_contents(data, key_id, file_key, options)
|
|
@@ -109,7 +108,6 @@ class PorkyLib::FileService
|
|
|
109
108
|
# Remove tempfile from disk
|
|
110
109
|
tempfile.unlink
|
|
111
110
|
end
|
|
112
|
-
deprecate :overwrite_file, :none, 2020, 0o1
|
|
113
111
|
|
|
114
112
|
def presigned_post_url(bucket_name, options = {})
|
|
115
113
|
file_name = options[:file_name] || SecureRandom.uuid
|
|
@@ -11,15 +11,6 @@ module PorkyLib::FileServiceHelper
|
|
|
11
11
|
data.bytesize > max_size
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def file_data(file_or_content)
|
|
15
|
-
if file?(file_or_content)
|
|
16
|
-
read_file(file_or_content)
|
|
17
|
-
else
|
|
18
|
-
file_or_content
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
deprecate :file_data, :none, 2020, 1
|
|
22
|
-
|
|
23
14
|
def file?(file_or_content)
|
|
24
15
|
a_file?(file_or_content) || a_path?(file_or_content)
|
|
25
16
|
end
|
data/lib/porky_lib/version.rb
CHANGED
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.9.
|
|
4
|
+
version: 0.9.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Greg Fletcher
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-11-
|
|
11
|
+
date: 2019-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-kms
|