Skip to content

Commit

Permalink
Merge branch 'release-1.35.0'
Browse files Browse the repository at this point in the history
* release-1.35.0:
  Bumping version to 1.35.0
  Update endpoints model
  Update to latest models
  Multi-auth trait support (#3233)
  • Loading branch information
aws-sdk-python-automation committed Aug 16, 2024
2 parents 7fdb763 + 756df07 commit ec0fda7
Show file tree
Hide file tree
Showing 23 changed files with 401 additions and 27 deletions.
32 changes: 32 additions & 0 deletions .changes/1.35.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"category": "``batch``",
"description": "Improvements of integration between AWS Batch and EC2.",
"type": "api-change"
},
{
"category": "``inspector2``",
"description": "Update the correct format of key and values for resource tags",
"type": "api-change"
},
{
"category": "``quicksight``",
"description": "Amazon QuickSight launches Customer Managed Key (CMK) encryption for Data Source metadata",
"type": "api-change"
},
{
"category": "``sagemaker``",
"description": "Introduce Endpoint and EndpointConfig Arns in sagemaker:ListPipelineExecutionSteps API response",
"type": "api-change"
},
{
"category": "``sesv2``",
"description": "Marking use case description field of account details as deprecated.",
"type": "api-change"
},
{
"category": "signing",
"description": "Adds internal support for the new 'auth' trait to allow a priority list of auth types for a service or operation.",
"type": "feature"
}
]
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
CHANGELOG
=========

1.35.0
======

* api-change:``batch``: Improvements of integration between AWS Batch and EC2.
* api-change:``inspector2``: Update the correct format of key and values for resource tags
* api-change:``quicksight``: Amazon QuickSight launches Customer Managed Key (CMK) encryption for Data Source metadata
* api-change:``sagemaker``: Introduce Endpoint and EndpointConfig Arns in sagemaker:ListPipelineExecutionSteps API response
* api-change:``sesv2``: Marking use case description field of account details as deprecated.
* feature:signing: Adds internal support for the new 'auth' trait to allow a priority list of auth types for a service or operation.


1.34.162
========

Expand Down
2 changes: 1 addition & 1 deletion botocore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
import re

__version__ = '1.34.162'
__version__ = '1.35.0'


class NullHandler(logging.Handler):
Expand Down
3 changes: 3 additions & 0 deletions botocore/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ def compute_client_args(
client_config.disable_request_compression
),
client_context_params=client_config.client_context_params,
sigv4a_signing_region_set=(
client_config.sigv4a_signing_region_set
),
)
self._compute_retry_config(config_kwargs)
self._compute_connect_timeout(config_kwargs)
Expand Down
27 changes: 26 additions & 1 deletion botocore/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
urlsplit,
urlunsplit,
)
from botocore.exceptions import NoAuthTokenError, NoCredentialsError
from botocore.exceptions import (
NoAuthTokenError,
NoCredentialsError,
UnknownSignatureVersionError,
UnsupportedSignatureVersionError,
)
from botocore.utils import (
is_valid_ipv6_endpoint_url,
normalize_url_path,
Expand Down Expand Up @@ -1132,6 +1137,19 @@ def add_auth(self, request):
request.headers['Authorization'] = auth_header


def resolve_auth_type(auth_trait):
for auth_type in auth_trait:
if auth_type == 'smithy.api#noAuth':
return AUTH_TYPE_TO_SIGNATURE_VERSION[auth_type]
elif auth_type in AUTH_TYPE_TO_SIGNATURE_VERSION:
signature_version = AUTH_TYPE_TO_SIGNATURE_VERSION[auth_type]
if signature_version in AUTH_TYPE_MAPS:
return signature_version
else:
raise UnknownSignatureVersionError(signature_version=auth_type)
raise UnsupportedSignatureVersionError(signature_version=auth_trait)


AUTH_TYPE_MAPS = {
'v2': SigV2Auth,
'v3': SigV3Auth,
Expand Down Expand Up @@ -1160,3 +1178,10 @@ def add_auth(self, request):
's3v4-query': S3SigV4QueryAuth,
}
)

AUTH_TYPE_TO_SIGNATURE_VERSION = {
'aws.auth#sigv4': 'v4',
'aws.auth#sigv4a': 'v4a',
'smithy.api#httpBearerAuth': 'bearer',
'smithy.api#noAuth': 'none',
}
18 changes: 12 additions & 6 deletions botocore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from botocore import waiter, xform_name
from botocore.args import ClientArgsCreator
from botocore.auth import AUTH_TYPE_MAPS
from botocore.auth import AUTH_TYPE_MAPS, resolve_auth_type
from botocore.awsrequest import prepare_request_dict
from botocore.compress import maybe_compress_request
from botocore.config import Config
Expand Down Expand Up @@ -148,15 +148,19 @@ def create_client(
region_name, client_config = self._normalize_fips_region(
region_name, client_config
)
if auth := service_model.metadata.get('auth'):
service_signature_version = resolve_auth_type(auth)
else:
service_signature_version = service_model.metadata.get(
'signatureVersion'
)
endpoint_bridge = ClientEndpointBridge(
self._endpoint_resolver,
scoped_config,
client_config,
service_signing_name=service_model.metadata.get('signingName'),
config_store=self._config_store,
service_signature_version=service_model.metadata.get(
'signatureVersion'
),
service_signature_version=service_signature_version,
)
client_args = self._get_client_args(
service_model,
Expand Down Expand Up @@ -487,7 +491,7 @@ def _default_s3_presign_to_sigv2(self, signature_version, **kwargs):
return

if signature_version.startswith('v4-s3express'):
return f'{signature_version}'
return signature_version

for suffix in ['-query', '-presign-post']:
if signature_version.endswith(suffix):
Expand Down Expand Up @@ -953,8 +957,10 @@ def _make_api_call(self, operation_name, api_params):
'client_region': self.meta.region_name,
'client_config': self.meta.config,
'has_streaming_input': operation_model.has_streaming_input,
'auth_type': operation_model.auth_type,
'auth_type': operation_model.resolved_auth_type,
'unsigned_payload': operation_model.unsigned_payload,
}

api_params = self._emit_api_params(
api_params=api_params,
operation_model=operation_model,
Expand Down
7 changes: 7 additions & 0 deletions botocore/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ class Config:
Defaults to None.
:type sigv4a_signing_region_set: string
:param sigv4a_signing_region_set: A set of AWS regions to apply the signature for
when using SigV4a for signing. Set to ``*`` to represent all regions.
Defaults to None.
:type client_context_params: dict
:param client_context_params: A dictionary of parameters specific to
individual services. If available, valid parameters can be found in
Expand Down Expand Up @@ -257,6 +263,7 @@ class Config:
('request_min_compression_size_bytes', None),
('disable_request_compression', None),
('client_context_params', None),
('sigv4a_signing_region_set', None),
]
)

Expand Down
6 changes: 6 additions & 0 deletions botocore/configprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@
False,
utils.ensure_boolean,
),
'sigv4a_signing_region_set': (
'sigv4a_signing_region_set',
'AWS_SIGV4A_SIGNING_REGION_SET',
None,
None,
),
}
# A mapping for the s3 specific configuration vars. These are the configuration
# vars that typically go in the s3 section of the config file. This mapping
Expand Down
14 changes: 13 additions & 1 deletion botocore/data/batch/2016-08-10/service-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{"shape":"ClientException"},
{"shape":"ServerException"}
],
"documentation":"<p>Cancels a job in an Batch job queue. Jobs that are in the <code>SUBMITTED</code> or <code>PENDING</code> are canceled. A job in<code>RUNNABLE</code> remains in <code>RUNNABLE</code> until it reaches the head of the job queue. Then the job status is updated to <code>FAILED</code>.</p> <note> <p>A <code>PENDING</code> job is canceled after all dependency jobs are completed. Therefore, it may take longer than expected to cancel a job in <code>PENDING</code> status.</p> <p>When you try to cancel an array parent job in <code>PENDING</code>, Batch attempts to cancel all child jobs. The array parent job is canceled when all child jobs are completed.</p> </note> <p>Jobs that progressed to the <code>STARTING</code> or <code>RUNNING</code> state aren't canceled. However, the API operation still succeeds, even if no job is canceled. These jobs must be terminated with the <a>TerminateJob</a> operation.</p>"
"documentation":"<p>Cancels a job in an Batch job queue. Jobs that are in a <code>SUBMITTED</code>, <code>PENDING</code>, or <code>RUNNABLE</code> state are cancelled and the job status is updated to <code>FAILED</code>.</p> <note> <p>A <code>PENDING</code> job is canceled after all dependency jobs are completed. Therefore, it may take longer than expected to cancel a job in <code>PENDING</code> status.</p> <p>When you try to cancel an array parent job in <code>PENDING</code>, Batch attempts to cancel all child jobs. The array parent job is canceled when all child jobs are completed.</p> </note> <p>Jobs that progressed to the <code>STARTING</code> or <code>RUNNING</code> state aren't canceled. However, the API operation still succeeds, even if no job is canceled. These jobs must be terminated with the <a>TerminateJob</a> operation.</p>"
},
"CreateComputeEnvironment":{
"name":"CreateComputeEnvironment",
Expand Down Expand Up @@ -681,6 +681,10 @@
"uuid":{
"shape":"String",
"documentation":"<p>Unique identifier for the compute environment.</p>"
},
"context":{
"shape":"String",
"documentation":"<p>Reserved.</p>"
}
},
"documentation":"<p>An object that represents an Batch compute environment.</p>"
Expand Down Expand Up @@ -1176,6 +1180,10 @@
"eksConfiguration":{
"shape":"EksConfiguration",
"documentation":"<p>The details for the Amazon EKS cluster that supports the compute environment.</p>"
},
"context":{
"shape":"String",
"documentation":"<p>Reserved.</p>"
}
},
"documentation":"<p>Contains the parameters for <code>CreateComputeEnvironment</code>.</p>"
Expand Down Expand Up @@ -4082,6 +4090,10 @@
"updatePolicy":{
"shape":"UpdatePolicy",
"documentation":"<p>Specifies the updated infrastructure update policy for the compute environment. For more information about infrastructure updates, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>"
},
"context":{
"shape":"String",
"documentation":"<p>Reserved.</p>"
}
},
"documentation":"<p>Contains the parameters for <code>UpdateComputeEnvironment</code>.</p>"
Expand Down
2 changes: 2 additions & 0 deletions botocore/data/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -20436,6 +20436,7 @@
},
"vpc-lattice" : {
"endpoints" : {
"af-south-1" : { },
"ap-northeast-1" : { },
"ap-northeast-2" : { },
"ap-south-1" : { },
Expand All @@ -20444,6 +20445,7 @@
"ca-central-1" : { },
"eu-central-1" : { },
"eu-north-1" : { },
"eu-south-1" : { },
"eu-west-1" : { },
"eu-west-2" : { },
"eu-west-3" : { },
Expand Down
15 changes: 13 additions & 2 deletions botocore/data/inspector2/2020-06-08/service-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7849,7 +7849,7 @@
},
"TagValueList":{
"type":"list",
"member":{"shape":"String"},
"member":{"shape":"TargetResourceTagsValue"},
"max":5,
"min":1
},
Expand All @@ -7870,11 +7870,22 @@
},
"TargetResourceTags":{
"type":"map",
"key":{"shape":"NonEmptyString"},
"key":{"shape":"TargetResourceTagsKey"},
"value":{"shape":"TagValueList"},
"max":5,
"min":1
},
"TargetResourceTagsKey":{
"type":"string",
"max":128,
"min":1,
"pattern":"^[\\p{L}\\p{Z}\\p{N}_.:/=\\-@]*$"
},
"TargetResourceTagsValue":{
"type":"string",
"max":256,
"min":1
},
"TargetStatusFilterList":{
"type":"list",
"member":{"shape":"CisTargetStatusFilter"},
Expand Down
15 changes: 15 additions & 0 deletions botocore/data/quicksight/2018-04-01/service-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
{"shape":"ResourceNotFoundException"},
{"shape":"ResourceExistsException"},
{"shape":"ThrottlingException"},
{"shape":"CustomerManagedKeyUnavailableException"},
{"shape":"InternalFailureException"}
],
"documentation":"<p>Creates a data source.</p>"
Expand Down Expand Up @@ -2884,6 +2885,7 @@
{"shape":"InvalidParameterValueException"},
{"shape":"ThrottlingException"},
{"shape":"ResourceNotFoundException"},
{"shape":"CustomerManagedKeyUnavailableException"},
{"shape":"InternalFailureException"}
],
"documentation":"<p>Updates a data source.</p>"
Expand Down Expand Up @@ -9578,6 +9580,19 @@
},
"documentation":"<p>The configuration of custom values for the destination parameter in <code>DestinationParameterValueConfiguration</code>.</p>"
},
"CustomerManagedKeyUnavailableException":{
"type":"structure",
"members":{
"Message":{"shape":"String"},
"RequestId":{
"shape":"String",
"documentation":"<p>The Amazon Web Services request ID for this operation.</p>"
}
},
"documentation":"<p>The customer managed key that is registered to your Amazon QuickSight account is unavailable.</p>",
"error":{"httpStatusCode":400},
"exception":true
},
"Dashboard":{
"type":"structure",
"members":{
Expand Down
28 changes: 28 additions & 0 deletions botocore/data/sagemaker/2017-07-24/service-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -18182,6 +18182,16 @@
"CreationTime"
]
},
"EndpointConfigStepMetadata":{
"type":"structure",
"members":{
"Arn":{
"shape":"EndpointConfigArn",
"documentation":"<p>The Amazon Resource Name (ARN) of the endpoint configuration used in the step.</p>"
}
},
"documentation":"<p>Metadata for an endpoint configuration step.</p>"
},
"EndpointConfigSummary":{
"type":"structure",
"required":[
Expand Down Expand Up @@ -18400,6 +18410,16 @@
"UpdateRollbackFailed"
]
},
"EndpointStepMetadata":{
"type":"structure",
"members":{
"Arn":{
"shape":"EndpointArn",
"documentation":"<p>The Amazon Resource Name (ARN) of the endpoint in the step.</p>"
}
},
"documentation":"<p>Metadata for an endpoint step.</p>"
},
"EndpointSummary":{
"type":"structure",
"required":[
Expand Down Expand Up @@ -30960,6 +30980,14 @@
"AutoMLJob":{
"shape":"AutoMLJobStepMetadata",
"documentation":"<p>The Amazon Resource Name (ARN) of the AutoML job that was run by this step.</p>"
},
"Endpoint":{
"shape":"EndpointStepMetadata",
"documentation":"<p>The endpoint that was invoked during this step execution.</p>"
},
"EndpointConfig":{
"shape":"EndpointConfigStepMetadata",
"documentation":"<p>The endpoint configuration used to create an endpoint during this step execution.</p>"
}
},
"documentation":"<p>Metadata for a step execution.</p>"
Expand Down
6 changes: 3 additions & 3 deletions botocore/data/sesv2/2019-09-27/service-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -5509,8 +5509,7 @@
"type":"structure",
"required":[
"MailType",
"WebsiteURL",
"UseCaseDescription"
"WebsiteURL"
],
"members":{
"MailType":{
Expand Down Expand Up @@ -6959,8 +6958,9 @@
},
"UseCaseDescription":{
"type":"string",
"deprecated":true,
"deprecatedMessage":"Use case description is optional and deprecated",
"max":5000,
"min":1,
"sensitive":true
},
"UseDefaultIfPreferenceUnavailable":{"type":"boolean"},
Expand Down
Loading

0 comments on commit ec0fda7

Please sign in to comment.