Skip to content

Commit bd1f8f5

Browse files
committed
Revert "Support Auth trait for Sigv4a (#2923)"
This reverts commit 31e5357.
1 parent 4500210 commit bd1f8f5

File tree

36 files changed

+11138
-64622
lines changed

36 files changed

+11138
-64622
lines changed

build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/service.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def initialize(options)
5252
@protocol_settings = metadata['protocolSettings'] || {}
5353
@api_version = metadata['apiVersion']
5454
@signature_version = metadata['signatureVersion']
55-
@auth = api.fetch('metadata')['auth']
5655
@full_name = metadata['serviceFullName']
5756
@short_name = metadata['serviceAbbreviation'] || @full_name
5857

@@ -160,9 +159,6 @@ def included_in_core?
160159
# @return [String] The signature version, e.g. "v4"
161160
attr_reader :signature_version
162161

163-
# @return [Array<String>] A list of supported auth types
164-
attr_reader :auth
165-
166162
# @return [String] The full product name for the service,
167163
# e.g. "Amazon Simple Storage Service".
168164
attr_reader :full_name

build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/views/client_api_module.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ def operations
251251
end
252252
o.authorizer = operation['authorizer'] if operation.key?('authorizer')
253253
o.authtype = operation['authtype'] if operation.key?('authtype')
254-
o.auth = operation['auth'] if operation.key?('auth')
255254
o.require_apikey = operation['requiresApiKey'] if operation.key?('requiresApiKey')
256255
o.pager = pager(operation_name)
257256
o.async = @service.protocol_settings['h2'] == 'eventstream' &&
@@ -599,9 +598,6 @@ def initialize
599598
# @return [String,nil]
600599
attr_accessor :authtype
601600

602-
# @return [Array<String>]
603-
attr_accessor :auth
604-
605601
# @return [Boolean]
606602
attr_accessor :endpoint_trait
607603

build_tools/aws-sdk-code-generator/spec/interfaces/client/bearer_authorization_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
describe 'Client Interface:' do
66
describe 'SignatureVersion: bearer' do
77
before(:all) do
8-
SpecHelper.generate_service(['LegacySignBearerAuth'], multiple_files: false)
8+
SpecHelper.generate_service(['BearerAuth'], multiple_files: false)
99
end
1010

1111
let(:token) { 'token' }
1212

1313
let(:token_provider) { Aws::StaticTokenProvider.new(token) }
1414

1515
let(:client) do
16-
LegacySignBearerAuth::Client.new(
16+
BearerAuth::Client.new(
1717
region: 'us-west-2',
1818
stub_responses: true,
1919
token_provider: token_provider,
@@ -51,15 +51,15 @@
5151

5252
describe 'SignatureVersion: v4' do
5353
before(:all) do
54-
SpecHelper.generate_service(['LegacySignV4WithBearer'], multiple_files: false)
54+
SpecHelper.generate_service(['V4WithBearer'], multiple_files: false)
5555
end
5656

5757
let(:token) { 'token' }
5858

5959
let(:token_provider) { Aws::StaticTokenProvider.new(token) }
6060

6161
let(:client) do
62-
LegacySignV4WithBearer::Client.new(
62+
V4WithBearer::Client.new(
6363
region: 'us-west-2',
6464
stub_responses: true,
6565
token_provider: token_provider,

build_tools/aws-sdk-code-generator/spec/interfaces/client/transfer_encoding_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
end
1010

1111
let(:client) do
12-
TransferEncoding::Client.new(stub_responses: true)
12+
TransferEncoding::Client.new(
13+
region: 'us-west-2',
14+
access_key_id: 'akid',
15+
secret_access_key: 'secret',
16+
stub_responses: true,
17+
endpoint: 'https://svc.us-west-2.amazonaws.com'
18+
)
1319
end
1420

1521
it 'adds `Transfer-Encoding` header for `v4-unsigned-body` auth types' do
@@ -63,5 +69,6 @@
6369
resp = client.non_streaming(body: 'heyhey')
6470
expect(resp.context.http_request.headers['Content-Length']).to eq('19')
6571
end
72+
6673
end
6774
end

build_tools/aws-sdk-code-generator/templates/client_api_module.mustache

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ module {{module_name}}
7777
{{#authtype}}
7878
o['authtype'] = "{{.}}"
7979
{{/authtype}}
80-
{{#auth}}
81-
o['auth'] = {{&auth}}
82-
{{/auth}}
8380
{{#endpoint_trait}}
8481
o.endpoint_pattern = {
8582
{{#endpoint_pattern}}

build_tools/customizations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def dynamodb_example_deep_transform(subsegment, keys)
231231
api('STS') do |api|
232232
operations = %w(AssumeRoleWithSAML AssumeRoleWithWebIdentity)
233233
operations.each do |operation|
234-
api['operations'][operation]['auth'] = ['smithy.api#noAuth']
234+
api['operations'][operation]['authtype'] = 'none'
235235
end
236236
end
237237
end

build_tools/services.rb

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class ServiceEnumerator
1010
MANIFEST_PATH = File.expand_path('../../services.json', __FILE__)
1111

1212
# Minimum `aws-sdk-core` version for new gem builds
13-
MINIMUM_CORE_VERSION = "3.200.0"
13+
MINIMUM_CORE_VERSION = "3.199.0"
1414

1515
# Minimum `aws-sdk-core` version for new S3 gem builds
16-
MINIMUM_CORE_VERSION_S3 = "3.200.0"
16+
MINIMUM_CORE_VERSION_S3 = "3.199.0"
1717

1818
EVENTSTREAM_PLUGIN = "Aws::Plugins::EventStreamConfiguration"
1919

@@ -158,16 +158,9 @@ def gem_dependencies(api, dependencies)
158158
core_version_string = "', '>= #{min_core}"
159159
dependencies['aws-sdk-core'] = "~> #{version_file.split('.')[0]}#{core_version_string}"
160160

161-
api['metadata'].fetch('auth', []).each do |auth|
162-
if %w[aws.auth#sigv4 aws.auth#sigv4a].include?(auth)
163-
dependencies['aws-sigv4'] = '~> 1.5'
164-
end
165-
end
166-
167-
# deprecated auth but a reasonable fallback
168161
case api['metadata']['signatureVersion']
169-
when 'v4' then dependencies['aws-sigv4'] ||= '~> 1.1'
170-
when 'v2' then dependencies['aws-sigv2'] ||= '~> 1.0'
162+
when 'v4' then dependencies['aws-sigv4'] = '~> 1.1'
163+
when 'v2' then dependencies['aws-sigv2'] = '~> 1.0'
171164
end
172165
dependencies
173166
end

gems/aws-sdk-core/CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
Unreleased Changes
22
------------------
33

4-
* Feature - Support `auth` trait to enable SigV4a based services.
5-
6-
* Feature - Support configuration for sigv4a signing regions using `ENV['AWS_SIGV4A_SIGNING_REGION_SET']`, `sigv4a_signing_region_set` shared config, or the `sigv4a_signing_region_set` client option.
7-
84
3.199.0 (2024-06-25)
95
------------------
106

0 commit comments

Comments
 (0)