bfs-s3 0.8.3 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bfs-s3.gemspec +2 -1
  3. data/lib/bfs/bucket/s3.rb +10 -5
  4. metadata +8 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fde16d5ecd59f0ba7892b75083f66886361e5b7dc5efea15f5c28c2cdd7f0b44
4
- data.tar.gz: e5fc5fb205274be7c10071dbc2a8c9c6bbe7c12cc30c90cb0768b1758692183c
3
+ metadata.gz: 62b340a5f520e74eb90e955dbb60567e917f4cbb3c6541efd9e8bdda8dc26f9b
4
+ data.tar.gz: 52029ed05c542f450daa1de63a2bd7bd04962fe05d382123856f5db35238c451
5
5
  SHA512:
6
- metadata.gz: 720120b887769f077a4a5f2ac1874cb71f6c2bc9f11825be5aa41096787d226e50ba18008409a0fad45dbe608f61ac7a1ae0314fb811261e7bd2d09bdbfb2a5b
7
- data.tar.gz: 3c45d88593ebf385de8cc81c292cd86219ea13d8a6d962cf40b96ff06d34bd5188ab97af85b642beb5be39fffb9503cdf41f2fffe03ae23a9574145047c550bb
6
+ metadata.gz: 20f43fa100f573afd1b62bc2639e13f2488ff32cb82d0d98da9d8e5f3fc711128ab23c1bfdf3bbd0c9934c127f0df16aab604abbe12c337a0690f0fa052a63d7
7
+ data.tar.gz: bd6218d46b3cbe9608fda26ae57d20e34857249e6c115b091cb9ce6b1de13e37c00de4ee1cf67cf18e78bcfa5ea33179c0d44a0a8d4356c1089a52cd27cf7f32
data/bfs-s3.gemspec CHANGED
@@ -15,8 +15,9 @@ Gem::Specification.new do |s|
15
15
  s.files = `git ls-files`.split("\n")
16
16
  s.test_files = `git ls-files -- spec/*`.split("\n")
17
17
  s.require_paths = ['lib']
18
- s.required_ruby_version = '>= 2.6.0'
18
+ s.required_ruby_version = '>= 2.7'
19
19
 
20
20
  s.add_dependency 'aws-sdk-s3', '~> 1.38'
21
21
  s.add_dependency 'bfs', s.version
22
+ s.metadata['rubygems_mfa_required'] = 'true'
22
23
  end
data/lib/bfs/bucket/s3.rb CHANGED
@@ -141,15 +141,20 @@ module BFS
141
141
  config[:credentials] = opts[:credentials] if opts[:credentials]
142
142
  config[:credentials] ||= Aws::Credentials.new(opts[:access_key_id].to_s, opts[:secret_access_key].to_s) if opts[:access_key_id]
143
143
  config[:credentials] ||= Aws::SharedCredentials.new(profile_name: opts[:profile_name]) if opts[:profile_name]
144
- config[:credentials] = Aws::AssumeRoleCredentials.new(
145
- client: config[:credentials] ? Aws::STS::Client.new(credentials: config[:credentials]) : nil,
146
- role_arn: opts[:assume_role],
147
- role_session_name: SecureRandom.urlsafe_base64(12),
148
- ) if opts[:assume_role]
144
+ config[:credentials] = assume_role_credentials(opts[:assume_role], config[:credentials]) if opts[:assume_role]
149
145
 
150
146
  Aws::S3::Client.new(config)
151
147
  end
152
148
 
149
+ def assume_role_credentials(role_arn, credentials = nil)
150
+ opts = {
151
+ role_arn: role_arn,
152
+ role_session_name: SecureRandom.urlsafe_base64(12),
153
+ }
154
+ opts[:client] = Aws::STS::Client.new(credentials: credentials) if credentials
155
+ Aws::AssumeRoleCredentials.new(**opts)
156
+ end
157
+
153
158
  def walk(pattern, **opts)
154
159
  prefix = pattern[%r{^[^*?\{\}\[\]]+/}]
155
160
  prefix = File.join(*[@prefix, prefix].compact) if @prefix
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bfs-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-27 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.3
33
+ version: 0.9.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: 0.8.3
40
+ version: 0.9.1
41
41
  description: https://github.com/bsm/bfs.rb
42
42
  email: dimitrij@blacksquaremedia.com
43
43
  executables: []
@@ -51,7 +51,8 @@ files:
51
51
  homepage: https://github.com/bsm/bfs.rb
52
52
  licenses:
53
53
  - Apache-2.0
54
- metadata: {}
54
+ metadata:
55
+ rubygems_mfa_required: 'true'
55
56
  post_install_message:
56
57
  rdoc_options: []
57
58
  require_paths:
@@ -60,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
61
  requirements:
61
62
  - - ">="
62
63
  - !ruby/object:Gem::Version
63
- version: 2.6.0
64
+ version: '2.7'
64
65
  required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  requirements:
66
67
  - - ">="
67
68
  - !ruby/object:Gem::Version
68
69
  version: '0'
69
70
  requirements: []
70
- rubygems_version: 3.2.15
71
+ rubygems_version: 3.3.3
71
72
  signing_key:
72
73
  specification_version: 4
73
74
  summary: S3 bucket adapter for bfs