prx-ruby-aws-creds 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prx-ruby-aws-creds.rb +3 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be6f99128dc5cd1c634799ec569f7da121872f9bcc9822f407e1fb37b2c700af
|
4
|
+
data.tar.gz: fa22d551a8ba6e663fc0856862ca7abe6821776042f3312a590024b3f6523cc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b3451644c679537bda4b136b8e8e5d9526e7d3d507f2bbf30a435868f34bcf9b858c9f4f675efd48f84b129ce15260c4b7c19a5c6e146695d29a3ed90dfa292
|
7
|
+
data.tar.gz: da0c6bd5b54c1e131a84afcd7f49652138edf170f6960f005511521f93bb9191c4f7791ef10e86fab46f3ab66effdf83f8ed45bf69f5c6c09f749190b8c0489b
|
data/lib/prx-ruby-aws-creds.rb
CHANGED
@@ -80,14 +80,7 @@ class PrxRubyAwsCreds
|
|
80
80
|
aws_config_file = IniFile.load(AWS_CONFIG_FILE)
|
81
81
|
aws_config_file_section = aws_config_file["profile #{profile_name}"]
|
82
82
|
|
83
|
-
|
84
|
-
sso_session_name = aws_config_file["sso_session"]
|
85
|
-
sso_session_section = aws_config_file["sso-session #{sso_session_name}"]
|
86
|
-
|
87
|
-
sso_start_url = sso_session_section["sso_start_url"]
|
88
|
-
else
|
89
|
-
sso_start_url = aws_config_file_section["sso_start_url"]
|
90
|
-
end
|
83
|
+
sso_start_url = aws_config_file_section["sso_session"] ? aws_config_file["sso-session #{aws_config_file_section["sso_session"]}"]["sso_start_url"] : aws_config_file_section["sso_start_url"]
|
91
84
|
|
92
85
|
# The selected profile does not use SSO
|
93
86
|
return if !sso_start_url
|
@@ -158,8 +151,9 @@ class PrxRubyAwsCreds
|
|
158
151
|
# access token to get back a set of temporary credentials.
|
159
152
|
# https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html
|
160
153
|
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SSO/Client.html#get_role_credentials-instance_method
|
154
|
+
sso_region = aws_config_file_section["sso_session"] ? aws_config_file["sso-session #{aws_config_file_section["sso_session"]}"]["sso_region"] : aws_config_file_section["sso_region"]
|
161
155
|
opts = sso_get_role_options(profile_name)
|
162
|
-
sso = Aws::SSO::Client.new(region:
|
156
|
+
sso = Aws::SSO::Client.new(region: sso_region)
|
163
157
|
credentials = sso.get_role_credentials(opts)
|
164
158
|
|
165
159
|
# Cache the credentials. The structure of this file doesn't exactly
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prx-ruby-aws-creds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Kalafarski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inifile
|