aws-sdk-core 3.180.2 → 3.181.0

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: 9d6a082ec31cbf3212a495241a9d0ef606f1569fc4e808d052794616caee39ce
4
- data.tar.gz: e107003d7a98303241d8d9f016f4a81d9d0c3f0012e355e172911ede5aa80701
3
+ metadata.gz: 146ac9f16fcd2580c959c58a93c911c2fb023caea3d9113fa29da22e85627eaf
4
+ data.tar.gz: f33db208ab8d3cac7a8f96d4c7e8c8609ca48b4a01c5db136c5210cbe70f8ca2
5
5
  SHA512:
6
- metadata.gz: b73a9b216e87fd749add538b8ca9f3531d9d5d0b5ae97b404056dbaafb39bbf5597096a016a34e36361a86d4b1802721b22f57e74674ba2d976ce6f124ab6aa7
7
- data.tar.gz: fd4859dd906959788161d88275c470109bb5798bc8c19e62f173e789f1c89d657043983da6d66a40b346082d74d8e4f86a91e0ec4d9dca73f7dd8c9e18ca66e1
6
+ metadata.gz: 5074b88e182acdfb8ef77a11e72bd3a23b737f124103e213d95fd2e09d59e93364da10ca99f7b2c7d8ec4754bcff474480c8ba301f313bebf66e08e4f91bb5b9
7
+ data.tar.gz: 7d6e5a2a1442fd5c926b6f691d505eaf830e47ef9eac5a6f9f984f8d9bedeb161bf5dfada064b67baab61c9c8c4772bcfbacaaa1d75ddafd283ba6b87e5db8a9
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.181.0 (2023-08-22)
5
+ ------------------
6
+
7
+ * Feature - Add support for `on_chunk_received` callback.
8
+
9
+ 3.180.3 (2023-08-09)
10
+ ------------------
11
+
12
+ * Issue - Add support for sso-session names with whitespace configured by the CLI `aws sso configure` command (#2895).
13
+
4
14
  3.180.2 (2023-08-07)
5
15
  ------------------
6
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.180.2
1
+ 3.181.0
@@ -359,12 +359,8 @@ module Aws
359
359
  !(prof_config.keys & SSO_CREDENTIAL_PROFILE_KEYS).empty?
360
360
 
361
361
  if sso_session_name = prof_config['sso_session']
362
- sso_session = cfg["sso-session #{sso_session_name}"]
363
- unless sso_session
364
- raise ArgumentError,
365
- "sso-session #{sso_session_name} must be defined in the config file. " \
366
- "Referenced by profile #{profile}"
367
- end
362
+ sso_session = sso_session(cfg, profile, sso_session_name)
363
+
368
364
  sso_region = sso_session['sso_region']
369
365
  sso_start_url = sso_session['sso_start_url']
370
366
 
@@ -389,7 +385,7 @@ module Aws
389
385
  sso_role_name: prof_config['sso_role_name'],
390
386
  sso_session: prof_config['sso_session'],
391
387
  sso_region: sso_region,
392
- sso_start_url: prof_config['sso_start_url']
388
+ sso_start_url: sso_start_url
393
389
  )
394
390
  end
395
391
  end
@@ -402,16 +398,7 @@ module Aws
402
398
  !(prof_config.keys & SSO_TOKEN_PROFILE_KEYS).empty?
403
399
 
404
400
  sso_session_name = prof_config['sso_session']
405
- sso_session = cfg["sso-session #{sso_session_name}"]
406
- unless sso_session
407
- raise ArgumentError,
408
- "sso-session #{sso_session_name} must be defined in the config file." \
409
- "Referenced by profile #{profile}"
410
- end
411
-
412
- unless sso_session['sso_region']
413
- raise ArgumentError, "sso-session #{sso_session_name} missing required parameter: sso_region"
414
- end
401
+ sso_session = sso_session(cfg, profile, sso_session_name)
415
402
 
416
403
  SSOTokenProvider.new(
417
404
  sso_session: sso_session_name,
@@ -469,5 +456,22 @@ module Aws
469
456
  ret ||= 'default'
470
457
  ret
471
458
  end
459
+
460
+ def sso_session(cfg, profile, sso_session_name)
461
+ # aws sso-configure may add quotes around sso session names with whitespace
462
+ sso_session = cfg["sso-session #{sso_session_name}"] || cfg["sso-session '#{sso_session_name}'"]
463
+
464
+ unless sso_session
465
+ raise ArgumentError,
466
+ "sso-session #{sso_session_name} must be defined in the config file. " \
467
+ "Referenced by profile #{profile}"
468
+ end
469
+
470
+ unless sso_session['sso_region']
471
+ raise ArgumentError, "sso-session #{sso_session_name} missing required parameter: sso_region"
472
+ end
473
+
474
+ sso_session
475
+ end
472
476
  end
473
477
  end
@@ -605,7 +605,7 @@ module Aws::SSO
605
605
  params: params,
606
606
  config: config)
607
607
  context[:gem_name] = 'aws-sdk-core'
608
- context[:gem_version] = '3.180.2'
608
+ context[:gem_version] = '3.181.0'
609
609
  Seahorse::Client::Request.new(handlers, context)
610
610
  end
611
611
 
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.180.2'
57
+ GEM_VERSION = '3.181.0'
58
58
 
59
59
  end
@@ -601,7 +601,7 @@ module Aws::SSOOIDC
601
601
  params: params,
602
602
  config: config)
603
603
  context[:gem_name] = 'aws-sdk-core'
604
- context[:gem_version] = '3.180.2'
604
+ context[:gem_version] = '3.181.0'
605
605
  Seahorse::Client::Request.new(handlers, context)
606
606
  end
607
607
 
@@ -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.180.2'
57
+ GEM_VERSION = '3.181.0'
58
58
 
59
59
  end
@@ -2344,7 +2344,7 @@ module Aws::STS
2344
2344
  params: params,
2345
2345
  config: config)
2346
2346
  context[:gem_name] = 'aws-sdk-core'
2347
- context[:gem_version] = '3.180.2'
2347
+ context[:gem_version] = '3.181.0'
2348
2348
  Seahorse::Client::Request.new(handlers, context)
2349
2349
  end
2350
2350
 
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.180.2'
57
+ GEM_VERSION = '3.181.0'
58
58
 
59
59
  end
@@ -60,6 +60,16 @@ the number of bytes read from the body, and the total number of
60
60
  bytes in the body.
61
61
  DOCS
62
62
 
63
+ option(:on_chunk_received,
64
+ default: nil,
65
+ doc_type: 'Proc',
66
+ docstring: <<-DOCS)
67
+ When a Proc object is provided, it will be used as callback when each chunk
68
+ of the response body is received. It provides three arguments: the chunk,
69
+ the number of bytes received, and the total number of
70
+ bytes in the response (or nil if the server did not send a `content-length`).
71
+ DOCS
72
+
63
73
  # @api private
64
74
  class OptionHandler < Client::Handler
65
75
  def call(context)
@@ -68,8 +78,29 @@ bytes in the body.
68
78
  end
69
79
  on_chunk_sent = context.config.on_chunk_sent if on_chunk_sent.nil?
70
80
  context[:on_chunk_sent] = on_chunk_sent if on_chunk_sent
81
+
82
+ if context.params.is_a?(Hash) && context.params[:on_chunk_received]
83
+ on_chunk_received = context.params.delete(:on_chunk_received)
84
+ end
85
+ on_chunk_received = context.config.on_chunk_received if on_chunk_received.nil?
86
+
87
+ add_response_events(on_chunk_received, context) if on_chunk_received
88
+
71
89
  @handler.call(context)
72
90
  end
91
+
92
+ def add_response_events(on_chunk_received, context)
93
+ shared_data = {bytes_received: 0}
94
+
95
+ context.http_response.on_headers do |_status, headers|
96
+ shared_data[:content_length] = headers['content-length']&.to_i
97
+ end
98
+
99
+ context.http_response.on_data do |chunk|
100
+ shared_data[:bytes_received] += chunk.bytesize if chunk && chunk.respond_to?(:bytesize)
101
+ on_chunk_received.call(chunk, shared_data[:bytes_received], shared_data[:content_length])
102
+ end
103
+ end
73
104
  end
74
105
 
75
106
  # @api private
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.180.2
4
+ version: 3.181.0
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: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath