miam 0.2.4.beta8 → 0.2.4.beta9

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: db416d15e77789e9842a5961c0fd9a0ddf37520c
4
- data.tar.gz: 8518f5af7bfd066ffb3c50099efeac19ec93871a
3
+ metadata.gz: 44bcfc369fae53c8765d934768e003a496078243
4
+ data.tar.gz: e7074dd752db3217df398dbe0bbd831853a3e2e7
5
5
  SHA512:
6
- metadata.gz: c308c609a2498a1f7e3c9d4ff231d9a419864c791d2c4aae0d7d98f5273e7c43c23522de2ec5b2bf70e66b905c4ed6ab60af0b15a13ec24632b630c47f14ae06
7
- data.tar.gz: 09e1f6e04a5edb027e443dde184e4c77f8ad16772afc867bbf74ca143cd02c479e43f99c1a0fc9d8fe43f9a6e83ee63cbd813d38e63b6c2086829577427904b8
6
+ metadata.gz: 80661b72134d986f3d3c77f7e02dd42e6c187eac8801fd019c72c657e3e94d4149137bc865034aa363310e6531786a6dbade724cbc751fb8daf923dc251a70d7
7
+ data.tar.gz: 1d2814ba935448e1bbb49ec5d3ff9e4587824913ec03ae338b69684440bed06537ff1a997fb6f184b37479b6593bd00139d2310bb5e200c2dc39ae2477cad521
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.0.0
4
+ - 2.3.3
5
5
  script:
6
6
  - bundle install
7
7
  - travis_wait bundle exec rake
data/README.md CHANGED
@@ -25,6 +25,8 @@ It defines the state of IAM using DSL, and updates IAM according to DSL.
25
25
  * `>= 0.2.4`
26
26
  * Fix for Password Policy ([RP#22](https://github.com/winebarrel/miam/pull/22))
27
27
  * Fix `--target` option for Policies ([RP#21](https://github.com/winebarrel/miam/pull/21))
28
+ * Fix for `Rate exceeded` ([PR#23](https://github.com/winebarrel/miam/pull/23))
29
+ * Fix for non-User credentials ([PR#17](https://github.com/winebarrel/miam/pull/17))
28
30
 
29
31
  ## Installation
30
32
 
data/lib/miam/client.rb CHANGED
@@ -5,7 +5,8 @@ class Miam::Client
5
5
  @options = {:format => :ruby}.merge(options)
6
6
  aws_config = options.delete(:aws_config) || {}
7
7
  @iam = Aws::IAM::Client.new(aws_config)
8
- @driver = Miam::Driver.new(@iam, options)
8
+ @sts = Aws::STS::Client.new(aws_config)
9
+ @driver = Miam::Driver.new(@iam, @sts, options)
9
10
  @password_manager = options[:password_manager] || Miam::PasswordManager.new('-', options)
10
11
  end
11
12
 
data/lib/miam/driver.rb CHANGED
@@ -4,9 +4,11 @@ class Miam::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
11
+ @account_id = nil
10
12
  end
11
13
 
12
14
  def create_user(user_name, attrs)
@@ -473,7 +475,8 @@ class Miam::Driver
473
475
 
474
476
  def account_id
475
477
  # https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
476
- @account_id ||= @iam.get_user.user.arn.split(':').fetch(4)
478
+ # http://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html
479
+ @account_id ||= @sts.get_caller_identity.account
477
480
  end
478
481
 
479
482
  def policy_arn(policy_name, policy_path)
data/lib/miam/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Miam
2
- VERSION = '0.2.4.beta8'
2
+ VERSION = '0.2.4.beta9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4.beta8
4
+ version: 0.2.4.beta9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-05 00:00:00.000000000 Z
11
+ date: 2017-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  version: 1.3.1
244
244
  requirements: []
245
245
  rubyforge_project:
246
- rubygems_version: 2.5.1
246
+ rubygems_version: 2.5.2
247
247
  signing_key:
248
248
  specification_version: 4
249
249
  summary: Miam is a tool to manage IAM.