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 +4 -4
- data/bin/asu +2 -1
- data/lib/yle-aws-role.rb +2 -0
- data/lib/yle/aws/role.rb +4 -2
- data/lib/yle/aws/role/accounts.rb +5 -2
- data/lib/yle/aws/role/cli.rb +2 -0
- data/lib/yle/aws/role/config.rb +2 -0
- data/lib/yle/aws/role/errors.rb +2 -0
- data/lib/yle/aws/role/version.rb +3 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c41e7b917fb0289825eaa965371bec11cb36282524829853fa0f914c426396a
|
4
|
+
data.tar.gz: c6c18b60af03e452c38a0b8879b2291944ec94ff0da749d32c8993820c6134dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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('
|
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
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:
|
54
|
+
role_arn: role_arn,
|
53
55
|
role_session_name: session_name,
|
54
|
-
duration_seconds:
|
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(
|
42
|
-
pattern =
|
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
|
data/lib/yle/aws/role/cli.rb
CHANGED
data/lib/yle/aws/role/config.rb
CHANGED
data/lib/yle/aws/role/errors.rb
CHANGED
data/lib/yle/aws/role/version.rb
CHANGED
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.
|
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-
|
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
|
-
|
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
|