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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2126c3d8e997ce7f62c9c4d66f5eeef1b3ca33dbe07963cee7ab64af41e3bea3
4
- data.tar.gz: c8e520892d84cfe2afb40aae3c2064c2f9aed5c291b4346d3a45a2f61df6175d
3
+ metadata.gz: f11249692fa65ae987ba92fad403281cc16a877ccfe8381afb6ae7806c3a50ae
4
+ data.tar.gz: 0f8b8f4a441fb62dc3b5c7f296e8e3c5fff877262414796b98fc20dbd4eb680c
5
5
  SHA512:
6
- metadata.gz: 33e18c7d668078ac612c1c77324c86fc4a102e6d4f752211ca1b6ca9cec91ae098e1261c3ae1ec03dfe2c57d16925608feef5f89cb76a32203d04cb9d790b135
7
- data.tar.gz: 459028118688f266b87f788388ffbb5a7cc6e32931b8bc6ffdbad86dfc00818adc7d394ffee4aa672cb5a4003bfdf2046bfbda5e729582a7022c2d0c835df634
6
+ metadata.gz: e7b0fbfd6d0062f19f0c9ec4f70b909123e98b570a83b156fcbb4bae0e58a685745f1bffdb55c2999d4fd0e8ad0a2927b685bd59373d9008c5f2a3e12a5878e2
7
+ data.tar.gz: 356fab036a80251e70ad0ecd0232db0df377a2bfffef5b2631f12fa3d3dd048166f10013105818dfd59ff4e66deef16dfaf2c03ceb889009b8b9d5beb89907f5
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.197.1 (2024-06-19)
5
+ ------------------
6
+
7
+ * Issue - Support an array of string arguments for `Aws::ProcessCredentials` to be executed by `system`.
8
+
4
9
  3.197.0 (2024-06-05)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.197.0
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 recieve a JSON payload containing the credentials.
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 Invocation string for process
23
- # credentials provider.
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(@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
- def credentials_from_process(proc_invocation)
34
- begin
35
- raw_out = `#{proc_invocation}`
36
- process_status = $?
37
- rescue Errno::ENOENT
38
- raise Errors::InvalidProcessCredentialsPayload.new("Could not find process #{proc_invocation}")
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
- if process_status.success?
42
- begin
43
- creds_json = Aws::Json.load(raw_out)
44
- rescue Aws::Json::ParseError
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
- raise Errors::InvalidProcessCredentialsPayload.new("Invalid payload for JSON credentials version 1")
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(@process)
89
+ @credentials = credentials_from_process
72
90
  end
73
91
 
74
92
  def near_expiration?(expiration_length)
@@ -630,7 +630,7 @@ module Aws::SSO
630
630
  params: params,
631
631
  config: config)
632
632
  context[:gem_name] = 'aws-sdk-core'
633
- context[:gem_version] = '3.197.0'
633
+ context[:gem_version] = '3.197.1'
634
634
  Seahorse::Client::Request.new(handlers, context)
635
635
  end
636
636
 
data/lib/aws-sdk-sso.rb CHANGED
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-sso/customizations'
54
54
  # @!group service
55
55
  module Aws::SSO
56
56
 
57
- GEM_VERSION = '3.197.0'
57
+ GEM_VERSION = '3.197.1'
58
58
 
59
59
  end
@@ -983,7 +983,7 @@ module Aws::SSOOIDC
983
983
  params: params,
984
984
  config: config)
985
985
  context[:gem_name] = 'aws-sdk-core'
986
- context[:gem_version] = '3.197.0'
986
+ context[:gem_version] = '3.197.1'
987
987
  Seahorse::Client::Request.new(handlers, context)
988
988
  end
989
989
 
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-ssooidc/customizations'
54
54
  # @!group service
55
55
  module Aws::SSOOIDC
56
56
 
57
- GEM_VERSION = '3.197.0'
57
+ GEM_VERSION = '3.197.1'
58
58
 
59
59
  end
@@ -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.0'
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
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-sts/customizations'
54
54
  # @!group service
55
55
  module Aws::STS
56
56
 
57
- GEM_VERSION = '3.197.0'
57
+ GEM_VERSION = '3.197.1'
58
58
 
59
59
  end
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.0
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-05 00:00:00.000000000 Z
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath