From 59ba1f7a6d5f699210ed13a670b0d47c68c2f9bd Mon Sep 17 00:00:00 2001 From: aws-sdk-python-automation Date: Fri, 1 Nov 2024 18:08:12 +0000 Subject: [PATCH 1/7] Update to latest models --- .../api-change-bedrockagent-84328.json | 5 + .../api-change-docdbelastic-733.json | 5 + .../next-release/api-change-logs-53637.json | 5 + .../api-change-taxsettings-84056.json | 5 + .../bedrock-agent/2023-06-05/service-2.json | 10 +- .../2022-11-28/paginators-1.json | 6 + .../docdb-elastic/2022-11-28/service-2.json | 228 +++++++++++++++++- botocore/data/logs/2014-03-28/service-2.json | 2 +- .../taxsettings/2018-05-10/paginators-1.json | 6 + .../taxsettings/2018-05-10/service-2.json | 225 ++++++++++++++++- 10 files changed, 482 insertions(+), 15 deletions(-) create mode 100644 .changes/next-release/api-change-bedrockagent-84328.json create mode 100644 .changes/next-release/api-change-docdbelastic-733.json create mode 100644 .changes/next-release/api-change-logs-53637.json create mode 100644 .changes/next-release/api-change-taxsettings-84056.json diff --git a/.changes/next-release/api-change-bedrockagent-84328.json b/.changes/next-release/api-change-bedrockagent-84328.json new file mode 100644 index 0000000000..132769d558 --- /dev/null +++ b/.changes/next-release/api-change-bedrockagent-84328.json @@ -0,0 +1,5 @@ +{ + "type": "api-change", + "category": "``bedrock-agent``", + "description": "Amazon Bedrock Knowledge Bases now supports using application inference profiles to increase throughput and improve resilience." +} diff --git a/.changes/next-release/api-change-docdbelastic-733.json b/.changes/next-release/api-change-docdbelastic-733.json new file mode 100644 index 0000000000..81eaf31acd --- /dev/null +++ b/.changes/next-release/api-change-docdbelastic-733.json @@ -0,0 +1,5 @@ +{ + "type": "api-change", + "category": "``docdb-elastic``", + "description": "Amazon DocumentDB Elastic Clusters adds support for pending maintenance actions feature with APIs GetPendingMaintenanceAction, ListPendingMaintenanceActions and ApplyPendingMaintenanceAction" +} diff --git a/.changes/next-release/api-change-logs-53637.json b/.changes/next-release/api-change-logs-53637.json new file mode 100644 index 0000000000..e477bb4f4c --- /dev/null +++ b/.changes/next-release/api-change-logs-53637.json @@ -0,0 +1,5 @@ +{ + "type": "api-change", + "category": "``logs``", + "description": "This release introduces an improvement in PutLogEvents" +} diff --git a/.changes/next-release/api-change-taxsettings-84056.json b/.changes/next-release/api-change-taxsettings-84056.json new file mode 100644 index 0000000000..488e508848 --- /dev/null +++ b/.changes/next-release/api-change-taxsettings-84056.json @@ -0,0 +1,5 @@ +{ + "type": "api-change", + "category": "``taxsettings``", + "description": "Add support for supplemental tax registrations via these new APIs: PutSupplementalTaxRegistration, ListSupplementalTaxRegistrations, and DeleteSupplementalTaxRegistration." +} diff --git a/botocore/data/bedrock-agent/2023-06-05/service-2.json b/botocore/data/bedrock-agent/2023-06-05/service-2.json index 89a8d37bb5..c819c6330a 100644 --- a/botocore/data/bedrock-agent/2023-06-05/service-2.json +++ b/botocore/data/bedrock-agent/2023-06-05/service-2.json @@ -5,11 +5,13 @@ "endpointPrefix":"bedrock-agent", "jsonVersion":"1.1", "protocol":"rest-json", + "protocols":["rest-json"], "serviceFullName":"Agents for Amazon Bedrock", "serviceId":"Bedrock Agent", "signatureVersion":"v4", "signingName":"bedrock", - "uid":"bedrock-agent-2023-06-05" + "uid":"bedrock-agent-2023-06-05", + "auth":["aws.auth#sigv4"] }, "operations":{ "AssociateAgentKnowledgeBase":{ @@ -1996,7 +1998,7 @@ "type":"string", "max":2048, "min":20, - "pattern":"^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$" + "pattern":"^(arn:aws(-[^:]{1,12})?:(bedrock|sagemaker):[a-z0-9-]{1,20}:([0-9]{12})?:([a-z-]+/)?)?([a-zA-Z0-9.-]{1,63}){0,2}(([:][a-z0-9-]{1,63}){0,2})?(/[a-z0-9]{1,12})?$" }, "BedrockEmbeddingModelConfiguration":{ "type":"structure", @@ -2027,7 +2029,7 @@ "type":"string", "max":2048, "min":1, - "pattern":"^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}::foundation-model/([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2})|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile/[a-zA-Z0-9-:.]+)$" + "pattern":"^(arn:aws(-[^:]{1,12})?:(bedrock):[a-z0-9-]{1,20}:([0-9]{12})?:([a-z-]+/)?)?([a-zA-Z0-9.-]{1,63}){0,2}(([:][a-z0-9-]{1,63}){0,2})?(/[a-z0-9]{1,12})?$" }, "Boolean":{ "type":"boolean", @@ -8170,7 +8172,7 @@ "members":{ "embeddingModelArn":{ "shape":"BedrockEmbeddingModelArn", - "documentation":"

The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

" + "documentation":"

The Amazon Resource Name (ARN) of the model or inference profile used to create vector embeddings for the knowledge base.

" }, "embeddingModelConfiguration":{ "shape":"EmbeddingModelConfiguration", diff --git a/botocore/data/docdb-elastic/2022-11-28/paginators-1.json b/botocore/data/docdb-elastic/2022-11-28/paginators-1.json index db11a76bfb..bed516d060 100644 --- a/botocore/data/docdb-elastic/2022-11-28/paginators-1.json +++ b/botocore/data/docdb-elastic/2022-11-28/paginators-1.json @@ -11,6 +11,12 @@ "output_token": "nextToken", "limit_key": "maxResults", "result_key": "clusters" + }, + "ListPendingMaintenanceActions": { + "input_token": "nextToken", + "output_token": "nextToken", + "limit_key": "maxResults", + "result_key": "resourcePendingMaintenanceActions" } } } diff --git a/botocore/data/docdb-elastic/2022-11-28/service-2.json b/botocore/data/docdb-elastic/2022-11-28/service-2.json index ef72cb5b36..9aaad56f6f 100644 --- a/botocore/data/docdb-elastic/2022-11-28/service-2.json +++ b/botocore/data/docdb-elastic/2022-11-28/service-2.json @@ -5,14 +5,36 @@ "endpointPrefix":"docdb-elastic", "jsonVersion":"1.1", "protocol":"rest-json", + "protocols":["rest-json"], "serviceAbbreviation":"DocDB Elastic", "serviceFullName":"Amazon DocumentDB Elastic Clusters", "serviceId":"DocDB Elastic", "signatureVersion":"v4", "signingName":"docdb-elastic", - "uid":"docdb-elastic-2022-11-28" + "uid":"docdb-elastic-2022-11-28", + "auth":["aws.auth#sigv4"] }, "operations":{ + "ApplyPendingMaintenanceAction":{ + "name":"ApplyPendingMaintenanceAction", + "http":{ + "method":"POST", + "requestUri":"/pending-action", + "responseCode":200 + }, + "input":{"shape":"ApplyPendingMaintenanceActionInput"}, + "output":{"shape":"ApplyPendingMaintenanceActionOutput"}, + "errors":[ + {"shape":"ThrottlingException"}, + {"shape":"ValidationException"}, + {"shape":"ConflictException"}, + {"shape":"InternalServerException"}, + {"shape":"ResourceNotFoundException"}, + {"shape":"AccessDeniedException"} + ], + "documentation":"

The type of pending maintenance action to be applied to the resource.

", + "idempotent":true + }, "CopyClusterSnapshot":{ "name":"CopyClusterSnapshot", "http":{ @@ -151,6 +173,25 @@ ], "documentation":"

Returns information about a specific elastic cluster snapshot

" }, + "GetPendingMaintenanceAction":{ + "name":"GetPendingMaintenanceAction", + "http":{ + "method":"GET", + "requestUri":"/pending-action/{resourceArn}", + "responseCode":200 + }, + "input":{"shape":"GetPendingMaintenanceActionInput"}, + "output":{"shape":"GetPendingMaintenanceActionOutput"}, + "errors":[ + {"shape":"ThrottlingException"}, + {"shape":"ValidationException"}, + {"shape":"ConflictException"}, + {"shape":"InternalServerException"}, + {"shape":"ResourceNotFoundException"}, + {"shape":"AccessDeniedException"} + ], + "documentation":"

Retrieves all maintenance actions that are pending.

" + }, "ListClusterSnapshots":{ "name":"ListClusterSnapshots", "http":{ @@ -185,6 +226,23 @@ ], "documentation":"

Returns information about provisioned Amazon DocumentDB elastic clusters.

" }, + "ListPendingMaintenanceActions":{ + "name":"ListPendingMaintenanceActions", + "http":{ + "method":"GET", + "requestUri":"/pending-actions", + "responseCode":200 + }, + "input":{"shape":"ListPendingMaintenanceActionsInput"}, + "output":{"shape":"ListPendingMaintenanceActionsOutput"}, + "errors":[ + {"shape":"ThrottlingException"}, + {"shape":"ValidationException"}, + {"shape":"InternalServerException"}, + {"shape":"AccessDeniedException"} + ], + "documentation":"

Retrieves a list of all maintenance actions that are pending.

" + }, "ListTagsForResource":{ "name":"ListTagsForResource", "http":{ @@ -334,6 +392,42 @@ }, "exception":true }, + "ApplyPendingMaintenanceActionInput":{ + "type":"structure", + "required":[ + "applyAction", + "optInType", + "resourceArn" + ], + "members":{ + "applyAction":{ + "shape":"InputString", + "documentation":"

The pending maintenance action to apply to the resource.

Valid actions are:

" + }, + "applyOn":{ + "shape":"InputString", + "documentation":"

A specific date to apply the pending maintenance action. Required if opt-in-type is APPLY_ON. Format: yyyy/MM/dd HH:mm-yyyy/MM/dd HH:mm

" + }, + "optInType":{ + "shape":"OptInType", + "documentation":"

A value that specifies the type of opt-in request, or undoes an opt-in request. An opt-in request of type IMMEDIATE can't be undone.

" + }, + "resourceArn":{ + "shape":"InputString", + "documentation":"

The Amazon DocumentDB Amazon Resource Name (ARN) of the resource to which the pending maintenance action applies.

" + } + } + }, + "ApplyPendingMaintenanceActionOutput":{ + "type":"structure", + "required":["resourcePendingMaintenanceAction"], + "members":{ + "resourcePendingMaintenanceAction":{ + "shape":"ResourcePendingMaintenanceAction", + "documentation":"

The output of the pending maintenance action being applied.

" + } + } + }, "Arn":{ "type":"string", "max":1011, @@ -841,6 +935,33 @@ } } }, + "GetPendingMaintenanceActionInput":{ + "type":"structure", + "required":["resourceArn"], + "members":{ + "resourceArn":{ + "shape":"InputString", + "documentation":"

Retrieves pending maintenance actions for a specific Amazon Resource Name (ARN).

", + "location":"uri", + "locationName":"resourceArn" + } + } + }, + "GetPendingMaintenanceActionOutput":{ + "type":"structure", + "required":["resourcePendingMaintenanceAction"], + "members":{ + "resourcePendingMaintenanceAction":{ + "shape":"ResourcePendingMaintenanceAction", + "documentation":"

Provides information about a pending maintenance action for a resource.

" + } + } + }, + "InputString":{ + "type":"string", + "max":256, + "min":1 + }, "Integer":{ "type":"integer", "box":true @@ -941,6 +1062,43 @@ } } }, + "ListPendingMaintenanceActionsInput":{ + "type":"structure", + "members":{ + "maxResults":{ + "shape":"ListPendingMaintenanceActionsInputMaxResultsInteger", + "documentation":"

The maximum number of results to include in the response. If more records exist than the specified maxResults value, a pagination token (marker) is included in the response so that the remaining results can be retrieved.

", + "location":"querystring", + "locationName":"maxResults" + }, + "nextToken":{ + "shape":"PaginationToken", + "documentation":"

An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by maxResults.

", + "location":"querystring", + "locationName":"nextToken" + } + } + }, + "ListPendingMaintenanceActionsInputMaxResultsInteger":{ + "type":"integer", + "box":true, + "max":100, + "min":1 + }, + "ListPendingMaintenanceActionsOutput":{ + "type":"structure", + "required":["resourcePendingMaintenanceActions"], + "members":{ + "nextToken":{ + "shape":"PaginationToken", + "documentation":"

An optional pagination token provided by a previous request. If this parameter is displayed, the responses will include only records beyond the marker, up to the value specified by maxResults.

" + }, + "resourcePendingMaintenanceActions":{ + "shape":"ResourcePendingMaintenanceActionList", + "documentation":"

Provides information about a pending maintenance action for a resource.

" + } + } + }, "ListTagsForResourceRequest":{ "type":"structure", "required":["resourceArn"], @@ -962,14 +1120,58 @@ } } }, + "OptInType":{ + "type":"string", + "enum":[ + "IMMEDIATE", + "NEXT_MAINTENANCE", + "APPLY_ON", + "UNDO_OPT_IN" + ] + }, "PaginationToken":{ "type":"string", - "documentation":"

Token or cursor used in paginated operations.

When this value is provided as operation input, the service returns results from where the previous response left off. When this value is present in operation output, it indicates that there are more results to retrieve.

This should be opaque to not expose implementation details and potentially versioned to allow evolution of pagination strategy.

" + "documentation":"
Token or cursor used in paginated operations. When this value is provided as operation input, the service returns results from where the previous response left off. When this value is present in operation output, it indicates that there are more results to retrieve. This should be opaque to not expose implementation details and potentially versioned to allow evolution of pagination strategy. 
" }, "Password":{ "type":"string", "sensitive":true }, + "PendingMaintenanceActionDetails":{ + "type":"structure", + "required":["action"], + "members":{ + "action":{ + "shape":"String", + "documentation":"

Displays the specific action of a pending maintenance action.

" + }, + "autoAppliedAfterDate":{ + "shape":"String", + "documentation":"

Displays the date of the maintenance window when the action is applied. The maintenance action is applied to the resource during its first maintenance window after this date. If this date is specified, any NEXT_MAINTENANCE optInType requests are ignored.

" + }, + "currentApplyDate":{ + "shape":"String", + "documentation":"

Displays the effective date when the pending maintenance action is applied to the resource.

" + }, + "description":{ + "shape":"String", + "documentation":"

Displays a description providing more detail about the maintenance action.

" + }, + "forcedApplyDate":{ + "shape":"String", + "documentation":"

Displays the date when the maintenance action is automatically applied. The maintenance action is applied to the resource on this date regardless of the maintenance window for the resource. If this date is specified, any IMMEDIATE optInType requests are ignored.

" + }, + "optInStatus":{ + "shape":"String", + "documentation":"

Displays the type of optInType request that has been received for the resource.

" + } + }, + "documentation":"

Retrieves the details of maintenance actions that are pending.

" + }, + "PendingMaintenanceActionDetailsList":{ + "type":"list", + "member":{"shape":"PendingMaintenanceActionDetails"} + }, "ResourceNotFoundException":{ "type":"structure", "required":[ @@ -998,6 +1200,24 @@ }, "exception":true }, + "ResourcePendingMaintenanceAction":{ + "type":"structure", + "members":{ + "pendingMaintenanceActionDetails":{ + "shape":"PendingMaintenanceActionDetailsList", + "documentation":"

Provides information about a pending maintenance action for a resource.

" + }, + "resourceArn":{ + "shape":"String", + "documentation":"

The Amazon DocumentDB Amazon Resource Name (ARN) of the resource to which the pending maintenance action applies.

" + } + }, + "documentation":"

Provides information about a pending maintenance action for a resource.

" + }, + "ResourcePendingMaintenanceActionList":{ + "type":"list", + "member":{"shape":"ResourcePendingMaintenanceAction"} + }, "RestoreClusterFromSnapshotInput":{ "type":"structure", "required":[ @@ -1138,7 +1358,9 @@ "COPYING", "STARTING", "STOPPING", - "STOPPED" + "STOPPED", + "MAINTENANCE", + "INACCESSIBLE_ENCRYPTION_CREDENTIALS_RECOVERABLE" ] }, "StopClusterInput":{ diff --git a/botocore/data/logs/2014-03-28/service-2.json b/botocore/data/logs/2014-03-28/service-2.json index a7d5a36749..0dfaba30f7 100644 --- a/botocore/data/logs/2014-03-28/service-2.json +++ b/botocore/data/logs/2014-03-28/service-2.json @@ -2663,7 +2663,7 @@ "type":"map", "key":{"shape":"EntityKeyAttributesKey"}, "value":{"shape":"EntityKeyAttributesValue"}, - "max":3, + "max":4, "min":2 }, "EntityKeyAttributesKey":{ diff --git a/botocore/data/taxsettings/2018-05-10/paginators-1.json b/botocore/data/taxsettings/2018-05-10/paginators-1.json index 3944b04ceb..91fc65c549 100644 --- a/botocore/data/taxsettings/2018-05-10/paginators-1.json +++ b/botocore/data/taxsettings/2018-05-10/paginators-1.json @@ -5,6 +5,12 @@ "output_token": "nextToken", "limit_key": "maxResults", "result_key": "accountDetails" + }, + "ListSupplementalTaxRegistrations": { + "input_token": "nextToken", + "output_token": "nextToken", + "limit_key": "maxResults", + "result_key": "taxRegistrations" } } } diff --git a/botocore/data/taxsettings/2018-05-10/service-2.json b/botocore/data/taxsettings/2018-05-10/service-2.json index 31e0ca5a69..9320741855 100644 --- a/botocore/data/taxsettings/2018-05-10/service-2.json +++ b/botocore/data/taxsettings/2018-05-10/service-2.json @@ -44,7 +44,24 @@ {"shape":"ConflictException"}, {"shape":"InternalServerException"} ], - "documentation":"

Adds or updates tax registration for multiple accounts in batch. This can be used to add or update tax registrations for up to five accounts in one batch. You can't set a TRN if there's a pending TRN. You'll need to delete the pending TRN first.

To call this API operation for specific countries, see the following country-specific requirements.

Bangladesh

Brazil

Georgia

Kenya

Malaysia

Nepal

Saudi Arabia

South Korea

Spain

Turkey

Ukraine

" + "documentation":"

Adds or updates tax registration for multiple accounts in batch. This can be used to add or update tax registrations for up to five accounts in one batch. You can't set a TRN if there's a pending TRN. You'll need to delete the pending TRN first.

To call this API operation for specific countries, see the following country-specific requirements.

Bangladesh

Brazil

Georgia

Kenya

Malaysia

Nepal

Saudi Arabia

South Korea

Spain

Turkey

Ukraine

" + }, + "DeleteSupplementalTaxRegistration":{ + "name":"DeleteSupplementalTaxRegistration", + "http":{ + "method":"POST", + "requestUri":"/DeleteSupplementalTaxRegistration", + "responseCode":200 + }, + "input":{"shape":"DeleteSupplementalTaxRegistrationRequest"}, + "output":{"shape":"DeleteSupplementalTaxRegistrationResponse"}, + "errors":[ + {"shape":"ValidationException"}, + {"shape":"ConflictException"}, + {"shape":"ResourceNotFoundException"}, + {"shape":"InternalServerException"} + ], + "documentation":"

Deletes a supplemental tax registration for a single account.

" }, "DeleteTaxRegistration":{ "name":"DeleteTaxRegistration", @@ -94,6 +111,22 @@ ], "documentation":"

Downloads your tax documents to the Amazon S3 bucket that you specify in your request.

" }, + "ListSupplementalTaxRegistrations":{ + "name":"ListSupplementalTaxRegistrations", + "http":{ + "method":"POST", + "requestUri":"/ListSupplementalTaxRegistrations", + "responseCode":200 + }, + "input":{"shape":"ListSupplementalTaxRegistrationsRequest"}, + "output":{"shape":"ListSupplementalTaxRegistrationsResponse"}, + "errors":[ + {"shape":"ValidationException"}, + {"shape":"ResourceNotFoundException"}, + {"shape":"InternalServerException"} + ], + "documentation":"

Retrieves supplemental tax registrations for a single account.

" + }, "ListTaxRegistrations":{ "name":"ListTaxRegistrations", "http":{ @@ -110,6 +143,22 @@ ], "documentation":"

Retrieves the tax registration of accounts listed in a consolidated billing family. This can be used to retrieve up to 100 accounts' tax registrations in one call (default 50).

" }, + "PutSupplementalTaxRegistration":{ + "name":"PutSupplementalTaxRegistration", + "http":{ + "method":"POST", + "requestUri":"/PutSupplementalTaxRegistration", + "responseCode":200 + }, + "input":{"shape":"PutSupplementalTaxRegistrationRequest"}, + "output":{"shape":"PutSupplementalTaxRegistrationResponse"}, + "errors":[ + {"shape":"ValidationException"}, + {"shape":"ConflictException"}, + {"shape":"InternalServerException"} + ], + "documentation":"

Stores supplemental tax registration for a single account.

" + }, "PutTaxRegistration":{ "name":"PutTaxRegistration", "http":{ @@ -124,7 +173,7 @@ {"shape":"ConflictException"}, {"shape":"InternalServerException"} ], - "documentation":"

Adds or updates tax registration for a single account. You can't set a TRN if there's a pending TRN. You'll need to delete the pending TRN first.

To call this API operation for specific countries, see the following country-specific requirements.

Bangladesh

Brazil

Georgia

Kenya

Malaysia

Nepal

Saudi Arabia

South Korea

Spain

Turkey

Ukraine

" + "documentation":"

Adds or updates tax registration for a single account. You can't set a TRN if there's a pending TRN. You'll need to delete the pending TRN first.

To call this API operation for specific countries, see the following country-specific requirements.

Bangladesh

Brazil

Georgia

Kenya

Malaysia

Nepal

Saudi Arabia

South Korea

Spain

Turkey

Ukraine

" } }, "shapes":{ @@ -366,7 +415,7 @@ }, "stateOrRegion":{ "shape":"State", - "documentation":"

The state, region, or province that the address is located.

If this is required for tax settings, use the same name as shown on the Tax Settings page.

" + "documentation":"

The state, region, or province that the address is located. This field is only required for Canada, India, United Arab Emirates, Romania, and Brazil (CPF). It is optional for all other countries.

If this is required for tax settings, use the same name as shown on the Tax Settings page.

" } }, "documentation":"

The details of the address associated with the TRN information.

" @@ -523,6 +572,10 @@ }, "documentation":"

Additional tax information associated with your TRN in Brazil.

" }, + "BusinessRegistrationNumber":{ + "type":"string", + "pattern":"^[0-9]{12}$" + }, "BusinessRepresentativeName":{ "type":"string", "max":200, @@ -538,7 +591,7 @@ }, "canadaRetailSalesTaxNumber":{ "shape":"CanadaRetailSalesTaxNumberString", - "documentation":"

Manitoba Retail Sales Tax ID number. Customers purchasing Amazon Web Services for resale in Manitoba must provide a valid Retail Sales Tax ID number for Manitoba. Leave this blank if you do not have a Retail Sales Tax ID number in Manitoba or are not purchasing Amazon Web Services for resale.

" + "documentation":"

Manitoba Retail Sales Tax ID number. Customers purchasing Amazon Web Services services for resale in Manitoba must provide a valid Retail Sales Tax ID number for Manitoba. Leave this blank if you do not have a Retail Sales Tax ID number in Manitoba or are not purchasing Amazon Web Services services for resale.

" }, "isResellerAccount":{ "shape":"Boolean", @@ -621,6 +674,21 @@ "min":10, "pattern":"^(\\d{4}-(0[0-9]|1[0-2])-([0-2][0-9]|3[0-1]))$" }, + "DeleteSupplementalTaxRegistrationRequest":{ + "type":"structure", + "required":["authorityId"], + "members":{ + "authorityId":{ + "shape":"GenericString", + "documentation":"

The unique authority Id for the supplemental TRN information that needs to be deleted.

" + } + } + }, + "DeleteSupplementalTaxRegistrationResponse":{ + "type":"structure", + "members":{ + } + }, "DeleteTaxRegistrationRequest":{ "type":"structure", "members":{ @@ -688,6 +756,12 @@ "type":"string", "pattern":"^(?!\\s*$)[\\s\\S]+$" }, + "GenericString":{ + "type":"string", + "max":200, + "min":1, + "pattern":"^[\\s\\S]*$" + }, "GeorgiaAdditionalInfo":{ "type":"structure", "required":["personType"], @@ -898,6 +972,33 @@ "min":1, "pattern":"^[0-9\\u3130-\\u318F\\uAC00-\\uD7AF,.( )-\\\\s]*$" }, + "ListSupplementalTaxRegistrationsRequest":{ + "type":"structure", + "members":{ + "maxResults":{ + "shape":"MaxResults", + "documentation":"

The number of taxRegistrations results you want in one response.

" + }, + "nextToken":{ + "shape":"PaginationTokenString", + "documentation":"

The token to retrieve the next set of results.

" + } + } + }, + "ListSupplementalTaxRegistrationsResponse":{ + "type":"structure", + "required":["taxRegistrations"], + "members":{ + "nextToken":{ + "shape":"PaginationTokenString", + "documentation":"

The token to retrieve the next set of results.

" + }, + "taxRegistrations":{ + "shape":"SupplementalTaxRegistrationList", + "documentation":"

The list of supplemental tax registrations.

" + } + } + }, "ListTaxRegistrationsRequest":{ "type":"structure", "members":{ @@ -927,11 +1028,18 @@ }, "MalaysiaAdditionalInfo":{ "type":"structure", - "required":["serviceTaxCodes"], "members":{ + "businessRegistrationNumber":{ + "shape":"BusinessRegistrationNumber", + "documentation":"

The tax registration number (TRN) in Malaysia.

For individual, you can specify the taxInformationNumber in MalaysiaAdditionalInfo with NRIC type, and a valid MyKad or NRIC number. For business, you must specify a businessRegistrationNumber in MalaysiaAdditionalInfo with a TIN type and tax identification number. For business resellers, you must specify a businessRegistrationNumber and taxInformationNumber in MalaysiaAdditionalInfo with a sales and service tax (SST) type and a valid SST number.

For business resellers with service codes, you must specify businessRegistrationNumber, taxInformationNumber, and distinct serviceTaxCodes in MalaysiaAdditionalInfo with a SST type and valid sales and service tax (SST) number. By using this API operation, Amazon Web Services registers your self-declaration that you’re an authorized business reseller registered with the Royal Malaysia Customs Department (RMCD), and have a valid SST number.

" + }, "serviceTaxCodes":{ "shape":"MalaysiaServiceTaxCodesList", "documentation":"

List of service tax codes for your TRN in Malaysia.

" + }, + "taxInformationNumber":{ + "shape":"TaxInformationNumber", + "documentation":"

The tax information number in Malaysia.

For individual, you can specify the taxInformationNumber in MalaysiaAdditionalInfo with NRIC type, and a valid MyKad or NRIC number. For business resellers, you must specify a businessRegistrationNumber and taxInformationNumber in MalaysiaAdditionalInfo with a sales and service tax (SST) type and a valid SST number.

For business resellers with service codes, you must specify businessRegistrationNumber, taxInformationNumber, and distinct serviceTaxCodes in MalaysiaAdditionalInfo with a SST type and valid sales and service tax (SST) number. By using this API operation, Amazon Web Services registers your self-declaration that you’re an authorized business reseller registered with the Royal Malaysia Customs Department (RMCD), and have a valid SST number.

" } }, "documentation":"

Additional tax information associated with your TRN in Malaysia.

" @@ -949,7 +1057,7 @@ "type":"list", "member":{"shape":"MalaysiaServiceTaxCode"}, "max":4, - "min":1 + "min":0 }, "MaxResults":{ "type":"integer", @@ -995,6 +1103,33 @@ "min":1, "pattern":"^(?!\\s*$)[\\s\\S]+$" }, + "PutSupplementalTaxRegistrationRequest":{ + "type":"structure", + "required":["taxRegistrationEntry"], + "members":{ + "taxRegistrationEntry":{ + "shape":"SupplementalTaxRegistrationEntry", + "documentation":"

The supplemental TRN information that will be stored for the caller account ID.

" + } + } + }, + "PutSupplementalTaxRegistrationResponse":{ + "type":"structure", + "required":[ + "authorityId", + "status" + ], + "members":{ + "authorityId":{ + "shape":"GenericString", + "documentation":"

Unique authority ID for the supplemental TRN information that was stored.

" + }, + "status":{ + "shape":"TaxRegistrationStatus", + "documentation":"

The status of the supplemental TRN stored in the system after processing. Based on the validation occurring on the TRN, the status can be Verified, Pending, Rejected, or Deleted.

" + } + } + }, "PutTaxRegistrationRequest":{ "type":"structure", "required":["taxRegistrationEntry"], @@ -1182,6 +1317,76 @@ "min":1, "pattern":"^(?!\\s*$)[\\s\\S]+$" }, + "SupplementalTaxRegistration":{ + "type":"structure", + "required":[ + "address", + "authorityId", + "legalName", + "registrationId", + "registrationType", + "status" + ], + "members":{ + "address":{"shape":"Address"}, + "authorityId":{ + "shape":"GenericString", + "documentation":"

Unique authority ID for the supplemental TRN.

" + }, + "legalName":{ + "shape":"LegalName", + "documentation":"

The legal name associated with your TRN registration.

" + }, + "registrationId":{ + "shape":"RegistrationId", + "documentation":"

The supplemental TRN unique identifier.

" + }, + "registrationType":{ + "shape":"SupplementalTaxRegistrationType", + "documentation":"

Type of supplemental TRN. Currently, this can only be VAT.

" + }, + "status":{ + "shape":"TaxRegistrationStatus", + "documentation":"

The status of your TRN.

" + } + }, + "documentation":"

Supplemental TRN details.

", + "sensitive":true + }, + "SupplementalTaxRegistrationEntry":{ + "type":"structure", + "required":[ + "address", + "legalName", + "registrationId", + "registrationType" + ], + "members":{ + "address":{"shape":"Address"}, + "legalName":{ + "shape":"LegalName", + "documentation":"

The legal name associated with your TRN registration.

" + }, + "registrationId":{ + "shape":"RegistrationId", + "documentation":"

The supplemental TRN unique identifier.

" + }, + "registrationType":{ + "shape":"SupplementalTaxRegistrationType", + "documentation":"

Type of supplemental TRN. Currently, this can only be VAT.

" + } + }, + "documentation":"

The supplemental TRN information to provide when adding or updating a supplemental TRN.

", + "sensitive":true + }, + "SupplementalTaxRegistrationList":{ + "type":"list", + "member":{"shape":"SupplementalTaxRegistration"} + }, + "SupplementalTaxRegistrationType":{ + "type":"string", + "enum":["VAT"] + }, "TaxCode":{ "type":"string", "pattern":"^([0-9]{11}|[A-Z]{6}[0-9]{2}[A-Z][0-9]{2}[A-Z][0-9]{3}[A-Z])$" @@ -1218,6 +1423,10 @@ "type":"string", "pattern":"^[\\s\\S]*$" }, + "TaxInformationNumber":{ + "type":"string", + "pattern":"^[A-Z]{1,2}[0-9]{1,11}$" + }, "TaxInheritanceDetails":{ "type":"structure", "members":{ @@ -1369,7 +1578,9 @@ "GST", "CPF", "CNPJ", - "SST" + "SST", + "TIN", + "NRIC" ] }, "TaxRegistrationWithJurisdiction":{ From a072fd2b902d934cb5080cd0f78e30ffde2d6a41 Mon Sep 17 00:00:00 2001 From: aws-sdk-python-automation Date: Fri, 1 Nov 2024 18:08:12 +0000 Subject: [PATCH 2/7] Update endpoints model --- botocore/data/endpoints.json | 1 + 1 file changed, 1 insertion(+) diff --git a/botocore/data/endpoints.json b/botocore/data/endpoints.json index 59fedef47b..7aaaa1b1ce 100644 --- a/botocore/data/endpoints.json +++ b/botocore/data/endpoints.json @@ -16192,6 +16192,7 @@ "hostname" : "rekognition-fips.ca-central-1.amazonaws.com" }, "eu-central-1" : { }, + "eu-south-2" : { }, "eu-west-1" : { }, "eu-west-2" : { }, "il-central-1" : { }, From 1b4ce6d294c18d843a954bb52cecb452908d35b9 Mon Sep 17 00:00:00 2001 From: aws-sdk-python-automation Date: Fri, 1 Nov 2024 18:09:16 +0000 Subject: [PATCH 3/7] Bumping version to 1.35.54 --- .changes/1.35.54.json | 22 +++++++++++++++++++ .../api-change-bedrockagent-84328.json | 5 ----- .../api-change-docdbelastic-733.json | 5 ----- .../next-release/api-change-logs-53637.json | 5 ----- .../api-change-taxsettings-84056.json | 5 ----- CHANGELOG.rst | 9 ++++++++ botocore/__init__.py | 2 +- docs/source/conf.py | 2 +- 8 files changed, 33 insertions(+), 22 deletions(-) create mode 100644 .changes/1.35.54.json delete mode 100644 .changes/next-release/api-change-bedrockagent-84328.json delete mode 100644 .changes/next-release/api-change-docdbelastic-733.json delete mode 100644 .changes/next-release/api-change-logs-53637.json delete mode 100644 .changes/next-release/api-change-taxsettings-84056.json diff --git a/.changes/1.35.54.json b/.changes/1.35.54.json new file mode 100644 index 0000000000..a9a810894b --- /dev/null +++ b/.changes/1.35.54.json @@ -0,0 +1,22 @@ +[ + { + "category": "``bedrock-agent``", + "description": "Amazon Bedrock Knowledge Bases now supports using application inference profiles to increase throughput and improve resilience.", + "type": "api-change" + }, + { + "category": "``docdb-elastic``", + "description": "Amazon DocumentDB Elastic Clusters adds support for pending maintenance actions feature with APIs GetPendingMaintenanceAction, ListPendingMaintenanceActions and ApplyPendingMaintenanceAction", + "type": "api-change" + }, + { + "category": "``logs``", + "description": "This release introduces an improvement in PutLogEvents", + "type": "api-change" + }, + { + "category": "``taxsettings``", + "description": "Add support for supplemental tax registrations via these new APIs: PutSupplementalTaxRegistration, ListSupplementalTaxRegistrations, and DeleteSupplementalTaxRegistration.", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/next-release/api-change-bedrockagent-84328.json b/.changes/next-release/api-change-bedrockagent-84328.json deleted file mode 100644 index 132769d558..0000000000 --- a/.changes/next-release/api-change-bedrockagent-84328.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "api-change", - "category": "``bedrock-agent``", - "description": "Amazon Bedrock Knowledge Bases now supports using application inference profiles to increase throughput and improve resilience." -} diff --git a/.changes/next-release/api-change-docdbelastic-733.json b/.changes/next-release/api-change-docdbelastic-733.json deleted file mode 100644 index 81eaf31acd..0000000000 --- a/.changes/next-release/api-change-docdbelastic-733.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "api-change", - "category": "``docdb-elastic``", - "description": "Amazon DocumentDB Elastic Clusters adds support for pending maintenance actions feature with APIs GetPendingMaintenanceAction, ListPendingMaintenanceActions and ApplyPendingMaintenanceAction" -} diff --git a/.changes/next-release/api-change-logs-53637.json b/.changes/next-release/api-change-logs-53637.json deleted file mode 100644 index e477bb4f4c..0000000000 --- a/.changes/next-release/api-change-logs-53637.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "api-change", - "category": "``logs``", - "description": "This release introduces an improvement in PutLogEvents" -} diff --git a/.changes/next-release/api-change-taxsettings-84056.json b/.changes/next-release/api-change-taxsettings-84056.json deleted file mode 100644 index 488e508848..0000000000 --- a/.changes/next-release/api-change-taxsettings-84056.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "api-change", - "category": "``taxsettings``", - "description": "Add support for supplemental tax registrations via these new APIs: PutSupplementalTaxRegistration, ListSupplementalTaxRegistrations, and DeleteSupplementalTaxRegistration." -} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9e285de489..6c580cc658 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,15 @@ CHANGELOG ========= +1.35.54 +======= + +* api-change:``bedrock-agent``: Amazon Bedrock Knowledge Bases now supports using application inference profiles to increase throughput and improve resilience. +* api-change:``docdb-elastic``: Amazon DocumentDB Elastic Clusters adds support for pending maintenance actions feature with APIs GetPendingMaintenanceAction, ListPendingMaintenanceActions and ApplyPendingMaintenanceAction +* api-change:``logs``: This release introduces an improvement in PutLogEvents +* api-change:``taxsettings``: Add support for supplemental tax registrations via these new APIs: PutSupplementalTaxRegistration, ListSupplementalTaxRegistrations, and DeleteSupplementalTaxRegistration. + + 1.35.53 ======= diff --git a/botocore/__init__.py b/botocore/__init__.py index ef4a32cdcb..7d30fabaf8 100644 --- a/botocore/__init__.py +++ b/botocore/__init__.py @@ -16,7 +16,7 @@ import os import re -__version__ = '1.35.53' +__version__ = '1.35.54' class NullHandler(logging.Handler): diff --git a/docs/source/conf.py b/docs/source/conf.py index 68a2cf516e..9f9f8d84f4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,7 +59,7 @@ # The short X.Y version. version = '1.35.' # The full version, including alpha/beta/rc tags. -release = '1.35.53' +release = '1.35.54' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 664e37cdba5d25ab600c5a0c206d698805832c26 Mon Sep 17 00:00:00 2001 From: Alessandra Romero <24320222+alexgromero@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:58:00 -0500 Subject: [PATCH 4/7] Query compatibility mode header (#3295) --- ...ement-QueryCompatibilityModeHeader-5257.json | 5 +++++ botocore/handlers.py | 7 +++++++ botocore/model.py | 4 ++++ tests/functional/test_sqs.py | 8 ++++++++ tests/unit/test_handlers.py | 17 +++++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 .changes/next-release/enhancement-QueryCompatibilityModeHeader-5257.json diff --git a/.changes/next-release/enhancement-QueryCompatibilityModeHeader-5257.json b/.changes/next-release/enhancement-QueryCompatibilityModeHeader-5257.json new file mode 100644 index 0000000000..09786edc36 --- /dev/null +++ b/.changes/next-release/enhancement-QueryCompatibilityModeHeader-5257.json @@ -0,0 +1,5 @@ +{ + "type": "enhancement", + "category": "protocol", + "description": "Added support for header enabling service migration off the AWS Query protocol." +} diff --git a/botocore/handlers.py b/botocore/handlers.py index d44cb07469..6d00ffadf1 100644 --- a/botocore/handlers.py +++ b/botocore/handlers.py @@ -1287,6 +1287,12 @@ def _update_status_code(response, **kwargs): http_response.status_code = parsed_status_code +def add_query_compatibility_header(model, params, **kwargs): + if not model.service_model.is_query_compatible: + return + params['headers']['x-amzn-query-mode'] = 'true' + + # This is a list of (event_name, handler). # When a Session is created, everything in this list will be # automatically registered with that Session. @@ -1348,6 +1354,7 @@ def _update_status_code(response, **kwargs): ('docs.response-params.s3.*.complete-section', document_expires_shape), ('before-endpoint-resolution.s3', customize_endpoint_resolver_builtins), ('before-call', add_recursion_detection_header), + ('before-call', add_query_compatibility_header), ('before-call.s3', add_expect_header), ('before-call.glacier', add_glacier_version), ('before-call.apigateway', add_accept_header), diff --git a/botocore/model.py b/botocore/model.py index 677266c8d2..70d20f8cca 100644 --- a/botocore/model.py +++ b/botocore/model.py @@ -478,6 +478,10 @@ def signature_version(self): def signature_version(self, value): self._signature_version = value + @CachedProperty + def is_query_compatible(self): + return 'awsQueryCompatible' in self.metadata + def __repr__(self): return f'{self.__class__.__name__}({self.service_name})' diff --git a/tests/functional/test_sqs.py b/tests/functional/test_sqs.py index bde70c86ed..b1e39b2944 100644 --- a/tests/functional/test_sqs.py +++ b/tests/functional/test_sqs.py @@ -46,3 +46,11 @@ def test_query_compatible_error_parsing(self): self.client.delete_queue( QueueUrl="not-a-real-queue-botocore", ) + + def test_query_compatibility_mode_header_sent(self): + with self.http_stubber as stub: + stub.add_response() + self.client.delete_queue(QueueUrl="not-a-real-queue-botocore") + request = self.http_stubber.requests[0] + assert 'x-amzn-query-mode' in request.headers + assert request.headers['x-amzn-query-mode'] == b'true' diff --git a/tests/unit/test_handlers.py b/tests/unit/test_handlers.py index 924abed8af..b26b4b92b2 100644 --- a/tests/unit/test_handlers.py +++ b/tests/unit/test_handlers.py @@ -1944,3 +1944,20 @@ def test_document_response_params_without_expires(document_expires_mocks): mocks['section'].get_section.assert_not_called() mocks['param_section'].add_new_section.assert_not_called() mocks['doc_section'].write.assert_not_called() + + +def test_add_query_compatibility_header(): + service_model = ServiceModel({'metadata': {'awsQueryCompatible': {}}}) + operation_model = OperationModel(mock.Mock(), service_model) + request_dict = {'headers': {}} + handlers.add_query_compatibility_header(operation_model, request_dict) + assert 'x-amzn-query-mode' in request_dict['headers'] + assert request_dict['headers']['x-amzn-query-mode'] == 'true' + + +def test_does_not_add_query_compatibility_header(): + service_model = ServiceModel({'metadata': {}}) + operation_model = OperationModel(mock.Mock(), service_model) + request_dict = {'headers': {}} + handlers.add_query_compatibility_header(operation_model, request_dict) + assert 'x-amzn-query-mode' not in request_dict['headers'] From 179e8b5361cd83d4c4acdf0c1bc1708b4a6966e9 Mon Sep 17 00:00:00 2001 From: Ujl <19787410+ubaskota@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:24:46 -0500 Subject: [PATCH 5/7] Fixes the issue in EndpointExceptionError by changing the format of the error message (#3296) --- botocore/endpoint_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botocore/endpoint_provider.py b/botocore/endpoint_provider.py index 9439086c53..38b0a5ffe6 100644 --- a/botocore/endpoint_provider.py +++ b/botocore/endpoint_provider.py @@ -638,7 +638,7 @@ def process_input(self, value): return self.default if self.required: raise EndpointResolutionError( - f"Cannot find value for required parameter {self.name}" + msg=f"Cannot find value for required parameter {self.name}" ) # in all other cases, the parameter will keep the value None else: From d44bb5740c674d68f9e2553e4be906acfa27bc4e Mon Sep 17 00:00:00 2001 From: jonathan343 <43360731+jonathan343@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:10:52 -0700 Subject: [PATCH 6/7] Add Flexible Checksum v2 Config Options (#3271) Add ``request_checksum_calculation`` and ``response_checksum_validation`` config options. --- botocore/args.py | 52 +++++++++++++++++++++++++++++++ botocore/config.py | 33 ++++++++++++++++++++ botocore/configprovider.py | 14 ++++++++- botocore/exceptions.py | 9 ++++++ tests/unit/test_args.py | 64 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 171 insertions(+), 1 deletion(-) diff --git a/botocore/args.py b/botocore/args.py index aeb9ff4198..688996bced 100644 --- a/botocore/args.py +++ b/botocore/args.py @@ -61,6 +61,15 @@ # values result in a warning-level log message. USERAGENT_APPID_MAXLEN = 50 +VALID_REQUEST_CHECKSUM_CALCULATION_CONFIG = ( + "when_supported", + "when_required", +) +VALID_RESPONSE_CHECKSUM_VALIDATION_CONFIG = ( + "when_supported", + "when_required", +) + class ClientArgsCreator: def __init__( @@ -271,12 +280,19 @@ def compute_client_args( sigv4a_signing_region_set=( client_config.sigv4a_signing_region_set ), + request_checksum_calculation=( + client_config.request_checksum_calculation + ), + response_checksum_validation=( + client_config.response_checksum_validation + ), ) self._compute_retry_config(config_kwargs) self._compute_connect_timeout(config_kwargs) self._compute_user_agent_appid_config(config_kwargs) self._compute_request_compression_config(config_kwargs) self._compute_sigv4a_signing_region_set_config(config_kwargs) + self._compute_checksum_config(config_kwargs) s3_config = self.compute_s3_config(client_config) is_s3_service = self._is_s3_service(service_name) @@ -782,3 +798,39 @@ def _compute_sigv4a_signing_region_set_config(self, config_kwargs): 'sigv4a_signing_region_set' ) config_kwargs['sigv4a_signing_region_set'] = sigv4a_signing_region_set + + def _compute_checksum_config(self, config_kwargs): + self._handle_checksum_config( + config_kwargs, + config_key="request_checksum_calculation", + default_value="when_supported", + valid_options=VALID_REQUEST_CHECKSUM_CALCULATION_CONFIG, + ) + self._handle_checksum_config( + config_kwargs, + config_key="response_checksum_validation", + default_value="when_supported", + valid_options=VALID_RESPONSE_CHECKSUM_VALIDATION_CONFIG, + ) + + def _handle_checksum_config( + self, + config_kwargs, + config_key, + default_value, + valid_options, + ): + value = config_kwargs.get(config_key) + if value is None: + value = ( + self._config_store.get_config_variable(config_key) + or default_value + ) + value = value.lower() + if value not in valid_options: + raise botocore.exceptions.InvalidChecksumConfigError( + config_key=config_key, + config_value=value, + valid_options=valid_options, + ) + config_kwargs[config_key] = value diff --git a/botocore/config.py b/botocore/config.py index eee55bb06d..f99a5a6e2d 100644 --- a/botocore/config.py +++ b/botocore/config.py @@ -235,6 +235,37 @@ class Config: specified service will be ignored. Defaults to None. + + :type request_checksum_calculation: str + :param request_checksum_calculation: Determines when a checksum will be + calculated for request payloads. Valid values are: + + * ``when_supported`` -- When set, a checksum will be calculated for + all request payloads of operations modeled with the ``httpChecksum`` + trait where ``requestChecksumRequired`` is ``true`` and/or a + ``requestAlgorithmMember`` is modeled. + + * ``when_required`` -- When set, a checksum will only be calculated + for request payloads of operations modeled with the ``httpChecksum`` + trait where ``requestChecksumRequired`` is ``true`` or where a + ``requestAlgorithmMember`` is modeled and supplied. + + Defaults to None. + + :type response_checksum_validation: str + :param response_checksum_validation: Determines when checksum validation + will be performed on response payloads. Valid values are: + + * ``when_supported`` -- When set, checksum validation is performed on + all response payloads of operations modeled with the ``httpChecksum`` + trait where ``responseAlgorithms`` is modeled, except when no modeled + checksum algorithms are supported. + + * ``when_required`` -- When set, checksum validation is not performed + on response payloads of operations unless the checksum algorithm is + supported and the ``requestValidationModeMember`` member is set to ``ENABLED``. + + Defaults to None. """ OPTION_DEFAULTS = OrderedDict( @@ -264,6 +295,8 @@ class Config: ('disable_request_compression', None), ('client_context_params', None), ('sigv4a_signing_region_set', None), + ('request_checksum_calculation', None), + ('response_checksum_validation', None), ] ) diff --git a/botocore/configprovider.py b/botocore/configprovider.py index 3341802e53..475b4af6db 100644 --- a/botocore/configprovider.py +++ b/botocore/configprovider.py @@ -168,6 +168,18 @@ None, None, ), + 'request_checksum_calculation': ( + 'request_checksum_calculation', + 'AWS_REQUEST_CHECKSUM_CALCULATION', + "when_supported", + None, + ), + 'response_checksum_validation': ( + 'response_checksum_validation', + 'AWS_RESPONSE_CHECKSUM_VALIDATION', + "when_supported", + None, + ), } # Evaluate AWS_STS_REGIONAL_ENDPOINTS settings @@ -468,7 +480,7 @@ def __copy__(self): def get_config_variable(self, logical_name): """ - Retrieve the value associeated with the specified logical_name + Retrieve the value associated with the specified logical_name from the corresponding provider. If no value is found None will be returned. diff --git a/botocore/exceptions.py b/botocore/exceptions.py index 9fa0dfaa84..626e6cf7a0 100644 --- a/botocore/exceptions.py +++ b/botocore/exceptions.py @@ -814,3 +814,12 @@ class EndpointResolutionError(EndpointProviderError): class UnknownEndpointResolutionBuiltInName(EndpointProviderError): fmt = 'Unknown builtin variable name: {name}' + + +class InvalidChecksumConfigError(BotoCoreError): + """Error when invalid value supplied for checksum config""" + + fmt = ( + 'Unsupported configuration value for {config_key}. ' + 'Expected one of {valid_options} but got {config_value}.' + ) diff --git a/tests/unit/test_args.py b/tests/unit/test_args.py index 9338b05371..af6695c083 100644 --- a/tests/unit/test_args.py +++ b/tests/unit/test_args.py @@ -614,6 +614,70 @@ def test_bad_value_disable_request_compression(self): config = client_args['client_config'] self.assertFalse(config.disable_request_compression) + def test_checksum_default_client_config(self): + input_config = Config() + client_args = self.call_get_client_args(client_config=input_config) + config = client_args["client_config"] + self.assertEqual(config.request_checksum_calculation, "when_supported") + self.assertEqual(config.response_checksum_validation, "when_supported") + + def test_checksum_client_config(self): + input_config = Config( + request_checksum_calculation="when_required", + response_checksum_validation="when_required", + ) + client_args = self.call_get_client_args(client_config=input_config) + config = client_args['client_config'] + self.assertEqual(config.request_checksum_calculation, "when_required") + self.assertEqual(config.response_checksum_validation, "when_required") + + def test_checksum_config_store(self): + self.config_store.set_config_variable( + "request_checksum_calculation", "when_required" + ) + self.config_store.set_config_variable( + "response_checksum_validation", "when_required" + ) + config = self.call_get_client_args()['client_config'] + self.assertEqual(config.request_checksum_calculation, "when_required") + self.assertEqual(config.response_checksum_validation, "when_required") + + def test_checksum_client_config_overrides_config_store(self): + self.config_store.set_config_variable( + "request_checksum_calculation", "when_supported" + ) + self.config_store.set_config_variable( + "response_checksum_validation", "when_supported" + ) + input_config = Config( + request_checksum_calculation="when_required", + response_checksum_validation="when_required", + ) + client_args = self.call_get_client_args(client_config=input_config) + config = client_args['client_config'] + self.assertEqual(config.request_checksum_calculation, "when_required") + self.assertEqual(config.response_checksum_validation, "when_required") + + def test_request_checksum_calculation_invalid_client_config(self): + with self.assertRaises(exceptions.InvalidChecksumConfigError): + config = Config(request_checksum_calculation="invalid_config") + self.call_get_client_args(client_config=config) + self.config_store.set_config_variable( + 'request_checksum_calculation', "invalid_config" + ) + with self.assertRaises(exceptions.InvalidChecksumConfigError): + self.call_get_client_args() + + def test_response_checksum_validation_invalid_client_config(self): + with self.assertRaises(exceptions.InvalidChecksumConfigError): + config = Config(response_checksum_validation="invalid_config") + self.call_get_client_args(client_config=config) + self.config_store.set_config_variable( + 'response_checksum_validation', "invalid_config" + ) + with self.assertRaises(exceptions.InvalidChecksumConfigError): + self.call_get_client_args() + class TestEndpointResolverBuiltins(unittest.TestCase): def setUp(self): From dc710ecc562e28d8fa4f108907951b56cc2592cd Mon Sep 17 00:00:00 2001 From: jonathan343 <43360731+jonathan343@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:11:43 -0700 Subject: [PATCH 7/7] Add support for CRC64NVME when the CRT is available. (#3273) * Add support for CRC64NVME when the CRT is available. * Update crc64nvme priority --- botocore/httpchecksum.py | 18 ++++++++++++++++-- tests/unit/test_httpchecksum.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/botocore/httpchecksum.py b/botocore/httpchecksum.py index a97eb430d4..8056b2bb18 100644 --- a/botocore/httpchecksum.py +++ b/botocore/httpchecksum.py @@ -109,6 +109,19 @@ def digest(self): return self._int_crc32c.to_bytes(4, byteorder="big") +class CrtCrc64NvmeChecksum(BaseChecksum): + # Note: This class is only used if the CRT is available + def __init__(self): + self._int_crc64nvme = 0 + + def update(self, chunk): + new_checksum = crt_checksums.crc64nvme(chunk, self._int_crc64nvme) + self._int_crc64nvme = new_checksum & 0xFFFFFFFFFFFFFFFF + + def digest(self): + return self._int_crc64nvme.to_bytes(8, byteorder="big") + + class Sha1Checksum(BaseChecksum): def __init__(self): self._checksum = sha1() @@ -465,12 +478,13 @@ def _handle_bytes_response(http_response, response, algorithm): "sha1": Sha1Checksum, "sha256": Sha256Checksum, } -_CRT_CHECKSUM_ALGORITHMS = ["crc32", "crc32c"] +_CRT_CHECKSUM_ALGORITHMS = ["crc32", "crc32c", "crc64nvme"] if HAS_CRT: # Use CRT checksum implementations if available _CRT_CHECKSUM_CLS = { "crc32": CrtCrc32Checksum, "crc32c": CrtCrc32cChecksum, + "crc64nvme": CrtCrc64NvmeChecksum, } _CHECKSUM_CLS.update(_CRT_CHECKSUM_CLS) # Validate this list isn't out of sync with _CRT_CHECKSUM_CLS keys @@ -478,4 +492,4 @@ def _handle_bytes_response(http_response, response, algorithm): name in _CRT_CHECKSUM_ALGORITHMS for name in _CRT_CHECKSUM_CLS.keys() ) _SUPPORTED_CHECKSUM_ALGORITHMS = list(_CHECKSUM_CLS.keys()) -_ALGORITHMS_PRIORITY_LIST = ['crc32c', 'crc32', 'sha1', 'sha256'] +_ALGORITHMS_PRIORITY_LIST = ['crc64nvme', 'crc32c', 'crc32', 'sha1', 'sha256'] diff --git a/tests/unit/test_httpchecksum.py b/tests/unit/test_httpchecksum.py index bc8265a9b3..1e46fc3268 100644 --- a/tests/unit/test_httpchecksum.py +++ b/tests/unit/test_httpchecksum.py @@ -26,6 +26,7 @@ Crc32Checksum, CrtCrc32cChecksum, CrtCrc32Checksum, + CrtCrc64NvmeChecksum, Sha1Checksum, Sha256Checksum, StreamingChecksumBody, @@ -193,6 +194,24 @@ def test_request_checksum_algorithm_model_no_crt_crc32c_unsupported(self): str(context.exception), ) + @unittest.skipIf(HAS_CRT, "Error only expected when CRT is not available") + def test_request_checksum_algorithm_model_no_crt_crc64nvme_unsupported( + self, + ): + request = self._build_request(b"") + operation_model = self._make_operation_model( + http_checksum={"requestAlgorithmMember": "Algorithm"}, + ) + params = {"Algorithm": "crc64nvme"} + with self.assertRaises(MissingDependencyException) as context: + resolve_request_checksum_algorithm( + request, operation_model, params + ) + self.assertIn( + "Using CRC64NVME requires an additional dependency", + str(context.exception), + ) + def test_request_checksum_algorithm_model_legacy_md5(self): request = self._build_request(b"") operation_model = self._make_operation_model(required=True) @@ -691,6 +710,10 @@ def test_crt_crc32(self): def test_crt_crc32c(self): self.assert_base64_checksum(CrtCrc32cChecksum, "yZRlqg==") + @requires_crt() + def test_crt_crc64nvme(self): + self.assert_base64_checksum(CrtCrc64NvmeChecksum, "jSnVw/bqjr4=") + class TestCrtChecksumOverrides(unittest.TestCase): @requires_crt() @@ -703,6 +726,11 @@ def test_crt_crc32c_available(self): actual_cls = _CHECKSUM_CLS.get("crc32c") self.assertEqual(actual_cls, CrtCrc32cChecksum) + @requires_crt() + def test_crt_crc64nvme_available(self): + actual_cls = _CHECKSUM_CLS.get("crc64nvme") + self.assertEqual(actual_cls, CrtCrc64NvmeChecksum) + class TestStreamingChecksumBody(unittest.TestCase): def setUp(self):