aws-sdk-core 3.197.0 → 3.197.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/process_credentials.rb +45 -27
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +1 -1
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/aws-sdk-sts.rb +1 -1
- 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: f11249692fa65ae987ba92fad403281cc16a877ccfe8381afb6ae7806c3a50ae
|
4
|
+
data.tar.gz: 0f8b8f4a441fb62dc3b5c7f296e8e3c5fff877262414796b98fc20dbd4eb680c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b0fbfd6d0062f19f0c9ec4f70b909123e98b570a83b156fcbb4bae0e58a685745f1bffdb55c2999d4fd0e8ad0a2927b685bd59373d9008c5f2a3e12a5878e2
|
7
|
+
data.tar.gz: 356fab036a80251e70ad0ecd0232db0df377a2bfffef5b2631f12fa3d3dd048166f10013105818dfd59ff4e66deef16dfaf2c03ceb889009b8b9d5beb89907f5
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.197.
|
1
|
+
3.197.1
|
@@ -2,9 +2,15 @@
|
|
2
2
|
|
3
3
|
module Aws
|
4
4
|
# A credential provider that executes a given process and attempts
|
5
|
-
# to read its stdout to
|
5
|
+
# to read its stdout to receive a JSON payload containing the credentials.
|
6
6
|
#
|
7
|
-
# credentials = Aws::ProcessCredentials.new('/usr/bin/credential_proc')
|
7
|
+
# credentials = Aws::ProcessCredentials.new(['/usr/bin/credential_proc'])
|
8
|
+
# ec2 = Aws::EC2::Client.new(credentials: credentials)
|
9
|
+
#
|
10
|
+
# Arguments should be provided as strings in the array, for example:
|
11
|
+
#
|
12
|
+
# process = ['/usr/bin/credential_proc', 'arg1', 'arg2']
|
13
|
+
# credentials = Aws::ProcessCredentials.new(process)
|
8
14
|
# ec2 = Aws::EC2::Client.new(credentials: credentials)
|
9
15
|
#
|
10
16
|
# Automatically handles refreshing credentials if an Expiration time is
|
@@ -19,40 +25,49 @@ module Aws
|
|
19
25
|
# Creates a new ProcessCredentials object, which allows an
|
20
26
|
# external process to be used as a credential provider.
|
21
27
|
#
|
22
|
-
# @param [String] process
|
23
|
-
#
|
28
|
+
# @param [Array<String>, String] process An array of strings including
|
29
|
+
# the process name and its arguments to execute, or a single string to be
|
30
|
+
# executed by the shell (deprecated and insecure).
|
24
31
|
def initialize(process)
|
32
|
+
if process.is_a?(String)
|
33
|
+
warn('Passing a single string to Aws::ProcessCredentials.new '\
|
34
|
+
'is insecure, please use use an array of system arguments instead')
|
35
|
+
end
|
25
36
|
@process = process
|
26
|
-
@credentials = credentials_from_process
|
37
|
+
@credentials = credentials_from_process
|
27
38
|
@async_refresh = false
|
28
39
|
|
29
40
|
super
|
30
41
|
end
|
31
42
|
|
32
43
|
private
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
44
|
+
|
45
|
+
def credentials_from_process
|
46
|
+
r, w = IO.pipe
|
47
|
+
success = system(*@process, out: w)
|
48
|
+
w.close
|
49
|
+
raw_out = r.read
|
50
|
+
r.close
|
51
|
+
|
52
|
+
unless success
|
53
|
+
raise Errors::InvalidProcessCredentialsPayload.new(
|
54
|
+
'credential_process provider failure, the credential process had '\
|
55
|
+
'non zero exit status and failed to provide credentials'
|
56
|
+
)
|
39
57
|
end
|
40
58
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
raise Errors::InvalidProcessCredentialsPayload.new("Invalid JSON response")
|
46
|
-
end
|
47
|
-
payload_version = creds_json['Version']
|
48
|
-
if payload_version == 1
|
49
|
-
_parse_payload_format_v1(creds_json)
|
50
|
-
else
|
51
|
-
raise Errors::InvalidProcessCredentialsPayload.new("Invalid version #{payload_version} for credentials payload")
|
52
|
-
end
|
53
|
-
else
|
54
|
-
raise Errors::InvalidProcessCredentialsPayload.new('credential_process provider failure, the credential process had non zero exit status and failed to provide credentials')
|
59
|
+
begin
|
60
|
+
creds_json = Aws::Json.load(raw_out)
|
61
|
+
rescue Aws::Json::ParseError
|
62
|
+
raise Errors::InvalidProcessCredentialsPayload.new('Invalid JSON response')
|
55
63
|
end
|
64
|
+
|
65
|
+
payload_version = creds_json['Version']
|
66
|
+
return _parse_payload_format_v1(creds_json) if payload_version == 1
|
67
|
+
|
68
|
+
raise Errors::InvalidProcessCredentialsPayload.new(
|
69
|
+
"Invalid version #{payload_version} for credentials payload"
|
70
|
+
)
|
56
71
|
end
|
57
72
|
|
58
73
|
def _parse_payload_format_v1(creds_json)
|
@@ -64,11 +79,14 @@ module Aws
|
|
64
79
|
|
65
80
|
@expiration = creds_json['Expiration'] ? Time.iso8601(creds_json['Expiration']) : nil
|
66
81
|
return creds if creds.set?
|
67
|
-
|
82
|
+
|
83
|
+
raise Errors::InvalidProcessCredentialsPayload.new(
|
84
|
+
'Invalid payload for JSON credentials version 1'
|
85
|
+
)
|
68
86
|
end
|
69
87
|
|
70
88
|
def refresh
|
71
|
-
@credentials = credentials_from_process
|
89
|
+
@credentials = credentials_from_process
|
72
90
|
end
|
73
91
|
|
74
92
|
def near_expiration?(expiration_length)
|
data/lib/aws-sdk-sso/client.rb
CHANGED
data/lib/aws-sdk-sso.rb
CHANGED
data/lib/aws-sdk-ssooidc.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -2377,7 +2377,7 @@ module Aws::STS
|
|
2377
2377
|
params: params,
|
2378
2378
|
config: config)
|
2379
2379
|
context[:gem_name] = 'aws-sdk-core'
|
2380
|
-
context[:gem_version] = '3.197.
|
2380
|
+
context[:gem_version] = '3.197.1'
|
2381
2381
|
Seahorse::Client::Request.new(handlers, context)
|
2382
2382
|
end
|
2383
2383
|
|
data/lib/aws-sdk-sts.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.197.
|
4
|
+
version: 3.197.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|