yle-aws-role 2.0.1 → 2.0.2

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: 487ba074255efe194b3ce4a0c111cccb7131ce92f2cae0e04820d255aa22a1c2
4
- data.tar.gz: 6e58f555b729400c092e8a47e25a1b584deb291ad988ab591471c1f402827e1b
3
+ metadata.gz: 5c41e7b917fb0289825eaa965371bec11cb36282524829853fa0f914c426396a
4
+ data.tar.gz: c6c18b60af03e452c38a0b8879b2291944ec94ff0da749d32c8993820c6134dc
5
5
  SHA512:
6
- metadata.gz: 06f11aed7628aa9dbdd25853bb6eb25515763e1158edb7a67af63f27e71b5b8adaddc0ffc24ffa6c0258b22ae742b18578a1dfd5d43b92bdefe5fa4c6300cfde
7
- data.tar.gz: 60103da98186ed41858ad14171e9bf2bbc2e4009f682f2ad8332ba7e5f06d6c1c67c3321d8a7e3567ed1191ca9b2a638d8608d40859846f9671dcdac496e5583
6
+ metadata.gz: 61e60a6832f7ecb0705589662ed6e56337bd3c5beace2ec32a46780c75c7aae844c198340ea7028f294e6a5ac90de6135007087a0e88fa52af7db64bd3295b19
7
+ data.tar.gz: 71d08bc2e9e2f9620e9d20459f002f267831d42ab6548acc0a310c315a03801d341928bf65bc17e88a8eed1b9d6f6838e9790c2e134b14109aefe5ce8eac031e
data/bin/asu CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require 'bundler/setup' if File.exist? File.expand_path('../../Gemfile', __FILE__)
4
+ require 'bundler/setup' if File.exist? File.expand_path('../Gemfile', __dir__)
4
5
  require 'yle/aws/role/cli'
5
6
 
6
7
  cli = Yle::AWS::Role::Cli.new(ARGV)
data/lib/yle-aws-role.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yle/aws/role'
data/lib/yle/aws/role.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'aws-sdk-core'
2
4
  require 'shellwords'
3
5
 
@@ -49,9 +51,9 @@ module Yle
49
51
  raise Errors::AssumeRoleError, 'Role name not specified' if !@role_name
50
52
 
51
53
  @credentials = Aws::AssumeRoleCredentials.new(
52
- role_arn: role_arn,
54
+ role_arn: role_arn,
53
55
  role_session_name: session_name,
54
- duration_seconds: duration
56
+ duration_seconds: duration
55
57
  ).credentials
56
58
  rescue Aws::STS::Errors::ServiceError,
57
59
  Aws::Errors::MissingCredentialsError => e
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Yle
2
4
  module AWS
3
5
  class Role
@@ -12,6 +14,7 @@ module Yle
12
14
 
13
15
  # Returns an `AccountAlias` that best matches the passed string
14
16
  def find(id_or_alias)
17
+ id_or_alias = id_or_alias.to_s
15
18
  if account_id?(id_or_alias)
16
19
  name = aliases.key(id_or_alias) || id_or_alias
17
20
  AccountAlias.new(name, id_or_alias)
@@ -38,8 +41,8 @@ module Yle
38
41
  aliases.keys.select { |key| matcher =~ key }.min_by(&:length)
39
42
  end
40
43
 
41
- def alias_matcher(s)
42
- pattern = s.gsub(/([^^])(?=[^$])/, '\1.*')
44
+ def alias_matcher(id_or_alias)
45
+ pattern = id_or_alias.gsub(/([^^])(?=[^$])/, '\1.*')
43
46
  Regexp.new(pattern)
44
47
  end
45
48
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'slop'
2
4
 
3
5
  require 'yle/aws/role'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Yle
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Yle
2
4
  module AWS
3
5
  class Role
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Yle
2
4
  module AWS
3
5
  class Role
4
- VERSION = '2.0.1'.freeze
6
+ VERSION = '2.0.2'
5
7
  end
6
8
  end
7
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yle-aws-role
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yleisradio
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-02-02 00:00:00.000000000 Z
13
+ date: 2018-12-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aws-sdk-core
@@ -119,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubyforge_project:
123
- rubygems_version: 2.7.3
122
+ rubygems_version: 3.0.1
124
123
  signing_key:
125
124
  specification_version: 4
126
125
  summary: Tooling to help to assume AWS IAM roles