subiam 1.3.1 → 1.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b81ca181c46e26116f12af3fee3f296fb5d3f48
4
- data.tar.gz: c4747d17684e7b9e9133eec5d6efe9798914710b
3
+ metadata.gz: f0b5670a50dcc6f6055c40d914a4d14d1572989f
4
+ data.tar.gz: 4e7905af3e231805bc5877ff929e6d49da7171d8
5
5
  SHA512:
6
- metadata.gz: 20e6d0a2ef0a55541ab4e558b873032a4820dea87d4444111e954fa530b7a90b755b1b898eb30c192def451847a4dbc9adf2926a747f64b81ea48f051feecdd8
7
- data.tar.gz: 3cc4f5d753c583176993d84ce0855ffd56f1299c667f7a3b6655a62af792b34edc3c6417131dbecafa245f5b6a1a3997029e9ad33feb1d8f302e7c7e93c8cf30
6
+ metadata.gz: 3b316c0bcb141985faa3462fd2fed020793ea0974f5b7fb2c784d30f6318225e75a67c8b0aeb3caffa4f562a73becb9193256a849cc98fadbbac1b35ad0b30c5
7
+ data.tar.gz: 0232dcc311173fb3b9d519f60b6a4c2e94f29638f0c6148cdb1381588604b2eab4a1732723bd0aaee388c2f2995641e7c041a7badcff49bb9d16294430222d0c
@@ -5,7 +5,8 @@ class Subiam::Client
5
5
  @options = {:format => :ruby}.merge(options)
6
6
  aws_config = options[:aws_config] || {}
7
7
  @iam = Aws::IAM::Client.new(aws_config)
8
- @driver = Subiam::Driver.new(@iam, options)
8
+ @sts = Aws::STS::Client.new(aws_config)
9
+ @driver = Subiam::Driver.new(@iam, @sts, options)
9
10
  @password_manager = options[:password_manager] || Subiam::PasswordManager.new('-', options)
10
11
  @target = nil
11
12
  end
@@ -4,8 +4,9 @@ class Subiam::Driver
4
4
  MAX_POLICY_SIZE = 2048
5
5
  MAX_POLICY_VERSIONS = 5
6
6
 
7
- def initialize(iam, options = {})
7
+ def initialize(iam, sts, options = {})
8
8
  @iam = iam
9
+ @sts = sts
9
10
  @options = options
10
11
  end
11
12
 
@@ -457,7 +458,7 @@ class Subiam::Driver
457
458
 
458
459
  def account_id
459
460
  # https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
460
- @account_id ||= @iam.get_user.user.arn.split(':').fetch(4)
461
+ @account_id ||= @sts.get_caller_identity.account
461
462
  end
462
463
 
463
464
  def policy_arn(policy_name)
@@ -1,3 +1,3 @@
1
1
  module Subiam
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['yuya.yaguchi@gree.net']
11
11
  spec.summary = %q{Subiam is a tool to manage IAM. Forked from Miam.}
12
12
  spec.description = %q{Subiam is a tool to manage IAM. It defines the state of IAM using DSL, and updates IAM according to DSL. Forked from Miam.}
13
- spec.homepage = 'https://github.com/yayugu/subiam'
13
+ spec.homepage = 'https://github.com/gree/subiam'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subiam
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-27 00:00:00.000000000 Z
12
+ date: 2016-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-core
@@ -213,7 +213,7 @@ files:
213
213
  - spec/subiam/target_spec.rb
214
214
  - spec/subiam/update_spec.rb
215
215
  - subiam.gemspec
216
- homepage: https://github.com/yayugu/subiam
216
+ homepage: https://github.com/gree/subiam
217
217
  licenses:
218
218
  - MIT
219
219
  metadata: {}