onlyoffice_s3_wrapper 0.2.0 → 0.3.0

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: a6147e29e1e324812b01f9748f18a4aa66f1e391d8888acd2c2a8e49a28076db
4
- data.tar.gz: f343cc5ca7cbc42e9412f2f127a05fc39ed9cdcbd31f9a1dd1eeb9820350c8f3
3
+ metadata.gz: 82668768004470091bdf2f1cf2c4c242f8ec8a7a0f5d6fdb7b20d4155d305782
4
+ data.tar.gz: 289810f2dde148fe5971954fcfee400480322d0a853d01268eecd263ecd5ee04
5
5
  SHA512:
6
- metadata.gz: 627aa9ab9034ba2253555da52a7409edc0d521cbca545c8e11a7d0406dafe56e272d82da004712690b33856c95668280fbb2738e4f81c48dd2b5e4e4d83b9a8e
7
- data.tar.gz: a297f145abe4a37aeb26bd7d48973793015e24e175979961ccb0313372ccf602e8d0085d3ccebca35fd983644cc86bdc274cce32fddbba582db6d422d5b0f94c
6
+ metadata.gz: 24446cf6c22cfecdfd41c37b1347c821244d8a79cf6eff4ebcc29c758313a80627c590c4903ee8f5488a29fe8fb1e50443d7cad5f762994613d6d55d02972de9
7
+ data.tar.gz: de18daabfed6d3d3c7db6041570894c4c2b0e60a4dcf68c943a26d3c8669b282f2d2f3dae5700eecc9f026ef976fae56dd55f819cf6739c801eff57d782a04fd
@@ -136,27 +136,15 @@ module OnlyofficeS3Wrapper
136
136
  end
137
137
 
138
138
  # Get S3 key and S3 private key
139
- # @param force_file_read [True, False] force key read from file
140
- # @return [Array <String>] list of keys
141
- def read_keys(force_file_read: false)
142
- return if read_env_keys && !force_file_read
143
-
144
- @access_key_id = File.read("#{Dir.home}/.s3/key").strip &&
145
- @secret_access_key = File.read("#{Dir.home}/.s3/private_key").strip
139
+ # @param key_location [String] Path to search for key files
140
+ # @return [nil]
141
+ def read_keys(key_location = "#{Dir.home}/.s3")
142
+ @access_key_id = File.read("#{key_location}/key").strip
143
+ @secret_access_key = File.read("#{key_location}/private_key").strip
146
144
  rescue Errno::ENOENT
147
- raise Errno::ENOENT, "No key or private key found in #{Dir.home}/.s3/ "\
148
- "Please create files #{Dir.home}/.s3/key "\
149
- "and #{Dir.home}/.s3/private_key"
150
- end
151
-
152
- private
153
-
154
- # Read keys from env variables
155
- def read_env_keys
156
- return false unless ENV['S3_KEY'] && ENV['S3_PRIVATE_KEY']
157
-
158
- @access_key_id = ENV['S3_KEY']
159
- @secret_access_key = ENV['S3_PRIVATE_KEY']
145
+ raise Errno::ENOENT, "No key or private key found in #{key_location} "\
146
+ "Please create files #{key_location}/key "\
147
+ "and #{key_location}/private_key"
160
148
  end
161
149
  end
162
150
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module OnlyofficeS3Wrapper
4
4
  # [String] Version of gem
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlyoffice_s3_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-10 00:00:00.000000000 Z
13
+ date: 2020-09-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aws-sdk-s3
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.79.1
21
+ version: 1.80.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.79.1
28
+ version: 1.80.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: onlyoffice_file_helper
31
31
  requirement: !ruby/object:Gem::Requirement