diff --git a/testbed/boto__botocore/.codecov.yml b/testbed/boto__botocore/.codecov.yml new file mode 100644 index 0000000000000000000000000000000000000000..8634e4940e1da8a5190141a992007745e3c41640 --- /dev/null +++ b/testbed/boto__botocore/.codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "botocore/vendored" diff --git a/testbed/boto__botocore/.coveragerc b/testbed/boto__botocore/.coveragerc new file mode 100644 index 0000000000000000000000000000000000000000..a713c118d813c924106114fde49faaadfd0e956e --- /dev/null +++ b/testbed/boto__botocore/.coveragerc @@ -0,0 +1,10 @@ +[run] +branch = True +omit = + botocore/vendored/* + +[report] +exclude_lines = + raise NotImplementedError.* +include = + botocore/* diff --git a/testbed/boto__botocore/.git-blame-ignore-revs b/testbed/boto__botocore/.git-blame-ignore-revs new file mode 100644 index 0000000000000000000000000000000000000000..d547a9ec5c2179997cd9c7ded22460dcde611003 --- /dev/null +++ b/testbed/boto__botocore/.git-blame-ignore-revs @@ -0,0 +1,17 @@ +# You can configure git to automatically use this file with the following config: +# git config --global blame.ignoreRevsFile .git-blame-ignore-revs + +# Reformat using isort +e34b6a36ae0c1571bcb5fd7034e817d3b397e283 + +# Add Black and Pyupgrade to botocore directory +321ed9bb9345f05528e61a9edccb811012f7dc2a + +# Cleanup pyupgrade misses +a2c2fe68a2f9ae259dd1d72b172d41c7c81808cd + +# Run Black and PyUpgrade over tests directory +10747e5e2f2f97a9493b91b5c886bda71678e3be + +# Update to black 23 +459a6a370ea1a4ab52b792f3d6e8311bc774b583 diff --git a/testbed/boto__botocore/.gitignore b/testbed/boto__botocore/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0f2258c9ecdb1a069c1cb36bedd15bc16798f71a --- /dev/null +++ b/testbed/boto__botocore/.gitignore @@ -0,0 +1,42 @@ +.DS_Store +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Emacs backup files +*~ + +# IDEA / PyCharm IDE +.idea/ + +# Virtualenvs +env +env2 +env3 + +docs/source/reference/services +tests/coverage.xml +tests/nosetests.xml diff --git a/testbed/boto__botocore/.pre-commit-config.yaml b/testbed/boto__botocore/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e8947045cad42fb6092762ee1ebe64a318a4bd03 --- /dev/null +++ b/testbed/boto__botocore/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +exclude: "\ + ^(\ + .github|\ + .changes|\ + botocore/data|\ + botocore/vendored|\ + botocore/compat.py|\ + docs/|\ + tests/functional/endpoint-rules|\ + tests/unit/auth/aws4_testsuite|\ + tests/unit/data/endpoints/|\ + tests/unit/response_parsing/xml|\ + CHANGELOG.rst\ + )" +repos: + - repo: 'https://github.com/pre-commit/pre-commit-hooks' + rev: v4.5.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: 'https://github.com/PyCQA/isort' + rev: 5.12.0 + hooks: + - id: isort + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.8 + hooks: + - id: ruff + args: [ --fix ] + - id: ruff-format diff --git a/testbed/boto__botocore/CHANGELOG.rst b/testbed/boto__botocore/CHANGELOG.rst new file mode 100644 index 0000000000000000000000000000000000000000..d7e6ff25e5a59cb8fcb2cf4e9d36ce8f135504b9 --- /dev/null +++ b/testbed/boto__botocore/CHANGELOG.rst @@ -0,0 +1,17696 @@ +========= +CHANGELOG +========= + +1.35.31 +======= + +* api-change:``bedrock-agent``: This release adds support to stop an ongoing ingestion job using the StopIngestionJob API in Agents for Amazon Bedrock. +* api-change:``codeartifact``: Add support for the dual stack endpoints. +* api-change:``rds``: This release provides additional support for enabling Aurora Limitless Database DB clusters. + + +1.35.30 +======= + +* api-change:``bedrock``: Add support for custom models via provisioned throughput for Bedrock Model Evaluation +* api-change:``clouddirectory``: Add examples for API operations in model. +* api-change:``connect``: Amazon Connect introduces StartOutboundChatContact API allowing customers to initiate outbound chat contacts +* api-change:``pricing``: Add examples for API operations in model. +* api-change:``resource-groups``: This update includes new APIs to support application groups and to allow users to manage resource tag-sync tasks in applications. +* api-change:``supplychain``: Release DataLakeDataset, DataIntegrationFlow and ResourceTagging APIs for AWS Supply Chain +* api-change:``timestream-influxdb``: Timestream for InfluxDB now supports port configuration and additional customer-modifiable InfluxDB v2 parameters. This release adds Port to the CreateDbInstance and UpdateDbInstance API, and additional InfluxDB v2 parameters to the CreateDbParameterGroup API. +* api-change:``verifiedpermissions``: Add examples for API operations in model. + + +1.35.29 +======= + +* api-change:``customer-profiles``: Introduces optional RoleArn parameter for PutIntegration request and includes RoleArn in the response of PutIntegration, GetIntegration and ListIntegrations +* api-change:``quicksight``: Adding personalization in QuickSight data stories. Admins can enable or disable personalization through QuickSight settings. +* api-change:``securityhub``: Documentation updates for AWS Security Hub +* api-change:``sesv2``: This release adds support for engagement tracking over Https using custom domains. + + +1.35.28 +======= + +* api-change:``chatbot``: Return State and StateReason fields for Chatbot Channel Configurations. +* api-change:``lambda``: Reverting Lambda resource-based policy and block public access APIs. +* api-change:``organizations``: Add support for policy operations on the CHATBOT_POLICY policy type. +* api-change:``pcs``: AWS PCS API documentation - Edited the description of the iamInstanceProfileArn parameter of the CreateComputeNodeGroup and UpdateComputeNodeGroup actions; edited the description of the SlurmCustomSetting data type to list the supported parameters for clusters and compute node groups. +* api-change:``rds-data``: Documentation update for RDS Data API to reflect support for Aurora MySQL Serverless v2 and Provisioned DB clusters. +* api-change:``sagemaker``: Adding `TagPropagation` attribute to Sagemaker API + + +1.35.27 +======= + +* api-change:``cloudtrail``: Doc-only update for CloudTrail network activity events release (in preview) +* api-change:``ec2``: Updates to documentation for the transit gateway security group referencing feature. +* api-change:``fsx``: Doc-only update to address Lustre S3 hard-coded names. +* api-change:``worklink``: The worklink client has been removed following the deprecation of the service. + + +1.35.26 +======= + +* api-change:``bedrock``: Add support for Cross Region Inference in Bedrock Model Evaluations. +* api-change:``budgets``: Releasing minor partitional endpoint updates +* api-change:``kinesis``: This release includes support to add tags when creating a stream +* api-change:``pinpoint-sms-voice-v2``: AWS End User Messaging SMS-Voice V2 has added support for resource policies. Use the three new APIs to create, view, edit, and delete resource policies. +* api-change:``sagemaker``: Adding `HiddenInstanceTypes` and `HiddenSageMakerImageVersionAliases` attribute to SageMaker API + + +1.35.25 +======= + +* api-change:``apigateway``: Documentation updates for Amazon API Gateway +* api-change:``athena``: List/Get/Update/Delete/CreateDataCatalog now integrate with AWS Glue connections. Users can create a Glue connection through Athena or use a Glue connection to define their Athena federated parameters. +* api-change:``bedrock-agent``: Amazon Bedrock Prompt Flows and Prompt Management now supports using inference profiles to increase throughput and improve resilience. +* api-change:``ec2``: Amazon EC2 G6e instances powered by NVIDIA L40S Tensor Core GPUs are the most cost-efficient GPU instances for deploying generative AI models and the highest performance GPU instances for spatial computing workloads. +* api-change:``emr-serverless``: This release adds support for job concurrency and queuing configuration at Application level. +* api-change:``glue``: Added AthenaProperties parameter to Glue Connections, allowing Athena to store service specific properties on Glue Connections. +* api-change:``rds``: Support ComputeRedundancy parameter in ModifyDBShardGroup API. Add DBShardGroupArn in DBShardGroup API response. Remove InvalidMaxAcuFault from CreateDBShardGroup and ModifyDBShardGroup API. Both API will throw InvalidParameterValueException for invalid ACU configuration. +* api-change:``resource-explorer-2``: AWS Resource Explorer released ListResources feature which allows customers to list all indexed AWS resources within a view. + + +1.35.24 +======= + +* api-change:``dynamodb``: Generate account endpoint for DynamoDB requests when the account ID is available +* api-change:``neptune``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``sagemaker``: Amazon SageMaker now supports using manifest files to specify the location of uncompressed model artifacts within Model Packages +* api-change:``sagemaker-metrics``: This release introduces support for the SageMaker Metrics BatchGetMetrics API. +* api-change:``workspaces``: Releasing new ErrorCodes for SysPrep failures during ImageImport and CreateImage process + + +1.35.23 +======= + +* api-change:``codeconnections``: This release adds the PullRequestComment field to CreateSyncConfiguration API input, UpdateSyncConfiguration API input, GetSyncConfiguration API output and ListSyncConfiguration API output +* api-change:``glue``: This change is for releasing TestConnection api SDK model +* api-change:``lambda``: Tagging support for Lambda event source mapping, and code signing configuration resources. +* api-change:``mediaconvert``: This release provides support for additional DRM configurations per SPEKE Version 2.0. +* api-change:``medialive``: Adds Bandwidth Reduction Filtering for HD AVC and HEVC encodes, multiplex container settings. +* api-change:``quicksight``: QuickSight: 1. Add new API - ListFoldersForResource. 2. Commit mode adds visibility configuration of Apply button on multi-select controls for authors. +* api-change:``sagemaker``: Introduced support for G6e instance types on SageMaker Studio for JupyterLab and CodeEditor applications. +* api-change:``workspaces-web``: WorkSpaces Secure Browser now enables Administrators to view and manage end-user browsing sessions via Session Management APIs. + + +1.35.22 +======= + +* api-change:``ce``: This release extends the GetReservationPurchaseRecommendation API to support recommendations for Amazon DynamoDB reservations. +* api-change:``ds``: Added new APIs for enabling, disabling, and describing access to the AWS Directory Service Data API +* api-change:``ds-data``: Added new AWS Directory Service Data API, enabling you to manage data stored in AWS Directory Service directories. This includes APIs for creating, reading, updating, and deleting directory users, groups, and group memberships. +* api-change:``guardduty``: Add `launchType` and `sourceIPs` fields to GuardDuty findings. +* api-change:``mailmanager``: Introduce a new RuleSet condition evaluation, where customers can set up a StringExpression with a MimeHeader condition. This condition will perform the necessary validation based on the X-header provided by customers. +* api-change:``rds``: Updates Amazon RDS documentation with information upgrading snapshots with unsupported engine versions for RDS for MySQL and RDS for PostgreSQL. +* api-change:``s3``: Added SSE-KMS support for directory buckets. + + +1.35.21 +======= + +* api-change:``codebuild``: GitLab Enhancements - Add support for Self-Hosted GitLab runners in CodeBuild. Add group webhooks +* api-change:``ecr``: The `DescribeImageScanning` API now includes `fixAvailable`, `exploitAvailable`, and `fixedInVersion` fields to provide more detailed information about the availability of fixes, exploits, and fixed versions for identified image vulnerabilities. +* api-change:``ecs``: This is a documentation only release to address various tickets. +* api-change:``lambda``: Support for JSON resource-based policies and block public access +* api-change:``rds``: Updates Amazon RDS documentation with configuration information about the BYOL model for RDS for Db2. +* api-change:``ssm``: Support for additional levels of cross-account, cross-Region organizational units in Automation. Various documentation updates. + + +1.35.20 +======= + +* api-change:``bedrock``: This feature adds cross account s3 bucket and VPC support to ModelInvocation jobs. To use a cross account bucket, pass in the accountId of the bucket to s3BucketOwner in the ModelInvocationJobInputDataConfig or ModelInvocationJobOutputDataConfig. +* api-change:``iot``: This release adds additional enhancements to AWS IoT Device Management Software Package Catalog and Jobs. It also adds SBOM support in Software Package Version. +* api-change:``medialive``: Removing the ON_PREMISE enum from the input settings field. +* api-change:``organizations``: Doc only update for AWS Organizations that fixes several customer-reported issues +* api-change:``pca-connector-scep``: This is a general availability (GA) release of Connector for SCEP, a feature of AWS Private CA. Connector for SCEP links your SCEP-enabled and mobile device management systems to AWS Private CA for digital signature installation and certificate management. +* api-change:``rds``: Launching Global Cluster tagging. + + +1.35.19 +======= + +* api-change:``amplify``: Doc only update to Amplify to explain platform setting for Next.js 14 SSG only applications +* api-change:``ivs``: Updates to all tags descriptions. +* api-change:``ivschat``: Updates to all tags descriptions. + + +1.35.18 +======= + +* api-change:``cognito-idp``: Added email MFA option to user pools with advanced security features. +* api-change:``elbv2``: Correct incorrectly mapped error in ELBv2 waiters +* api-change:``emr``: Update APIs to allow modification of ODCR options, allocation strategy, and InstanceTypeConfigs on running InstanceFleet clusters. +* api-change:``glue``: AWS Glue is introducing two new optimizers for Apache Iceberg tables: snapshot retention and orphan file deletion. Customers can enable these optimizers and customize their configurations to perform daily maintenance tasks on their Iceberg tables based on their specific requirements. +* api-change:``mediaconvert``: This release includes support for dynamic video overlay workflows, including picture-in-picture and squeezeback +* api-change:``rds``: This release adds support for the os-upgrade pending maintenance action for Amazon Aurora DB clusters. +* api-change:``storagegateway``: The S3 File Gateway now supports DSSE-KMS encryption. A new parameter EncryptionType is added to these APIs: CreateSmbFileShare, CreateNfsFileShare, UpdateSmbFileShare, UpdateNfsFileShare, DescribeSmbFileShares, DescribeNfsFileShares. Also, in favor of EncryptionType, KmsEncrypted is deprecated. +* api-change:``synthetics``: This release introduces two features. The first is tag replication, which allows for the propagation of canary tags onto Synthetics related resources, such as Lambda functions. The second is a limit increase in canary name length, which has now been increased from 21 to 255 characters. + + +1.35.17 +======= + +* api-change:``bedrock-agent``: Amazon Bedrock Knowledge Bases now supports using inference profiles to increase throughput and improve resilience. +* api-change:``bedrock-agent-runtime``: Amazon Bedrock Knowledge Bases now supports using inference profiles to increase throughput and improve resilience. +* api-change:``ecr``: Added KMS_DSSE to EncryptionType +* api-change:``guardduty``: Add support for new statistic types in GetFindingsStatistics. +* api-change:``lexv2-models``: Support new Polly voice engines in VoiceSettings: long-form and generative +* api-change:``medialive``: Adds AV1 Codec support, SRT ouputs, and MediaLive Anywhere support. + + +1.35.16 +======= + +* api-change:``chime-sdk-voice``: Documentation-only update that clarifies the ValidateE911Address action of the Amazon Chime SDK Voice APIs. +* api-change:``cognito-identity``: This release adds sensitive trait to some required shapes. +* api-change:``pipes``: This release adds support for customer managed KMS keys in Amazon EventBridge Pipe +* api-change:``securityhub``: Documentation update for Security Hub +* enhancement:AWSCRT: Update awscrt version to 0.21.5 +* enhancement:``s3``: Adds logic to gracefully handle invalid timestamps returned in the Expires header. + + +1.35.15 +======= + +* api-change:``dynamodb``: Doc-only update for DynamoDB. Added information about async behavior for TagResource and UntagResource APIs and updated the description of ResourceInUseException. +* api-change:``elbv2``: Add paginators for the ELBv2 DescribeListenerCertificates and DescribeRules APIs. Fix broken waiter for the ELBv2 DescribeLoadBalancers API. +* api-change:``ivs-realtime``: IVS Real-Time now offers customers the ability to broadcast to Stages using RTMP(S). +* api-change:``kafka``: Amazon MSK Replicator can now replicate data to identically named topics between MSK clusters within the same AWS Region or across different AWS Regions. +* api-change:``sagemaker``: Amazon Sagemaker supports orchestrating SageMaker HyperPod clusters with Amazon EKS +* api-change:``sagemaker-runtime``: AWS SageMaker Runtime feature: Add sticky routing to support stateful inference models. + + +1.35.14 +======= + +* api-change:``qapps``: Adds UpdateLibraryItemMetadata api to change status of app for admin verification feature and returns isVerified field in any api returning the app or library item. + + +1.35.13 +======= + +* api-change:``application-signals``: Amazon CloudWatch Application Signals now supports creating Service Level Objectives using a new calculation type. Users can now create SLOs which are configured with request-based SLIs to help meet their specific business requirements. +* api-change:``codepipeline``: Updates to add recent notes to APIs and to replace example S3 bucket names globally. +* api-change:``connect``: Amazon Connect Custom Vocabulary now supports Catalan (Spain), Danish (Denmark), Dutch (Netherlands), Finnish (Finland), Indonesian (Indonesia), Malay (Malaysia), Norwegian Bokmal (Norway), Polish (Poland), Swedish (Sweden), and Tagalog/Filipino (Philippines). +* api-change:``gamelift``: Amazon GameLift provides additional events for tracking the fleet creation process. +* api-change:``kinesisanalyticsv2``: Support for Flink 1.20 in Managed Service for Apache Flink +* api-change:``sagemaker``: Amazon SageMaker now supports idle shutdown of JupyterLab and CodeEditor applications on SageMaker Studio. + + +1.35.12 +======= + +* api-change:``appsync``: Adds new logging levels (INFO and DEBUG) for additional log output control +* api-change:``bedrock-agent``: Add support for user metadata inside PromptVariant. +* api-change:``finspace``: Updates Finspace documentation for smaller instances. +* api-change:``fis``: This release adds safety levers, a new mechanism to stop all running experiments and prevent new experiments from starting. +* api-change:``logs``: Update to support new APIs for delivery of logs from AWS services. +* api-change:``s3control``: Amazon Simple Storage Service /S3 Access Grants / Features : This release launches new Access Grants API - ListCallerAccessGrants. + + +1.35.11 +======= + +* api-change:``connect``: Release ReplicaConfiguration as part of DescribeInstance +* api-change:``datazone``: Add support to let data publisher specify a subset of the data asset that a subscriber will have access to based on the asset filters provided, when accepting a subscription request. +* api-change:``elbv2``: This release adds support for configuring TCP idle timeout on NLB and GWLB listeners. +* api-change:``mediaconnect``: AWS Elemental MediaConnect introduces thumbnails for Flow source monitoring. Thumbnails provide still image previews of the live content feeding your MediaConnect Flow allowing you to easily verify that your source is operating as expected. +* api-change:``medialive``: Added MinQP as a Rate Control option for H264 and H265 encodes. +* api-change:``sagemaker``: Amazon SageMaker now supports automatic mounting of a user's home folder in the Amazon Elastic File System (EFS) associated with the SageMaker Studio domain to their Studio Spaces to enable users to share data between their own private spaces. +* api-change:``timestream-influxdb``: Timestream for InfluxDB now supports compute scaling and deployment type conversion. This release adds the DbInstanceType and DeploymentType parameters to the UpdateDbInstance API. + + +1.35.10 +======= + +* api-change:``backup``: The latest update introduces two new attributes, VaultType and VaultState, to the DescribeBackupVault and ListBackupVaults APIs. The VaultState attribute reflects the current status of the vault, while the VaultType attribute indicates the specific category of the vault. +* api-change:``datazone``: Amazon DataZone now adds new governance capabilities of Domain Units for organization within your Data Domains, and Authorization Policies for tighter controls. +* api-change:``logs``: This release introduces a new optional parameter: Entity, in PutLogEvents request +* api-change:``redshift-data``: The release include the new Redshift DataAPI feature for session use, customer execute query with --session-keep-alive-seconds parameter and can submit follow-up queries to same sessions with returned`session-id` + + +1.35.9 +====== + +* api-change:``bedrock-agent-runtime``: Lifting the maximum length on Bedrock KnowledgeBase RetrievalFilter array +* api-change:``bedrock-runtime``: Add support for imported-model in invokeModel and InvokeModelWithResponseStream. +* api-change:``personalize``: This releases ability to update automatic training scheduler for customer solutions +* api-change:``quicksight``: Increased Character Limit for Dataset Calculation Field expressions +* api-change:``stepfunctions``: This release adds support for static analysis to ValidateStateMachineDefinition API, which can now return optional WARNING diagnostics for semantic errors on the definition of an Amazon States Language (ASL) state machine. +* api-change:``wafv2``: The minimum request rate for a rate-based rule is now 10. Before this, it was 100. + + +1.35.8 +====== + +* api-change:``appconfig``: This release adds support for deletion protection, which is a safety guardrail to prevent the unintentional deletion of a recently used AWS AppConfig Configuration Profile or Environment. This also includes a change to increase the maximum length of the Name parameter in UpdateConfigurationProfile. +* api-change:``datazone``: Update regex to include dot character to be consistent with IAM role creation in the authorized principal field for create and update subscription target. +* api-change:``devicefarm``: This release removed support for Calabash, UI Automation, Built-in Explorer, remote access record, remote access replay, and web performance profile framework in ScheduleRun API. +* api-change:``ec2``: Amazon VPC IP Address Manager (IPAM) now allows customers to provision IPv4 CIDR blocks and allocate Elastic IP Addresses directly from IPAM pools with public IPv4 space +* api-change:``internetmonitor``: Adds new querying types to show overall traffic suggestion information for monitors +* api-change:``pcs``: Introducing AWS Parallel Computing Service (AWS PCS), a new service makes it easy to setup and manage high performance computing (HPC) clusters, and build scientific and engineering models at virtually any scale on AWS. +* api-change:``workspaces``: Documentation-only update that clarifies the StartWorkspaces and StopWorkspaces actions, and a few other minor edits. + + +1.35.7 +====== + +* api-change:``bedrock``: Amazon Bedrock SDK updates for Inference Profile. +* api-change:``bedrock-runtime``: Amazon Bedrock SDK updates for Inference Profile. +* api-change:``chatbot``: Update documentation to be consistent with the API docs +* api-change:``omics``: Adds data provenance to import jobs from read sets and references +* api-change:``polly``: Amazon Polly adds 2 new voices: Jitka (cs-CZ) and Sabrina (de-CH). + + +1.35.6 +====== + +* api-change:``iotsitewise``: AWS IoT SiteWise now supports versioning for asset models. It enables users to retrieve active version of their asset model and perform asset model writes with optimistic lock. +* api-change:``workspaces``: This release adds support for creating and managing directories that use AWS IAM Identity Center as user identity source. Such directories can be used to create non-Active Directory domain joined WorkSpaces Personal.Updated RegisterWorkspaceDirectory and DescribeWorkspaceDirectories APIs. + + +1.35.5 +====== + +* api-change:``bedrock-agent``: Releasing the support for Action User Confirmation. +* api-change:``bedrock-agent-runtime``: Releasing the support for Action User Confirmation. +* api-change:``codebuild``: Added support for the MAC_ARM environment type for CodeBuild fleets. +* api-change:``organizations``: Releasing minor partitional endpoint updates. +* api-change:``qbusiness``: Amazon QBusiness: Enable support for SAML and OIDC federation through AWS IAM Identity Provider integration. +* api-change:``supplychain``: Update API documentation to clarify the event SLA as well as the data model expectations + + +1.35.4 +====== + +* api-change:``autoscaling``: Amazon EC2 Auto Scaling now provides EBS health check to manage EC2 instance replacement +* api-change:``bedrock``: Amazon Bedrock Evaluation BatchDeleteEvaluationJob API allows customers to delete evaluation jobs under terminated evaluation job statuses - Stopped, Failed, or Completed. Customers can submit a batch of 25 evaluation jobs to be deleted at once. +* api-change:``emr-containers``: Correct endpoint for FIPS is configured for US Gov Regions. +* api-change:``inspector2``: Add enums for Agentless scan statuses and EC2 enablement error states +* api-change:``quicksight``: Explicit query for authors and dashboard viewing sharing for embedded users +* api-change:``route53``: Amazon Route 53 now supports the Asia Pacific (Malaysia) Region (ap-southeast-5) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. + + +1.35.3 +====== + +* api-change:``codestar``: The codestar client has been removed following the deprecation of the service on July 31, 2024. +* api-change:``ec2``: DescribeInstanceStatus now returns health information on EBS volumes attached to Nitro instances +* api-change:``entityresolution``: Increase the mapping attributes in Schema to 35. +* api-change:``glue``: Add optional field JobRunQueuingEnabled to CreateJob and UpdateJob APIs. +* api-change:``lambda``: Release FilterCriteria encryption for Lambda EventSourceMapping, enabling customers to encrypt their filter criteria using a customer-owned KMS key. +* api-change:``securityhub``: Security Hub documentation and definition updates +* api-change:``ses``: Enable email receiving customers to provide SES with access to their S3 buckets via an IAM role for "Deliver to S3 Action" + + +1.35.2 +====== + +* api-change:``ecs``: Documentation only release to address various tickets +* api-change:``opensearchserverless``: Added FailureCode and FailureMessage to BatchGetCollectionResponse for BatchGetVPCEResponse for non-Active Collection and VPCE. +* api-change:``s3``: Amazon Simple Storage Service / Features : Add support for conditional writes for PutObject and CompleteMultipartUpload APIs. + + +1.35.1 +====== + +* api-change:``bedrock``: Amazon Bedrock Batch Inference/ Model Invocation is a feature which allows customers to asynchronously run inference on a large set of records/files stored in S3. +* api-change:``codebuild``: AWS CodeBuild now supports creating fleets with macOS platform for running builds. +* api-change:``deadline``: This release adds additional search fields and provides sorting by multiple fields. +* api-change:``lambda``: Release Lambda FunctionRecursiveConfig, enabling customers to turn recursive loop detection on or off on individual functions. This release adds two new APIs, GetFunctionRecursionConfig and PutFunctionRecursionConfig. +* api-change:``ssm-sap``: Add new attributes to the outputs of GetApplication and GetDatabase APIs. + + +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 +======== + +* api-change:``docdb``: This release adds Global Cluster Failover capability which enables you to change your global cluster's primary AWS region, the region that serves writes, during a regional outage. Performing a failover action preserves your Global Cluster setup. +* api-change:``ecs``: This release introduces a new ContainerDefinition configuration to support the customer-managed keys for ECS container restart feature. +* api-change:``iam``: Make the LastUsedDate field in the GetAccessKeyLastUsed response optional. This may break customers who only call the API for access keys with a valid LastUsedDate. This fixes a deserialization issue for access keys without a LastUsedDate, because the field was marked as required but could be null. +* api-change:``s3``: Amazon Simple Storage Service / Features : Adds support for pagination in the S3 ListBuckets API. + + +1.34.161 +======== + +* api-change:``codebuild``: AWS CodeBuild now supports using Secrets Manager to store git credentials and using multiple source credentials in a single project. + + +1.34.160 +======== + +* api-change:``amplify``: Add a new field "cacheConfig" that enables users to configure the CDN cache settings for an App +* api-change:``appstream``: This release includes following new APIs: CreateThemeForStack, DescribeThemeForStack, UpdateThemeForStack, DeleteThemeForStack to support custom branding programmatically. +* api-change:``fis``: This release adds support for additional error information on experiment failure. It adds the error code, location, and account id on relevant failures to the GetExperiment and ListExperiment API responses. +* api-change:``glue``: Add AttributesToGet parameter support for Glue GetTables +* api-change:``neptune-graph``: Amazon Neptune Analytics provides a new option for customers to load data into a graph using the RDF (Resource Description Framework) NTRIPLES format. When loading NTRIPLES files, use the value `convertToIri` for the `blankNodeHandling` parameter. + + +1.34.159 +======== + +* api-change:``compute-optimizer``: Doc only update for Compute Optimizer that fixes several customer-reported issues relating to ECS finding classifications +* api-change:``config``: Documentation update for the OrganizationConfigRuleName regex pattern. +* api-change:``ec2``: This release adds new capabilities to manage On-Demand Capacity Reservations including the ability to split your reservation, move capacity between reservations, and modify the instance eligibility of your reservation. +* api-change:``eks``: Added support for new AL2023 GPU AMIs to the supported AMITypes. +* api-change:``groundstation``: Updating documentation for OEMEphemeris to link to AWS Ground Station User Guide +* api-change:``medialive``: AWS Elemental MediaLive now supports now supports editing the PID values for a Multiplex. +* api-change:``sagemaker``: Releasing large data support as part of CreateAutoMLJobV2 in SageMaker Autopilot and CreateDomain API for SageMaker Canvas. + + +1.34.158 +======== + +* api-change:``cognito-idp``: Fixed a description of AdvancedSecurityAdditionalFlows in Amazon Cognito user pool configuration. +* api-change:``connect``: This release supports adding RoutingCriteria via UpdateContactRoutingData public API. +* api-change:``ssm``: Systems Manager doc-only updates for August 2024. + + +1.34.157 +======== + +* api-change:``cognito-idp``: Added support for threat protection for custom authentication in Amazon Cognito user pools. +* api-change:``connect``: This release fixes a regression in number of access control tags that are allowed to be added to a security profile in Amazon Connect. You can now add up to four access control tags on a single security profile. +* api-change:``ec2``: Launch of private IPv6 addressing for VPCs and Subnets. VPC IPAM supports the planning and monitoring of private IPv6 usage. +* api-change:``glue``: This release adds support to retrieve the validation status when creating or updating Glue Data Catalog Views. Also added is support for BasicCatalogTarget partition keys. + + +1.34.156 +======== + +* api-change:``appintegrations``: Updated CreateDataIntegration and CreateDataIntegrationAssociation API to support bulk data export from Amazon Connect Customer Profiles to the customer S3 bucket. +* api-change:``glue``: Introducing AWS Glue Data Quality anomaly detection, a new functionality that uses ML-based solutions to detect data anomalies users have not explicitly defined rules for. + + +1.34.155 +======== + +* api-change:``bedrock-agent-runtime``: Introduce model invocation output traces for orchestration traces, which contain the model's raw response and usage. +* api-change:``cognito-idp``: Advanced security feature updates to include password history and log export for Cognito user pools. +* api-change:``cost-optimization-hub``: This release adds savings percentage support to the ListRecommendationSummaries API. +* api-change:``workspaces``: Added support for BYOL_GRAPHICS_G4DN_WSP IngestionProcess +* enhancement:AWSCRT: Update awscrt version to 0.21.2 + + +1.34.154 +======== + +* api-change:``datazone``: This releases Data Product feature. Data Products allow grouping data assets into cohesive, self-contained units for ease of publishing for data producers, and ease of finding and accessing for data consumers. +* api-change:``ecr``: Released two new APIs along with documentation updates. The GetAccountSetting API is used to view the current basic scan type version setting for your registry, while the PutAccountSetting API is used to update the basic scan type version for your registry. +* api-change:``kinesis-video-webrtc-storage``: Add JoinStorageSessionAsViewer API +* api-change:``pi``: Added a description for the Dimension db.sql.tokenized_id on the DimensionGroup data type page. + + +1.34.153 +======== + +* api-change:``cloudwatch``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``kinesis``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``resiliencehub``: Customers are presented with the grouping recommendations and can determine if the recommendations are accurate and apply to their case. This feature simplifies onboarding by organizing resources into appropriate AppComponents. +* api-change:``route53``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``waf-regional``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. + + +1.34.152 +======== + +* api-change:``bedrock``: API and Documentation for Bedrock Model Copy feature. This feature lets you share and copy a custom model from one region to another or one account to another. +* api-change:``controlcatalog``: AWS Control Tower provides two new public APIs controlcatalog:ListControls and controlcatalog:GetControl under controlcatalog service namespace, which enable customers to programmatically retrieve control metadata of available controls. +* api-change:``controltower``: Updated Control Tower service documentation for controlcatalog control ARN support with existing Control Tower public APIs +* api-change:``iam``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``memorydb``: Doc only update for changes to deletion API. +* api-change:``rds``: This release adds support for specifying optional MinACU parameter in CreateDBShardGroup and ModifyDBShardGroup API. DBShardGroup response will contain MinACU if specified. +* api-change:``sagemaker``: This release adds support for Amazon EMR Serverless applications in SageMaker Studio for running data processing jobs. +* api-change:``ssm-quicksetup``: This release adds API support for the QuickSetup feature of AWS Systems Manager +* api-change:``support``: Doc only updates to CaseDetails + + +1.34.151 +======== + +* api-change:``appstream``: Added support for Red Hat Enterprise Linux 8 on Amazon AppStream 2.0 +* api-change:``autoscaling``: Increase the length limit for VPCZoneIdentifier from 2047 to 5000 +* api-change:``codepipeline``: AWS CodePipeline V2 type pipelines now support stage level conditions to enable development teams to safely release changes that meet quality and compliance requirements. +* api-change:``elasticache``: Doc only update for changes to deletion API. +* api-change:``elb``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``events``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``lexv2-models``: This release adds new capabilities to the AMAZON.QnAIntent: Custom prompting, Guardrails integration and ExactResponse support for Bedrock Knowledge Base. +* api-change:``logs``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``rolesanywhere``: IAM RolesAnywhere now supports custom role session name on the CreateSession. This release adds the acceptRoleSessionName option to a profile to control whether a role session name will be accepted in a session request with a given profile. +* api-change:``tnb``: This release adds Network Service Update, through which customers will be able to update their instantiated networks to a new network package. See the documentation for limitations. The release also enhances the Get network operation API to return parameter overrides used during the operation. +* api-change:``workspaces``: Removing multi-session as it isn't supported for pools + + +1.34.150 +======== + +* api-change:``elasticache``: Renaming full service name as it appears in developer documentation. +* api-change:``memorydb``: Renaming full service name as it appears in developer documentation. + + +1.34.149 +======== + +* api-change:``application-autoscaling``: Application Auto Scaling is now more responsive to the changes in demand of your SageMaker Inference endpoints. To get started, create or update a Target Tracking policy based on High Resolution CloudWatch metrics. +* api-change:``application-signals``: CloudWatch Application Signals now supports application logs correlation with traces and operational health metrics of applications running on EC2 instances. Users can view the most relevant telemetry to troubleshoot application health anomalies such as spikes in latency, errors, and availability. +* api-change:``bedrock-runtime``: Provides ServiceUnavailableException error message +* api-change:``codecommit``: CreateRepository API now throws OperationNotAllowedException when the account has been restricted from creating a repository. +* api-change:``datazone``: Introduces GetEnvironmentCredentials operation to SDK +* api-change:``ec2``: EC2 Fleet now supports using custom identifiers to reference Amazon Machine Images (AMI) in launch requests that are configured to choose from a diversified list of instance types. +* api-change:``ecr``: API and documentation updates for Amazon ECR, adding support for creating, updating, describing and deleting ECR Repository Creation Template. +* api-change:``eks``: This release adds support for EKS cluster to manage extended support. +* api-change:``elbv2``: This release adds support for sharing trust stores across accounts and organizations through integration with AWS Resource Access Manager. +* api-change:``network-firewall``: You can now log events that are related to TLS inspection, in addition to the existing alert and flow logging. +* api-change:``outposts``: Adding default vCPU information to GetOutpostSupportedInstanceTypes and GetOutpostInstanceTypes responses +* api-change:``stepfunctions``: This release adds support to customer managed KMS key encryption in AWS Step Functions. + + +1.34.148 +======== + +* api-change:``cleanrooms``: Three enhancements to the AWS Clean Rooms: Disallowed Output Columns, Flexible Result Receivers, SQL as a Seed +* api-change:``dynamodb``: DynamoDB doc only update for July +* api-change:``iotsitewise``: Adds support for creating SiteWise Edge gateways that run on a Siemens Industrial Edge Device. +* api-change:``mediapackagev2``: This release adds support for Irdeto DRM encryption in DASH manifests. +* api-change:``medical-imaging``: CopyImageSet API adds copying selected instances between image sets, and overriding inconsistent metadata with a force parameter. UpdateImageSetMetadata API enables reverting to prior versions; updates to Study, Series, and SOP Instance UIDs; and updates to private elements, with a force parameter. +* api-change:``pinpoint-sms-voice-v2``: Update for rebrand to AWS End User Messaging SMS and Voice. + + +1.34.147 +======== + +* api-change:``appsync``: Adding support for paginators in AppSync list APIs +* api-change:``cleanrooms``: This release adds AWS Entity Resolution integration to associate ID namespaces & ID mapping workflow resources as part of ID namespace association and ID mapping table in AWS Clean Rooms. It also introduces a new ID_MAPPING_TABLE analysis rule to manage the protection on ID mapping table. +* api-change:``cleanroomsml``: Adds SQL query as the source of seed audience for audience generation job. +* api-change:``connect``: Added PostContactSummary segment type on ListRealTimeContactAnalysisSegmentsV2 API +* api-change:``connect-contact-lens``: Added PostContactSummary segment type on ListRealTimeContactAnalysisSegments API +* api-change:``datazone``: This release removes the deprecated dataProductItem field from Search API output. +* api-change:``entityresolution``: Support First Party ID Mapping + + +1.34.146 +======== + +* api-change:``datazone``: This release adds 1/ support of register S3 locations of assets in AWS Lake Formation hybrid access mode for DefaultDataLake blueprint. 2/ support of CRUD operations for Asset Filters. +* api-change:``ivs``: Documentation update for IVS Low Latency API Reference. +* api-change:``mobile``: The mobile client has been removed following the deprecation of the service. +* api-change:``neptune-graph``: Amazon Neptune Analytics provides new options for customers to start with smaller graphs at a lower cost. CreateGraph, CreaateGraphImportTask, UpdateGraph and StartImportTask APIs will now allow 32 and 64 for `provisioned-memory` +* api-change:``redshift-serverless``: Adds dualstack support for Redshift Serverless workgroup. + + +1.34.145 +======== + +* api-change:``acm-pca``: Fix broken waiters for the acm-pca client. Waiters broke in version 1.13.144 of the Boto3 SDK. +* api-change:``connect``: Amazon Connect expands search API coverage for additional resources. Search for hierarchy groups by name, ID, tag, or other criteria (new endpoint). Search for agent statuses by name, ID, tag, or other criteria (new endpoint). Search for users by their assigned proficiencies (enhanced endpoint) +* api-change:``ec2``: Amazon VPC IP Address Manager (IPAM) now supports Bring-Your-Own-IP (BYOIP) for IP addresses registered with any Internet Registry. This feature uses DNS TXT records to validate ownership of a public IP address range. +* api-change:``firehose``: This release 1) Add configurable buffering hints for Snowflake as destination. 2) Add ReadFromTimestamp for MSK As Source. Firehose will start reading data from MSK Cluster using offset associated with this timestamp. 3) Gated public beta release to add Apache Iceberg tables as destination. +* api-change:``ivschat``: Documentation update for IVS Chat API Reference. +* api-change:``medialive``: AWS Elemental MediaLive now supports the SRT protocol via the new SRT Caller input type. +* api-change:``rds``: Updates Amazon RDS documentation to specify an eventual consistency model for DescribePendingMaintenanceActions. +* api-change:``sagemaker``: SageMaker Training supports R5, T3 and R5D instances family. And SageMaker Processing supports G5 and R5D instances family. +* api-change:``secretsmanager``: Doc only update for Secrets Manager +* api-change:``taxsettings``: Set default endpoint for aws partition. Requests from all regions in aws partition will be forward to us-east-1 endpoint. +* api-change:``timestream-query``: Doc-only update for TimestreamQuery. Added guidance about the accepted valid value for the QueryPricingModel parameter. +* api-change:``workspaces-thin-client``: Documentation update for WorkSpaces Thin Client. +* bugfix:Waiter: Update waiters to handle expected boolean values when matching errors (`boto/botocore#3220 `__) + + +1.34.144 +======== + +* api-change:``acm-pca``: Minor refactoring of C2J model for AWS Private CA +* api-change:``arc-zonal-shift``: Adds the option to subscribe to get notifications when a zonal autoshift occurs in a region. +* api-change:``globalaccelerator``: This feature adds exceptions to the Customer API to avoid throwing Internal Service errors +* api-change:``pinpoint``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``quicksight``: Vega ally control options and Support for Reviewed Answers in Topics + + +1.34.143 +======== + +* api-change:``batch``: This feature allows AWS Batch Jobs with EKS container orchestration type to be run as Multi-Node Parallel Jobs. +* api-change:``bedrock``: Add support for contextual grounding check for Guardrails for Amazon Bedrock. +* api-change:``bedrock-agent``: Introduces new data sources and chunking strategies for Knowledge bases, advanced parsing logic using FMs, session summary generation, and code interpretation (preview) for Claude V3 Sonnet and Haiku models. Also introduces Prompt Flows (preview) to link prompts, foundational models, and resources. +* api-change:``bedrock-agent-runtime``: Introduces query decomposition, enhanced Agents integration with Knowledge bases, session summary generation, and code interpretation (preview) for Claude V3 Sonnet and Haiku models. Also introduces Prompt Flows (preview) to link prompts, foundational models, and resources for end-to-end solutions. +* api-change:``bedrock-runtime``: Add support for contextual grounding check and ApplyGuardrail API for Guardrails for Amazon Bedrock. +* api-change:``ec2``: Add parameters to enable provisioning IPAM BYOIPv4 space at a Local Zone Network Border Group level +* api-change:``glue``: Add recipe step support for recipe node +* api-change:``groundstation``: Documentation update specifying OEM ephemeris units of measurement +* api-change:``license-manager-linux-subscriptions``: Add support for third party subscription providers, starting with RHEL subscriptions through Red Hat Subscription Manager (RHSM). Additionally, add support for tagging subscription provider resources, and detect when an instance has more than one Linux subscription and notify the customer. +* api-change:``mediaconnect``: AWS Elemental MediaConnect introduces the ability to disable outputs. Disabling an output allows you to keep the output attached to the flow, but stop streaming to the output destination. A disabled output does not incur data transfer costs. + + +1.34.142 +======== + +* api-change:``datazone``: This release deprecates dataProductItem field from SearchInventoryResultItem, along with some unused DataProduct shapes +* api-change:``fsx``: Adds support for FSx for NetApp ONTAP 2nd Generation file systems, and FSx for OpenZFS Single AZ HA file systems. +* api-change:``opensearch``: This release adds support for enabling or disabling Natural Language Query Processing feature for Amazon OpenSearch Service domains, and provides visibility into the current state of the setup or tear-down. +* api-change:``sagemaker``: This release 1/ enables optimization jobs that allows customers to perform Ahead-of-time compilation and quantization. 2/ allows customers to control access to Amazon Q integration in SageMaker Studio. 3/ enables AdditionalModelDataSources for CreateModel action. + + +1.34.141 +======== + +* api-change:``codedeploy``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``devicefarm``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``dms``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``elasticbeanstalk``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``es``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``firehose``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``gamelift``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``qapps``: This is a general availability (GA) release of Amazon Q Apps, a capability of Amazon Q Business. Q Apps leverages data sources your company has provided to enable users to build, share, and customize apps within your organization. +* api-change:``route53resolver``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``ses``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. + + +1.34.140 +======== + +* api-change:``acm``: Documentation updates, including fixes for xml formatting, broken links, and ListCertificates description. +* api-change:``ecr``: This release for Amazon ECR makes change to bring the SDK into sync with the API. +* api-change:``payment-cryptography-data``: Added further restrictions on logging of potentially sensitive inputs and outputs. +* api-change:``qbusiness``: Add personalization to Q Applications. Customers can enable or disable personalization when creating or updating a Q application with the personalization configuration. + + +1.34.139 +======== + +* api-change:``application-autoscaling``: Doc only update for Application Auto Scaling that fixes resource name. +* api-change:``directconnect``: This update includes documentation for support of new native 400 GBps ports for Direct Connect. +* api-change:``organizations``: Added a new reason under ConstraintViolationException in RegisterDelegatedAdministrator API to prevent registering suspended accounts as delegated administrator of a service. +* api-change:``rekognition``: This release adds support for tagging projects and datasets with the CreateProject and CreateDataset APIs. +* api-change:``workspaces``: Fix create workspace bundle RootStorage/UserStorage to accept non null values + + +1.34.138 +======== + +* api-change:``ec2``: Documentation updates for Elastic Compute Cloud (EC2). +* api-change:``fms``: Increases Customer API's ManagedServiceData length +* api-change:``s3``: Added response overrides to Head Object requests. + + +1.34.137 +======== + +* api-change:``apigateway``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``cognito-identity``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``connect``: Authentication profiles are Amazon Connect resources (in gated preview) that allow you to configure authentication settings for users in your contact center. This release adds support for new ListAuthenticationProfiles, DescribeAuthenticationProfile and UpdateAuthenticationProfile APIs. +* api-change:``docdb``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``eks``: Updates EKS managed node groups to support EC2 Capacity Blocks for ML +* api-change:``payment-cryptography``: Added further restrictions on logging of potentially sensitive inputs and outputs. +* api-change:``payment-cryptography-data``: Adding support for dynamic keys for encrypt, decrypt, re-encrypt and translate pin functions. With this change, customers can use one-time TR-31 keys directly in dataplane operations without the need to first import them into the service. +* api-change:``stepfunctions``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``swf``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``wafv2``: JSON body inspection: Update documentation to clarify that JSON parsing doesn't include full validation. + + +1.34.136 +======== + +* api-change:``acm-pca``: Added CCPC_LEVEL_1_OR_HIGHER KeyStorageSecurityStandard and SM2 KeyAlgorithm and SM3WITHSM2 SigningAlgorithm for China regions. +* api-change:``cloudhsmv2``: Added 3 new APIs to support backup sharing: GetResourcePolicy, PutResourcePolicy, and DeleteResourcePolicy. Added BackupArn to the output of the DescribeBackups API. Added support for BackupArn in the CreateCluster API. +* api-change:``connect``: This release supports showing PreferredAgentRouting step via DescribeContact API. +* api-change:``emr``: This release provides the support for new allocation strategies i.e. CAPACITY_OPTIMIZED_PRIORITIZED for Spot and PRIORITIZED for On-Demand by taking input of priority value for each instance type for instance fleet clusters. +* api-change:``glue``: Added AttributesToGet parameter to Glue GetDatabases, allowing caller to limit output to include only the database name. +* api-change:``kinesisanalyticsv2``: Support for Flink 1.19 in Managed Service for Apache Flink +* api-change:``opensearch``: This release removes support for enabling or disabling Natural Language Query Processing feature for Amazon OpenSearch Service domains. +* api-change:``pi``: Noting that the filter db.sql.db_id isn't available for RDS for SQL Server DB instances. +* api-change:``workspaces``: Added support for Red Hat Enterprise Linux 8 on Amazon WorkSpaces Personal. + + +1.34.135 +======== + +* api-change:``application-autoscaling``: Amazon WorkSpaces customers can now use Application Auto Scaling to automatically scale the number of virtual desktops in a WorkSpaces pool. +* api-change:``chime-sdk-media-pipelines``: Added Amazon Transcribe multi language identification to Chime SDK call analytics. Enabling customers sending single stream audio to generate call recordings using Chime SDK call analytics +* api-change:``cloudfront``: Doc only update for CloudFront that fixes customer-reported issue +* api-change:``datazone``: This release supports the data lineage feature of business data catalog in Amazon DataZone. +* api-change:``elasticache``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``mq``: This release makes the EngineVersion field optional for both broker and configuration and uses the latest available version by default. The AutoMinorVersionUpgrade field is also now optional for broker creation and defaults to 'true'. +* api-change:``qconnect``: Adds CreateContentAssociation, ListContentAssociations, GetContentAssociation, and DeleteContentAssociation APIs. +* api-change:``quicksight``: Adding support for Repeating Sections, Nested Filters +* api-change:``rds``: Updates Amazon RDS documentation for TAZ export to S3. +* api-change:``sagemaker``: Add capability for Admins to customize Studio experience for the user by showing or hiding Apps and MLTools. +* api-change:``workspaces``: Added support for WorkSpaces Pools. + + +1.34.134 +======== + +* api-change:``controltower``: Added ListLandingZoneOperations API. +* api-change:``eks``: Added support for disabling unmanaged addons during cluster creation. +* api-change:``ivs-realtime``: IVS Real-Time now offers customers the ability to upload public keys for customer vended participant tokens. +* api-change:``kinesisanalyticsv2``: This release adds support for new ListApplicationOperations and DescribeApplicationOperation APIs. It adds a new configuration to enable system rollbacks, adds field ApplicationVersionCreateTimestamp for clarity and improves support for pagination for APIs. +* api-change:``opensearch``: This release adds support for enabling or disabling Natural Language Query Processing feature for Amazon OpenSearch Service domains, and provides visibility into the current state of the setup or tear-down. + + +1.34.133 +======== + +* api-change:``autoscaling``: Doc only update for Auto Scaling's TargetTrackingMetricDataQuery +* api-change:``ec2``: This release is for the launch of the new u7ib-12tb.224xlarge, R8g, c7gn.metal and mac2-m1ultra.metal instance types +* api-change:``networkmanager``: This is model changes & documentation update for the Asynchronous Error Reporting feature for AWS Cloud WAN. This feature allows customers to view errors that occur while their resources are being provisioned, enabling customers to fix their resources without needing external support. +* api-change:``workspaces-thin-client``: This release adds the deviceCreationTags field to CreateEnvironment API input, UpdateEnvironment API input and GetEnvironment API output. + + +1.34.132 +======== + +* api-change:``bedrock-runtime``: Increases Converse API's document name length +* api-change:``customer-profiles``: This release includes changes to ProfileObjectType APIs, adds functionality top set and get capacity for profile object types. +* api-change:``ec2``: Fix EC2 multi-protocol info in models. +* api-change:``qbusiness``: Allow enable/disable Q Apps when creating/updating a Q application; Return the Q Apps enablement information when getting a Q application. +* api-change:``ssm``: Add sensitive trait to SSM IPAddress property for CloudTrail redaction +* api-change:``workspaces-web``: Added ability to enable DeepLinking functionality on a Portal via UserSettings as well as added support for IdentityProvider resource tagging. + + +1.34.131 +======== + +* api-change:``bedrock-runtime``: This release adds document support to Converse and ConverseStream APIs +* api-change:``codeartifact``: Add support for the Cargo package format. +* api-change:``compute-optimizer``: This release enables AWS Compute Optimizer to analyze and generate optimization recommendations for Amazon RDS MySQL and RDS PostgreSQL. +* api-change:``cost-optimization-hub``: This release enables AWS Cost Optimization Hub to show cost optimization recommendations for Amazon RDS MySQL and RDS PostgreSQL. +* api-change:``dynamodb``: Doc-only update for DynamoDB. Fixed Important note in 6 Global table APIs - CreateGlobalTable, DescribeGlobalTable, DescribeGlobalTableSettings, ListGlobalTables, UpdateGlobalTable, and UpdateGlobalTableSettings. +* api-change:``glue``: Fix Glue paginators for Jobs, JobRuns, Triggers, Blueprints and Workflows. +* api-change:``ivs-realtime``: IVS Real-Time now offers customers the ability to record individual stage participants to S3. +* api-change:``sagemaker``: Adds support for model references in Hub service, and adds support for cross-account access of Hubs +* api-change:``securityhub``: Documentation updates for Security Hub + + +1.34.130 +======== + +* api-change:``artifact``: This release adds an acceptanceType field to the ReportSummary structure (used in the ListReports API response). +* api-change:``athena``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``cur``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``directconnect``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``elastictranscoder``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``opensearch``: This release enables customers to use JSON Web Tokens (JWT) for authentication on their Amazon OpenSearch Service domains. + + +1.34.129 +======== + +* api-change:``bedrock-runtime``: This release adds support for using Guardrails with the Converse and ConverseStream APIs. +* api-change:``cloudtrail``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``config``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``eks``: This release adds support to surface async fargate customer errors from async path to customer through describe-fargate-profile API response. +* api-change:``lightsail``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``polly``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``rekognition``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``sagemaker``: Launched a new feature in SageMaker to provide managed MLflow Tracking Servers for customers to track ML experiments. This release also adds a new capability of attaching additional storage to SageMaker HyperPod cluster instances. +* api-change:``shield``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``snowball``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. + + +1.34.128 +======== + +* api-change:``acm-pca``: Doc-only update that adds name constraints as an allowed extension for ImportCertificateAuthorityCertificate. +* api-change:``batch``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``codebuild``: AWS CodeBuild now supports global and organization GitHub webhooks +* api-change:``cognito-idp``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``ds``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``efs``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``glue``: This release introduces a new feature, Usage profiles. Usage profiles allow the AWS Glue admin to create different profiles for various classes of users within the account, enforcing limits and defaults for jobs and sessions. +* api-change:``mediaconvert``: This release includes support for creating I-frame only video segments for DASH trick play. +* api-change:``secretsmanager``: Doc only update for Secrets Manager +* api-change:``waf``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. + + +1.34.127 +======== + +* api-change:``datazone``: This release introduces a new default service blueprint for custom environment creation. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``macie2``: This release adds support for managing the status of automated sensitive data discovery for individual accounts in an organization, and determining whether individual S3 buckets are included in the scope of the analyses. +* api-change:``mediaconvert``: This release adds the ability to search for historical job records within the management console using a search box and/or via the SDK/CLI with partial string matching search on input file name. +* api-change:``route53domains``: Add v2 smoke tests and smithy smokeTests trait for SDK testing. + + +1.34.126 +======== + +* api-change:``cloudhsmv2``: Added support for hsm type hsm2m.medium. Added supported for creating a cluster in FIPS or NON_FIPS mode. +* api-change:``glue``: This release adds support for configuration of evaluation method for composite rules in Glue Data Quality rulesets. +* api-change:``iotwireless``: Add RoamingDeviceSNR and RoamingDeviceRSSI to Customer Metrics. +* api-change:``kms``: This feature allows customers to use their keys stored in KMS to derive a shared secret which can then be used to establish a secured channel for communication, provide proof of possession, or establish trust with other parties. +* api-change:``mediapackagev2``: This release adds support for CMAF ingest (DASH-IF live media ingest protocol interface 1) + + +1.34.125 +======== + +* api-change:``apptest``: AWS Mainframe Modernization Application Testing is an AWS Mainframe Modernization service feature that automates functional equivalence testing for mainframe application modernization and migration to AWS, and regression testing. +* api-change:``backupstorage``: The backupstorage client has been removed following the deprecation of the service. +* api-change:``ec2``: Tagging support for Traffic Mirroring FilterRule resource +* api-change:``osis``: SDK changes for self-managed vpc endpoint to OpenSearch ingestion pipelines. +* api-change:``redshift``: Updates to remove DC1 and DS2 node types. +* api-change:``secretsmanager``: Introducing RotationToken parameter for PutSecretValue API +* api-change:``securitylake``: This release updates request validation regex to account for non-commercial aws partitions. +* api-change:``sesv2``: This release adds support for Amazon EventBridge as an email sending events destination. + + +1.34.124 +======== + +* api-change:``accessanalyzer``: IAM Access Analyzer now provides policy recommendations to help resolve unused permissions for IAM roles and users. Additionally, IAM Access Analyzer now extends its custom policy checks to detect when IAM policies grant public access or access to critical resources ahead of deployments. +* api-change:``guardduty``: Added API support for GuardDuty Malware Protection for S3. +* api-change:``networkmanager``: This is model changes & documentation update for Service Insertion feature for AWS Cloud WAN. This feature allows insertion of AWS/3rd party security services on Cloud WAN. This allows to steer inter/intra segment traffic via security appliances and provide visibility to the route updates. +* api-change:``pca-connector-scep``: Connector for SCEP allows you to use a managed, cloud CA to enroll mobile devices and networking gear. SCEP is a widely-adopted protocol used by mobile device management (MDM) solutions for enrolling mobile devices. With the connector, you can use AWS Private CA with popular MDM solutions. +* api-change:``sagemaker``: Introduced Scope and AuthenticationRequestExtraParams to SageMaker Workforce OIDC configuration; this allows customers to modify these options for their private Workforce IdP integration. Model Registry Cross-account model package groups are discoverable. + + +1.34.123 +======== + +* api-change:``application-signals``: This is the initial SDK release for Amazon CloudWatch Application Signals. Amazon CloudWatch Application Signals provides curated application performance monitoring for developers to monitor and troubleshoot application health using pre-built dashboards and Service Level Objectives. +* api-change:``ecs``: This release introduces a new cluster configuration to support the customer-managed keys for ECS managed storage encryption. +* api-change:``imagebuilder``: This release updates the regex pattern for Image Builder ARNs. + + +1.34.122 +======== + +* api-change:``auditmanager``: New feature: common controls. When creating custom controls, you can now use pre-grouped AWS data sources based on common compliance themes. Also, the awsServices parameter is deprecated because we now manage services in scope for you. If used, the input is ignored and an empty list is returned. +* api-change:``b2bi``: Added exceptions to B2Bi List operations and ConflictException to B2Bi StartTransformerJob operation. Also made capabilities field explicitly required when creating a Partnership. +* api-change:``codepipeline``: CodePipeline now supports overriding S3 Source Object Key during StartPipelineExecution, as part of Source Overrides. +* api-change:``sagemaker``: This release introduces a new optional parameter: InferenceAmiVersion, in ProductionVariant. +* api-change:``verifiedpermissions``: This release adds OpenIdConnect (OIDC) configuration support for IdentitySources, allowing for external IDPs to be used in authorization requests. + + +1.34.121 +======== + +* api-change:``account``: This release adds 3 new APIs (AcceptPrimaryEmailUpdate, GetPrimaryEmail, and StartPrimaryEmailUpdate) used to centrally manage the root user email address of member accounts within an AWS organization. +* api-change:``alexaforbusiness``: The alexaforbusiness client has been removed following the deprecation of the service. +* api-change:``firehose``: Adds integration with Secrets Manager for Redshift, Splunk, HttpEndpoint, and Snowflake destinations +* api-change:``fsx``: This release adds support to increase metadata performance on FSx for Lustre file systems beyond the default level provisioned when a file system is created. This can be done by specifying MetadataConfiguration during the creation of Persistent_2 file systems or by updating it on demand. +* api-change:``glue``: This release adds support for creating and updating Glue Data Catalog Views. +* api-change:``honeycode``: The honeycode client has been removed following the deprecation of the service. +* api-change:``iotwireless``: Adds support for wireless device to be in Conflict FUOTA Device Status due to a FUOTA Task, so it couldn't be attached to a new one. +* api-change:``location``: Added two new APIs, VerifyDevicePosition and ForecastGeofenceEvents. Added support for putting larger geofences up to 100,000 vertices with Geobuf fields. +* api-change:``sns``: Doc-only update for SNS. These changes include customer-reported issues and TXC3 updates. +* api-change:``sqs``: Doc only updates for SQS. These updates include customer-reported issues and TCX3 modifications. +* api-change:``storagegateway``: Adds SoftwareUpdatePreferences to DescribeMaintenanceStartTime and UpdateMaintenanceStartTime, a structure which contains AutomaticUpdatePolicy. +* enhancement:AWSCRT: Update awscrt version to 0.20.11 + + +1.34.120 +======== + +* api-change:``globalaccelerator``: This release contains a new optional ip-addresses input field for the update accelerator and update custom routing accelerator apis. This input enables consumers to replace IPv4 addresses on existing accelerators with addresses provided in the input. +* api-change:``glue``: AWS Glue now supports native SaaS connectivity: Salesforce connector available now +* api-change:``s3``: Added new params copySource and key to copyObject API for supporting S3 Access Grants plugin. These changes will not change any of the existing S3 API functionality. + + +1.34.119 +======== + +* api-change:``ec2``: U7i instances with up to 32 TiB of DDR5 memory and 896 vCPUs are now available. C7i-flex instances are launched and are lower-priced variants of the Amazon EC2 C7i instances that offer a baseline level of CPU performance with the ability to scale up to the full compute performance 95% of the time. +* api-change:``pipes``: This release adds Timestream for LiveAnalytics as a supported target in EventBridge Pipes +* api-change:``sagemaker``: Extend DescribeClusterNode response with private DNS hostname and IP address, and placement information about availability zone and availability zone ID. +* api-change:``taxsettings``: Initial release of AWS Tax Settings API + + +1.34.118 +======== + +* api-change:``amplify``: This doc-only update identifies fields that are specific to Gen 1 and Gen 2 applications. +* api-change:``batch``: This release adds support for the AWS Batch GetJobQueueSnapshot API operation. +* api-change:``eks``: Adds support for EKS add-ons pod identity associations integration +* api-change:``iottwinmaker``: Support RESET_VALUE UpdateType for PropertyUpdates to reset property value to default or null + + +1.34.117 +======== + +* api-change:``codebuild``: AWS CodeBuild now supports Self-hosted GitHub Actions runners for Github Enterprise +* api-change:``codeguru-security``: This release includes minor model updates and documentation updates. +* api-change:``elasticache``: Update to attributes of TestFailover and minor revisions. +* api-change:``launch-wizard``: This release adds support for describing workload deployment specifications, deploying additional workload types, and managing tags for Launch Wizard resources with API operations. + + +1.34.116 +======== + +* api-change:``acm``: add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``bedrock-agent``: With this release, Knowledge bases for Bedrock adds support for Titan Text Embedding v2. +* api-change:``bedrock-runtime``: This release adds Converse and ConverseStream APIs to Bedrock Runtime +* api-change:``cloudtrail``: CloudTrail Lake returns PartitionKeys in the GetEventDataStore API response. Events are grouped into partitions based on these keys for better query performance. For example, the calendarday key groups events by day, while combining the calendarday key with the hour key groups them by day and hour. +* api-change:``connect``: Adding associatedQueueIds as a SearchCriteria and response field to the SearchRoutingProfiles API +* api-change:``emr-serverless``: The release adds support for spark structured streaming. +* api-change:``rds``: Updates Amazon RDS documentation for Aurora Postgres DBname. +* api-change:``sagemaker``: Adds Model Card information as a new component to Model Package. Autopilot launches algorithm selection for TimeSeries modality to generate AutoML candidates per algorithm. + + +1.34.115 +======== + +* api-change:``athena``: Throwing validation errors on CreateNotebook with Name containing `/`,`:`,`\` +* api-change:``codebuild``: AWS CodeBuild now supports manually creating GitHub webhooks +* api-change:``connect``: This release includes changes to DescribeContact API's response by including ConnectedToSystemTimestamp, RoutingCriteria, Customer, Campaign, AnsweringMachineDetectionStatus, CustomerVoiceActivity, QualityMetrics, DisconnectDetails, and SegmentAttributes information from a contact in Amazon Connect. +* api-change:``glue``: Add optional field JobMode to CreateJob and UpdateJob APIs. +* api-change:``securityhub``: Add ROOT type for TargetType model + + +1.34.114 +======== + +* api-change:``dynamodb``: Doc-only update for DynamoDB. Specified the IAM actions needed to authorize a user to create a table with a resource-based policy. +* api-change:``ec2``: Providing support to accept BgpAsnExtended attribute +* api-change:``kafka``: Adds ControllerNodeInfo in ListNodes response to support Raft mode for MSK +* api-change:``swf``: This release adds new APIs for deleting activity type and workflow type resources. + + +1.34.113 +======== + +* api-change:``dynamodb``: Documentation only updates for DynamoDB. +* api-change:``iotfleetwise``: AWS IoT FleetWise now supports listing vehicles with attributes filter, ListVehicles API is updated to support additional attributes filter. +* api-change:``managedblockchain``: This is a minor documentation update to address the impact of the shut down of the Goerli and Polygon networks. + + +1.34.112 +======== + +* api-change:``emr-serverless``: This release adds the capability to run interactive workloads using Apache Livy Endpoint. +* api-change:``opsworks``: Documentation-only update for OpsWorks Stacks. + + +1.34.111 +======== + +* api-change:``chatbot``: This change adds support for tagging Chatbot configurations. +* api-change:``cloudformation``: Added DeletionMode FORCE_DELETE_STACK for deleting a stack that is stuck in DELETE_FAILED state due to resource deletion failure. +* api-change:``kms``: This release includes feature to import customer's asymmetric (RSA, ECC and SM2) and HMAC keys into KMS in China. +* api-change:``opensearch``: This release adds support for enabling or disabling a data source configured as part of Zero-ETL integration with Amazon S3, by setting its status. +* api-change:``wafv2``: You can now use Security Lake to collect web ACL traffic data. + + +1.34.110 +======== + +* api-change:``cloudfront``: Model update; no change to SDK functionality. +* api-change:``glue``: Add Maintenance window to CreateJob and UpdateJob APIs and JobRun response. Add a new Job Run State for EXPIRED. +* api-change:``lightsail``: This release adds support for Amazon Lightsail instances to switch between dual-stack or IPv4 only and IPv6-only public IP address types. +* api-change:``mailmanager``: This release includes a new Amazon SES feature called Mail Manager, which is a set of email gateway capabilities designed to help customers strengthen their organization's email infrastructure, simplify email workflow management, and streamline email compliance control. +* api-change:``pi``: Performance Insights added a new input parameter called AuthorizedActions to support the fine-grained access feature. Performance Insights also restricted the acceptable input characters. +* api-change:``rds``: Updates Amazon RDS documentation for Db2 license through AWS Marketplace. +* api-change:``storagegateway``: Added new SMBSecurityStrategy enum named MandatoryEncryptionNoAes128, new mode enforces encryption and disables AES 128-bit algorithums. + + +1.34.109 +======== + +* api-change:``bedrock-agent``: This release adds support for using Guardrails with Bedrock Agents. +* api-change:``bedrock-agent-runtime``: This release adds support for using Guardrails with Bedrock Agents. +* api-change:``controltower``: Added ListControlOperations API and filtering support for ListEnabledControls API. Updates also includes added metadata for enabled controls and control operations. +* api-change:``osis``: Add support for creating an OpenSearch Ingestion pipeline that is attached to a provided VPC. Add information about the destinations of an OpenSearch Ingestion pipeline to the GetPipeline and ListPipelines APIs. +* api-change:``rds``: This release adds support for EngineLifecycleSupport on DBInstances, DBClusters, and GlobalClusters. +* api-change:``secretsmanager``: add v2 smoke tests and smithy smokeTests trait for SDK testing + + +1.34.108 +======== + +* api-change:``application-autoscaling``: add v2 smoke tests and smithy smokeTests trait for SDK testing. +* api-change:``codebuild``: Aws CodeBuild now supports 36 hours build timeout +* api-change:``elbv2``: This release adds dualstack-without-public-ipv4 IP address type for ALB. +* api-change:``lakeformation``: Introduces a new API, GetDataLakePrincipal, that returns the identity of the invoking principal +* api-change:``transfer``: Enable use of CloudFormation traits in Smithy model to improve generated CloudFormation schema from the Smithy API model. + + +1.34.107 +======== + +* api-change:``acm-pca``: This release adds support for waiters to fail on AccessDeniedException when having insufficient permissions +* api-change:``connect``: Adding Contact Flow metrics to the GetMetricDataV2 API +* api-change:``kafka``: AWS MSK support for Broker Removal. +* api-change:``mwaa``: Amazon MWAA now supports Airflow web server auto scaling to automatically handle increased demand from REST APIs, Command Line Interface (CLI), or more Airflow User Interface (UI) users. Customers can specify maximum and minimum web server instances during environment creation and update workflow. +* api-change:``quicksight``: This release adds DescribeKeyRegistration and UpdateKeyRegistration APIs to manage QuickSight Customer Managed Keys (CMK). +* api-change:``sagemaker``: Introduced WorkerAccessConfiguration to SageMaker Workteam. This allows customers to configure resource access for workers in a workteam. +* api-change:``secretsmanager``: Documentation updates for AWS Secrets Manager +* bugfix:retries: Fix backoff calculation for truncated binary exponential backoff (`#3178 `__) + + +1.34.106 +======== + +* api-change:``bedrock-agent-runtime``: Updating Bedrock Knowledge Base Metadata & Filters feature with two new filters listContains and stringContains +* api-change:``codebuild``: CodeBuild Reserved Capacity VPC Support +* api-change:``datasync``: Task executions now display a CANCELLING status when an execution is in the process of being cancelled. +* api-change:``grafana``: This release adds new ServiceAccount and ServiceAccountToken APIs. +* api-change:``medical-imaging``: Added support for importing medical imaging data from Amazon S3 buckets across accounts and regions. +* api-change:``securityhub``: Documentation-only update for AWS Security Hub + + +1.34.105 +======== + +* api-change:``connect``: Amazon Connect provides enhanced search capabilities for flows & flow modules on the Connect admin website and programmatically using APIs. You can search for flows and flow modules by name, description, type, status, and tags, to filter and identify a specific flow in your Connect instances. +* api-change:``s3``: Updated a few x-id in the http uri traits + + +1.34.104 +======== + +* api-change:``events``: Amazon EventBridge introduces KMS customer-managed key (CMK) encryption support for custom and partner events published on EventBridge Event Bus (including default bus) and UpdateEventBus API. +* api-change:``vpc-lattice``: This release adds TLS Passthrough support. It also increases max number of target group per rule to 10. + + +1.34.103 +======== + +* api-change:``discovery``: add v2 smoke tests and smithy smokeTests trait for SDK testing +* api-change:``greengrassv2``: Mark ComponentVersion in ComponentDeploymentSpecification as required. +* api-change:``sagemaker``: Introduced support for G6 instance types on Sagemaker Notebook Instances and on SageMaker Studio for JupyterLab and CodeEditor applications. +* api-change:``sso-oidc``: Updated request parameters for PKCE support. + + +1.34.102 +======== + +* api-change:``bedrock-agent-runtime``: This release adds support to provide guardrail configuration and modify inference parameters that are then used in RetrieveAndGenerate API in Agents for Amazon Bedrock. +* api-change:``pinpoint``: This release adds support for specifying email message headers for Email Templates, Campaigns, Journeys and Send Messages. +* api-change:``route53resolver``: Update the DNS Firewall settings to correct a spelling issue. +* api-change:``ssm-sap``: Added support for application-aware start/stop of SAP applications running on EC2 instances, with SSM for SAP +* api-change:``verifiedpermissions``: Adds policy effect and actions fields to Policy API's. + + +1.34.101 +======== + +* api-change:``cognito-idp``: Add EXTERNAL_PROVIDER enum value to UserStatusType. +* api-change:``ec2``: Adding Precision Hardware Clock (PHC) to public API DescribeInstanceTypes +* api-change:``ecr``: This release adds pull through cache rules support for GitLab container registry in Amazon ECR. +* api-change:``fms``: The policy scope resource tag is always a string value, either a non-empty string or an empty string. +* api-change:``polly``: Add new engine - generative - that builds the most expressive conversational voices. +* api-change:``sqs``: This release adds MessageSystemAttributeNames to ReceiveMessageRequest to replace AttributeNames. + + +1.34.100 +======== + +* api-change:``b2bi``: Documentation update to clarify the MappingTemplate definition. +* api-change:``budgets``: This release adds tag support for budgets and budget actions. +* api-change:``resiliencehub``: AWS Resilience Hub has expanded its drift detection capabilities by introducing a new type of drift detection - application resource drift. This new enhancement detects changes, such as the addition or deletion of resources within the application's input sources. +* api-change:``route53profiles``: Doc only update for Route 53 profiles that fixes some link issues + + +1.34.99 +======= + +* api-change:``medialive``: AWS Elemental MediaLive now supports configuring how SCTE 35 passthrough triggers segment breaks in HLS and MediaPackage output groups. Previously, messages triggered breaks in all these output groups. The new option is to trigger segment breaks only in groups that have SCTE 35 passthrough enabled. + + +1.34.98 +======= + +* api-change:``bedrock-agent``: This release adds support for using Provisioned Throughput with Bedrock Agents. +* api-change:``connect``: This release adds 5 new APIs for managing attachments: StartAttachedFileUpload, CompleteAttachedFileUpload, GetAttachedFile, BatchGetAttachedFileMetadata, DeleteAttachedFile. These APIs can be used to programmatically upload and download attachments to Connect resources, like cases. +* api-change:``connectcases``: This feature supports the release of Files related items +* api-change:``datasync``: Updated guidance on using private or self-signed certificate authorities (CAs) with AWS DataSync object storage locations. +* api-change:``inspector2``: This release adds CSV format to GetCisScanReport for Inspector v2 +* api-change:``sagemaker``: Amazon SageMaker Inference now supports m6i, c6i, r6i, m7i, c7i, r7i and g5 instance types for Batch Transform Jobs +* api-change:``sesv2``: Adds support for specifying replacement headers per BulkEmailEntry in SendBulkEmail in SESv2. + + +1.34.97 +======= + +* api-change:``dynamodb``: This release adds support to specify an optional, maximum OnDemandThroughput for DynamoDB tables and global secondary indexes in the CreateTable or UpdateTable APIs. You can also override the OnDemandThroughput settings by calling the ImportTable, RestoreFromPointInTime, or RestoreFromBackup APIs. +* api-change:``ec2``: This release includes a new API for retrieving the public endorsement key of the EC2 instance's Nitro Trusted Platform Module (NitroTPM). +* api-change:``personalize``: This releases ability to delete users and their data, including their metadata and interactions data, from a dataset group. +* api-change:``redshift-serverless``: Update Redshift Serverless List Scheduled Actions Output Response to include Namespace Name. + + +1.34.96 +======= + +* api-change:``bedrock-agent``: This release adds support for using MongoDB Atlas as a vector store when creating a knowledge base. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``personalize-runtime``: This release adds support for a Reason attribute for predicted items generated by User-Personalization-v2. +* api-change:``securityhub``: Updated CreateMembers API request with limits. +* api-change:``sesv2``: Fixes ListContacts and ListImportJobs APIs to use POST instead of GET. + + +1.34.95 +======= + +* api-change:``chime-sdk-voice``: Due to changes made by the Amazon Alexa service, GetSipMediaApplicationAlexaSkillConfiguration and PutSipMediaApplicationAlexaSkillConfiguration APIs are no longer available for use. For more information, refer to the Alexa Smart Properties page. +* api-change:``codeartifact``: Add support for the Ruby package format. +* api-change:``fms``: AWS Firewall Manager now supports the network firewall service stream exception policy feature for accounts within your organization. +* api-change:``omics``: Add support for workflow sharing and dynamic run storage +* api-change:``opensearch``: This release enables customers to create Route53 A and AAAA alias record types to point custom endpoint domain to OpenSearch domain's dualstack search endpoint. +* api-change:``pinpoint-sms-voice-v2``: Amazon Pinpoint has added two new features Multimedia services (MMS) and protect configurations. Use the three new MMS APIs to send media messages to a mobile phone which includes image, audio, text, or video files. Use the ten new protect configurations APIs to block messages to specific countries. +* api-change:``qbusiness``: This is a general availability (GA) release of Amazon Q Business. Q Business enables employees in an enterprise to get comprehensive answers to complex questions and take actions through a unified, intuitive web-based chat experience - using an enterprise's existing content, data, and systems. +* api-change:``quicksight``: New Q embedding supporting Generative Q&A +* api-change:``route53resolver``: Release of FirewallDomainRedirectionAction parameter on the Route 53 DNS Firewall Rule. This allows customers to configure a DNS Firewall rule to inspect all the domains in the DNS redirection chain (default) , such as CNAME, ALIAS, DNAME, etc., or just the first domain and trust the rest. +* api-change:``sagemaker``: Amazon SageMaker Training now supports the use of attribute-based access control (ABAC) roles for training job execution roles. Amazon SageMaker Inference now supports G6 instance types. +* api-change:``signer``: Documentation updates for AWS Signer. Adds cross-account signing constraint and definitions for cross-account actions. + + +1.34.94 +======= + +* api-change:``amplify``: Updating max results limit for listing any resources (Job, Artifacts, Branch, BackendResources, DomainAssociation) to 50 with the exception of list apps that where max results can be up to 100. +* api-change:``connectcases``: This feature releases DeleteField, DeletedLayout, and DeleteTemplate API's +* api-change:``inspector2``: Update Inspector2 to include new Agentless API parameters. +* api-change:``timestream-query``: This change allows users to update and describe account settings associated with their accounts. +* api-change:``transcribe``: This update provides error messaging for generative call summarization in Transcribe Call Analytics +* api-change:``trustedadvisor``: This release adds the BatchUpdateRecommendationResourceExclusion API to support batch updates of Recommendation Resource exclusion statuses and introduces a new exclusion status filter to the ListRecommendationResources and ListOrganizationRecommendationResources APIs. + + +1.34.93 +======= + +* api-change:``codepipeline``: Add ability to manually and automatically roll back a pipeline stage to a previously successful execution. +* api-change:``cognito-idp``: Add LimitExceededException to SignUp errors +* api-change:``connectcampaigns``: This release adds support for specifying if Answering Machine should wait for prompt sound. +* api-change:``marketplace-entitlement``: Releasing minor endpoint updates. +* api-change:``oam``: This release introduces support for Source Accounts to define which Metrics and Logs to share with the Monitoring Account +* api-change:``rds``: SupportsLimitlessDatabase field added to describe-db-engine-versions to indicate whether the DB engine version supports Aurora Limitless Database. +* api-change:``support``: Releasing minor endpoint updates. + + +1.34.92 +======= + +* api-change:``appsync``: UpdateGraphQLAPI documentation update and datasource introspection secret arn update +* api-change:``fms``: AWS Firewall Manager adds support for network ACL policies to manage Amazon Virtual Private Cloud (VPC) network access control lists (ACLs) for accounts in your organization. +* api-change:``ivs``: Bug Fix: IVS does not support arns with the `svs` prefix +* api-change:``ivs-realtime``: Bug Fix: IVS Real Time does not support ARNs using the `svs` prefix. +* api-change:``rds``: Updates Amazon RDS documentation for setting local time zones for RDS for Db2 DB instances. +* api-change:``stepfunctions``: Add new ValidateStateMachineDefinition operation, which performs syntax checking on the definition of a Amazon States Language (ASL) state machine. + + +1.34.91 +======= + +* api-change:``datasync``: This change allows users to disable and enable the schedules associated with their tasks. +* api-change:``ec2``: Launching capability for customers to enable or disable automatic assignment of public IPv4 addresses to their network interface +* api-change:``emr-containers``: EMRonEKS Service support for SecurityConfiguration enforcement for Spark Jobs. +* api-change:``entityresolution``: Support Batch Unique IDs Deletion. +* api-change:``gamelift``: Amazon GameLift releases container fleets support for public preview. Deploy Linux-based containerized game server software for hosting on Amazon GameLift. +* api-change:``ssm``: Add SSM DescribeInstanceProperties API to public AWS SDK. + + +1.34.90 +======= + +* api-change:``bedrock``: This release introduces Model Evaluation and Guardrails for Amazon Bedrock. +* api-change:``bedrock-agent``: Introducing the ability to create multiple data sources per knowledge base, specify S3 buckets as data sources from external accounts, and exposing levers to define the deletion behavior of the underlying vector store data. +* api-change:``bedrock-agent-runtime``: This release introduces zero-setup file upload support for the RetrieveAndGenerate API. This allows you to chat with your data without setting up a Knowledge Base. +* api-change:``bedrock-runtime``: This release introduces Guardrails for Amazon Bedrock. +* api-change:``ce``: Added additional metadata that might be applicable to your reservation recommendations. +* api-change:``ec2``: This release introduces EC2 AMI Deregistration Protection, a new AMI property that can be enabled by customers to protect an AMI against an unintended deregistration. This release also enables the AMI owners to view the AMI 'LastLaunchedTime' in DescribeImages API. +* api-change:``pi``: Clarifies how aggregation works for GetResourceMetrics in the Performance Insights API. +* api-change:``rds``: Fix the example ARN for ModifyActivityStreamRequest +* api-change:``sqs``: This release enables customers to call SQS using AWS JSON-1.0 protocol +* api-change:``workspaces-web``: Added InstanceType and MaxConcurrentSessions parameters on CreatePortal and UpdatePortal Operations as well as the ability to read Customer Managed Key & Additional Encryption Context parameters on supported resources (Portal, BrowserSettings, UserSettings, IPAccessSettings) + + +1.34.89 +======= + +* api-change:``bedrock-agent``: Releasing the support for simplified configuration and return of control +* api-change:``bedrock-agent-runtime``: Releasing the support for simplified configuration and return of control +* api-change:``payment-cryptography``: Adding support to TR-31/TR-34 exports for optional headers, allowing customers to add additional metadata (such as key version and KSN) when exporting keys from the service. +* api-change:``redshift-serverless``: Updates description of schedule field for scheduled actions. +* api-change:``route53profiles``: Route 53 Profiles allows you to apply a central DNS configuration across many VPCs regardless of account. +* api-change:``sagemaker``: This release adds support for Real-Time Collaboration and Shared Space for JupyterLab App on SageMaker Studio. +* api-change:``servicediscovery``: This release adds examples to several Cloud Map actions. +* api-change:``transfer``: Adding new API to support remote directory listing using SFTP connector + + +1.34.88 +======= + +* api-change:``glue``: Adding RowFilter in the response for GetUnfilteredTableMetadata API +* api-change:``internetmonitor``: This update introduces the GetInternetEvent and ListInternetEvents APIs, which provide access to internet events displayed on the Amazon CloudWatch Internet Weather Map. +* api-change:``personalize``: This releases auto training capability while creating a solution and automatically syncing latest solution versions when creating/updating a campaign + + +1.34.87 +======= + +* api-change:``drs``: Outpost ARN added to Source Server and Recovery Instance +* api-change:``emr-serverless``: This release adds the capability to publish detailed Spark engine metrics to Amazon Managed Service for Prometheus (AMP) for enhanced monitoring for Spark jobs. +* api-change:``guardduty``: Added IPv6Address fields for local and remote IP addresses +* api-change:``quicksight``: This release adds support for the Cross Sheet Filter and Control features, and support for warnings in asset imports for any permitted errors encountered during execution +* api-change:``rolesanywhere``: This release introduces the PutAttributeMapping and DeleteAttributeMapping APIs. IAM Roles Anywhere now provides the capability to define a set of mapping rules, allowing customers to specify which data is extracted from their X.509 end-entity certificates. +* api-change:``sagemaker``: Removed deprecated enum values and updated API documentation. +* api-change:``workspaces``: Adds new APIs for managing and sharing WorkSpaces BYOL configuration across accounts. + + +1.34.86 +======= + +* api-change:``ec2``: Documentation updates for Elastic Compute Cloud (EC2). +* api-change:``qbusiness``: This release adds support for IAM Identity Center (IDC) as the identity gateway for Q Business. It also allows users to provide an explicit intent for Q Business to identify how the Chat request should be handled. + + +1.34.85 +======= + +* api-change:``bedrock-agent``: For Create Agent API, the agentResourceRoleArn parameter is no longer required. +* api-change:``emr-serverless``: This release adds support for shuffle optimized disks that allow larger disk sizes and higher IOPS to efficiently run shuffle heavy workloads. +* api-change:``entityresolution``: Cross Account Resource Support . +* api-change:``iotwireless``: Add PublicGateways in the GetWirelessStatistics call response, indicating the LoRaWAN public network accessed by the device. +* api-change:``lakeformation``: This release adds Lake Formation managed RAM support for the 4 APIs - "DescribeLakeFormationIdentityCenterConfiguration", "CreateLakeFormationIdentityCenterConfiguration", "DescribeLakeFormationIdentityCenterConfiguration", and "DeleteLakeFormationIdentityCenterConfiguration" +* api-change:``m2``: Adding new ListBatchJobRestartPoints API and support for restart batch job. +* api-change:``mediapackagev2``: Dash v2 is a MediaPackage V2 feature to support egressing on DASH manifest format. +* api-change:``outposts``: This release adds new APIs to allow customers to configure their Outpost capacity at order-time. +* api-change:``wellarchitected``: AWS Well-Architected now has a Connector for Jira to allow customers to efficiently track workload risks and improvement efforts and create closed-loop mechanisms. +* enhancement:AWSCRT: Update awscrt version to 0.20.9 + + +1.34.84 +======= + +* api-change:``cloudformation``: Adding support for the new parameter "IncludePropertyValues" in the CloudFormation DescribeChangeSet API. When this parameter is included, the DescribeChangeSet response will include more detailed information such as before and after values for the resource properties that will change. +* api-change:``config``: Updates documentation for AWS Config +* api-change:``glue``: Modifying request for GetUnfilteredTableMetadata for view-related fields. +* api-change:``healthlake``: Added new CREATE_FAILED status for data stores. Added new errorCause to DescribeFHIRDatastore API and ListFHIRDatastores API response for additional insights into data store creation and deletion workflows. +* api-change:``iotfleethub``: Documentation updates for AWS IoT Fleet Hub to clarify that Fleet Hub supports organization instance of IAM Identity Center. +* api-change:``kms``: This feature supports the ability to specify a custom rotation period for automatic key rotations, the ability to perform on-demand key rotations, and visibility into your key material rotations. +* api-change:``mediatailor``: Added InsertionMode to PlaybackConfigurations. This setting controls whether players can use stitched or guided ad insertion. The default for players that do not specify an insertion mode is stitched. +* api-change:``neptune-graph``: Update to API documentation to resolve customer reported issues. +* api-change:``outposts``: This release adds EXPEDITORS as a valid shipment carrier. +* api-change:``redshift``: Adds support for Amazon Redshift DescribeClusterSnapshots API to include Snapshot ARN response field. +* api-change:``transfer``: This change releases support for importing self signed certificates to the Transfer Family for sending outbound file transfers over TLS/HTTPS. + + +1.34.83 +======= + +* api-change:``batch``: This release adds the task properties field to attempt details and the name field on EKS container detail. +* api-change:``cloudfront``: CloudFront origin access control extends support to AWS Lambda function URLs and AWS Elemental MediaPackage v2 origins. +* api-change:``cloudwatch``: This release adds support for Metric Characteristics for CloudWatch Anomaly Detection. Anomaly Detector now takes Metric Characteristics object with Periodic Spikes boolean field that tells Anomaly Detection that spikes that repeat at the same time every week are part of the expected pattern. +* api-change:``codebuild``: Support access tokens for Bitbucket sources +* api-change:``iam``: For CreateOpenIDConnectProvider API, the ThumbprintList parameter is no longer required. +* api-change:``medialive``: AWS Elemental MediaLive introduces workflow monitor, a new feature that enables the visualization and monitoring of your media workflows. Create signal maps of your existing workflows and monitor them by creating notification and monitoring template groups. +* api-change:``omics``: This release adds support for retrieval of S3 direct access metadata on sequence stores and read sets, and adds support for SHA256up and SHA512up HealthOmics ETags. +* api-change:``pipes``: LogConfiguration ARN validation fixes +* api-change:``rds``: Updates Amazon RDS documentation for Standard Edition 2 support in RDS Custom for Oracle. +* api-change:``s3control``: Documentation updates for Amazon S3-control. + + +1.34.82 +======= + +* api-change:``cleanrooms``: AWS Clean Rooms Differential Privacy is now fully available. Differential privacy protects against user-identification attempts. +* api-change:``connect``: This release adds new Submit Auto Evaluation Action for Amazon Connect Rules. +* api-change:``networkmonitor``: Examples were added to CloudWatch Network Monitor commands. +* api-change:``qconnect``: This release adds a new QiC public API updateSession and updates an existing QiC public API createSession +* api-change:``rekognition``: Added support for ContentType to content moderation detections. +* api-change:``supplychain``: This release includes API SendDataIntegrationEvent for AWS Supply Chain +* api-change:``workspaces-thin-client``: Adding tags field to SoftwareSet. Removing tags fields from Summary objects. Changing the list of exceptions in tagging APIs. Fixing an issue where the SDK returns empty tags in Get APIs. + + +1.34.81 +======= + +* api-change:``codebuild``: Add new webhook filter types for GitHub webhooks +* api-change:``mediaconvert``: This release includes support for bringing your own fonts to use for burn-in or DVB-Sub captioning workflows. +* api-change:``pinpoint``: The OrchestrationSendingRoleArn has been added to the email channel and is used to send emails from campaigns or journeys. +* api-change:``rds``: This release adds support for specifying the CA certificate to use for the new db instance when restoring from db snapshot, restoring from s3, restoring to point in time, and creating a db instance read replica. + + +1.34.80 +======= + +* api-change:``controlcatalog``: This is the initial SDK release for AWS Control Catalog, a central catalog for AWS managed controls. This release includes 3 new APIs - ListDomains, ListObjectives, and ListCommonControls - that vend high-level data to categorize controls across the AWS platform. +* api-change:``mgn``: Added USE_SOURCE as default option to LaunchConfigurationTemplate bootMode parameter. +* api-change:``networkmonitor``: Updated the allowed monitorName length for CloudWatch Network Monitor. + + +1.34.79 +======= + +* api-change:``quicksight``: Adding IAMIdentityCenterInstanceArn parameter to CreateAccountSubscription +* api-change:``resource-groups``: Added a new QueryErrorCode RESOURCE_TYPE_NOT_SUPPORTED that is returned by the ListGroupResources operation if the group query contains unsupported resource types. +* api-change:``verifiedpermissions``: Adding BatchIsAuthorizedWithToken API which supports multiple authorization requests against a PolicyStore given a bearer token. + + +1.34.78 +======= + +* api-change:``b2bi``: Adding support for X12 5010 HIPAA EDI version and associated transaction sets. +* api-change:``cleanrooms``: Feature: New schemaStatusDetails field to the existing Schema object that displays a status on Schema API responses to show whether a schema is queryable or not. New BatchGetSchemaAnalysisRule API to retrieve multiple schemaAnalysisRules using a single API call. +* api-change:``ec2``: Amazon EC2 G6 instances powered by NVIDIA L4 Tensor Core GPUs can be used for a wide range of graphics-intensive and machine learning use cases. Gr6 instances also feature NVIDIA L4 GPUs and can be used for graphics workloads with higher memory requirements. +* api-change:``emr-containers``: This release adds support for integration with EKS AccessEntry APIs to enable automatic Cluster Access for EMR on EKS. +* api-change:``ivs``: API update to include an SRT ingest endpoint and passphrase for all channels. +* api-change:``verifiedpermissions``: Adds GroupConfiguration field to Identity Source API's + + +1.34.77 +======= + +* api-change:``cleanroomsml``: The release includes a public SDK for AWS Clean Rooms ML APIs, making them globally available to developers worldwide. +* api-change:``cloudformation``: This release would return a new field - PolicyAction in cloudformation's existed DescribeChangeSetResponse, showing actions we are going to apply on the physical resource (e.g., Delete, Retain) according to the user's template +* api-change:``datazone``: This release supports the feature of dataQuality to enrich asset with dataQualityResult in Amazon DataZone. +* api-change:``docdb``: This release adds Global Cluster Switchover capability which enables you to change your global cluster's primary AWS Region, the region that serves writes, while preserving the replication between all regions in the global cluster. +* api-change:``groundstation``: This release adds visibilityStartTime and visibilityEndTime to DescribeContact and ListContacts responses. +* api-change:``lambda``: Add Ruby 3.3 (ruby3.3) support to AWS Lambda +* api-change:``medialive``: Cmaf Ingest outputs are now supported in Media Live +* api-change:``medical-imaging``: SearchImageSets API now supports following enhancements - Additional support for searching on UpdatedAt and SeriesInstanceUID - Support for searching existing filters between dates/times - Support for sorting the search result by Ascending/Descending - Additional parameters returned in the response +* api-change:``transfer``: Add ability to specify Security Policies for SFTP Connectors + + +1.34.76 +======= + +* api-change:``ecs``: Documentation only update for Amazon ECS. +* api-change:``glue``: Adding View related fields to responses of read-only Table APIs. +* api-change:``ivschat``: Doc-only update. Changed "Resources" to "Key Concepts" in docs and updated text. +* api-change:``rolesanywhere``: This release increases the limit on the roleArns request parameter for the *Profile APIs that support it. This parameter can now take up to 250 role ARNs. +* api-change:``securityhub``: Documentation updates for AWS Security Hub + + +1.34.75 +======= + +* api-change:``cloudwatch``: This release adds support for CloudWatch Anomaly Detection on cross-account metrics. SingleMetricAnomalyDetector and MetricDataQuery inputs to Anomaly Detection APIs now take an optional AccountId field. +* api-change:``datazone``: This release supports the feature of AI recommendations for descriptions to enrich the business data catalog in Amazon DataZone. +* api-change:``deadline``: AWS Deadline Cloud is a new fully managed service that helps customers set up, deploy, and scale rendering projects in minutes, so they can improve the efficiency of their rendering pipelines and take on more projects. +* api-change:``emr``: This release fixes a broken link in the documentation. +* api-change:``lightsail``: This release adds support to upgrade the TLS version of the distribution. + + +1.34.74 +======= + +* api-change:``b2bi``: Supporting new EDI X12 transaction sets for X12 versions 4010, 4030, and 5010. +* api-change:``codebuild``: Add new fleet status code for Reserved Capacity. +* api-change:``codeconnections``: Duplicating the CodeStar Connections service into the new, rebranded AWS CodeConnections service. +* api-change:``internetmonitor``: This release adds support to allow customers to track cross account monitors through ListMonitor, GetMonitor, ListHealthEvents, GetHealthEvent, StartQuery APIs. +* api-change:``iotwireless``: Add support for retrieving key historical and live metrics for LoRaWAN devices and gateways +* api-change:``marketplace-catalog``: This release enhances the ListEntities API to support ResaleAuthorizationId filter and sort for OfferEntity in the request and the addition of a ResaleAuthorizationId field in the response of OfferSummary. +* api-change:``neptune-graph``: Add the new API Start-Import-Task for Amazon Neptune Analytics. +* api-change:``sagemaker``: This release adds support for custom images for the CodeEditor App on SageMaker Studio + + +1.34.73 +======= + +* api-change:``codecatalyst``: This release adds support for understanding pending changes to subscriptions by including two new response parameters for the GetSubscription API for Amazon CodeCatalyst. +* api-change:``compute-optimizer``: This release enables AWS Compute Optimizer to analyze and generate recommendations with a new customization preference, Memory Utilization. +* api-change:``ec2``: Amazon EC2 C7gd, M7gd and R7gd metal instances with up to 3.8 TB of local NVMe-based SSD block-level storage have up to 45% improved real-time NVMe storage performance than comparable Graviton2-based instances. +* api-change:``eks``: Add multiple customer error code to handle customer caused failure when managing EKS node groups +* api-change:``guardduty``: Add EC2 support for GuardDuty Runtime Monitoring auto management. +* api-change:``neptune-graph``: Update ImportTaskCancelled waiter to evaluate task state correctly and minor documentation changes. +* api-change:``oam``: This release adds support for sharing AWS::InternetMonitor::Monitor resources. +* api-change:``quicksight``: Amazon QuickSight: Adds support for setting up VPC Endpoint restrictions for accessing QuickSight Website. + + +1.34.72 +======= + +* api-change:``batch``: This feature allows AWS Batch to support configuration of imagePullSecrets and allowPrivilegeEscalation for jobs running on EKS +* api-change:``bedrock-agent``: This changes introduces metadata documents statistics and also updates the documentation for bedrock agent. +* api-change:``bedrock-agent-runtime``: This release introduces filtering support on Retrieve and RetrieveAndGenerate APIs. +* api-change:``elasticache``: Added minimum capacity to Amazon ElastiCache Serverless. This feature allows customer to ensure minimum capacity even without current load +* api-change:``secretsmanager``: Documentation updates for Secrets Manager + + +1.34.71 +======= + +* api-change:``bedrock-agent-runtime``: This release adds support to customize prompts sent through the RetrieveAndGenerate API in Agents for Amazon Bedrock. +* api-change:``ce``: Adds support for backfill of cost allocation tags, with new StartCostAllocationTagBackfill and ListCostAllocationTagBackfillHistory API. +* api-change:``ec2``: Documentation updates for Elastic Compute Cloud (EC2). +* api-change:``ecs``: This is a documentation update for Amazon ECS. +* api-change:``finspace``: Add new operation delete-kx-cluster-node and add status parameter to list-kx-cluster-node operation. + + +1.34.70 +======= + +* api-change:``codebuild``: Supporting GitLab and GitLab Self Managed as source types in AWS CodeBuild. +* api-change:``ec2``: Added support for ModifyInstanceMetadataDefaults and GetInstanceMetadataDefaults to set Instance Metadata Service account defaults +* api-change:``ecs``: Documentation only update for Amazon ECS. +* api-change:``emr-containers``: This release increases the number of supported job template parameters from 20 to 100. +* api-change:``globalaccelerator``: AWS Global Accelerator now supports cross-account sharing for bring your own IP addresses. +* api-change:``medialive``: Exposing TileMedia H265 options +* api-change:``sagemaker``: Introduced support for the following new instance types on SageMaker Studio for JupyterLab and CodeEditor applications: m6i, m6id, m7i, c6i, c6id, c7i, r6i, r6id, r7i, and p5 + + +1.34.69 +======= + +* api-change:``firehose``: Updates Amazon Firehose documentation for message regarding Enforcing Tags IAM Policy. +* api-change:``kendra``: Documentation update, March 2024. Corrects some docs for Amazon Kendra. +* api-change:``pricing``: Add ResourceNotFoundException to ListPriceLists and GetPriceListFileUrl APIs +* api-change:``rolesanywhere``: This release relaxes constraints on the durationSeconds request parameter for the *Profile APIs that support it. This parameter can now take on values that go up to 43200. +* api-change:``securityhub``: Added new resource detail object to ASFF, including resource for LastKnownExploitAt + + +1.34.68 +======= + +* api-change:``codeartifact``: This release adds Package groups to CodeArtifact so you can more conveniently configure package origin controls for multiple packages. + + +1.34.67 +======= + +* api-change:``accessanalyzer``: This release adds support for policy validation and external access findings for DynamoDB tables and streams. IAM Access Analyzer helps you author functional and secure resource-based policies and identify cross-account access. Updated service API, documentation, and paginators. +* api-change:``codebuild``: This release adds support for new webhook events (RELEASED and PRERELEASED) and filter types (TAG_NAME and RELEASE_NAME). +* api-change:``connect``: This release updates the *InstanceStorageConfig APIs to support a new ResourceType: REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS. Use this resource type to enable streaming for real-time analysis of chat contacts and to associate a Kinesis stream where real-time analysis chat segments will be published. +* api-change:``dynamodb``: This release introduces 3 new APIs ('GetResourcePolicy', 'PutResourcePolicy' and 'DeleteResourcePolicy') and modifies the existing 'CreateTable' API for the resource-based policy support. It also modifies several APIs to accept a 'TableArn' for the 'TableName' parameter. +* api-change:``managedblockchain-query``: AMB Query: update GetTransaction to include transactionId as input +* api-change:``savingsplans``: Introducing the Savings Plans Return feature enabling customers to return their Savings Plans within 7 days of purchase. + + +1.34.66 +======= + +* api-change:``cloudformation``: Documentation update, March 2024. Corrects some formatting. +* api-change:``ec2``: This release adds the new DescribeMacHosts API operation for getting information about EC2 Mac Dedicated Hosts. Users can now see the latest macOS versions that their underlying Apple Mac can support without needing to be updated. +* api-change:``finspace``: Adding new attributes readWrite and onDemand to dataview models for Database Maintenance operations. +* api-change:``logs``: Update LogSamples field in Anomaly model to be a list of LogEvent +* api-change:``managedblockchain-query``: Introduces a new API for Amazon Managed Blockchain Query: ListFilteredTransactionEvents. + + +1.34.65 +======= + +* api-change:``cloudformation``: This release supports for a new API ListStackSetAutoDeploymentTargets, which provider auto-deployment configuration as a describable resource. Customers can now view the specific combinations of regions and OUs that are being auto-deployed. +* api-change:``kms``: Adds the ability to use the default policy name by omitting the policyName parameter in calls to PutKeyPolicy and GetKeyPolicy +* api-change:``mediatailor``: This release adds support to allow customers to show different content within a channel depending on metadata associated with the viewer. +* api-change:``rds``: This release launches the ModifyIntegration API and support for data filtering for zero-ETL Integrations. +* api-change:``s3``: Fix two issues with response root node names. +* api-change:``timestream-query``: Documentation updates, March 2024 + + +1.34.64 +======= + +* api-change:``backup``: This release introduces a boolean attribute ManagedByAWSBackupOnly as part of ListRecoveryPointsByResource api to filter the recovery points based on ownership. This attribute can be used to filter out the recovery points protected by AWSBackup. +* api-change:``codebuild``: AWS CodeBuild now supports overflow behavior on Reserved Capacity. +* api-change:``connect``: This release adds Hierarchy based Access Control fields to Security Profile public APIs and adds support for UserAttributeFilter to SearchUsers API. +* api-change:``ec2``: Add media accelerator and neuron device information on the describe instance types API. +* api-change:``kinesisanalyticsv2``: Support for Flink 1.18 in Managed Service for Apache Flink +* api-change:``s3``: Documentation updates for Amazon S3. +* api-change:``sagemaker``: Adds m6i, m6id, m7i, c6i, c6id, c7i, r6i r6id, r7i, p5 instance type support to Sagemaker Notebook Instances and miscellaneous wording fixes for previous Sagemaker documentation. +* api-change:``workspaces-thin-client``: Removed unused parameter kmsKeyArn from UpdateDeviceRequest + + +1.34.63 +======= + +* api-change:``amplify``: Documentation updates for Amplify. Identifies the APIs available only to apps created using Amplify Gen 1. +* api-change:``ec2-instance-connect``: This release includes a new exception type "SerialConsoleSessionUnsupportedException" for SendSerialConsoleSSHPublicKey API. +* api-change:``elbv2``: This release allows you to configure HTTP client keep-alive duration for communication between clients and Application Load Balancers. +* api-change:``fis``: This release adds support for previewing target resources before running a FIS experiment. It also adds resource ARNs for actions, experiments, and experiment templates to API responses. +* api-change:``iot-roborunner``: The iot-roborunner client has been removed following the deprecation of the service. +* api-change:``rds``: Updates Amazon RDS documentation for EBCDIC collation for RDS for Db2. +* api-change:``secretsmanager``: Doc only update for Secrets Manager +* api-change:``timestream-influxdb``: This is the initial SDK release for Amazon Timestream for InfluxDB. Amazon Timestream for InfluxDB is a new time-series database engine that makes it easy for application developers and DevOps teams to run InfluxDB databases on AWS for near real-time time-series applications using open source APIs. +* enhancement:``urllib3``: Added support for urllib3 2.2.1+ in Python 3.10+ + + +1.34.62 +======= + +* api-change:``ivs-realtime``: adds support for multiple new composition layout configuration options (grid, pip) +* api-change:``kinesisanalyticsv2``: Support new RuntimeEnvironmentUpdate parameter within UpdateApplication API allowing callers to change the Flink version upon which their application runs. +* api-change:``s3``: This release makes the default option for S3 on Outposts request signing to use the SigV4A algorithm when using AWS Common Runtime (CRT). + + +1.34.61 +======= + +* api-change:``cloudformation``: CloudFormation documentation update for March, 2024 +* api-change:``connect``: This release increases MaxResults limit to 500 in request for SearchUsers, SearchQueues and SearchRoutingProfiles APIs of Amazon Connect. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``kafka``: Added support for specifying the starting position of topic replication in MSK-Replicator. +* api-change:``ssm``: March 2024 doc-only updates for Systems Manager. + + +1.34.60 +======= + +* api-change:``codestar-connections``: Added a sync configuration enum to disable publishing of deployment status to source providers (PublishDeploymentStatus). Added a sync configuration enum (TriggerStackUpdateOn) to only trigger changes. +* api-change:``elasticache``: Revisions to API text that are now to be carried over to SDK text, changing usages of "SFO" in code examples to "us-west-1", and some other typos. +* api-change:``mediapackagev2``: This release enables customers to safely update their MediaPackage v2 channel groups, channels and origin endpoints using entity tags. + + +1.34.59 +======= + +* api-change:``batch``: This release adds JobStateTimeLimitActions setting to the Job Queue API. It allows you to configure an action Batch can take for a blocking job in front of the queue after the defined period of time. The new parameter applies for ECS, EKS, and FARGATE Job Queues. +* api-change:``bedrock-agent-runtime``: Documentation update for Bedrock Runtime Agent +* api-change:``cloudtrail``: Added exceptions to CreateTrail, DescribeTrails, and ListImportFailures APIs. +* api-change:``codebuild``: This release adds support for a new webhook event: PULL_REQUEST_CLOSED. +* api-change:``cognito-idp``: Add ConcurrentModificationException to SetUserPoolMfaConfig +* api-change:``guardduty``: Add RDS Provisioned and Serverless Usage types +* api-change:``transfer``: Added DES_EDE3_CBC to the list of supported encryption algorithms for messages sent with an AS2 connector. + + +1.34.58 +======= + +* api-change:``appconfig``: AWS AppConfig now supports dynamic parameters, which enhance the functionality of AppConfig Extensions by allowing you to provide parameter values to your Extensions at the time you deploy your configuration. +* api-change:``ec2``: This release adds an optional parameter to RegisterImage and CopyImage APIs to support tagging AMIs at the time of creation. +* api-change:``grafana``: Adds support for the new GrafanaToken as part of the Amazon Managed Grafana Enterprise plugins upgrade to associate your AWS account with a Grafana Labs account. +* api-change:``lambda``: Documentation updates for AWS Lambda +* api-change:``payment-cryptography-data``: AWS Payment Cryptography EMV Decrypt Feature Release +* api-change:``rds``: Updates Amazon RDS documentation for io2 storage for Multi-AZ DB clusters +* api-change:``snowball``: Doc-only update for change to EKS-Anywhere ordering. +* api-change:``wafv2``: You can increase the max request body inspection size for some regional resources. The size setting is in the web ACL association config. Also, the AWSManagedRulesBotControlRuleSet EnableMachineLearning setting now takes a Boolean instead of a primitive boolean type, for languages like Java. +* api-change:``workspaces``: Added note for user decoupling + + +1.34.57 +======= + +* api-change:``dynamodb``: Doc only updates for DynamoDB documentation +* api-change:``imagebuilder``: Add PENDING status to Lifecycle Execution resource status. Add StartTime and EndTime to ListLifecycleExecutionResource API response. +* api-change:``mwaa``: Amazon MWAA adds support for Apache Airflow v2.8.1. +* api-change:``rds``: Updated the input of CreateDBCluster and ModifyDBCluster to support setting CA certificates. Updated the output of DescribeDBCluster to show current CA certificate setting value. +* api-change:``redshift``: Update for documentation only. Covers port ranges, definition updates for data sharing, and definition updates to cluster-snapshot documentation. +* api-change:``verifiedpermissions``: Deprecating details in favor of configuration for GetIdentitySource and ListIdentitySources APIs. + + +1.34.56 +======= + +* api-change:``apigateway``: Documentation updates for Amazon API Gateway +* api-change:``chatbot``: Minor update to documentation. +* api-change:``organizations``: This release contains an endpoint addition +* api-change:``sesv2``: Adds support for providing custom headers within SendEmail and SendBulkEmail for SESv2. + + +1.34.55 +======= + +* api-change:``cloudformation``: Add DetailedStatus field to DescribeStackEvents and DescribeStacks APIs +* api-change:``fsx``: Added support for creating FSx for NetApp ONTAP file systems with up to 12 HA pairs, delivering up to 72 GB/s of read throughput and 12 GB/s of write throughput. +* api-change:``organizations``: Documentation update for AWS Organizations + + +1.34.54 +======= + +* api-change:``accessanalyzer``: Fixed a typo in description field. +* api-change:``autoscaling``: With this release, Amazon EC2 Auto Scaling groups, EC2 Fleet, and Spot Fleet improve the default price protection behavior of attribute-based instance type selection of Spot Instances, to consistently select from a wide range of instance types. +* api-change:``ec2``: With this release, Amazon EC2 Auto Scaling groups, EC2 Fleet, and Spot Fleet improve the default price protection behavior of attribute-based instance type selection of Spot Instances, to consistently select from a wide range of instance types. + + +1.34.53 +======= + +* api-change:``docdb-elastic``: Launched Elastic Clusters Readable Secondaries, Start/Stop, Configurable Shard Instance count, Automatic Backups and Snapshot Copying +* api-change:``eks``: Added support for new AL2023 AMIs to the supported AMITypes. +* api-change:``lexv2-models``: This release makes AMAZON.QnAIntent generally available in Amazon Lex. This generative AI feature leverages large language models available through Amazon Bedrock to automate frequently asked questions (FAQ) experience for end-users. +* api-change:``migrationhuborchestrator``: Adds new CreateTemplate, UpdateTemplate and DeleteTemplate APIs. +* api-change:``quicksight``: TooltipTarget for Combo chart visuals; ColumnConfiguration limit increase to 2000; Documentation Update +* api-change:``sagemaker``: Adds support for ModelDataSource in Model Packages to support unzipped models. Adds support to specify SourceUri for models which allows registration of models without mandating a container for hosting. Using SourceUri, customers can decouple the model from hosting information during registration. +* api-change:``securitylake``: Add capability to update the Data Lake's MetaStoreManager Role in order to perform required data lake updates to use Iceberg table format in their data lake or update the role for any other reason. + + +1.34.52 +======= + +* api-change:``batch``: This release adds Batch support for configuration of multicontainer jobs in ECS, Fargate, and EKS. This support is available for all types of jobs, including both array jobs and multi-node parallel jobs. +* api-change:``bedrock-agent-runtime``: This release adds support to override search strategy performed by the Retrieve and RetrieveAndGenerate APIs for Amazon Bedrock Agents +* api-change:``ce``: This release introduces the new API 'GetApproximateUsageRecords', which retrieves estimated usage records for hourly granularity or resource-level data at daily granularity. +* api-change:``ec2``: This release increases the range of MaxResults for GetNetworkInsightsAccessScopeAnalysisFindings to 1,000. +* api-change:``iot``: This release reduces the maximum results returned per query invocation from 500 to 100 for the SearchIndex API. This change has no implications as long as the API is invoked until the nextToken is NULL. +* api-change:``wafv2``: AWS WAF now supports configurable time windows for request aggregation with rate-based rules. Customers can now select time windows of 1 minute, 2 minutes or 10 minutes, in addition to the previously supported 5 minutes. + + +1.34.51 +======= + +* api-change:``amplifyuibuilder``: We have added the ability to tag resources after they are created + + +1.34.50 +======= + +* api-change:``apigateway``: Documentation updates for Amazon API Gateway. +* api-change:``drs``: Added volume status to DescribeSourceServer replicated volumes. +* api-change:``kafkaconnect``: Adds support for tagging, with new TagResource, UntagResource and ListTagsForResource APIs to manage tags and updates to existing APIs to allow tag on create. This release also adds support for the new DeleteWorkerConfiguration API. +* api-change:``rds``: This release adds support for gp3 data volumes for Multi-AZ DB Clusters. + + +1.34.49 +======= + +* api-change:``appsync``: Documentation only updates for AppSync +* api-change:``qldb``: Clarify possible values for KmsKeyArn and EncryptionDescription. +* api-change:``rds``: Add pattern and length based validations for DBShardGroupIdentifier +* api-change:``rum``: Doc-only update for new RUM metrics that were added + + +1.34.48 +======= + +* api-change:``internetmonitor``: This release adds IPv4 prefixes to health events +* api-change:``kinesisvideo``: Increasing NextToken parameter length restriction for List APIs from 512 to 1024. + + +1.34.47 +======= + +* api-change:``iotevents``: Increase the maximum length of descriptions for Inputs, Detector Models, and Alarm Models +* api-change:``lookoutequipment``: This release adds a field exposing model quality to read APIs for models. It also adds a model quality field to the API response when creating an inference scheduler. +* api-change:``medialive``: MediaLive now supports the ability to restart pipelines in a running channel. +* api-change:``ssm``: This release adds support for sharing Systems Manager parameters with other AWS accounts. + + +1.34.46 +======= + +* api-change:``dynamodb``: Publishing quick fix for doc only update. +* api-change:``firehose``: This release updates a few Firehose related APIs. +* api-change:``lambda``: Add .NET 8 (dotnet8) Runtime support to AWS Lambda. + + +1.34.45 +======= + +* api-change:``amplify``: This release contains API changes that enable users to configure their Amplify domains with their own custom SSL/TLS certificate. +* api-change:``chatbot``: This release adds support for AWS Chatbot. You can now monitor, operate, and troubleshoot your AWS resources with interactive ChatOps using the AWS SDK. +* api-change:``config``: Documentation updates for the AWS Config CLI +* api-change:``ivs``: Changed description for latencyMode in Create/UpdateChannel and Channel/ChannelSummary. +* api-change:``keyspaces``: Documentation updates for Amazon Keyspaces +* api-change:``mediatailor``: MediaTailor: marking #AdBreak.OffsetMillis as required. + + +1.34.44 +======= + +* api-change:``connectparticipant``: Doc only update to GetTranscript API reference guide to inform users about presence of events in the chat transcript. +* api-change:``emr``: adds fine grained control over Unhealthy Node Replacement to Amazon ElasticMapReduce +* api-change:``firehose``: This release adds support for Data Message Extraction for decompressed CloudWatch logs, and to use a custom file extension or time zone for S3 destinations. +* api-change:``lambda``: Documentation-only updates for Lambda to clarify a number of existing actions and properties. +* api-change:``rds``: Doc only update for a valid option in DB parameter group +* api-change:``sns``: This release marks phone numbers as sensitive inputs. + + +1.34.43 +======= + +* api-change:``artifact``: This is the initial SDK release for AWS Artifact. AWS Artifact provides on-demand access to compliance and third-party compliance reports. This release includes access to List and Get reports, along with their metadata. This release also includes access to AWS Artifact notifications settings. +* api-change:``codepipeline``: Add ability to override timeout on action level. +* api-change:``detective``: Doc only updates for content enhancement +* api-change:``guardduty``: Marked fields IpAddressV4, PrivateIpAddress, Email as Sensitive. +* api-change:``healthlake``: This release adds a new response parameter, JobProgressReport, to the DescribeFHIRImportJob and ListFHIRImportJobs API operation. JobProgressReport provides details on the progress of the import job on the server. +* api-change:``opensearch``: Adds additional supported instance types. +* api-change:``polly``: Amazon Polly adds 1 new voice - Burcu (tr-TR) +* api-change:``sagemaker``: This release adds a new API UpdateClusterSoftware for SageMaker HyperPod. This API allows users to patch HyperPod clusters with latest platform softwares. +* api-change:``secretsmanager``: Doc only update for Secrets Manager +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.42 +======= + +* api-change:``controltower``: Adds support for new Baseline and EnabledBaseline APIs for automating multi-account governance. +* api-change:``lookoutequipment``: This feature allows customers to see pointwise model diagnostics results for their models. +* api-change:``qbusiness``: This release adds the metadata-boosting feature, which allows customers to easily fine-tune the underlying ranking of retrieved RAG passages in order to optimize Q&A answer relevance. It also adds new feedback reasons for the PutFeedback API. + + +1.34.41 +======= + +* bugfix:ContainerProvider: Properly refreshes token from file from EKS in ContainerProvider +* api-change:``lightsail``: This release adds support to upgrade the major version of a database. +* api-change:``marketplace-catalog``: AWS Marketplace Catalog API now supports setting intent on requests +* api-change:``resource-explorer-2``: Resource Explorer now uses newly supported IPv4 'amazonaws.com' endpoints by default. +* api-change:``securitylake``: Documentation updates for Security Lake +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.40 +======= + +* api-change:``appsync``: Adds support for new options on GraphqlAPIs, Resolvers and Data Sources for emitting Amazon CloudWatch metrics for enhanced monitoring of AppSync APIs. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``neptune-graph``: Adding a new option "parameters" for data plane api ExecuteQuery to support running parameterized query via SDK. +* api-change:``route53domains``: This release adds bill contact support for RegisterDomain, TransferDomain, UpdateDomainContact and GetDomainDetail API. + + +1.34.39 +======= + +* api-change:``amp``: Overall documentation updates. +* api-change:``batch``: This feature allows Batch to support configuration of repository credentials for jobs running on ECS +* api-change:``braket``: Creating a job will result in DeviceOfflineException when using an offline device, and DeviceRetiredException when using a retired device. +* api-change:``cost-optimization-hub``: Adding includeMemberAccounts field to the response of ListEnrollmentStatuses API. +* api-change:``ecs``: Documentation only update for Amazon ECS. +* api-change:``iot``: This release allows AWS IoT Core users to enable Online Certificate Status Protocol (OCSP) Stapling for TLS X.509 Server Certificates when creating and updating AWS IoT Domain Configurations with Custom Domain. +* api-change:``pricing``: Add Throttling Exception to all APIs. + + +1.34.38 +======= + +* api-change:``codepipeline``: Add ability to execute pipelines with new parallel & queued execution modes and add support for triggers with filtering on branches and file paths. +* api-change:``quicksight``: General Interactions for Visuals; Waterfall Chart Color Configuration; Documentation Update +* api-change:``workspaces``: This release introduces User-Decoupling feature. This feature allows Workspaces Core customers to provision workspaces without providing users. CreateWorkspaces and DescribeWorkspaces APIs will now take a new optional parameter "WorkspaceName". + + +1.34.37 +======= + +* api-change:``datasync``: AWS DataSync now supports manifests for specifying files or objects to transfer. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``redshift``: LisRecommendations API to fetch Amazon Redshift Advisor recommendations. + + +1.34.36 +======= + +* api-change:``appsync``: Support for environment variables in AppSync GraphQL APIs +* api-change:``ecs``: This release is a documentation only update to address customer issues. +* api-change:``es``: This release adds clear visibility to the customers on the changes that they make on the domain. +* api-change:``logs``: This release adds a new field, logGroupArn, to the response of the logs:DescribeLogGroups action. +* api-change:``opensearch``: This release adds clear visibility to the customers on the changes that they make on the domain. +* api-change:``wafv2``: You can now delete an API key that you've created for use with your CAPTCHA JavaScript integration API. + + +1.34.35 +======= + +* api-change:``glue``: Introduce Catalog Encryption Role within Glue Data Catalog Settings. Introduce SASL/PLAIN as an authentication method for Glue Kafka connections +* api-change:``workspaces``: Added definitions of various WorkSpace states + + +1.34.34 +======= + +* api-change:``dynamodb``: Any number of users can execute up to 50 concurrent restores (any type of restore) in a given account. +* api-change:``sagemaker``: Amazon SageMaker Canvas adds GenerativeAiSettings support for CanvasAppSettings. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.33 +======= + +* api-change:``cognito-idp``: Added CreateIdentityProvider and UpdateIdentityProvider details for new SAML IdP features +* api-change:``ivs``: This release introduces a new resource Playback Restriction Policy which can be used to geo-restrict or domain-restrict channel stream playback when associated with a channel. New APIs to support this resource were introduced in the form of Create/Delete/Get/Update/List. +* api-change:``managedblockchain-query``: This release adds support for transactions that have not reached finality. It also removes support for the status property from the response of the GetTransaction operation. You can use the confirmationStatus and executionStatus properties to determine the status of the transaction. +* api-change:``mediaconvert``: This release includes support for broadcast-mixed audio description tracks. +* api-change:``neptune-graph``: Adding new APIs in SDK for Amazon Neptune Analytics. These APIs include operations to execute, cancel, list queries and get the graph summary. + + +1.34.32 +======= + +* api-change:``cloudformation``: CloudFormation IaC generator allows you to scan existing resources in your account and select resources to generate a template for a new or existing CloudFormation stack. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``glue``: Update page size limits for GetJobRuns and GetTriggers APIs. +* api-change:``ssm``: This release adds an optional Duration parameter to StateManager Associations. This allows customers to specify how long an apply-only-on-cron association execution should run. Once the specified Duration is out all the ongoing cancellable commands or automations are cancelled. + + +1.34.31 +======= + +* api-change:``datazone``: Add new skipDeletionCheck to DeleteDomain. Add new skipDeletionCheck to DeleteProject which also automatically deletes dependent objects +* api-change:``route53``: Update the SDKs for text changes in the APIs. + + +1.34.30 +======= + +* api-change:``autoscaling``: EC2 Auto Scaling customers who use attribute based instance-type selection can now intuitively define their Spot instances price protection limit as a percentage of the lowest priced On-Demand instance type. +* api-change:``comprehend``: Comprehend PII analysis now supports Spanish input documents. +* api-change:``ec2``: EC2 Fleet customers who use attribute based instance-type selection can now intuitively define their Spot instances price protection limit as a percentage of the lowest priced On-Demand instance type. +* api-change:``mwaa``: This release adds MAINTENANCE environment status for Amazon MWAA environments. +* api-change:``rds``: Introduced support for the InsufficientDBInstanceCapacityFault error in the RDS RestoreDBClusterFromSnapshot and RestoreDBClusterToPointInTime API methods. This provides enhanced error handling, ensuring a more robust experience. +* api-change:``snowball``: Modified description of createaddress to include direction to add path when providing a JSON file. + + +1.34.29 +======= + +* api-change:``connect``: Update list and string length limits for predefined attributes. +* api-change:``inspector2``: This release adds ECR container image scanning based on their lastRecordedPullTime. +* api-change:``sagemaker``: Amazon SageMaker Automatic Model Tuning now provides an API to programmatically delete tuning jobs. + + +1.34.28 +======= + +* api-change:``acm-pca``: AWS Private CA now supports an option to omit the CDP extension from issued certificates, when CRL revocation is enabled. +* api-change:``lightsail``: This release adds support for IPv6-only instance plans. + + +1.34.27 +======= + +* api-change:``ec2``: Introduced a new clientToken request parameter on CreateNetworkAcl and CreateRouteTable APIs. The clientToken parameter allows idempotent operations on the APIs. +* api-change:``ecs``: Documentation updates for Amazon ECS. +* api-change:``outposts``: DeviceSerialNumber parameter is now optional in StartConnection API +* api-change:``rds``: This release adds support for Aurora Limitless Database. +* api-change:``storagegateway``: Add DeprecationDate and SoftwareVersion to response of ListGateways. + + +1.34.26 +======= + +* api-change:``inspector2``: This release adds support for CIS scans on EC2 instances. + + +1.34.25 +======= + +* enhancement:documentation: Updates the GitHub issue creation link in our README + + +1.34.24 +======= + +* api-change:``appconfigdata``: Fix FIPS Endpoints in aws-us-gov. +* api-change:``cloud9``: Doc-only update around removing AL1 from list of available AMIs for Cloud9 +* api-change:``cloudfront-keyvaluestore``: This release improves upon the DescribeKeyValueStore API by returning two additional fields, Status of the KeyValueStore and the FailureReason in case of failures during creation of KeyValueStore. +* api-change:``connectcases``: This release adds the ability to view audit history on a case and introduces a new parameter, performedBy, for CreateCase and UpdateCase API's. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``ecs``: This release adds support for Transport Layer Security (TLS) and Configurable Timeout to ECS Service Connect. TLS facilitates privacy and data security for inter-service communications, while Configurable Timeout allows customized per-request timeout and idle timeout for Service Connect services. +* api-change:``finspace``: Allow customer to set zip default through command line arguments. +* api-change:``organizations``: Doc only update for quota increase change +* api-change:``rds``: Introduced support for the InsufficientDBInstanceCapacityFault error in the RDS CreateDBCluster API method. This provides enhanced error handling, ensuring a more robust experience when creating database clusters with insufficient instance capacity. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.23 +======= + +* api-change:``athena``: Introducing new NotebookS3LocationUri parameter to Athena ImportNotebook API. Payload is no longer required and either Payload or NotebookS3LocationUri needs to be provided (not both) for a successful ImportNotebook API call. If both are provided, an InvalidRequestException will be thrown. +* api-change:``codebuild``: Release CodeBuild Reserved Capacity feature +* api-change:``dynamodb``: This release adds support for including ApproximateCreationDateTimePrecision configurations in EnableKinesisStreamingDestination API, adds the same as an optional field in the response of DescribeKinesisStreamingDestination, and adds support for a new UpdateKinesisStreamingDestination API. +* api-change:``qconnect``: Increased Quick Response name max length to 100 + + +1.34.22 +======= + +* api-change:``b2bi``: Increasing TestMapping inputFileContent file size limit to 5MB and adding file size limit 250KB for TestParsing input file. This release also includes exposing InternalServerException for Tag APIs. +* api-change:``cloudtrail``: This release adds a new API ListInsightsMetricData to retrieve metric data from CloudTrail Insights. +* api-change:``connect``: GetMetricDataV2 now supports 3 groupings +* api-change:``drs``: Removed invalid and unnecessary default values. +* api-change:``firehose``: Allow support for Snowflake as a Kinesis Data Firehose delivery destination. +* api-change:``sagemaker-featurestore-runtime``: Increase BatchGetRecord limits from 10 items to 100 items + + +1.34.21 +======= + +* api-change:``dynamodb``: Updating note for enabling streams for UpdateTable. +* api-change:``keyspaces``: This release adds support for Multi-Region Replication with provisioned tables, and Keyspaces auto scaling APIs + + +1.34.20 +======= + +* api-change:``iot``: Revert release of LogTargetTypes +* api-change:``iotfleetwise``: Updated APIs: SignalNodeType query parameter has been added to ListSignalCatalogNodesRequest and ListVehiclesResponse has been extended with attributes field. +* api-change:``macie2``: This release adds support for analyzing Amazon S3 objects that are encrypted using dual-layer server-side encryption with AWS KMS keys (DSSE-KMS). It also adds support for reporting DSSE-KMS details in statistics and metadata about encryption settings for S3 buckets and objects. +* api-change:``payment-cryptography``: Provide an additional option for key exchange using RSA wrap/unwrap in addition to tr-34/tr-31 in ImportKey and ExportKey operations. Added new key usage (type) TR31_M1_ISO_9797_1_MAC_KEY, for use with Generate/VerifyMac dataplane operations with ISO9797 Algorithm 1 MAC calculations. +* api-change:``personalize-runtime``: Documentation updates for Amazon Personalize +* api-change:``personalize``: Documentation updates for Amazon Personalize. +* api-change:``rekognition``: This release adds ContentType and TaxonomyLevel attributes to DetectModerationLabels and GetMediaAnalysisJob API responses. +* api-change:``securityhub``: Documentation updates for AWS Security Hub + + +1.34.19 +======= + +* api-change:``sagemaker``: This release will have ValidationException thrown if certain invalid app types are provided. The release will also throw ValidationException if more than 10 account ids are provided in VpcOnlyTrustedAccounts. + + +1.34.18 +======= + +* api-change:``connect``: Supervisor Barge for Chat is now supported through the MonitorContact API. +* api-change:``connectparticipant``: Introduce new Supervisor participant role +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version +* api-change:``location``: Location SDK documentation update. Added missing fonts to the MapConfiguration data type. Updated note for the SubMunicipality property in the place data type. +* api-change:``mwaa``: This Amazon MWAA feature release includes new fields in CreateWebLoginToken response model. The new fields IamIdentity and AirflowIdentity will let you match identifications, as the Airflow identity length is currently hashed to 64 characters. +* api-change:``s3control``: S3 On Outposts team adds dualstack endpoints support for S3Control and S3Outposts API calls. +* api-change:``supplychain``: This release includes APIs CreateBillOfMaterialsImportJob and GetBillOfMaterialsImportJob. +* api-change:``transfer``: AWS Transfer Family now supports static IP addresses for SFTP & AS2 connectors and for async MDNs on AS2 servers. + + +1.34.17 +======= + +* api-change:``ec2``: This release adds support for adding an ElasticBlockStorage volume configurations in ECS RunTask/StartTask/CreateService/UpdateService APIs. The configuration allows for attaching EBS volumes to ECS Tasks. +* api-change:``ecs``: This release adds support for adding an ElasticBlockStorage volume configurations in ECS RunTask/StartTask/CreateService/UpdateService APIs. The configuration allows for attaching EBS volumes to ECS Tasks. +* api-change:``events``: Update events client to latest version +* api-change:``iot``: Add ConflictException to Update APIs of AWS IoT Software Package Catalog +* api-change:``iotfleetwise``: The following dataTypes have been removed: CUSTOMER_DECODED_INTERFACE in NetworkInterfaceType; CUSTOMER_DECODED_SIGNAL_INFO_IS_NULL in SignalDecoderFailureReason; CUSTOMER_DECODED_SIGNAL_NETWORK_INTERFACE_INFO_IS_NULL in NetworkInterfaceFailureReason; CUSTOMER_DECODED_SIGNAL in SignalDecoderType +* api-change:``secretsmanager``: Doc only update for Secrets Manager +* api-change:``workspaces``: Added AWS Workspaces RebootWorkspaces API - Extended Reboot documentation update + + +1.34.16 +======= + +* api-change:``connectcampaigns``: Minor pattern updates for Campaign and Dial Request API fields. +* api-change:``location``: This release adds API support for custom layers for the maps service APIs: CreateMap, UpdateMap, DescribeMap. +* api-change:``logs``: Add support for account level subscription filter policies to PutAccountPolicy, DescribeAccountPolicies, and DeleteAccountPolicy APIs. Additionally, PutAccountPolicy has been modified with new optional "selectionCriteria" parameter for resource selection. +* api-change:``qconnect``: QueryAssistant and GetRecommendations will be discontinued starting June 1, 2024. To receive generative responses after March 1, 2024 you will need to create a new Assistant in the Connect console and integrate the Amazon Q in Connect JavaScript library (amazon-q-connectjs) into your applications. +* api-change:``redshift-serverless``: Updates to ConfigParameter for RSS workgroup, removal of use_fips_ssl +* api-change:``route53``: Route53 now supports geoproximity routing in AWS regions +* api-change:``wisdom``: QueryAssistant and GetRecommendations will be discontinued starting June 1, 2024. To receive generative responses after March 1, 2024 you will need to create a new Assistant in the Connect console and integrate the Amazon Q in Connect JavaScript library (amazon-q-connectjs) into your applications. + + +1.34.15 +======= + +* api-change:``codebuild``: Aws CodeBuild now supports new compute type BUILD_GENERAL1_XLARGE +* api-change:``ec2``: Amazon EC2 R7iz bare metal instances are powered by custom 4th generation Intel Xeon Scalable processors. +* api-change:``route53resolver``: This release adds support for query type configuration on firewall rules that enables customers for granular action (ALLOW, ALERT, BLOCK) by DNS query type. + + +1.34.14 +======= + +* api-change:``connect``: Minor trait updates for User APIs +* api-change:``kms``: Documentation updates for AWS Key Management Service (KMS). +* api-change:``redshift-serverless``: use_fips_ssl and require_ssl parameter support for Workgroup, UpdateWorkgroup, and CreateWorkgroup + + +1.34.13 +======= + +* api-change:``config``: Updated ResourceType enum with new resource types onboarded by AWS Config in November and December 2023. +* api-change:``docdb``: Adding PerformanceInsightsEnabled and PerformanceInsightsKMSKeyId fields to DescribeDBInstances Response. +* api-change:``ecs``: This release adds support for managed instance draining which facilitates graceful termination of Amazon ECS instances. +* api-change:``es``: This release adds support for new or existing Amazon OpenSearch domains to enable TLS 1.3 or TLS 1.2 with perfect forward secrecy cipher suites for domain endpoints. +* api-change:``lightsail``: This release adds support to set up an HTTPS endpoint on an instance. +* api-change:``opensearch``: This release adds support for new or existing Amazon OpenSearch domains to enable TLS 1.3 or TLS 1.2 with perfect forward secrecy cipher suites for domain endpoints. +* api-change:``sagemaker``: Adding support for provisioned throughput mode for SageMaker Feature Groups +* api-change:``servicecatalog``: Added Idempotency token support to Service Catalog AssociateServiceActionWithProvisioningArtifact, DisassociateServiceActionFromProvisioningArtifact, DeleteServiceAction API +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.12 +======= + +* api-change:``connect``: Amazon Connect, Contact Lens Evaluation API increase evaluation notes max length to 3072. +* api-change:``mediaconvert``: This release includes video engine updates including HEVC improvements, support for ingesting VP9 encoded video in MP4 containers, and support for user-specified 3D LUTs. + + +1.34.11 +======= + +* api-change:``apprunner``: AWS App Runner adds Python 3.11 and Node.js 18 runtimes. +* api-change:``location``: This release introduces a new parameter to bypasses an API key's expiry conditions and delete the key. +* api-change:``quicksight``: Add LinkEntityArn support for different partitions; Add UnsupportedUserEditionException in UpdateDashboardLinks API; Add support for New Reader Experience Topics + + +1.34.10 +======= + +* api-change:``codestar-connections``: New integration with the GitLab self-managed provider type. +* api-change:``kinesis-video-archived-media``: NoDataRetentionException thrown when GetImages requested for a Stream that does not retain data (that is, has a DataRetentionInHours of 0). +* api-change:``sagemaker``: Amazon SageMaker Studio now supports Docker access from within app container + + +1.34.9 +====== + +* api-change:``emr``: Update emr client to latest version + + +1.34.8 +====== + +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.7 +====== + +* api-change:``bedrock-agent``: Adding Claude 2.1 support to Bedrock Agents +* api-change:``glue``: This release adds additional configurations for Query Session Context on the following APIs: GetUnfilteredTableMetadata, GetUnfilteredPartitionMetadata, GetUnfilteredPartitionsMetadata. +* api-change:``lakeformation``: This release adds additional configurations on GetTemporaryGlueTableCredentials for Query Session Context. +* api-change:``mediaconnect``: This release adds the DescribeSourceMetadata API. This API can be used to view the stream information of the flow's source. +* api-change:``networkmonitor``: CloudWatch Network Monitor is a new service within CloudWatch that will help network administrators and operators continuously monitor network performance metrics such as round-trip-time and packet loss between their AWS-hosted applications and their on-premises locations. +* api-change:``omics``: Provides minor corrections and an updated description of APIs. +* api-change:``secretsmanager``: Update endpoint rules and examples. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.6 +====== + +* enhancement:AWSCRT: Update awscrt version to 0.19.19 +* api-change:``amp``: This release updates Amazon Managed Service for Prometheus APIs to support customer managed KMS keys. +* api-change:``appintegrations``: The Amazon AppIntegrations service adds DeleteApplication API for deleting applications, and updates APIs to support third party applications reacting to workspace events and make data requests to Amazon Connect for agent and contact events. +* api-change:``bedrock-agent``: This release introduces Amazon Aurora as a vector store on Knowledge Bases for Amazon Bedrock +* api-change:``codecommit``: AWS CodeCommit now supports customer managed keys from AWS Key Management Service. UpdateRepositoryEncryptionKey is added for updating the key configuration. CreateRepository, GetRepository, BatchGetRepositories are updated with new input or output parameters. +* api-change:``connect``: Adds APIs to manage User Proficiencies and Predefined Attributes. Enhances StartOutboundVoiceContact API input. Introduces SearchContacts API. Enhances DescribeContact API. Adds an API to update Routing Attributes in QueuePriority and QueueTimeAdjustmentSeconds. +* api-change:``medialive``: MediaLive now supports the ability to configure the audio that an AWS Elemental Link UHD device produces, when the device is configured as the source for a flow in AWS Elemental MediaConnect. +* api-change:``neptune-graph``: Adds Waiters for successful creation and deletion of Graph, Graph Snapshot, Import Task and Private Endpoints for Neptune Analytics +* api-change:``rds-data``: This release adds support for using RDS Data API with Aurora PostgreSQL Serverless v2 and provisioned DB clusters. +* api-change:``rds``: This release adds support for using RDS Data API with Aurora PostgreSQL Serverless v2 and provisioned DB clusters. +* api-change:``sagemaker``: Amazon SageMaker Training now provides model training container access for debugging purposes. Amazon SageMaker Search now provides the ability to use visibility conditions to limit resource access to a single domain or multiple domains. + + +1.34.5 +====== + +* api-change:``appstream``: This release introduces configurable clipboard, allowing admins to specify the maximum length of text that can be copied by the users from their device to the remote session and vice-versa. +* api-change:``eks``: Add support for cluster insights, new EKS capability that surfaces potentially upgrade impacting issues. +* api-change:``guardduty``: This release 1) introduces a new API: GetOrganizationStatistics , and 2) adds a new UsageStatisticType TOP_ACCOUNTS_BY_FEATURE for GetUsageStatistics API +* api-change:``managedblockchain-query``: Adding Confirmation Status and Execution Status to GetTransaction Response. +* api-change:``mediatailor``: Adds the ability to configure time shifting on MediaTailor channels using the TimeShiftConfiguration field +* api-change:``route53``: Amazon Route 53 now supports the Canada West (Calgary) Region (ca-west-1) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.4 +====== + +* api-change:``appsync``: This release adds additional configurations on GraphQL APIs for limits on query depth, resolver count, and introspection +* api-change:``chime-sdk-meetings``: Add meeting features to specify a maximum camera resolution, a maximum content sharing resolution, and a maximum number of attendees for a given meeting. +* api-change:``ec2``: Provision BYOIPv4 address ranges and advertise them by specifying the network border groups option in Los Angeles, Phoenix and Dallas AWS Local Zones. +* api-change:``fsx``: Added support for FSx for OpenZFS on-demand data replication across AWS accounts and/or regions.Added the IncludeShared attribute for DescribeSnapshots.Added the CopyStrategy attribute for OpenZFSVolumeConfiguration. +* api-change:``marketplace-catalog``: AWS Marketplace now supports a new API, BatchDescribeEntities, which returns metadata and content for multiple entities. +* api-change:``rds``: RDS - The release adds two new APIs: DescribeDBRecommendations and ModifyDBRecommendation + + +1.34.3 +====== + +* api-change:``cognito-idp``: Amazon Cognito now supports trigger versions that define the fields in the request sent to pre token generation Lambda triggers. +* api-change:``eks``: Add support for EKS Cluster Access Management. +* api-change:``quicksight``: A docs-only release to add missing entities to the API reference. +* api-change:``route53resolver``: Add DOH protocols in resolver endpoints. + + +1.34.2 +====== + +* api-change:``cloud9``: Updated Cloud9 API documentation for AL2023 release +* api-change:``connect``: Adds relatedContactId field to StartOutboundVoiceContact API input. Introduces PauseContact API and ResumeContact API for Task contacts. Adds pause duration, number of pauses, timestamps for last paused and resumed events to DescribeContact API response. Adds new Rule type and new Rule action. +* api-change:``connectcases``: Increase number of fields that can be included in CaseEventIncludedData from 50 to 200 +* api-change:``kms``: Documentation updates for AWS Key Management Service +* api-change:``rds``: Updates Amazon RDS documentation by adding code examples +* api-change:``sagemaker``: This release 1) introduces a new API: DeleteCompilationJob , and 2) adds InfraCheckConfig for Create/Describe training job API + + +1.34.1 +====== + +* api-change:``appstream``: This release includes support for images of Windows Server 2022 platform. +* api-change:``b2bi``: Documentation updates for AWS B2B Data Interchange +* api-change:``billingconductor``: Billing Conductor is releasing a new API, GetBillingGroupCostReport, which provides the ability to retrieve/view the Billing Group Cost Report broken down by attributes for a specific billing group. +* api-change:``connect``: This release adds support for more granular billing using tags (key:value pairs) +* api-change:``controltower``: Documentation updates for AWS Control Tower. +* api-change:``firehose``: This release, 1) adds configurable buffering hints for the Splunk destination, and 2) reduces the minimum configurable buffering interval for supported destinations +* api-change:``gamelift``: Amazon GameLift adds the ability to add and update the game properties of active game sessions. +* api-change:``iot``: This release adds the ability to self-manage certificate signing in AWS IoT Core fleet provisioning using the new certificate provider resource. +* api-change:``neptune-graph``: This is the initial SDK release for Amazon Neptune Analytics +* api-change:``opensearch``: Updating documentation for Amazon OpenSearch Service support for new zero-ETL integration with Amazon S3. +* api-change:``quicksight``: Update Dashboard Links support; SingleAxisOptions support; Scatterplot Query limit support. +* api-change:``workspaces``: Updated note to ensure customers understand running modes. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.34.0 +====== + +* feature:Python: End of support for Python 3.7 +* api-change:``drs``: Adding AgentVersion to SourceServer and RecoveryInstance structures + + +1.33.13 +======= + +* api-change:``imagebuilder``: This release adds the Image Workflows feature to give more flexibility and control over the image building and testing process. +* api-change:``location``: This release 1) adds sub-municipality field in Places API for searching and getting places information, and 2) allows optimizing route calculation based on expected arrival time. +* api-change:``logs``: This release introduces the StartLiveTail API to tail ingested logs in near real time. + + +1.33.12 +======= + +* api-change:``neptune``: This release adds a new parameter configuration setting to the Neptune cluster related APIs that can be leveraged to switch between the underlying supported storage modes. +* api-change:``pinpoint``: This release includes Amazon Pinpoint API documentation updates pertaining to campaign message sending rate limits. +* api-change:``securityhub``: Added new resource detail objects to ASFF, including resources for AwsDynamoDbTable, AwsEc2ClientVpnEndpoint, AwsMskCluster, AwsS3AccessPoint, AwsS3Bucket +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.33.11 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``ec2``: M2 Mac instances are built on Apple M2 Mac mini computers. I4i instances are powered by 3rd generation Intel Xeon Scalable processors. C7i compute optimized, M7i general purpose and R7i memory optimized instances are powered by custom 4th Generation Intel Xeon Scalable processors. +* api-change:``finspace``: Releasing Scaling Group, Dataview, and Volume APIs + + +1.33.10 +======= + +* api-change:``codedeploy``: This release adds support for two new CodeDeploy features: 1) zonal deployments for Amazon EC2 in-place deployments, 2) deployments triggered by Auto Scaling group termination lifecycle hook events. + + +1.33.9 +====== + +* api-change:``backup``: AWS Backup - Features: Add VaultType to the output of DescribeRecoveryPoint, ListRecoveryPointByBackupVault API and add ResourceType to the input of ListRestoreJobs API +* api-change:``comprehend``: Documentation updates for Trust and Safety features. +* api-change:``connect``: Releasing Tagging Support for Instance Management APIS +* api-change:``ec2``: Releasing the new cpuManufacturer attribute within the DescribeInstanceTypes API response which notifies our customers with information on who the Manufacturer is for the processor attached to the instance, for example: Intel. +* api-change:``payment-cryptography``: AWS Payment Cryptography IPEK feature release + + +1.33.8 +====== + +* api-change:``athena``: Adding IdentityCenter enabled request for interactive query +* api-change:``cleanroomsml``: Updated service title from cleanroomsml to CleanRoomsML. +* api-change:``cloudformation``: Documentation update, December 2023 +* api-change:``ec2``: Adds A10G, T4G, and H100 as accelerator name options and Habana as an accelerator manufacturer option for attribute based selection + + +1.33.7 +====== + +* api-change:``billingconductor``: This release adds the ability to specify a linked account of the billing group for the custom line item resource. +* api-change:``braket``: This release enhances service support to create quantum tasks and hybrid jobs associated with Braket Direct Reservations. +* api-change:``cloud9``: This release adds the requirement to include the imageId parameter in the CreateEnvironmentEC2 API call. +* api-change:``cloudformation``: Including UPDATE_* states as a success status for CreateStack waiter. +* api-change:``finspace``: Release General Purpose type clusters +* api-change:``medialive``: Adds support for custom color correction on channels using 3D LUT files. +* api-change:``servicecatalog-appregistry``: Documentation-only updates for Dawn +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.33.6 +====== + +* api-change:``qconnect``: This release adds the PutFeedback API and allows providing feedback against the specified assistant for the specified target. +* api-change:``rbin``: Added resource identifier in the output and updated error handling. +* api-change:``verifiedpermissions``: Adds description field to PolicyStore API's and namespaces field to GetSchema. + + +1.33.5 +====== + +* api-change:``arc-zonal-shift``: This release adds a new capability, zonal autoshift. You can configure zonal autoshift so that AWS shifts traffic for a resource away from an Availability Zone, on your behalf, when AWS determines that there is an issue that could potentially affect customers in the Availability Zone. +* api-change:``glue``: Adds observation and analyzer support to the GetDataQualityResult and BatchGetDataQualityResult APIs. +* api-change:``sagemaker``: This release adds support for 1/ Code Editor, based on Code-OSS, Visual Studio Code Open Source, a new fully managed IDE option in SageMaker Studio 2/ JupyterLab, a new fully managed JupyterLab IDE experience in SageMaker Studio + + +1.33.4 +====== + +* api-change:``marketplace-agreement``: The AWS Marketplace Agreement Service provides an API interface that helps AWS Marketplace sellers manage their agreements, including listing, filtering, and viewing details about their agreements. +* api-change:``marketplace-catalog``: This release enhances the ListEntities API to support new entity type-specific strongly typed filters in the request and entity type-specific strongly typed summaries in the response. +* api-change:``marketplace-deployment``: AWS Marketplace Deployment is a new service that provides essential features that facilitate the deployment of software, data, and services procured through AWS Marketplace. +* api-change:``redshift-serverless``: This release adds the following support for Amazon Redshift Serverless: 1) cross-account cross-VPCs, 2) copying snapshots across Regions, 3) scheduling snapshot creation, and 4) restoring tables from a recovery point. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.33.3 +====== + +* api-change:``application-autoscaling``: Amazon SageMaker customers can now use Application Auto Scaling to automatically scale the number of Inference Component copies across an endpoint to meet the varying demand of their workloads. +* api-change:``cleanrooms``: AWS Clean Rooms now provides differential privacy to protect against user-identification attempts and machine learning modeling to allow two parties to identify similar users in their data. +* api-change:``cleanroomsml``: Public Preview SDK release of AWS Clean Rooms ML APIs +* api-change:``opensearch``: Launching Amazon OpenSearch Service support for new zero-ETL integration with Amazon S3. Customers can now manage their direct query data sources to Amazon S3 programatically +* api-change:``opensearchserverless``: Amazon OpenSearch Serverless collections support an additional attribute called standby-replicas. This allows to specify whether a collection should have redundancy enabled. +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``sagemaker``: This release adds following support 1/ Improved SDK tooling for model deployment. 2/ New Inference Component based features to lower inference costs and latency 3/ SageMaker HyperPod management. 4/ Additional parameters for FM Fine Tuning in Autopilot +* api-change:``sts``: Documentation updates for AWS Security Token Service. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.33.2 +====== + +* api-change:``accessanalyzer``: This release adds support for external access findings for S3 directory buckets to help you easily identify cross-account access. Updated service API, documentation, and paginators. +* api-change:``bedrock``: This release adds support for customization types, model life cycle status and minor versions/aliases for model identifiers. +* api-change:``bedrock-agent``: This release introduces Agents for Amazon Bedrock +* api-change:``bedrock-agent-runtime``: This release introduces Agents for Amazon Bedrock Runtime +* api-change:``bedrock-runtime``: This release adds support for minor versions/aliases for invoke model identifier. +* api-change:``connect``: Added support for following capabilities: Amazon Connect's in-app, web, and video calling. Two-way SMS integrations. Contact Lens real-time chat analytics feature. Amazon Connect Analytics Datalake capability. Capability to configure real time chat rules. +* api-change:``customer-profiles``: This release introduces DetectProfileObjectType API to auto generate object type mapping. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version +* api-change:``qbusiness``: Amazon Q - a generative AI powered application that your employees can use to ask questions and get answers from knowledge spread across disparate content repositories, summarize reports, write articles, take actions, and much more - all within their company's connected content repositories. +* api-change:``qconnect``: Amazon Q in Connect, an LLM-enhanced evolution of Amazon Connect Wisdom. This release adds generative AI support to Amazon Q Connect QueryAssistant and GetRecommendations APIs. +* api-change:``s3``: Adds support for S3 Express One Zone. +* api-change:``s3control``: Adds support for S3 Express One Zone, and InvocationSchemaVersion 2.0 for S3 Batch Operations. + + +1.33.1 +====== + +* api-change:``elasticache``: Launching Amazon ElastiCache Serverless that enables you to create a cache in under a minute without any capacity management. ElastiCache Serverless monitors the cache's memory, CPU, and network usage and scales both vertically and horizontally to support your application's requirements. + + +1.33.0 +====== + +* feature:Versioning: With the release of Botocore 1.33.0, Boto3 and Botocore will share the same version number. +* api-change:``appsync``: This update enables introspection of Aurora cluster databases using the RDS Data API +* api-change:``b2bi``: This is the initial SDK release for AWS B2B Data Interchange. +* api-change:``backup``: AWS Backup now supports restore testing, a new feature that allows customers to automate restore testing and validating their backups. Additionally, this release adds support for EBS Snapshots Archive tier. +* api-change:``controltower``: This release adds the following support: 1. The EnableControl API can configure controls that are configurable. 2. The GetEnabledControl API shows the configured parameters on an enabled control. 3. The new UpdateEnabledControl API can change parameters on an enabled control. +* api-change:``efs``: Update efs client to latest version +* api-change:``fis``: AWS FIS adds support for multi-account experiments & empty target resolution. This release also introduces the CreateTargetAccountConfiguration API that allows experiments across multiple AWS accounts, and the ListExperimentResolvedTargets API to list target details. +* api-change:``glue``: add observations support to DQ CodeGen config model + update document for connectiontypes supported by ConnectorData entities +* api-change:``rds``: Updates Amazon RDS documentation for support for RDS for Db2. +* api-change:``securityhub``: Adds and updates APIs to support central configuration. This feature allows the Security Hub delegated administrator to configure Security Hub for their entire AWS Org across multiple regions from a home Region. With this release, findings also include account name and application metadata. +* api-change:``transcribe``: This release adds support for AWS HealthScribe APIs within Amazon Transcribe +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.32.7 +====== + +* api-change:``accessanalyzer``: IAM Access Analyzer now continuously monitors IAM roles and users in your AWS account or organization to generate findings for unused access. Additionally, IAM Access Analyzer now provides custom policy checks to validate that IAM policies adhere to your security standards ahead of deployments. +* api-change:``amp``: This release adds support for the Amazon Managed Service for Prometheus collector, a fully managed, agentless Prometheus metrics scraping capability. +* api-change:``bcm-data-exports``: Users can create, read, update, delete Exports of billing and cost management data. Users can get details of Export Executions and details of Tables for exporting. Tagging support is provided for Exports +* api-change:``cloudtrail``: CloudTrail Lake now supports federating event data stores. giving users the ability to run queries against their event data using Amazon Athena. +* api-change:``codestar-connections``: This release adds support for the CloudFormation Git sync feature. Git sync enables updating a CloudFormation stack from a template stored in a Git repository. +* api-change:``compute-optimizer``: This release enables AWS Compute Optimizer to analyze and generate recommendations with customization and discounts preferences. +* api-change:``config``: Support Periodic Recording for Configuration Recorder +* api-change:``controltower``: Add APIs to create and manage a landing zone. +* api-change:``cost-optimization-hub``: This release launches Cost Optimization Hub, a new AWS Billing and Cost Management feature that helps you consolidate and prioritize cost optimization recommendations across your AWS Organizations member accounts and AWS Regions, so that you can get the most out of your AWS spend. +* api-change:``detective``: Added new APIs in Detective to support resource investigations +* api-change:``ecs``: Adds a new 'type' property to the Setting structure. Adds a new AccountSetting - guardDutyActivate for ECS. +* api-change:``efs``: Update efs client to latest version +* api-change:``eks``: This release adds support for EKS Pod Identity feature. EKS Pod Identity makes it easy for customers to obtain IAM permissions for the applications running in their EKS clusters. +* api-change:``eks-auth``: This release adds support for EKS Pod Identity feature. EKS Pod Identity makes it easy for customers to obtain IAM permissions for their applications running in the EKS clusters. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version +* api-change:``freetier``: This is the initial SDK release for the AWS Free Tier GetFreeTierUsage API +* api-change:``fsx``: Added support for FSx for ONTAP scale-out file systems and FlexGroup volumes. Added the HAPairs field and ThroughputCapacityPerHAPair for filesystem. Added AggregateConfiguration (containing Aggregates and ConstituentsPerAggregate) and SizeInBytes for volume. +* api-change:``guardduty``: Add support for Runtime Monitoring for ECS and ECS-EC2. +* api-change:``iotfleetwise``: AWS IoT FleetWise introduces new APIs for vision system data, such as data collected from cameras, radars, and lidars. You can now model and decode complex data types. +* api-change:``lakeformation``: This release adds four new APIs "DescribeLakeFormationIdentityCenterConfiguration", "CreateLakeFormationIdentityCenterConfiguration", "DescribeLakeFormationIdentityCenterConfiguration", and "DeleteLakeFormationIdentityCenterConfiguration", and also updates the corresponding documentation. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``logs``: Added APIs to Create, Update, Get, List and Delete LogAnomalyDetectors and List and Update Anomalies in Detector. Added LogGroupClass attribute for LogGroups to classify loggroup as Standard loggroup with all capabilities or InfrequentAccess loggroup with limited capabilities. +* api-change:``managedblockchain``: Add optional NetworkType property to Accessor APIs +* api-change:``personalize``: Enables metadata in recommendations, recommendations with themes, and next best action recommendations +* api-change:``personalize-events``: This release enables PutActions and PutActionInteractions +* api-change:``personalize-runtime``: Enables metadata in recommendations and next best action recommendations +* api-change:``quicksight``: This release launches new APIs for trusted identity propagation setup and supports creating datasources using trusted identity propagation as authentication method for QuickSight accounts configured with IAM Identity Center. +* api-change:``redshift``: This release adds support for multi-data warehouse writes through data sharing. +* api-change:``repostspace``: Initial release of AWS re:Post Private +* api-change:``s3``: Adding new params - Key and Prefix, to S3 API operations for supporting S3 Access Grants. Note - These updates will not change any of the existing S3 API functionality. +* api-change:``s3control``: Introduce Amazon S3 Access Grants, a new S3 access control feature that maps identities in directories such as Active Directory, or AWS Identity and Access Management (IAM) Principals, to datasets in S3. +* api-change:``secretsmanager``: AWS Secrets Manager has released the BatchGetSecretValue API, which allows customers to fetch up to 20 Secrets with a single request using a list of secret names or filters. +* api-change:``securityhub``: Adds and updates APIs to support customizable security controls. This feature allows Security Hub customers to provide custom parameters for security controls. With this release, findings for controls that support custom parameters will include the parameters used to generate the findings. +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``transcribe``: This release adds support for transcriptions from audio sources in 64 new languages and introduces generative call summarization in Transcribe Call Analytics (Post call) +* api-change:``workspaces``: The release introduces Multi-Region Resilience one-way data replication that allows you to replicate data from your primary WorkSpace to a standby WorkSpace in another AWS Region. DescribeWorkspaces now returns the status of data replication. +* api-change:``workspaces-thin-client``: Initial release of Amazon WorkSpaces Thin Client +* enhancement:AWSCRT: Update awscrt version to 0.19.17 + + +1.32.6 +====== + +* bugfix:sqs: Rolled back recent change to wire format protocol +* api-change:``kinesis``: This release adds support for resource based policies on streams and consumers. +* api-change:``s3control``: Amazon S3 Batch Operations now manages buckets or prefixes in a single step. +* api-change:``sagemaker``: This feature adds the end user license agreement status as a model access configuration parameter. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.32.5 +====== + +* api-change:``cloudfront``: This release adds support for CloudFront KeyValueStore, a globally managed key value datastore associated with CloudFront Functions. +* api-change:``cloudfront-keyvaluestore``: This release adds support for CloudFront KeyValueStore, a globally managed key value datastore associated with CloudFront Functions. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version +* api-change:``inspector-scan``: This release adds support for the new Amazon Inspector Scan API. The new Inspector Scan API can synchronously scan SBOMs adhering to the CycloneDX v1.5 format. +* api-change:``iotsitewise``: Adds 1/ user-defined unique identifier for asset and model metadata, 2/ asset model components, and 3/ query API for asset metadata and telemetry data. Supports 4/ multi variate anomaly detection using Amazon Lookout for Equipment, 5/ warm storage tier, and 6/ buffered ingestion of time series data. +* api-change:``iottwinmaker``: This release adds following support. 1. New APIs for metadata bulk operations. 2. Modify the component type API to support composite component types - nesting component types within one another. 3. New list APIs for components and properties. 4. Support the larger scope digital twin modeling. +* api-change:``s3``: Add support for automatic date based partitioning in S3 Server Access Logs. + + +1.32.4 +====== + +* enhancement:IMDS: Adds a config option to opt out of IMDSv1 fallback +* api-change:``codestar-connections``: This release updates a few CodeStar Connections related APIs. +* api-change:``docdb``: Amazon DocumentDB updates for new cluster storage configuration: Amazon DocumentDB I/O-Optimized. +* api-change:``ec2``: This release adds support for Security group referencing over Transit gateways, enabling you to simplify Security group management and control of instance-to-instance traffic across VPCs that are connected by Transit gateway. + + +1.32.3 +====== + +* api-change:``appmesh``: Change the default value of these fields from 0 to null: MaxConnections, MaxPendingRequests, MaxRequests, HealthCheckThreshold, PortNumber, and HealthCheckPolicy -> port. Users are not expected to perceive the change, except that badRequestException is thrown when required fields missing configured. +* api-change:``athena``: Adding SerivicePreProcessing time metric +* api-change:``cloud9``: A minor doc only update related to changing the date of an API change. +* api-change:``cloudformation``: This release adds a new flag ImportExistingResources to CreateChangeSet. Specify this parameter on a CREATE- or UPDATE-type change set to import existing resources with custom names instead of recreating them. +* api-change:``codepipeline``: CodePipeline now supports overriding source revisions to achieve manual re-deploy of a past revision +* api-change:``codestar-connections``: This release adds support for the CloudFormation Git sync feature. Git sync enables updating a CloudFormation stack from a template stored in a Git repository. +* api-change:``connect``: This release adds WISDOM_QUICK_RESPONSES as new IntegrationType of Connect IntegrationAssociation resource and bug fixes. +* api-change:``dlm``: Added support for SAP HANA in Amazon Data Lifecycle Manager EBS snapshot lifecycle policies with pre and post scripts. +* api-change:``ec2``: This release adds new features for Amazon VPC IP Address Manager (IPAM) Allowing a choice between Free and Advanced Tiers, viewing public IP address insights across regions and in Amazon Cloudwatch, use IPAM to plan your subnet IPs within a VPC and bring your own autonomous system number to IPAM. +* api-change:``ecr``: Documentation and operational updates for Amazon ECR, adding support for pull through cache rules for upstream registries that require authentication. +* api-change:``emr``: Update emr client to latest version +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``internetmonitor``: Adds new querying capabilities for running data queries on a monitor +* api-change:``ivs``: type & defaulting refinement to various range properties +* api-change:``ivschat``: type & defaulting refinement to various range properties +* api-change:``kinesisvideo``: Docs only build to bring up-to-date with public docs. +* api-change:``location``: Remove default value and allow nullable for request parameters having minimum value larger than zero. +* api-change:``macie``: The macie client has been removed following the deprecation of the service. +* api-change:``medialive``: MediaLive has now added support for per-output static image overlay. +* api-change:``mgn``: Removed invalid and unnecessary default values. +* api-change:``osis``: Add support for enabling a persistent buffer when creating or updating an OpenSearch Ingestion pipeline. Add tags to Pipeline and PipelineSummary response models. +* api-change:``pipes``: TargetParameters now properly supports BatchJobParameters.ArrayProperties.Size and BatchJobParameters.RetryStrategy.Attempts being optional, and EcsTaskParameters.Overrides.EphemeralStorage.SizeInGiB now properly required when setting EphemeralStorage +* api-change:``rds``: This release adds support for option groups and replica enhancements to Amazon RDS Custom. +* api-change:``redshift``: Updated SDK for Amazon Redshift, which you can use to configure a connection with IAM Identity Center to manage access to databases. With these, you can create a connection through a managed application. You can also change a managed application, delete it, or get information about an existing one. +* api-change:``redshift-serverless``: Updated SDK for Amazon Redshift Serverless, which provides the ability to configure a connection with IAM Identity Center to manage user and group access to databases. +* api-change:``s3``: Removes all default 0 values for numbers and false values for booleans +* api-change:``sso-admin``: Improves support for configuring RefreshToken and TokenExchange grants on applications. +* api-change:``sso-oidc``: Adding support for `sso-oauth:CreateTokenWithIAM`. +* api-change:``sts``: API updates for the AWS Security Token Service +* api-change:``trustedadvisor``: AWS Trusted Advisor introduces new APIs to enable you to programmatically access Trusted Advisor best practice checks, recommendations, and prioritized recommendations. Trusted Advisor APIs enable you to integrate Trusted Advisor with your operational tools to automate your workloads. +* api-change:``verifiedpermissions``: Adding BatchIsAuthorized API which supports multiple authorization requests against a PolicyStore +* api-change:``wisdom``: This release adds QuickResponse as a new Wisdom resource and Wisdom APIs for import, create, read, search, update and delete QuickResponse resources. + + +1.32.2 +====== + +* api-change:``codecatalyst``: This release includes updates to the Dev Environment APIs to include an optional vpcConnectionName parameter that supports using Dev Environments with Amazon VPC. +* api-change:``dlm``: This release adds support for Amazon Data Lifecycle Manager default policies for EBS snapshots and EBS-backed AMIs. +* api-change:``ec2``: Enable use of tenant-specific PublicSigningKeyUrl from device trust providers and onboard jumpcloud as a new device trust provider. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version +* api-change:``fsx``: Enables customers to update their PerUnitStorageThroughput on their Lustre file systems. +* api-change:``glue``: Introduces new column statistics APIs to support statistics generation for tables within the Glue Data Catalog. +* api-change:``imagebuilder``: This release adds the Image Lifecycle Management feature to automate the process of deprecating, disabling and deleting outdated images and their associated resources. +* api-change:``iot``: GA release the ability to index and search devices based on their GeoLocation data. With GeoQueries you can narrow your search to retrieve devices located in the desired geographic boundary. +* api-change:``ivs-realtime``: This release introduces server side composition and recording for stages. +* api-change:``kafka``: Added a new API response field which determines if there is an action required from the customer regarding their cluster. +* api-change:``lambda``: Adds support for logging configuration in Lambda Functions. Customers will have more control how their function logs are captured and to which cloud watch log group they are delivered also. +* api-change:``macie2``: This release adds support for configuring Macie to assume an IAM role when retrieving sample occurrences of sensitive data reported by findings. +* api-change:``mediapackage``: DRM_TOP_LEVEL_COMPACT allows placing content protection elements at the MPD level and referenced at the AdaptationSet level +* api-change:``pinpoint-sms-voice-v2``: Amazon Pinpoint now offers additional operations as part of version 2 of the SMS and voice APIs. This release includes 26 new APIs to create and manage phone number registrations, add verified destination numbers, and request sender IDs. +* api-change:``polly``: Add new engine - long-form - dedicated for longer content, such as news articles, training materials, or marketing videos. +* api-change:``quicksight``: Custom permission support for QuickSight roles; Three new datasources STARBURST, TRINO, BIGQUERY; Lenient mode changes the default behavior to allow for exporting and importing with certain UI allowed errors, Support for permissions and tags export and import. +* api-change:``sagemaker``: Amazon SageMaker Studio now supports Trainium instance types - trn1.2xlarge, trn1.32xlarge, trn1n.32xlarge. +* api-change:``ssm``: This release introduces the ability to filter automation execution steps which have parent steps. In addition, runbook variable information is returned by GetAutomationExecution and parent step information is returned by the DescribeAutomationStepExecutions API. +* api-change:``ssm-incidents``: Introduces new APIs ListIncidentFindings and BatchGetIncidentFindings to use findings related to an incident. +* api-change:``sso-admin``: Instances bound to a single AWS account, API operations for managing instances and applications, and assignments to applications are now supported. Trusted identity propagation is also supported, with new API operations for managing trusted token issuers and application grants and scopes. +* api-change:``transfer``: Introduced S3StorageOptions for servers to enable directory listing optimizations and added Type fields to logical directory mappings. + + +1.32.1 +====== + +* enhancement:Package Size: The botocore .whl file distributed on PyPI now provides compressed service models to improve total size on disk. +* api-change:``autoscaling``: This release introduces Instance Maintenance Policy, a new EC2 Auto Scaling capability that allows customers to define whether instances are launched before or after existing instances are terminated during instance replacement operations. +* api-change:``cloudtrail``: The Lake Repricing feature lets customers configure a BillingMode for an event data store. The BillingMode determines the cost for ingesting and storing events and the default and maximum retention period for the event data store. +* api-change:``codecatalyst``: This release adds functionality for retrieving information about workflows and workflow runs and starting workflow runs in Amazon CodeCatalyst. +* api-change:``ec2``: AWS EBS now supports Snapshot Lock, giving users the ability to lock an EBS Snapshot to prohibit deletion of the snapshot. This release introduces the LockSnapshot, UnlockSnapshot & DescribeLockedSnapshots APIs to manage lock configuration for snapshots. The release also includes the dl2q_24xlarge. +* api-change:``finspace-data``: Adding deprecated trait to APIs in this name space. +* api-change:``finspace``: Adding deprecated trait on Dataset Browser Environment APIs +* api-change:``lambda``: Add Java 21 (java21) support to AWS Lambda +* api-change:``mwaa``: This Amazon MWAA release adds support for customer-managed VPC endpoints. This lets you choose whether to create, and manage your environment's VPC endpoints, or to have Amazon MWAA create, and manage them for you. +* api-change:``rds``: Updates Amazon RDS documentation for support for upgrading RDS for MySQL snapshots from version 5.7 to version 8.0. +* api-change:``redshift``: The custom domain name SDK for Amazon Redshift provisioned clusters is updated with additional required parameters for modify and delete operations. Additionally, users can provide domain names with longer top-level domains. +* api-change:``s3control``: Add 5 APIs to create, update, get, list, delete S3 Storage Lens group(eg. CreateStorageLensGroup), 3 APIs for tagging(TagResource,UntagResource,ListTagsForResource), and update to StorageLensConfiguration to allow metrics to be aggregated on Storage Lens groups. +* api-change:``ssm-sap``: Update the default value of MaxResult to 50. + + +1.32.0 +====== + +* feature:ContainerProvider: Added Support for EKS container credentials +* api-change:``backup``: AWS Backup - Features: Provide Job Summary for your backup activity. +* api-change:``cleanrooms``: This feature provides the ability for the collaboration creator to configure either the member who can run queries or a different member in the collaboration to be billed for query compute costs. +* api-change:``connect``: Introducing SegmentAttributes parameter for StartChatContact API +* api-change:``glue``: Introduces new storage optimization APIs to support automatic compaction of Apache Iceberg tables. +* api-change:``iot``: This release introduces new attributes in API CreateSecurityProfile, UpdateSecurityProfile and DescribeSecurityProfile to support management of Metrics Export for AWS IoT Device Defender Detect. +* api-change:``lambda``: Add Python 3.12 (python3.12) support to AWS Lambda +* api-change:``mediatailor``: Removed unnecessary default values. +* api-change:``pipes``: Added support (via new LogConfiguration field in CreatePipe and UpdatePipe APIs) for logging to Amazon CloudWatch Logs, Amazon Simple Storage Service (Amazon S3), and Amazon Kinesis Data Firehose +* api-change:``resource-explorer-2``: Resource Explorer supports multi-account search. You can now use Resource Explorer to search and discover resources across AWS accounts within your organization or organizational unit. +* api-change:``sagemaker``: This release makes Model Registry Inference Specification fields as not required. +* api-change:``signer``: Documentation updates for AWS Signer +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.85 +======= + +* enhancement:AWSCRT: Update awscrt version to 0.19.12 +* api-change:``dataexchange``: Removed Required trait for DataSet.OriginDetails.ProductId. +* api-change:``dms``: Added new Db2 LUW Target endpoint with related endpoint settings. New executeTimeout endpoint setting for mysql endpoint. New ReplicationDeprovisionTime field for serverless describe-replications. +* api-change:``ec2``: Adds the new EC2 DescribeInstanceTopology API, which you can use to retrieve the network topology of your running instances on select platform types to determine their relative proximity to each other. +* api-change:``ecs``: Adds a Client Token parameter to the ECS RunTask API. The Client Token parameter allows for idempotent RunTask requests. +* api-change:``emr``: Update emr client to latest version +* api-change:``servicecatalog-appregistry``: When the customer associates a resource collection to their application with this new feature, then a new application tag will be applied to all supported resources that are part of that collection. This allows customers to more easily find the application that is associated with those resources. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.84 +======= + +* enhancement:AWSCRT: Update awscrt version to 0.19.10 +* api-change:``controltower``: AWS Control Tower supports tagging for enabled controls. This release introduces TagResource, UntagResource and ListTagsForResource APIs to manage tags in existing enabled controls. It updates EnabledControl API to tag resources at creation time. +* api-change:``cur``: This release adds support for tagging and customers can now tag report definitions. Additionally, ReportStatus is now added to report definition to show when the last delivered time stamp and if it succeeded or not. +* api-change:``ec2``: EC2 adds API updates to enable ENA Express at instance launch time. +* api-change:``fms``: Adds optimizeUnassociatedWebACL flag to ManagedServiceData, updates third-party firewall examples, and other minor documentation updates. +* api-change:``marketplace-entitlement``: Update marketplace-entitlement client to latest version +* api-change:``mediaconvert``: This release includes the ability to specify any input source as the primary input for corresponding follow modes, and allows users to specify fit and fill behaviors without resizing content. +* api-change:``rds``: Updates Amazon RDS documentation for zero-ETL integrations. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.83 +======= + +* api-change:``cloudformation``: Added new ConcurrencyMode feature for AWS CloudFormation StackSets for faster deployments to target accounts. +* api-change:``cloudtrail``: The Insights in Lake feature lets customers enable CloudTrail Insights on a source CloudTrail Lake event data store and create a destination event data store to collect Insights events based on unusual management event activity in the source event data store. +* api-change:``comprehend``: This release adds support for toxicity detection and prompt safety classification. +* api-change:``connect``: This release adds the ability to integrate customer lambda functions with Connect attachments for scanning and updates the ListIntegrationAssociations API to support filtering on IntegrationArn. +* api-change:``ec2``: AWS EBS now supports Block Public Access for EBS Snapshots. This release introduces the EnableSnapshotBlockPublicAccess, DisableSnapshotBlockPublicAccess and GetSnapshotBlockPublicAccessState APIs to manage account-level public access settings for EBS Snapshots in an AWS Region. +* api-change:``eks``: Adding EKS Anywhere subscription related operations. +* api-change:``lambda``: Add Custom runtime on Amazon Linux 2023 (provided.al2023) support to AWS Lambda. +* api-change:``logs``: Update to support new APIs for delivery of logs from AWS services. +* api-change:``omics``: Support UBAM filetype for Omics Storage and make referenceArn optional +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.82 +======= + +* api-change:``sqs``: This release enables customers to call SQS using AWS JSON-1.0 protocol and bug fix. + + +1.31.81 +======= + +* api-change:``connect``: This release clarifies in our public documentation that InstanceId is a requirement for SearchUsers API requests. +* api-change:``connectcases``: This release adds the ability to add/view comment authors through CreateRelatedItem and SearchRelatedItems API. For more information see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html +* api-change:``datasync``: This change allows for 0 length access keys and secret keys for object storage locations. Users can now pass in empty string credentials. +* api-change:``guardduty``: Added API support for new GuardDuty EKS Audit Log finding types. +* api-change:``lambda``: Add Node 20 (nodejs20.x) support to AWS Lambda. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``omics``: Adding Run UUID and Run Output URI: GetRun and StartRun API response has two new fields "uuid" and "runOutputUri". +* api-change:``rds``: This Amazon RDS release adds support for patching the OS of an RDS Custom for Oracle DB instance. You can now upgrade the database or operating system using the modify-db-instance command. +* api-change:``redshift-serverless``: Added a new parameter in the workgroup that helps you control your cost for compute resources. This feature provides a ceiling for RPUs that Amazon Redshift Serverless can scale up to. When automatic compute scaling is required, having a higher value for MaxRPU can enhance query throughput. +* api-change:``resiliencehub``: AWS Resilience Hub enhances Resiliency Score, providing actionable recommendations to improve application resilience. Amazon Elastic Kubernetes Service (EKS) operational recommendations have been added to help improve the resilience posture of your applications. +* api-change:``sqs``: This release enables customers to call SQS using AWS JSON-1.0 protocol. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.80 +======= + +* api-change:``dataexchange``: Updated SendDataSetNotificationRequest Comment to be maximum length 4096. +* api-change:``dlm``: Added support for pre and post scripts in Amazon Data Lifecycle Manager EBS snapshot lifecycle policies. +* api-change:``rds``: This Amazon RDS release adds support for the multi-tenant configuration. In this configuration, an RDS DB instance can contain multiple tenant databases. In RDS for Oracle, a tenant database is a pluggable database (PDB). +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.79 +======= + +* api-change:``ce``: This release extends the GetReservationPurchaseRecommendation API to support recommendations for Amazon MemoryDB reservations. +* api-change:``codebuild``: AWS CodeBuild now supports AWS Lambda compute. +* api-change:``connect``: Added new API that allows Amazon Connect Outbound Campaigns to create contacts in Amazon Connect when ingesting your dial requests. +* api-change:``docdb``: Update the input of CreateDBInstance and ModifyDBInstance to support setting CA Certificates. Update the output of DescribeDBInstance and DescribeDBEngineVersions to show current and supported CA certificates. +* api-change:``iam``: Add partitional endpoint for iso-e. +* api-change:``mwaa``: This release adds support for Apache Airflow version 2.7.2. This version release includes support for deferrable operators and triggers. +* api-change:``polly``: Amazon Polly adds new US English voices - Danielle and Gregory. Danielle and Gregory are available as Neural voices only. +* api-change:``route53``: Add partitional endpoints for iso-e and iso-f. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.78 +======= + +* api-change:``config``: Updated ResourceType enum with new resource types onboarded by AWS Config in October 2023. +* api-change:``connect``: Amazon Connect Chat introduces Create Persistent Contact Association API, allowing customers to choose when to resume previous conversations from previous chats, eliminating the need to repeat themselves and allowing agents to provide personalized service with access to entire conversation history. +* api-change:``iotwireless``: Added LoRaWAN version 1.0.4 support +* api-change:``launch-wizard``: AWS Launch Wizard is a service that helps reduce the time it takes to deploy applications to the cloud while providing a guided deployment experience. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.77 +======= + +* api-change:``apprunner``: AWS App Runner now supports using dual-stack address type for the public endpoint of your incoming traffic. +* api-change:``connect``: GetMetricDataV2 API: Update to include new metrics PERCENT_NON_TALK_TIME, PERCENT_TALK_TIME, PERCENT_TALK_TIME_AGENT, PERCENT_TALK_TIME_CUSTOMER +* api-change:``gamelift``: Amazon GameLift adds support for shared credentials, which allows applications that are deployed on managed EC2 fleets to interact with other AWS resources. +* api-change:``glue``: This release introduces Google BigQuery Source and Target in AWS Glue CodeGenConfigurationNode. +* api-change:``network-firewall``: This release introduces the stateless rule analyzer, which enables you to analyze your stateless rules for asymmetric routing. +* api-change:``quicksight``: This release introduces Float Decimal Type as SubType in QuickSight SPICE datasets and Custom week start and Custom timezone options in Analysis and Dashboard +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.76 +======= + +* api-change:``connect``: Adds the BatchGetFlowAssociation API which returns flow associations (flow-resource) corresponding to the list of resourceArns supplied in the request. This release also adds IsDefault, LastModifiedRegion and LastModifiedTime fields to the responses of several Describe and List APIs. +* api-change:``globalaccelerator``: Global Accelerator now support accelerators with cross account endpoints. +* api-change:``rds``: This release adds support for customized networking resources to Amazon RDS Custom. +* api-change:``redshift``: Added support for Multi-AZ deployments for Provisioned RA3 clusters that provide 99.99% SLA availability. +* api-change:``sagemaker``: Support for batch transform input in Model dashboard + + +1.31.75 +======= + +* api-change:``amplify``: Add backend field to CreateBranch and UpdateBranch requests. Add pagination support for ListApps, ListDomainAssociations, ListBranches, and ListJobs +* api-change:``application-insights``: Automate attaching managed policies +* api-change:``ec2``: Capacity Blocks for ML are a new EC2 purchasing option for reserving GPU instances on a future date to support short duration machine learning (ML) workloads. Capacity Blocks automatically place instances close together inside Amazon EC2 UltraClusters for low-latency, high-throughput networking. +* api-change:``m2``: Added name filter ability for ListDataSets API, added ForceUpdate for Updating environment and BatchJob submission using S3BatchJobIdentifier +* api-change:``neptunedata``: Minor change to not retry CancelledByUserException +* api-change:``translate``: Added support for Brevity translation settings feature. + + +1.31.74 +======= + +* api-change:``connect``: This release adds InstanceId field for phone number APIs. +* api-change:``dataexchange``: We added a new API action: SendDataSetNotification. +* api-change:``datasync``: Platform version changes to support AL1 deprecation initiative. +* api-change:``finspace``: Introducing new API UpdateKxClusterCodeConfiguration, introducing new cache types for clusters and introducing new deployment modes for updating clusters. +* api-change:``mediapackagev2``: This feature allows customers to create a combination of manifest filtering, startover and time delay configuration that applies to all egress requests by default. +* api-change:``rds``: This release launches the CreateIntegration, DeleteIntegration, and DescribeIntegrations APIs to manage zero-ETL Integrations. +* api-change:``redshift-serverless``: Added support for custom domain names for Amazon Redshift Serverless workgroups. This feature enables customers to create a custom domain name and use ACM to generate fully secure connections to it. +* api-change:``resiliencehub``: Introduced the ability to filter applications by their last assessment date and time and have included metrics for the application's estimated workload Recovery Time Objective (RTO) and estimated workload Recovery Point Objective (RPO). +* api-change:``s3outposts``: Updated ListOutpostsWithS3 API response to include S3OutpostArn for use with AWS RAM. +* api-change:``wisdom``: This release added necessary API documents on creating a Wisdom knowledge base to integrate with S3. + + +1.31.73 +======= + +* api-change:``emr``: Update emr client to latest version +* api-change:``neptune``: Update TdeCredentialPassword type to SensitiveString +* api-change:``pinpoint``: Updated documentation to describe the case insensitivity for EndpointIds. +* api-change:``redshift``: added support to create a dual stack cluster +* api-change:``wafv2``: Updates the descriptions for the calls that manage web ACL associations, to provide information for customer-managed IAM policies. + + +1.31.72 +======= + +* api-change:``appstream``: This release introduces multi-session fleets, allowing customers to provision more than one user session on a single fleet instance. +* api-change:``ec2``: Launching GetSecurityGroupsForVpc API. This API gets security groups that can be associated by the AWS account making the request with network interfaces in the specified VPC. +* api-change:``network-firewall``: Network Firewall now supports inspection of outbound SSL/TLS traffic. +* api-change:``opensearch``: You can specify ipv4 or dualstack IPAddressType for cluster endpoints. If you specify IPAddressType as dualstack, the new endpoint will be visible under the 'EndpointV2' parameter and will support IPv4 and IPv6 requests. Whereas, the 'Endpoint' will continue to serve IPv4 requests. +* api-change:``redshift``: Add Redshift APIs GetResourcePolicy, DeleteResourcePolicy, PutResourcePolicy and DescribeInboundIntegrations for the new Amazon Redshift Zero-ETL integration feature, which can be used to control data ingress into Redshift namespace, and view inbound integrations. +* api-change:``sagemaker``: Amazon Sagemaker Autopilot now supports Text Generation jobs. +* api-change:``sns``: Message Archiving and Replay is now supported in Amazon SNS for FIFO topics. +* api-change:``ssm-sap``: AWS Systems Manager for SAP added support for registration and discovery of SAP ABAP applications +* api-change:``transfer``: No API changes from previous release. This release migrated the model to Smithy keeping all features unchanged. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.31.71 +======= + +* enhancement:Configuration: Adds client context params support to ``Config``. +* api-change:``connectcases``: Increase maximum length of CommentBody to 3000, and increase maximum length of StringValue to 1500 +* api-change:``groundstation``: This release will allow KMS alias names to be used when creating Mission Profiles +* api-change:``iam``: Updates to GetAccessKeyLastUsed action to replace NoSuchEntity error with AccessDeniedException error. + + +1.31.70 +======= + +* api-change:``codepipeline``: Add ability to trigger pipelines from git tags, define variables at pipeline level and new pipeline type V2. +* api-change:``ec2``: This release updates the documentation for InstanceInterruptionBehavior and HibernationOptionsRequest to more accurately describe the behavior of these two parameters when using Spot hibernation. +* api-change:``eks``: Added support for Cluster Subnet and Security Group mutability. +* api-change:``iam``: Add the partitional endpoint for IAM in iso-f. +* api-change:``migrationhub-config``: This release introduces DeleteHomeRegionControl API that customers can use to delete the Migration Hub Home Region configuration +* api-change:``migrationhubstrategy``: This release introduces multi-data-source feature in Migration Hub Strategy Recommendations. This feature now supports vCenter as a data source to fetch inventory in addition to ADS and Import from file workflow that is currently supported with MHSR collector. +* api-change:``opensearchserverless``: This release includes the following new APIs: CreateLifecyclePolicy, UpdateLifecyclePolicy, BatchGetLifecyclePolicy, DeleteLifecyclePolicy, ListLifecyclePolicies and BatchGetEffectiveLifecyclePolicy to support the data lifecycle management feature. + + +1.31.69 +======= + +* api-change:``marketplacecommerceanalytics``: The StartSupportDataExport operation has been deprecated as part of the Product Support Connection deprecation. As of December 2022, Product Support Connection is no longer supported. +* api-change:``networkmanager``: This release adds API support for Tunnel-less Connect (NoEncap Protocol) for AWS Cloud WAN +* api-change:``redshift-serverless``: This release adds support for customers to see the patch version and workgroup version in Amazon Redshift Serverless. +* api-change:``rekognition``: Amazon Rekognition introduces StartMediaAnalysisJob, GetMediaAnalysisJob, and ListMediaAnalysisJobs operations to run a bulk analysis of images with a Detect Moderation model. + + +1.31.68 +======= + +* api-change:``appconfig``: Update KmsKeyIdentifier constraints to support AWS KMS multi-Region keys. +* api-change:``appintegrations``: Updated ScheduleConfig to be an optional input to CreateDataIntegration to support event driven downloading of files from sources such as Amazon s3 using Amazon Connect AppIntegrations. +* api-change:``connect``: This release adds support for updating phone number metadata, such as phone number description. +* api-change:``discovery``: This release introduces three new APIs: StartBatchDeleteConfigurationTask, DescribeBatchDeleteConfigurationTask, and BatchDeleteAgents. +* api-change:``medical-imaging``: Updates on documentation links +* api-change:``ssm``: This release introduces a new API: DeleteOpsItem. This allows deletion of an OpsItem. + + +1.31.67 +======= + +* api-change:``gamesparks``: The gamesparks client has been removed following the deprecation of the service. +* api-change:``ec2``: Amazon EC2 C7a instances, powered by 4th generation AMD EPYC processors, are ideal for high performance, compute-intensive workloads such as high performance computing. Amazon EC2 R7i instances are next-generation memory optimized and powered by custom 4th Generation Intel Xeon Scalable processors. +* api-change:``managedblockchain-query``: This release adds support for Ethereum Sepolia network +* api-change:``neptunedata``: Doc changes to add IAM action mappings for the data actions. +* api-change:``omics``: This change enables customers to retrieve failure reasons with detailed status messages for their failed runs +* api-change:``opensearch``: Added Cluster Administrative options for node restart, opensearch process restart and opensearch dashboard restart for Multi-AZ without standby domains +* api-change:``quicksight``: This release adds the following: 1) Trino and Starburst Database Connectors 2) Custom total for tables and pivot tables 3) Enable restricted folders 4) Add rolling dates for time equality filters 5) Refine DataPathValue and introduce DataPathType 6) Add SeriesType to ReferenceLineDataConfiguration +* api-change:``secretsmanager``: Documentation updates for Secrets Manager +* api-change:``servicecatalog``: Introduce support for EXTERNAL product and provisioning artifact type in CreateProduct and CreateProvisioningArtifact APIs. +* api-change:``verifiedpermissions``: Improving Amazon Verified Permissions Create experience +* api-change:``workspaces``: Documentation updates for WorkSpaces + + +1.31.66 +======= + +* api-change:``cloud9``: Update to imageId parameter behavior and dates updated. +* api-change:``dynamodb``: Updating descriptions for several APIs. +* api-change:``kendra``: Changes for a new feature in Amazon Kendra's Query API to Collapse/Expand query results +* api-change:``rds``: This release adds support for upgrading the storage file system configuration on the DB instance using a blue/green deployment or a read replica. +* api-change:``wisdom``: This release adds an max limit of 25 recommendation ids for NotifyRecommendationsReceived API. + + +1.31.65 +======= + +* api-change:``codepipeline``: Add retryMode ALL_ACTIONS to RetryStageExecution API that retries a failed stage starting from first action in the stage +* api-change:``discovery``: This release introduces three new APIs: StartBatchDeleteConfigurationTask, DescribeBatchDeleteConfigurationTask, and BatchDeleteAgents. +* api-change:``ecs``: Documentation only updates to address Amazon ECS tickets. +* api-change:``globalaccelerator``: Fixed error where ListCustomRoutingEndpointGroups did not have a paginator +* api-change:``guardduty``: Add domainWithSuffix finding field to dnsRequestAction +* api-change:``kafka``: AWS Managed Streaming for Kafka is launching MSK Replicator, a new feature that enables customers to reliably replicate data across Amazon MSK clusters in same or different AWS regions. You can now use SDK to create, list, describe, delete, update, and manage tags of MSK Replicators. +* api-change:``route53-recovery-cluster``: Adds Owner field to ListRoutingControls API. +* api-change:``route53-recovery-control-config``: Adds permissions for GetResourcePolicy to support returning details about AWS Resource Access Manager resource policies for shared resources. + + +1.31.64 +======= + +* api-change:``cloudformation``: SDK and documentation updates for UpdateReplacePolicy +* api-change:``drs``: Updated exsiting API to allow AWS Elastic Disaster Recovery support of launching recovery into existing EC2 instances. +* api-change:``entityresolution``: This launch expands our matching techniques to include provider-based matching to help customer match, link, and enhance records with minimal data movement. With data service providers, we have removed the need for customers to build bespoke integrations,. +* api-change:``managedblockchain-query``: This release introduces two new APIs: GetAssetContract and ListAssetContracts. This release also adds support for Bitcoin Testnet. +* api-change:``mediapackagev2``: This release allows customers to manage MediaPackage v2 resource using CloudFormation. +* api-change:``opensearch``: This release allows customers to list and associate optional plugin packages with compatible Amazon OpenSearch Service clusters for enhanced functionality. +* api-change:``redshift-serverless``: Added support for managing credentials of serverless namespace admin using AWS Secrets Manager. +* api-change:``redshift``: Added support for managing credentials of provisioned cluster admin using AWS Secrets Manager. +* api-change:``sesv2``: This release provides enhanced visibility into your SES identity verification status. This will offer you more actionable insights, enabling you to promptly address any verification-related issues. +* api-change:``transfer``: Documentation updates for AWS Transfer Family +* api-change:``xray``: This releases enhances GetTraceSummaries API to support new TimeRangeType Service to query trace summaries by segment end time. + + +1.31.63 +======= + +* api-change:``auditmanager``: This release introduces a new limit to the awsAccounts parameter. When you create or update an assessment, there is now a limit of 200 AWS accounts that can be specified in the assessment scope. +* api-change:``autoscaling``: Update the NotificationMetadata field to only allow visible ascii characters. Add paginators to DescribeInstanceRefreshes, DescribeLoadBalancers, and DescribeLoadBalancerTargetGroups +* api-change:``config``: Add enums for resource types supported by Config +* api-change:``controltower``: Added new EnabledControl resource details to ListEnabledControls API and added new GetEnabledControl API. +* api-change:``customer-profiles``: Adds sensitive trait to various shapes in Customer Profiles Calculated Attribute API model. +* api-change:``ec2``: This release adds Ubuntu Pro as a supported platform for On-Demand Capacity Reservations and adds support for setting an Amazon Machine Image (AMI) to disabled state. Disabling the AMI makes it private if it was previously shared, and prevents new EC2 instance launches from it. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``glue``: Extending version control support to GitLab and Bitbucket from AWSGlue +* api-change:``inspector2``: Add MacOs ec2 platform support +* api-change:``ivs-realtime``: Update GetParticipant to return additional metadata. +* api-change:``lambda``: Adds support for Lambda functions to access Dual-Stack subnets over IPv6, via an opt-in flag in CreateFunction and UpdateFunctionConfiguration APIs +* api-change:``location``: This release adds endpoint updates for all AWS Location resource operations. +* api-change:``machinelearning``: This release marks Password field as sensitive +* api-change:``pricing``: Documentation updates for Price List +* api-change:``rds``: This release adds support for adding a dedicated log volume to open-source RDS instances. +* api-change:``rekognition``: Amazon Rekognition introduces support for Custom Moderation. This allows the enhancement of accuracy for detect moderation labels operations by creating custom adapters tuned on customer data. +* api-change:``sagemaker``: Amazon SageMaker Canvas adds KendraSettings and DirectDeploySettings support for CanvasAppSettings +* api-change:``textract``: This release adds 9 new APIs for adapter and adapter version management, 3 new APIs for tagging, and updates AnalyzeDocument and StartDocumentAnalysis API parameters for using adapters. +* api-change:``transcribe``: This release is to enable m4a format to customers +* api-change:``workspaces``: Updated the CreateWorkspaces action documentation to clarify that the PCoIP protocol is only available for Windows bundles. + + +1.31.62 +======= + +* enhancement:Dependencies: Add support for urllib3 2.0 for Python 3.10+ +* api-change:``ec2``: Documentation updates for Elastic Compute Cloud (EC2). +* api-change:``fsx``: After performing steps to repair the Active Directory configuration of a file system, use this action to initiate the process of attempting to recover to the file system. +* api-change:``marketplace-catalog``: This release adds support for Document type as an alternative for stringified JSON for StartChangeSet, DescribeChangeSet and DescribeEntity APIs +* api-change:``quicksight``: NullOption in FilterListConfiguration; Dataset schema/table max length increased; Support total placement for pivot table visual; Lenient mode relaxes the validation to create resources with definition; Data sources can be added to folders; Redshift data sources support IAM Role-based authentication +* api-change:``transfer``: This release updates the max character limit of PreAuthenticationLoginBanner and PostAuthenticationLoginBanner to 4096 characters + + +1.31.61 +======= + +* api-change:``omics``: Add Etag Support for Omics Storage in ListReadSets and GetReadSetMetadata API +* api-change:``rds``: Updates Amazon RDS documentation for corrections and minor improvements. +* api-change:``route53``: Add hostedzonetype filter to ListHostedZones API. +* api-change:``securityhub``: Added new resource detail objects to ASFF, including resources for AwsEventsEventbus, AwsEventsEndpoint, AwsDmsEndpoint, AwsDmsReplicationTask, AwsDmsReplicationInstance, AwsRoute53HostedZone, and AwsMskCluster +* api-change:``storagegateway``: Add SoftwareVersion to response of DescribeGatewayInformation. +* api-change:``workspaces``: This release introduces Manage applications. This feature allows users to manage their WorkSpaces applications by associating or disassociating their WorkSpaces with applications. The DescribeWorkspaces API will now additionally return OperatingSystemName in its responses. + + +1.31.60 +======= + +* api-change:``appconfig``: AWS AppConfig introduces KMS customer-managed key (CMK) encryption support for data saved to AppConfig's hosted configuration store. +* api-change:``datazone``: Initial release of Amazon DataZone +* api-change:``mediatailor``: Updates DescribeVodSource to include a list of ad break opportunities in the response +* api-change:``mgn``: This release includes the following new APIs: ListConnectors, CreateConnector, UpdateConnector, DeleteConnector and UpdateSourceServer to support the source action framework feature. +* api-change:``sagemaker``: Adding support for AdditionalS3DataSource, a data source used for training or inference that is in addition to the input dataset or model data. + + +1.31.59 +======= + +* api-change:``connect``: GetMetricDataV2 API: Update to include new metrics CONTACTS_RESOLVED_IN_X , AVG_HOLD_TIME_ALL_CONTACTS , AVG_RESOLUTION_TIME , ABANDONMENT_RATE , AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS with added features: Interval Period, TimeZone, Negate MetricFilters, Extended date time range. +* api-change:``location``: Amazon Location Service adds support for bounding polygon queries. Additionally, the GeofenceCount field has been added to the DescribeGeofenceCollection API response. +* api-change:``mediaconvert``: This release adds the ability to replace video frames without modifying the audio essence. +* api-change:``oam``: This release adds support for sharing AWS::ApplicationInsights::Application resources. +* api-change:``sagemaker``: This release allows users to run Selective Execution in SageMaker Pipelines without SourcePipelineExecutionArn if selected steps do not have any dependent steps. +* api-change:``wellarchitected``: AWS Well-Architected now supports Review Templates that allows you to create templates with pre-filled answers for Well-Architected and Custom Lens best practices. + + +1.31.58 +======= + +* api-change:``bedrock``: Provisioned throughput feature with Amazon and third-party base models, and update validators for model identifier and taggable resource ARNs. +* api-change:``bedrock-runtime``: Add model timeout exception for InvokeModelWithResponseStream API and update validator for invoke model identifier. +* api-change:``ec2``: Introducing Amazon EC2 R7iz instances with 3.9 GHz sustained all-core turbo frequency and deliver up to 20% better performance than previous generation z1d instances. +* api-change:``managedblockchain``: Remove Rinkeby as option from Ethereum APIs +* api-change:``rds``: Adds DefaultCertificateForNewLaunches field in the DescribeCertificates API response. +* api-change:``sso``: Fix FIPS Endpoints in aws-us-gov. +* api-change:``sts``: STS API updates for assumeRole +* api-change:``transfer``: Documentation updates for AWS Transfer Family + + +1.31.57 +======= + +* api-change:``bedrock-runtime``: Run Inference: Added support to run the inference on models. Includes set of APIs for running inference in streaming and non-streaming mode. +* api-change:``bedrock``: Model Invocation logging added to enable or disable logs in customer account. Model listing and description support added. Provisioned Throughput feature added. Custom model support added for creating custom models. Also includes list, and delete functions for custom model. +* api-change:``budgets``: Update DescribeBudgets and DescribeBudgetNotificationsForAccount MaxResults limit to 1000. +* api-change:``ec2``: Adds support for Customer Managed Key encryption for Amazon Verified Access resources +* api-change:``iotfleetwise``: AWS IoT FleetWise now supports encryption through a customer managed AWS KMS key. The PutEncryptionConfiguration and GetEncryptionConfiguration APIs were added. +* api-change:``sagemaker-featurestore-runtime``: Feature Store supports read/write of records with collection type features. +* api-change:``sagemaker``: Online store feature groups supports Standard and InMemory tier storage types for low latency storage for real-time data retrieval. The InMemory tier supports collection types List, Set, and Vector. +* api-change:``wafv2``: Correct and improve the documentation for the FieldToMatch option JA3 fingerprint. + + +1.31.56 +======= + +* api-change:``cognito-idp``: The UserPoolType Status field is no longer used. +* api-change:``firehose``: Features : Adding support for new data ingestion source to Kinesis Firehose - AWS Managed Services Kafka. +* api-change:``iot``: Added support for IoT Rules Engine Kafka Action Headers +* api-change:``textract``: This release adds new feature - Layout to Analyze Document API which can automatically extract layout elements such as titles, paragraphs, headers, section headers, lists, page numbers, footers, table areas, key-value areas and figure areas and order the elements as a human would read. + + +1.31.55 +======= + +* api-change:``appintegrations``: The Amazon AppIntegrations service adds a set of APIs (in preview) to manage third party applications to be used in Amazon Connect agent workspace. +* api-change:``apprunner``: This release allows an App Runner customer to specify a custom source directory to run the build & start command. This change allows App Runner to support monorepo based repositories +* api-change:``codedeploy``: CodeDeploy now supports In-place and Blue/Green EC2 deployments with multiple Classic Load Balancers and multiple Target Groups. +* api-change:``connect``: This release updates a set of Amazon Connect APIs that provides the ability to integrate third party applications in the Amazon Connect agent workspace. +* api-change:``dynamodb``: Amazon DynamoDB now supports Incremental Export as an enhancement to the existing Export Table +* api-change:``ec2``: The release includes AWS verified access to support FIPs compliance in North America regions +* api-change:``lakeformation``: This release adds three new API support "CreateLakeFormationOptIn", "DeleteLakeFormationOptIn" and "ListLakeFormationOptIns", and also updates the corresponding documentation. +* api-change:``pinpoint``: Update documentation for RemoveAttributes to more accurately reflect its behavior when attributes are deleted. +* api-change:``s3``: This release adds a new field COMPLETED to the ReplicationStatus Enum. You can now use this field to validate the replication status of S3 objects using the AWS SDK. + + +1.31.54 +======= + +* api-change:``amplifyuibuilder``: Support for generating code that is compatible with future versions of amplify project dependencies. +* api-change:``chime-sdk-media-pipelines``: Adds support for sending WebRTC audio to Amazon Kineses Video Streams. +* api-change:``emr-serverless``: This release adds support for application-wide default job configurations. +* api-change:``finspace-data``: Adding sensitive trait to attributes. Change max SessionDuration from 720 to 60. Correct "ApiAccess" attribute to "apiAccess" to maintain consistency between APIs. +* api-change:``quicksight``: Added ability to tag users upon creation. +* api-change:``ssm``: This release updates the enum values for ResourceType in SSM DescribeInstanceInformation input and ConnectionStatus in GetConnectionStatus output. +* api-change:``wafv2``: You can now perform an exact match against the web request's JA3 fingerprint. + + +1.31.53 +======= + +* api-change:``braket``: This release adds support to view the device queue depth (the number of queued quantum tasks and hybrid jobs on a device) and queue position for a quantum task and hybrid job. +* api-change:``dms``: new vendors for DMS CSF: MongoDB, MariaDB, DocumentDb and Redshift +* api-change:``ec2``: EC2 M2 Pro Mac instances are powered by Apple M2 Pro Mac Mini computers featuring 12 core CPU, 19 core GPU, 32 GiB of memory, and 16 core Apple Neural Engine and uniquely enabled by the AWS Nitro System through high-speed Thunderbolt connections. +* api-change:``efs``: Update efs client to latest version +* api-change:``guardduty``: Add `EKS_CLUSTER_NAME` to filter and sort key. +* api-change:``mediaconvert``: This release supports the creation of of audio-only tracks in CMAF output groups. + + +1.31.52 +======= + +* api-change:``appconfig``: Enabling boto3 paginators for list APIs and adding documentation around ServiceQuotaExceededException errors +* api-change:``apprunner``: This release adds improvements for managing App Runner auto scaling configuration resources. New APIs: UpdateDefaultAutoScalingConfiguration and ListServicesForAutoScalingConfiguration. Updated API: DeleteAutoScalingConfiguration. +* api-change:``codeartifact``: Add support for the Swift package format. +* api-change:``kinesisvideo``: Updated DescribeMediaStorageConfiguration, StartEdgeConfigurationUpdate, ImageGenerationConfiguration$SamplingInterval, and UpdateMediaStorageConfiguration to match AWS Docs. +* api-change:``logs``: Add ClientToken to QueryDefinition CFN Handler in CWL +* api-change:``s3``: Fix an issue where the SDK can fail to unmarshall response due to NumberFormatException +* api-change:``servicediscovery``: Adds a new DiscoverInstancesRevision API and also adds InstanceRevision field to the DiscoverInstances API response. +* api-change:``sso-oidc``: Update FIPS endpoints in aws-us-gov. + + +1.31.51 +======= + +* api-change:``ec2``: This release adds support for C7i, and R7a instance types. +* api-change:``outposts``: This release adds the InstanceFamilies field to the ListAssets response. +* api-change:``sagemaker``: This release adds support for one-time model monitoring schedules that are executed immediately without delay, explicit data analysis windows for model monitoring schedules and exclude features attributes to remove features from model monitor analysis. + + +1.31.50 +======= + +* api-change:``discovery``: Add sensitive protection for customer information +* api-change:``macie2``: This release changes the default managedDataIdentifierSelector setting for new classification jobs to RECOMMENDED. By default, new classification jobs now use the recommended set of managed data identifiers. +* api-change:``workmail``: This release includes four new APIs UpdateUser, UpdateGroup, ListGroupsForEntity and DescribeEntity, along with RemoteUsers and some enhancements to existing APIs. + + +1.31.49 +======= + +* api-change:``appstream``: This release introduces app block builder, allowing customers to provision a resource to package applications into an app block +* api-change:``connect``: New rule type (OnMetricDataUpdate) has been added +* api-change:``datasync``: Documentation-only updates for AWS DataSync. +* api-change:``sagemaker``: This release introduces Skip Model Validation for Model Packages + + +1.31.48 +======= + +* api-change:``appstream``: This release introduces multi-session fleets, allowing customers to provision more than one user session on a single fleet instance. +* api-change:``cloudformation``: Documentation updates for AWS CloudFormation +* api-change:``entityresolution``: Changed "ResolutionTechniques" and "MappedInputFields" in workflow and schema mapping operations to be required fields. +* api-change:``lookoutequipment``: This release adds APIs for the new scheduled retraining feature. + + +1.31.47 +======= + +* api-change:``cloud9``: Update to include information on Ubuntu 18 deprecation. +* api-change:``drs``: Updated existing APIs and added new ones to support using AWS Elastic Disaster Recovery post-launch actions. Added support for new regions. +* api-change:``firehose``: DocumentIdOptions has been added for the Amazon OpenSearch destination. +* api-change:``guardduty``: Add `managementType` field to ListCoverage API response. +* api-change:``internetmonitor``: This release updates the Amazon CloudWatch Internet Monitor API domain name. +* api-change:``ivs-realtime``: Doc only update that changes description for ParticipantToken. +* api-change:``simspaceweaver``: Edited the introductory text for the API reference. +* api-change:``xray``: Add StartTime field in GetTraceSummaries API response for each TraceSummary. + + +1.31.46 +======= + +* api-change:``ec2``: This release adds support for restricting public sharing of AMIs through AMI Block Public Access +* api-change:``events``: Update events client to latest version +* api-change:``kendra``: Amazon Kendra now supports confidence score buckets for retrieved passage results using the Retrieve API. + + +1.31.45 +======= + +* api-change:``ecr``: This release will have ValidationException be thrown from ECR LifecyclePolicy APIs in regions LifecyclePolicy is not supported, this includes existing Amazon Dedicated Cloud (ADC) regions. This release will also change Tag: TagValue and Tag: TagKey to required. +* api-change:``medialive``: AWS Elemental Link now supports attaching a Link UHD device to a MediaConnect flow. +* api-change:``quicksight``: This release launches new updates to QuickSight KPI visuals - support for sparklines, new templated layout and new targets for conditional formatting rules. + + +1.31.44 +======= + +* api-change:``fsx``: Amazon FSx documentation fixes +* api-change:``sagemaker``: Autopilot APIs will now support holiday featurization for Timeseries models. The models will now hold holiday metadata and should be able to accommodate holiday effect during inference. +* api-change:``sso-admin``: Content updates to IAM Identity Center API for China Regions. +* api-change:``workspaces``: A new field "ErrorDetails" will be added to the output of "DescribeWorkspaceImages" API call. This field provides in-depth details about the error occurred during image import process. These details include the possible causes of the errors and troubleshooting information. + + +1.31.43 +======= + +* api-change:``neptunedata``: Minor changes to send unsigned requests to Neptune clusters +* api-change:``securityhub``: Documentation updates for AWS Security Hub +* api-change:``simspaceweaver``: BucketName and ObjectKey are now required for the S3Location data type. BucketName is now required for the S3Destination data type. + + +1.31.42 +======= + +* api-change:``appflow``: Adding OAuth2.0 support for servicenow connector. +* api-change:``ec2``: This release adds 'outpost' location type to the DescribeInstanceTypeOfferings API, allowing customers that have been allowlisted for outpost to query their offerings in the API. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``medialive``: Adds advanced Output Locking options for Epoch Locking: Custom Epoch and Jam Sync Time +* api-change:``wafv2``: The targeted protection level of the Bot Control managed rule group now provides optional, machine-learning analysis of traffic statistics to detect some bot-related activity. You can enable or disable the machine learning functionality through the API. + + +1.31.41 +======= + +* api-change:``billingconductor``: This release adds support for line item filtering in for the custom line item resource. +* api-change:``cloud9``: Added support for Ubuntu 22.04 that was not picked up in a previous Trebuchet request. Doc-only update. +* api-change:``compute-optimizer``: This release adds support to provide recommendations for G4dn and P3 instances that use NVIDIA GPUs. +* api-change:``ec2``: Introducing Amazon EC2 C7gd, M7gd, and R7gd Instances with up to 3.8 TB of local NVMe-based SSD block-level storage. These instances are powered by AWS Graviton3 processors, delivering up to 25% better performance over Graviton2-based instances. +* api-change:``ecs``: Documentation only update for Amazon ECS. +* api-change:``events``: Update events client to latest version +* api-change:``rds``: Add support for feature integration with AWS Backup. +* api-change:``sagemaker``: SageMaker Neo now supports data input shape derivation for Pytorch 2.0 and XGBoost compilation job for cloud instance targets. You can skip DataInputConfig field during compilation job creation. You can also access derived information from model in DescribeCompilationJob response. +* api-change:``vpc-lattice``: This release adds Lambda event structure version config support for LAMBDA target groups. It also adds newline support for auth policies. + + +1.31.40 +======= + +* api-change:``chime-sdk-media-pipelines``: This release adds support for the Voice Analytics feature for customer-owned KVS streams as part of the Amazon Chime SDK call analytics. +* api-change:``connect``: Amazon Connect adds the ability to read, create, update, delete, and list view resources, and adds the ability to read, create, delete, and list view versions. +* api-change:``identitystore``: New Identity Store content for China Region launch +* api-change:``neptunedata``: Removed the descriptive text in the introduction. + + +1.31.39 +======= + +* api-change:``chime-sdk-media-pipelines``: This release adds support for feature Voice Enhancement for Call Recording as part of Amazon Chime SDK call analytics. +* api-change:``cloudhsm``: Deprecating CloudHSM Classic API Service. +* api-change:``connectcampaigns``: Amazon Connect outbound campaigns has launched agentless dialing mode which enables customers to make automated outbound calls without agent engagement. This release updates three of the campaign management API's to support the new agentless dialing mode and the new dialing capacity field. +* api-change:``connectparticipant``: Amazon Connect Participant Service adds the ability to get a view resource using a view token, which is provided in a participant message, with the release of the DescribeView API. +* api-change:``customer-profiles``: Adds sensitive trait to various shapes in Customer Profiles API model. +* api-change:``ecs``: This release adds support for an account-level setting that you can use to configure the number of days for AWS Fargate task retirement. +* api-change:``grafana``: Marking SAML RoleValues attribute as sensitive and updating VpcConfiguration attributes to match documentation. +* api-change:``health``: Adds new API DescribeEntityAggregatesForOrganization that retrieves entity aggregates across your organization. Also adds support for resource status filtering in DescribeAffectedEntitiesForOrganization, resource status aggregates in the DescribeEntityAggregates response, and new resource statuses. +* api-change:``ivs``: Updated "type" description for CreateChannel, UpdateChannel, Channel, and ChannelSummary. +* api-change:``kafkaconnect``: Minor model changes for Kafka Connect as well as endpoint updates. +* api-change:``payment-cryptography-data``: Make KeyCheckValue field optional when using asymmetric keys as Key Check Values typically only apply to symmetric keys +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version + + +1.31.38 +======= + +* api-change:``appflow``: Add SAP source connector parallel and pagination feature +* api-change:``apprunner``: App Runner adds support for Bitbucket. You can now create App Runner connection that connects to your Bitbucket repositories and deploy App Runner service with the source code stored in a Bitbucket repository. +* api-change:``auditmanager``: This release marks some assessment metadata as sensitive. We added a sensitive trait to the following attributes: assessmentName, emailAddress, scope, createdBy, lastUpdatedBy, and userName. +* api-change:``cleanrooms``: This release decouples member abilities in a collaboration. With this change, the member who can run queries no longer needs to be the same as the member who can receive results. +* api-change:``datasync``: AWS DataSync introduces Task Reports, a new feature that provides detailed reports of data transfer operations for each task execution. +* api-change:``neptunedata``: Allows customers to execute data plane actions like bulk loading graphs, issuing graph queries using Gremlin and openCypher directly from the SDK. +* api-change:``network-firewall``: Network Firewall increasing pagination token string length +* api-change:``pca-connector-ad``: The Connector for AD allows you to use a fully-managed AWS Private CA as a drop-in replacement for your self-managed enterprise CAs without local agents or proxy servers. Enterprises that use AD to manage Windows environments can reduce their private certificate authority (CA) costs and complexity. +* api-change:``sagemaker``: Amazon SageMaker Canvas adds IdentityProviderOAuthSettings support for CanvasAppSettings + + +1.31.37 +======= + +* api-change:``cognito-idp``: Added API example requests and responses for several operations. Fixed the validation regex for user pools Identity Provider name. +* api-change:``fsx``: Documentation updates for project quotas. +* api-change:``omics``: Add RetentionMode support for Runs. +* api-change:``sesv2``: Adds support for the new Export and Message Insights features: create, get, list and cancel export jobs; get message insights. + + +1.31.36 +======= + +* api-change:``backup``: Add support for customizing time zone for backup window in backup plan rules. +* api-change:``compute-optimizer``: This release enables AWS Compute Optimizer to analyze and generate licensing optimization recommendations for sql server running on EC2 instances. +* api-change:``organizations``: Documentation updates for permissions and links. +* api-change:``securitylake``: Remove incorrect regex enforcement on pagination tokens. +* api-change:``service-quotas``: Service Quotas now supports viewing the applied quota value and requesting a quota increase for a specific resource in an AWS account. +* api-change:``workspaces-web``: WorkSpaces Web now enables Admins to configure which cookies are synchronized from an end-user's local browser to the in-session browser. In conjunction with a browser extension, this feature enables enhanced Single-Sign On capability by reducing the number of times an end-user has to authenticate. + + +1.31.35 +======= + +* api-change:``cloudtrail``: Add ThrottlingException with error code 429 to handle CloudTrail Delegated Admin request rate exceeded on organization resources. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``detective``: Added protections to interacting with fields containing customer information. + + +1.31.34 +======= + +* api-change:``ec2``: Amazon EC2 M7a instances, powered by 4th generation AMD EPYC processors, deliver up to 50% higher performance compared to M6a instances. Amazon EC2 Hpc7a instances, powered by 4th Gen AMD EPYC processors, deliver up to 2.5x better performance compared to Amazon EC2 Hpc6a instances. +* api-change:``glue``: Added API attributes that help in the monitoring of sessions. +* api-change:``mediaconvert``: This release includes additional audio channel tags in Quicktime outputs, support for film grain synthesis for AV1 outputs, ability to create audio-only FLAC outputs, and ability to specify Amazon S3 destination storage class. +* api-change:``medialive``: MediaLive now supports passthrough of KLV data to a HLS output group with a TS container. MediaLive now supports setting an attenuation mode for AC3 audio when the coding mode is 3/2 LFE. MediaLive now supports specifying whether to include filler NAL units in RTMP output group settings. +* api-change:``mediatailor``: Adds new source location AUTODETECT_SIGV4 access type. +* api-change:``quicksight``: Excel support in Snapshot Export APIs. Removed Required trait for some insight Computations. Namespace-shared Folders support. Global Filters support. Table pin Column support. +* api-change:``rds``: This release updates the supported versions for Percona XtraBackup in Aurora MySQL. +* api-change:``s3control``: Updates to endpoint ruleset tests to address Smithy validation issues and standardize the capitalization of DualStack. +* api-change:``verifiedpermissions``: Documentation updates for Amazon Verified Permissions. + + +1.31.33 +======= + +* api-change:``apigateway``: This release adds RootResourceId to GetRestApi response. +* api-change:``ec2``: Marking fields as sensitive on BundleTask and GetPasswordData +* api-change:``polly``: Amazon Polly adds 1 new voice - Zayd (ar-AE) + + +1.31.32 +======= + +* api-change:``ce``: This release adds the LastUpdatedDate and LastUsedDate timestamps to help you manage your cost allocation tags. +* api-change:``globalaccelerator``: Global Accelerator now supports Client Ip Preservation for Network Load Balancer endpoints. +* api-change:``rds``: Adding parameters to CreateCustomDbEngineVersion reserved for future use. +* api-change:``verifiedpermissions``: Documentation updates for Amazon Verified Permissions. Increases max results per page for ListPolicyStores, ListPolicies, and ListPolicyTemplates APIs from 20 to 50. + + +1.31.31 +======= + +* api-change:``cloud9``: Doc only update to add Ubuntu 22.04 as an Image ID option for Cloud9 +* api-change:``ec2``: The DeleteKeyPair API has been updated to return the keyPairId when an existing key pair is deleted. +* api-change:``finspace``: Allow customers to manage outbound traffic from their Kx Environment when attaching a transit gateway by providing network acl entries. Allow the customer to choose how they want to update the databases on a cluster allowing updates to possibly be faster than usual. +* api-change:``rds``: Adding support for RDS Aurora Global Database Unplanned Failover +* api-change:``route53domains``: Fixed typos in description fields + + +1.31.30 +======= + +* api-change:``codecommit``: Add new ListFileCommitHistory operation to retrieve commits which introduced changes to a specific file. +* api-change:``securityhub``: Added Inspector Lambda code Vulnerability section to ASFF, including GeneratorDetails, EpssScore, ExploitAvailable, and CodeVulnerabilities. + + +1.31.29 +======= + +* api-change:``ec2``: Adds support for SubnetConfigurations to allow users to select their own IPv4 and IPv6 addresses for Interface VPC endpoints +* api-change:``gamelift``: Amazon GameLift updates its instance types support. + + +1.31.28 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``lexv2-models``: Update lexv2-models client to latest version + + +1.31.27 +======= + +* enhancement:Python: Added provisional Python 3.12 support to Botocore +* api-change:``chime-sdk-meetings``: Updated API documentation to include additional exceptions. +* api-change:``ec2``: Documentation updates for Elastic Compute Cloud (EC2). +* api-change:``glue``: AWS Glue Crawlers can now accept SerDe overrides from a custom csv classifier. The two SerDe options are LazySimpleSerDe and OpenCSVSerDe. In case, the user wants crawler to do the selection, "None" can be selected for this purpose. +* api-change:``pi``: AWS Performance Insights for Amazon RDS is launching Performance Analysis On Demand, a new feature that allows you to analyze database performance metrics and find out the performance issues. You can now use SDK to create, list, get, delete, and manage tags of performance analysis reports. +* api-change:``route53domains``: Provide explanation if CheckDomainTransferability return false. Provide requestId if a request is already submitted. Add sensitive protection for customer information +* api-change:``sagemaker``: SageMaker Inference Recommender now provides SupportedResponseMIMETypes from DescribeInferenceRecommendationsJob response + + +1.31.26 +======= + +* api-change:``mediapackage``: Fix SDK logging of certain fields. +* api-change:``omics``: This release provides support for annotation store versioning and cross account sharing for Omics Analytics +* api-change:``transfer``: Documentation updates for AWS Transfer Family + + +1.31.25 +======= + +* api-change:``amplifybackend``: Adds sensitive trait to required input shapes. +* api-change:``config``: Updated ResourceType enum with new resource types onboarded by AWS Config in July 2023. +* api-change:``ec2``: Amazon EC2 P5 instances, powered by the latest NVIDIA H100 Tensor Core GPUs, deliver the highest performance in EC2 for deep learning (DL) and HPC applications. M7i-flex and M7i instances are next-generation general purpose instances powered by custom 4th Generation Intel Xeon Scalable processors. +* api-change:``quicksight``: New Authentication method for Account subscription - IAM Identity Center. Hierarchy layout support, default column width support and related style properties for pivot table visuals. Non-additive topic field aggregations for Topic API +* api-change:``ses``: Update ses client to latest version +* api-change:``swf``: This release adds new API parameters to override workflow task list for workflow executions. + + +1.31.24 +======= + +* api-change:``cloudtrail``: Documentation updates for CloudTrail. +* api-change:``connect``: This release adds APIs to provision agents that are global / available in multiple AWS regions and distribute them across these regions by percentage. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``omics``: This release adds instanceType to GetRunTask & ListRunTasks responses. +* api-change:``secretsmanager``: Add additional InvalidRequestException to list of possible exceptions for ListSecret. +* api-change:``transfer``: Documentation updates for AW Transfer Family + + +1.31.23 +======= + +* api-change:``chime-sdk-voice``: Updating CreatePhoneNumberOrder, UpdatePhoneNumber and BatchUpdatePhoneNumbers APIs, adding phone number name +* api-change:``fsx``: For FSx for Lustre, add new data repository task type, RELEASE_DATA_FROM_FILESYSTEM, to release files that have been archived to S3. For FSx for Windows, enable support for configuring and updating SSD IOPS, and for updating storage type. For FSx for OpenZFS, add new deployment type, MULTI_AZ_1. +* api-change:``globalaccelerator``: Documentation update for dualstack EC2 endpoint support +* api-change:``guardduty``: Added autoEnable ALL to UpdateOrganizationConfiguration and DescribeOrganizationConfiguration APIs. +* api-change:``sagemaker``: This release adds support for cross account access for SageMaker Model Cards through AWS RAM. + + +1.31.22 +======= + +* api-change:``backup``: This release introduces a new logically air-gapped vault (Preview) in AWS Backup that stores immutable backup copies, which are locked by default and isolated with encryption using AWS owned keys. Logically air-gapped vault (Preview) allows secure recovery of application data across accounts. +* api-change:``elasticache``: Added support for cluster mode in online migration and test migration API +* api-change:``servicecatalog``: Introduce support for HashiCorp Terraform Cloud in Service Catalog by addying TERRAFORM_CLOUD product type in CreateProduct and CreateProvisioningArtifact API. + + +1.31.21 +======= + +* api-change:``detective``: Updated the email validation regex to be in line with the TLD name specifications. +* api-change:``ivs-realtime``: Add QUOTA_EXCEEDED and PUBLISHER_NOT_FOUND to EventErrorCode for stage health events. +* api-change:``kinesis-video-archived-media``: This release enables minimum of Images SamplingInterval to be as low as 200 milliseconds in Kinesis Video Stream Image feature. +* api-change:``kinesisvideo``: This release enables minimum of Images SamplingInterval to be as low as 200 milliseconds in Kinesis Video Stream Image feature. +* api-change:``rekognition``: This release adds code snippets for Amazon Rekognition Custom Labels. + + +1.31.20 +======= + +* api-change:``acm-pca``: Documentation correction for AWS Private CA +* api-change:``connect``: Added a new API UpdateRoutingProfileAgentAvailabilityTimer to update agent availability timer of a routing profile. +* api-change:``datasync``: Display cloud storage used capacity at a cluster level. +* api-change:``ecs``: This is a documentation update to address various tickets. +* api-change:``sagemaker``: Including DataCaptureConfig key in the Amazon Sagemaker Search's transform job object + + +1.31.19 +======= + +* api-change:``autoscaling``: Documentation changes related to Amazon EC2 Auto Scaling APIs. +* api-change:``cloud9``: Updated the deprecation date for Amazon Linux. Doc only update. +* api-change:``dms``: The release makes public API for DMS Schema Conversion feature. +* api-change:``ec2``: This release adds new parameter isPrimaryIPv6 to allow assigning an IPv6 address as a primary IPv6 address to a network interface which cannot be changed to give equivalent functionality available for network interfaces with primary IPv4 address. +* api-change:``sagemaker``: Amazon SageMaker now supports running training jobs on p5.48xlarge instance types. + + +1.31.18 +======= + +* api-change:``budgets``: As part of CAE tagging integration we need to update our budget names regex filter to prevent customers from using "/action/" in their budget names. +* api-change:``cognito-idp``: New feature that logs Cognito user pool error messages to CloudWatch logs. +* api-change:``glue``: This release includes additional Glue Streaming KAKFA SASL property types. +* api-change:``resiliencehub``: Drift Detection capability added when applications policy has moved from a meet to breach state. Customers will be able to exclude operational recommendations and receive credit in their resilience score. Customers can now add ARH permissions to an existing or new role. +* api-change:``sagemaker``: SageMaker Inference Recommender introduces a new API GetScalingConfigurationRecommendation to recommend auto scaling policies based on completed Inference Recommender jobs. + + +1.31.17 +======= + +* api-change:``batch``: This release adds support for price capacity optimized allocation strategy for Spot Instances. +* api-change:``dms``: Adding new API describe-engine-versions which provides information about the lifecycle of a replication instance's version. +* api-change:``internetmonitor``: This release adds a new feature for Amazon CloudWatch Internet Monitor that enables customers to set custom thresholds, for performance and availability drops, for impact limited to a single city-network to trigger creation of a health event. +* api-change:``medialive``: AWS Elemental Link devices now report their Availability Zone. Link devices now support the ability to change their Availability Zone. +* api-change:``polly``: Amazon Polly adds new French Belgian voice - Isabelle. Isabelle is available as Neural voice only. +* api-change:``rds``: Added support for deleted clusters PiTR. +* api-change:``sagemaker``: Add Stairs TrafficPattern and FlatInvocations to RecommendationJobStoppingConditions + + +1.31.16 +======= + +* api-change:``amplifyuibuilder``: Amplify Studio releases GraphQL support for codegen job action. +* api-change:``autoscaling``: You can now configure an instance refresh to set its status to 'failed' when it detects that a specified CloudWatch alarm has gone into the ALARM state. You can also choose to roll back the instance refresh automatically when the alarm threshold is met. +* api-change:``cleanrooms``: This release introduces custom SQL queries - an expanded set of SQL you can run. This release adds analysis templates, a new resource for storing pre-defined custom SQL queries ahead of time. This release also adds the Custom analysis rule, which lets you approve analysis templates for querying. +* api-change:``codestar-connections``: New integration with the Gitlab provider type. +* api-change:``drs``: Add support for in-aws right sizing +* api-change:``inspector2``: This release adds 1 new API: BatchGetFindingDetails to retrieve enhanced vulnerability intelligence details for findings. +* api-change:``lookoutequipment``: This release includes new import resource, model versioning and resource policy features. +* api-change:``omics``: Add CreationType filter for ListReadSets +* api-change:``rds``: This release adds support for Aurora MySQL local write forwarding, which allows for forwarding of write operations from reader DB instances to the writer DB instance. +* api-change:``route53``: Amazon Route 53 now supports the Israel (Tel Aviv) Region (il-central-1) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. +* api-change:``scheduler``: This release introduces automatic deletion of schedules in EventBridge Scheduler. If configured, EventBridge Scheduler automatically deletes a schedule after the schedule has completed its last invocation. + + +1.31.15 +======= + +* enhancement:HTTP: Move 100-continue behavior to use `HTTPConnections` request interface. +* api-change:``application-insights``: This release enable customer to add/remove/update more than one workload for a component +* api-change:``cloudformation``: This SDK release is for the feature launch of AWS CloudFormation RetainExceptOnCreate. It adds a new parameter retainExceptOnCreate in the following APIs: CreateStack, UpdateStack, RollbackStack, ExecuteChangeSet. +* api-change:``cloudfront``: Add a new JavaScript runtime version for CloudFront Functions. +* api-change:``connect``: This release adds support for new number types. +* api-change:``kafka``: Amazon MSK has introduced new versions of ListClusterOperations and DescribeClusterOperation APIs. These v2 APIs provide information and insights into the ongoing operations of both MSK Provisioned and MSK Serverless clusters. +* api-change:``pinpoint``: Added support for sending push notifications using the FCM v1 API with json credentials. Amazon Pinpoint customers can now deliver messages to Android devices using both FCM v1 API and the legacy FCM/GCM API + + +1.31.14 +======= + +* enhancement:compression: Adds support for the ``requestcompression`` operation trait. +* api-change:``sqs``: Documentation changes related to SQS APIs. + + +1.31.13 +======= + +* api-change:``autoscaling``: This release updates validation for instance types used in the AllowedInstanceTypes and ExcludedInstanceTypes parameters of the InstanceRequirements property of a MixedInstancesPolicy. +* api-change:``ebs``: SDK and documentation updates for Amazon Elastic Block Store API +* api-change:``ec2``: SDK and documentation updates for Amazon Elastic Block Store APIs +* api-change:``eks``: Add multiple customer error code to handle customer caused failure when managing EKS node groups +* api-change:``sagemaker``: Expose ProfilerConfig attribute in SageMaker Search API response. + + +1.31.12 +======= + +* api-change:``cloudcontrol``: Updates the documentation for CreateResource. +* api-change:``entityresolution``: AWS Entity Resolution can effectively match a source record from a customer relationship management (CRM) system with a source record from a marketing system containing campaign information. +* api-change:``glue``: Release Glue Studio Snowflake Connector Node for SDK/CLI +* api-change:``healthlake``: Updating the HealthLake service documentation. +* api-change:``managedblockchain-query``: Amazon Managed Blockchain (AMB) Query provides serverless access to standardized, multi-blockchain datasets with developer-friendly APIs. +* api-change:``mediaconvert``: This release includes general updates to user documentation. +* api-change:``omics``: The service is renaming as a part of AWS Health. +* api-change:``opensearchserverless``: This release adds new collection type VectorSearch. +* api-change:``polly``: Amazon Polly adds 1 new voice - Lisa (nl-BE) +* api-change:``route53``: Update that corrects the documents for received feedback. + + +1.31.11 +======= + +* api-change:``billingconductor``: Added support for Auto-Assocate Billing Groups for CreateBillingGroup, UpdateBillingGroup, and ListBillingGroups. +* api-change:``customer-profiles``: Amazon Connect Customer Profiles now supports rule-based resolution to match and merge similar profiles into unified profiles, helping companies deliver faster and more personalized customer service by providing access to relevant customer information for agents and automated experiences. +* api-change:``datasync``: AWS DataSync now supports Microsoft Azure Blob Storage locations. +* api-change:``dynamodb``: Documentation updates for DynamoDB +* api-change:``ec2``: This release adds an instance's peak and baseline network bandwidth as well as the memory sizes of an instance's inference accelerators to DescribeInstanceTypes. +* api-change:``emr-serverless``: This release adds support for publishing application logs to CloudWatch. +* api-change:``lambda``: Add Python 3.11 (python3.11) support to AWS Lambda +* api-change:``rds``: This release adds support for monitoring storage optimization progress on the DescribeDBInstances API. +* api-change:``sagemaker``: Mark ContentColumn and TargetLabelColumn as required Targets in TextClassificationJobConfig in CreateAutoMLJobV2API +* api-change:``securityhub``: Add support for CONTAINS and NOT_CONTAINS comparison operators for Automation Rules string filters and map filters +* api-change:``sts``: API updates for the AWS Security Token Service +* api-change:``transfer``: This release adds support for SFTP Connectors. +* api-change:``wisdom``: This release added two new data types: AssistantIntegrationConfiguration, and SessionIntegrationConfiguration to support Wisdom integration with Amazon Connect Chat + + +1.31.10 +======= + +* api-change:``apigatewayv2``: Documentation updates for Amazon API Gateway. +* api-change:``ce``: This release introduces the new API 'GetSavingsPlanPurchaseRecommendationDetails', which retrieves the details for a Savings Plan recommendation. It also updates the existing API 'GetSavingsPlansPurchaseRecommendation' to include the recommendation detail ID. +* api-change:``chime-sdk-media-pipelines``: AWS Media Pipeline compositing enhancement and Media Insights Pipeline auto language identification. +* api-change:``cloudformation``: This release supports filtering by DRIFT_STATUS for existing API ListStackInstances and adds support for a new API ListStackInstanceResourceDrifts. Customers can now view resource drift information from their StackSet management accounts. +* api-change:``ec2``: Add "disabled" enum value to SpotInstanceState. +* api-change:``glue``: Added support for Data Preparation Recipe node in Glue Studio jobs +* api-change:``quicksight``: This release launches new Snapshot APIs for CSV and PDF exports, adds support for info icon for filters and parameters in Exploration APIs, adds modeled exception to the DeleteAccountCustomization API, and introduces AttributeAggregationFunction's ability to add UNIQUE_VALUE aggregation in tooltips. + + +1.31.9 +====== + +* api-change:``glue``: This release adds support for AWS Glue Crawler with Apache Hudi Tables, allowing Crawlers to discover Hudi Tables in S3 and register them in Glue Data Catalog for query engines to query against. +* api-change:``mediaconvert``: This release includes improvements to Preserve 444 handling, compatibility of HEVC sources without frame rates, and general improvements to MP4 outputs. +* api-change:``rds``: Adds support for the DBSystemID parameter of CreateDBInstance to RDS Custom for Oracle. +* api-change:``workspaces``: Fixed VolumeEncryptionKey descriptions + + +1.31.8 +====== + +* api-change:``codecatalyst``: This release adds support for updating and deleting spaces and projects in Amazon CodeCatalyst. It also adds support for creating, getting, and deleting source repositories in CodeCatalyst projects. +* api-change:``connectcases``: This release adds the ability to assign a case to a queue or user. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``route53resolver``: This release adds support for Route 53 On Outposts, a new feature that allows customers to run Route 53 Resolver and Resolver endpoints locally on their Outposts. +* api-change:``s3``: Improve performance of S3 clients by simplifying and optimizing endpoint resolution. +* api-change:``sagemaker-featurestore-runtime``: Cross account support for SageMaker Feature Store +* api-change:``sagemaker``: Cross account support for SageMaker Feature Store +* api-change:``securitylake``: Adding support for Tags on Create and Resource Tagging API. +* api-change:``transcribe``: Added API argument --toxicity-detection to startTranscriptionJob API, which allows users to view toxicity scores of submitted audio. + + +1.31.7 +====== + +* enhancement:AWSCRT: Upgrade awscrt version to 0.16.26 +* api-change:``savingsplans``: Savings Plans endpoints update + + +1.31.6 +====== + +* api-change:``cloudformation``: SDK and documentation updates for GetTemplateSummary API (unrecognized resources) +* api-change:``ec2``: Amazon EC2 documentation updates. +* api-change:``grafana``: Amazon Managed Grafana now supports grafanaVersion update for existing workspaces with UpdateWorkspaceConfiguration API. DescribeWorkspaceConfiguration API additionally returns grafanaVersion. A new ListVersions API lists available versions or, if given a workspaceId, the versions it can upgrade to. +* api-change:``medical-imaging``: General Availability (GA) release of AWS Health Imaging, enabling customers to store, transform, and analyze medical imaging data at petabyte-scale. +* api-change:``ram``: This release adds support for securely sharing with AWS service principals. +* api-change:``ssm-sap``: Added support for SAP Hana High Availability discovery (primary and secondary nodes) and Backint agent installation with SSM for SAP. +* api-change:``wafv2``: Added the URI path to the custom aggregation keys that you can specify for a rate-based rule. + + +1.31.5 +====== + +* api-change:``codeguru-security``: Documentation updates for CodeGuru Security. +* api-change:``connect``: GetMetricDataV2 API: Update to include Contact Lens Conversational Analytics Metrics +* api-change:``es``: Regex Validation on the ElasticSearch Engine Version attribute +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``m2``: Allows UpdateEnvironment to update the environment to 0 host capacity. New GetSignedBluinsightsUrl API +* api-change:``snowball``: Adds support for RACK_5U_C. This is the first AWS Snow Family device designed to meet U.S. Military Ruggedization Standards (MIL-STD-810H) with 208 vCPU device in a portable, compact 5U, half-rack width form-factor. +* api-change:``translate``: Added DOCX word document support to TranslateDocument API + + +1.31.4 +====== + +* api-change:``codeartifact``: Doc only update for AWS CodeArtifact +* api-change:``docdb``: Added major version upgrade option in ModifyDBCluster API +* api-change:``ec2``: Add Nitro TPM support on DescribeInstanceTypes +* api-change:``glue``: Adding new supported permission type flags to get-unfiltered endpoints that callers may pass to indicate support for enforcing Lake Formation fine-grained access control on nested column attributes. +* api-change:``ivs``: This release provides the flexibility to configure what renditions or thumbnail qualities to record when creating recording configuration. +* api-change:``lakeformation``: Adds supports for ReadOnlyAdmins and AllowFullTableExternalDataAccess. Adds NESTED_PERMISSION and NESTED_CELL_PERMISSION to SUPPORTED_PERMISSION_TYPES enum. Adds CREATE_LF_TAG on catalog resource and ALTER, DROP, and GRANT_WITH_LF_TAG_EXPRESSION on LF Tag resource. + + +1.31.3 +====== + +* api-change:``cognito-idp``: API model updated in Amazon Cognito +* api-change:``connect``: Add support for deleting Queues and Routing Profiles. +* api-change:``datasync``: Added LunCount to the response object of DescribeStorageSystemResourcesResponse, LunCount represents the number of LUNs on a storage system resource. +* api-change:``dms``: Enhanced PostgreSQL target endpoint settings for providing Babelfish support. +* api-change:``ec2``: This release adds support for the C7gn and Hpc7g instances. C7gn instances are powered by AWS Graviton3 processors and the fifth-generation AWS Nitro Cards. Hpc7g instances are powered by AWS Graviton 3E processors and provide up to 200 Gbps network bandwidth. +* api-change:``fsx``: Amazon FSx for NetApp ONTAP now supports SnapLock, an ONTAP feature that enables you to protect your files in a volume by transitioning them to a write once, read many (WORM) state. +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``mediatailor``: Adds categories to MediaTailor channel assembly alerts +* api-change:``personalize``: This release provides ability to customers to change schema associated with their datasets in Amazon Personalize +* api-change:``proton``: This release adds support for deployment history for Proton provisioned resources +* api-change:``s3``: S3 Inventory now supports Object Access Control List and Object Owner as available object metadata fields in inventory reports. +* api-change:``sagemaker``: Amazon SageMaker Canvas adds WorkspeceSettings support for CanvasAppSettings +* api-change:``secretsmanager``: Documentation updates for Secrets Manager + + +1.31.2 +====== + +* bugfix:s3: Fix s3 presigned URLs for operations with query components (`#2962 `__) +* api-change:``cognito-idp``: API model updated in Amazon Cognito + + +1.31.1 +====== + +* api-change:``dms``: Releasing DMS Serverless. Adding support for PostgreSQL 15.x as source and target endpoint. Adding support for DocDB Elastic Clusters with sharded collections, PostgreSQL datatype mapping customization and disabling hostname validation of the certificate authority in Kafka endpoint settings +* api-change:``glue``: This release enables customers to create new Apache Iceberg tables and associated metadata in Amazon S3 by using native AWS Glue CreateTable operation. +* api-change:``logs``: Add CMK encryption support for CloudWatch Logs Insights query result data +* api-change:``medialive``: This release enables the use of Thumbnails in AWS Elemental MediaLive. +* api-change:``mediatailor``: The AWS Elemental MediaTailor SDK for Channel Assembly has added support for EXT-X-CUE-OUT and EXT-X-CUE-IN tags to specify ad breaks in HLS outputs, including support for EXT-OATCLS, EXT-X-ASSET, and EXT-X-CUE-OUT-CONT accessory tags. + + +1.31.0 +====== + +* api-change:``ec2``: Add Nitro Enclaves support on DescribeInstanceTypes +* api-change:``location``: This release adds support for authenticating with Amazon Location Service's Places & Routes APIs with an API Key. Also, with this release developers can publish tracked device position updates to Amazon EventBridge. +* api-change:``outposts``: Added paginator support to several APIs. Added the ISOLATED enum value to AssetState. +* api-change:``quicksight``: This release includes below three changes: small multiples axes improvement, field based coloring, removed required trait from Aggregation function for TopBottomFilter. +* api-change:``rds``: Updates Amazon RDS documentation for creating DB instances and creating Aurora global clusters. +* bugfix:configprovider: Fix bug when deep copying config value store where overrides were not preserved +* enhancement:configprovider: Always use shallow copy of session config value store for clients +* feature:configuration: Configure the endpoint URL in the shared configuration file or via an environment variable for a specific AWS service or all AWS services. + + +1.30.1 +====== + +* api-change:``comprehendmedical``: Update to Amazon Comprehend Medical documentation. +* api-change:``connect``: GetMetricDataV2 API: Channels filters do not count towards overall limitation of 100 filter values. +* api-change:``kms``: Added Dry Run Feature to cryptographic and cross-account mutating KMS APIs (14 in all). This feature allows users to test their permissions and parameters before making the actual API call. +* api-change:``mgn``: This release introduces the Global view feature and new Replication state APIs. +* api-change:``securityhub``: Documentation updates for AWS Security Hub + + +1.30.0 +====== + +* feature:Useragent: Update User-Agent header format +* api-change:``batch``: This feature allows customers to use AWS Batch with Linux with ARM64 CPU Architecture and X86_64 CPU Architecture with Windows OS on Fargate Platform. +* api-change:``sagemaker``: SageMaker Inference Recommender now accepts new fields SupportedEndpointType and ServerlessConfiguration to support serverless endpoints. + + +1.29.165 +======== + +* api-change:``amp``: AWS SDK service model generation tool version upgrade. +* api-change:``ecs``: Added new field "credentialspecs" to the ecs task definition to support gMSA of windows/linux in both domainless and domain-joined mode +* api-change:``ivs``: Corrects the HTTP response code in the generated docs for PutMetadata and DeleteRecordingConfiguration APIs. +* api-change:``mediaconvert``: This release includes improved color handling of overlays and general updates to user documentation. +* api-change:``sagemaker``: This release adds support for rolling deployment in SageMaker Inference. +* api-change:``transfer``: Add outbound Basic authentication support to AS2 connectors +* api-change:``verifiedpermissions``: This release corrects several broken links in the documentation. + + +1.29.164 +======== + +* api-change:``appstream``: This release introduces app block builder, allowing customers to provision a resource to package applications into an app block +* api-change:``chime``: The Amazon Chime SDK APIs in the Chime namespace are no longer supported. Customers should use APIs in the dedicated Amazon Chime SDK namespaces: ChimeSDKIdentity, ChimeSDKMediaPipelines, ChimeSDKMeetings, ChimeSDKMessaging, and ChimeSDKVoice. +* api-change:``cleanrooms``: This release adds support for the OR operator in RSQL join match conditions and the ability to control which operators (AND, OR) are allowed in a join match condition. +* api-change:``dynamodb``: This release adds ReturnValuesOnConditionCheckFailure parameter to PutItem, UpdateItem, DeleteItem, ExecuteStatement, BatchExecuteStatement and ExecuteTransaction APIs. When set to ALL_OLD, API returns a copy of the item as it was when a conditional write failed +* api-change:``gamelift``: Amazon GameLift now supports game builds that use the Amazon Linux 2023 (AL2023) operating system. +* api-change:``glue``: This release adds support for AWS Glue Crawler with Iceberg Tables, allowing Crawlers to discover Iceberg Tables in S3 and register them in Glue Data Catalog for query engines to query against. +* api-change:``sagemaker``: Adding support for timeseries forecasting in the CreateAutoMLJobV2 API. + + +1.29.163 +======== + +* api-change:``internetmonitor``: This release adds a new feature for Amazon CloudWatch Internet Monitor that enables customers to set custom thresholds, for performance and availability drops, for triggering when to create a health event. +* api-change:``kinesisanalyticsv2``: Support for new runtime environment in Kinesis Data Analytics Studio: Zeppelin-0.10, Apache Flink-1.15 +* api-change:``lambda``: Surface ResourceConflictException in DeleteEventSourceMapping +* api-change:``omics``: Add Common Workflow Language (CWL) as a supported language for Omics workflows +* api-change:``rds``: Amazon Relational Database Service (RDS) now supports joining a RDS for SQL Server instance to a self-managed Active Directory. +* api-change:``s3``: The S3 LISTObjects, ListObjectsV2 and ListObjectVersions API now supports a new optional header x-amz-optional-object-attributes. If header contains RestoreStatus as the value, then S3 will include Glacier restore status i.e. isRestoreInProgress and RestoreExpiryDate in List response. +* api-change:``sagemaker``: This release adds support for Model Cards Model Registry integration. + + +1.29.162 +======== + +* bugfix:Parsers: Fixes datetime parse error handling for out-of-range and negative timestamps (`#2564 `__). +* api-change:``appfabric``: Initial release of AWS AppFabric for connecting SaaS applications for better productivity and security. +* api-change:``appflow``: This release adds support to bypass SSO with the SAPOData connector when connecting to an SAP instance. +* api-change:``emr-serverless``: This release adds support to update the release label of an EMR Serverless application to upgrade it to a different version of Amazon EMR via UpdateApplication API. +* api-change:``ivs``: IVS customers can now revoke the viewer session associated with an auth token, to prevent and stop playback using that token. +* api-change:``kinesisvideo``: General Availability (GA) release of Kinesis Video Streams at Edge, enabling customers to provide a configuration for the Kinesis Video Streams EdgeAgent running on an on-premise IoT device. Customers can now locally record from cameras and stream videos to the cloud on a configured schedule. +* api-change:``macie2``: This release adds support for configuring new classification jobs to use the set of managed data identifiers that we recommend for jobs. For the managed data identifier selection type (managedDataIdentifierSelector), specify RECOMMENDED. +* api-change:``privatenetworks``: This release allows Private5G customers to choose different commitment plans (60-days, 1-year, 3-years) when placing new orders, enables automatic renewal option for 1-year and 3-years commitments. It also allows customers to update the commitment plan of an existing radio unit. +* api-change:``sagemaker-featurestore-runtime``: Introducing TTL for online store records for feature groups. +* api-change:``sagemaker``: Introducing TTL for online store records in feature groups. +* api-change:``ssm``: Systems Manager doc-only update for June 2023. +* api-change:``verifiedpermissions``: This update fixes several broken links to the Cedar documentation. + + +1.29.161 +======== + +* api-change:``connect``: This release provides a way to search for existing tags within an instance. Before tagging a resource, ensure consistency by searching for pre-existing key:value pairs. +* api-change:``glue``: Timestamp Starting Position For Kinesis and Kafka Data Sources in a Glue Streaming Job +* api-change:``guardduty``: Add support for user.extra.sessionName in Kubernetes Audit Logs Findings. +* api-change:``iam``: Support for a new API "GetMFADevice" to present MFA device metadata such as device certifications +* api-change:``pinpoint``: Added time zone estimation support for journeys + + +1.29.160 +======== + +* api-change:``devops-guru``: This release adds support for encryption via customer managed keys. +* api-change:``fsx``: Update to Amazon FSx documentation. +* api-change:``rds``: Documentation improvements for create, describe, and modify DB clusters and DB instances. +* api-change:``verifiedpermissions``: Added improved descriptions and new code samples to SDK documentation. + + +1.29.159 +======== + +* api-change:``chime-sdk-identity``: AppInstanceBots can be configured to be invoked or not using the Target or the CHIME.mentions attribute for ChannelMessages +* api-change:``chime-sdk-messaging``: ChannelMessages can be made visible to sender and intended recipient rather than all channel members with the target attribute. For example, a user can send messages to a bot and receive messages back in a group channel without other members seeing them. +* api-change:``kendra``: Introducing Amazon Kendra Retrieve API that can be used to retrieve relevant passages or text excerpts given an input query. +* api-change:``stepfunctions``: Update stepfunctions client to latest version + + +1.29.158 +======== + +* api-change:``dynamodb``: Documentation updates for DynamoDB +* api-change:``emr``: Update emr client to latest version +* api-change:``inspector2``: This release adds support for Software Bill of Materials (SBOM) export and the general availability of code scanning for AWS Lambda functions. +* api-change:``mediaconvert``: This release introduces the bandwidth reduction filter for the HEVC encoder, increases the limits of outputs per job, and updates support for the Nagra SDK to version 1.14.7. +* api-change:``mq``: The Cross Region Disaster Recovery feature allows to replicate a brokers state from one region to another in order to provide customers with multi-region resiliency in the event of a regional outage. +* api-change:``sagemaker``: This release provides support in SageMaker for output files in training jobs to be uploaded without compression and enable customer to deploy uncompressed model from S3 to real-time inference Endpoints. In addition, ml.trn1n.32xlarge is added to supported instance type list in training job. +* api-change:``transfer``: This release adds a new parameter StructuredLogDestinations to CreateServer, UpdateServer APIs. + + +1.29.157 +======== + +* api-change:``appflow``: This release adds new API to reset connector metadata cache +* api-change:``config``: Updated ResourceType enum with new resource types onboarded by AWS Config in May 2023. +* api-change:``ec2``: Adds support for targeting Dedicated Host allocations by assetIds in AWS Outposts +* api-change:``lambda``: This release adds RecursiveInvocationException to the Invoke API and InvokeWithResponseStream API. +* api-change:``redshift``: Added support for custom domain names for Redshift Provisioned clusters. This feature enables customers to create a custom domain name and use ACM to generate fully secure connections to it. + + +1.29.156 +======== + +* api-change:``cloudformation``: Specify desired CloudFormation behavior in the event of ChangeSet execution failure using the CreateChangeSet OnStackFailure parameter +* api-change:``ec2``: API changes to AWS Verified Access to include data from trust providers in logs +* api-change:``ecs``: Documentation only update to address various tickets. +* api-change:``glue``: This release adds support for creating cross region table/database resource links +* api-change:``pricing``: This release updates the PriceListArn regex pattern. +* api-change:``route53domains``: Update MaxItems upper bound to 1000 for ListPricesRequest +* api-change:``sagemaker``: Amazon Sagemaker Autopilot releases CreateAutoMLJobV2 and DescribeAutoMLJobV2 for Autopilot customers with ImageClassification, TextClassification and Tabular problem type config support. + + +1.29.155 +======== + +* api-change:``account``: Improve pagination support for ListRegions +* api-change:``connect``: Updates the *InstanceStorageConfig APIs to support a new ResourceType: SCREEN_RECORDINGS to enable screen recording and specify the storage configurations for publishing the recordings. Also updates DescribeInstance and ListInstances APIs to include InstanceAccessUrl attribute in the API response. +* api-change:``discovery``: Add Amazon EC2 instance recommendations export +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``s3``: This release adds SDK support for request-payer request header and request-charged response header in the "GetBucketAccelerateConfiguration", "ListMultipartUploads", "ListObjects", "ListObjectsV2" and "ListObjectVersions" S3 APIs. + + +1.29.154 +======== + +* api-change:``auditmanager``: This release introduces 2 Audit Manager features: CSV exports and new manual evidence options. You can now export your evidence finder results in CSV format. In addition, you can now add manual evidence to a control by entering free-form text or uploading a file from your browser. +* api-change:``efs``: Update efs client to latest version +* api-change:``guardduty``: Updated descriptions for some APIs. +* api-change:``location``: Amazon Location Service adds categories to places, including filtering on those categories in searches. Also, you can now add metadata properties to your geofences. + + +1.29.153 +======== + +* api-change:``cloudtrail``: This feature allows users to view dashboards for CloudTrail Lake event data stores. +* api-change:``codeguru-security``: Initial release of Amazon CodeGuru Security APIs +* api-change:``drs``: Added APIs to support network replication and recovery using AWS Elastic Disaster Recovery. +* api-change:``ec2``: This release introduces a new feature, EC2 Instance Connect Endpoint, that enables you to connect to a resource over TCP, without requiring the resource to have a public IPv4 address. +* api-change:``imagebuilder``: Change the Image Builder ImagePipeline dateNextRun field to more accurately describe the data. +* api-change:``lightsail``: This release adds pagination for the Get Certificates API operation. +* api-change:``s3``: Integrate double encryption feature to SDKs. +* api-change:``securityhub``: Add support for Security Hub Automation Rules +* api-change:``simspaceweaver``: This release fixes using aws-us-gov ARNs in API calls and adds documentation for snapshot APIs. +* api-change:``verifiedpermissions``: GA release of Amazon Verified Permissions. +* api-change:``wafv2``: You can now detect and block fraudulent account creation attempts with the new AWS WAF Fraud Control account creation fraud prevention (ACFP) managed rule group AWSManagedRulesACFPRuleSet. +* api-change:``wellarchitected``: AWS Well-Architected now supports Profiles that help customers prioritize which questions to focus on first by providing a list of prioritized questions that are better aligned with their business goals and outcomes. + + +1.29.152 +======== + +* api-change:``amplifyuibuilder``: AWS Amplify UIBuilder is launching Codegen UI, a new feature that enables you to generate your amplify uibuilder components and forms. +* api-change:``dynamodb``: Documentation updates for DynamoDB +* api-change:``dynamodbstreams``: Update dynamodbstreams client to latest version +* api-change:``fsx``: Amazon FSx for NetApp ONTAP now supports joining a storage virtual machine (SVM) to Active Directory after the SVM has been created. +* api-change:``opensearch``: This release adds support for SkipUnavailable connection property for cross cluster search +* api-change:``rekognition``: This release adds support for improved accuracy with user vector in Amazon Rekognition Face Search. Adds new APIs: AssociateFaces, CreateUser, DeleteUser, DisassociateFaces, ListUsers, SearchUsers, SearchUsersByImage. Also adds new face metadata that can be stored: user vector. +* api-change:``sagemaker``: Sagemaker Neo now supports compilation for inferentia2 (ML_INF2) and Trainium1 (ML_TRN1) as available targets. With these devices, you can run your workloads at highest performance with lowest cost. inferentia2 (ML_INF2) is available in CMH and Trainium1 (ML_TRN1) is available in IAD currently + + +1.29.151 +======== + +* api-change:``acm-pca``: Document-only update to refresh CLI documentation for AWS Private CA. No change to the service. +* api-change:``connect``: This release adds search APIs for Prompts, Quick Connects and Hours of Operations, which can be used to search for those resources within a Connect Instance. + + +1.29.150 +======== + +* api-change:``athena``: You can now define custom spark properties at start of the session for use cases like cluster encryption, table formats, and general Spark tuning. +* api-change:``comprehendmedical``: This release supports a new set of entities and traits. +* api-change:``payment-cryptography-data``: Initial release of AWS Payment Cryptography DataPlane Plane service for performing cryptographic operations typically used during card payment processing. +* api-change:``payment-cryptography``: Initial release of AWS Payment Cryptography Control Plane service for creating and managing cryptographic keys used during card payment processing. +* api-change:``servicecatalog``: New parameter added in ServiceCatalog DescribeProvisioningArtifact api - IncludeProvisioningArtifactParameters. This parameter can be used to return information about the parameters used to provision the product +* api-change:``timestream-write``: This release adds the capability for customers to define how their data should be partitioned, optimizing for certain access patterns. This definition will take place as a part of the table creation. + + +1.29.149 +======== + +* api-change:``cloudformation``: AWS CloudFormation StackSets is updating the deployment experience for all stackset operations to skip suspended AWS accounts during deployments. StackSets will skip target AWS accounts that are suspended and set the Detailed Status of the corresponding stack instances as SKIPPED_SUSPENDED_ACCOUNT +* api-change:``customer-profiles``: This release introduces event stream related APIs. +* api-change:``directconnect``: This update corrects the jumbo frames mtu values from 9100 to 8500 for transit virtual interfaces. +* api-change:``emr-containers``: EMR on EKS adds support for log rotation of Spark container logs with EMR-6.11.0 onwards, to the StartJobRun API. +* api-change:``iotdeviceadvisor``: AWS IoT Core Device Advisor now supports new Qualification Suite test case list. With this update, customers can more easily create new qualification test suite with an empty rootGroup input. +* api-change:``logs``: This change adds support for account level data protection policies using 3 new APIs, PutAccountPolicy, DeleteAccountPolicy and DescribeAccountPolicy. DescribeLogGroup API has been modified to indicate if account level policy is applied to the LogGroup via "inheritedProperties" list in the response. + + +1.29.148 +======== + +* api-change:``connect``: GetMetricDataV2 API is now available in AWS GovCloud(US) region. +* api-change:``emr``: Update emr client to latest version +* api-change:``iam``: This release updates the AccountAlias regex pattern with the same length restrictions enforced by the length constraint. +* api-change:``inspector2``: Adds new response properties and request parameters for 'last scanned at' on the ListCoverage operation. This feature allows you to search and view the date of which your resources were last scanned by Inspector. +* api-change:``iot-data``: Update thing shadow name regex to allow '$' character +* api-change:``iot``: Adding IoT Device Management Software Package Catalog APIs to register, store, and report system software packages, along with their versions and metadata in a centralized location. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``quicksight``: QuickSight support for pivot table field collapse state, radar chart range scale and multiple scope options in conditional formatting. +* api-change:``signer``: AWS Signer is launching Container Image Signing, a new feature that enables you to sign and verify container images. This feature enables you to validate that only container images you approve are used in your enterprise. +* api-change:``sqs``: Amazon SQS adds three new APIs - StartMessageMoveTask, CancelMessageMoveTask, and ListMessageMoveTasks to automate redriving messages from dead-letter queues to source queues or a custom destination. + + +1.29.147 +======== + +* api-change:``cloudformation``: AWS CloudFormation StackSets provides customers with three new APIs to activate, deactivate, and describe AWS Organizations trusted access which is needed to get started with service-managed StackSets. +* api-change:``ec2``: Making InstanceTagAttribute as the required parameter for the DeregisterInstanceEventNotificationAttributes and RegisterInstanceEventNotificationAttributes APIs. +* api-change:``finspace``: Releasing new Managed kdb Insights APIs +* api-change:``frauddetector``: Added new variable types, new DateTime data type, and new rules engine functions for interacting and working with DateTime data types. +* api-change:``keyspaces``: This release adds support for MRR GA launch, and includes multiregion support in create-keyspace, get-keyspace, and list-keyspace. +* api-change:``kms``: This release includes feature to import customer's asymmetric (RSA and ECC) and HMAC keys into KMS. It also includes feature to allow customers to specify number of days to schedule a KMS key deletion as a policy condition key. +* api-change:``lambda``: Add Ruby 3.2 (ruby3.2) Runtime support to AWS Lambda. +* api-change:``mwaa``: This release adds ROLLING_BACK and CREATING_SNAPSHOT environment statuses for Amazon MWAA environments. + + +1.29.146 +======== + +* api-change:``athena``: This release introduces the DeleteCapacityReservation API and the ability to manage capacity reservations using CloudFormation +* api-change:``cloudtrail``: This feature allows users to start and stop event ingestion on a CloudTrail Lake event data store. +* api-change:``sagemaker``: This release adds Selective Execution feature that allows SageMaker Pipelines users to run selected steps in a pipeline. +* api-change:``wafv2``: Added APIs to describe managed products. The APIs retrieve information about rule groups that are managed by AWS and by AWS Marketplace sellers. + + +1.29.145 +======== + +* api-change:``alexaforbusiness``: Alexa for Business has been deprecated and is no longer supported. +* api-change:``appflow``: Added ability to select DataTransferApiType for DescribeConnector and CreateFlow requests when using Async supported connectors. Added supportedDataTransferType to DescribeConnector/DescribeConnectors/ListConnector response. +* api-change:``customer-profiles``: This release introduces calculated attribute related APIs. +* api-change:``ivs``: API Update for IVS Advanced Channel type +* api-change:``sagemaker``: Amazon Sagemaker Autopilot adds support for Parquet file input to NLP text classification jobs. +* api-change:``wafv2``: Corrected the information for the header order FieldToMatch setting + + +1.29.144 +======== + +* api-change:``config``: Resource Types Exclusion feature launch by AWS Config +* api-change:``frauddetector``: This release enables publishing event predictions from Amazon Fraud Detector (AFD) to Amazon EventBridge. For example, after getting predictions from AFD, Amazon EventBridge rules can be configured to trigger notification through an SNS topic, send a message with SES, or trigger Lambda workflows. +* api-change:``healthlake``: This release adds a new request parameter to the CreateFHIRDatastore API operation. IdentityProviderConfiguration specifies how you want to authenticate incoming requests to your Healthlake Data Store. +* api-change:``m2``: Adds an optional create-only 'roleArn' property to Application resources. Enables PS and PO data set org types. +* api-change:``rds``: This release adds support for changing the engine for Oracle using the ModifyDbInstance API +* api-change:``servicecatalog``: Documentation updates for ServiceCatalog. +* api-change:``workspaces-web``: WorkSpaces Web now allows you to control which IP addresses your WorkSpaces Web portal may be accessed from. + + +1.29.143 +======== + +* api-change:``chime-sdk-voice``: Added optional CallLeg field to StartSpeakerSearchTask API request +* api-change:``glue``: Added Runtime parameter to allow selection of Ray Runtime +* api-change:``groundstation``: Updating description of GetMinuteUsage to be clearer. +* api-change:``iotfleetwise``: Campaigns now support selecting Timestream or S3 as the data destination, Signal catalogs now support "Deprecation" keyword released in VSS v2.1 and "Comment" keyword released in VSS v3.0 +* api-change:``location``: This release adds API support for political views for the maps service APIs: CreateMap, UpdateMap, DescribeMap. +* api-change:``memorydb``: Amazon MemoryDB for Redis now supports AWS Identity and Access Management authentication access to Redis clusters starting with redis-engine version 7.0 +* api-change:``personalize``: This release provides support for the exclusion of certain columns for training when creating a solution and creating or updating a recommender with Amazon Personalize. +* api-change:``polly``: Amazon Polly adds 2 new voices - Sofie (da-DK) and Niamh (en-IE) +* api-change:``securityhub``: Added new resource detail objects to ASFF, including resources for AwsGuardDutyDetector, AwsAmazonMqBroker, AwsEventSchemasRegistry, AwsAppSyncGraphQlApi and AwsStepFunctionStateMachine. +* api-change:``wafv2``: This SDK release provides customers the ability to use Header Order as a field to match. + + +1.29.142 +======== + +* bugfix:``Polly``: Remove `Content-Type` header from ``synthesize_speech`` URL presigning. +* api-change:``connect``: Documentation update for a new Initiation Method value in DescribeContact API +* api-change:``iotwireless``: Add Multicast Group support in Network Analyzer Configuration. +* api-change:``sagemaker``: Added ml.p4d and ml.inf1 as supported instance type families for SageMaker Notebook Instances. + + +1.29.141 +======== + +* api-change:``application-autoscaling``: With this release, ElastiCache customers will be able to use predefined metricType "ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage" for their ElastiCache instances. +* api-change:``codepipeline``: Add PollingDisabledAt time information in PipelineMetadata object of GetPipeline API. +* api-change:``gamelift``: GameLift FleetIQ users can now filter game server claim requests to exclude servers on instances that are draining. +* api-change:``glue``: Added ability to create data quality rulesets for shared, cross-account Glue Data Catalog tables. Added support for dataset comparison rules through a new parameter called AdditionalDataSources. Enhanced the data quality results with a map containing profiled metric values. +* api-change:``migration-hub-refactor-spaces``: This SDK update allows for path parameter syntax to be passed to the CreateRoute API. Path parameter syntax require parameters to be enclosed in {} characters. This update also includes a new AppendSourcePath field which lets users forward the source path to the Service URL endpoint. +* api-change:``sagemaker``: Amazon SageMaker Automatic Model Tuning now supports enabling Autotune for tuning jobs which can choose tuning job configurations. + + +1.29.140 +======== + +* api-change:``appsync``: This release introduces AppSync Merged APIs, which provide the ability to compose multiple source APIs into a single federated/merged API. +* api-change:``connect``: Amazon Connect Evaluation Capabilities: validation improvements +* api-change:``cur``: Add support for split cost allocation data on a report. +* api-change:``sagemaker``: SageMaker now provides an instantaneous deployment recommendation through the DescribeModel API + + +1.29.139 +======== + +* api-change:``fms``: Fixes issue that could cause calls to GetAdminScope and ListAdminAccountsForOrganization to return a 500 Internal Server error. +* api-change:``sagemaker``: Added ModelNameEquals, ModelPackageVersionArnEquals in request and ModelName, SamplePayloadUrl, ModelPackageVersionArn in response of ListInferenceRecommendationsJobs API. Added Invocation timestamps in response of DescribeInferenceRecommendationsJob API & ListInferenceRecommendationsJobSteps API. +* api-change:``translate``: Added support for calling TranslateDocument API. + + +1.29.138 +======== + +* api-change:``backup``: Added support for tags on restore. +* api-change:``pinpoint``: Amazon Pinpoint is deprecating the tags parameter in the UpdateSegment, UpdateCampaign, UpdateEmailTemplate, UpdateSmsTemplate, UpdatePushTemplate, UpdateInAppTemplate and UpdateVoiceTemplate. Amazon Pinpoint will end support tags parameter by May 22, 2023. +* api-change:``quicksight``: Add support for Asset Bundle, Geospatial Heatmaps. + + +1.29.137 +======== + +* api-change:``backup``: Add ResourceArn, ResourceType, and BackupVaultName to ListRecoveryPointsByLegalHold API response. +* api-change:``connectcases``: This release adds the ability to create fields with type Url through the CreateField API. For more information see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html +* api-change:``mediapackagev2``: Adds support for the MediaPackage Live v2 API +* api-change:``sesv2``: This release allows customers to update scaling mode property of dedicated IP pools with PutDedicatedIpPoolScalingAttributes call. + + +1.29.136 +======== + +* api-change:``athena``: Removing SparkProperties from EngineConfiguration object for StartSession API call +* api-change:``cloudtrail``: Add ConflictException to PutEventSelectors, add (Channel/EDS)ARNInvalidException to Tag APIs. These exceptions provide customers with more specific error messages instead of internal errors. +* api-change:``compute-optimizer``: In this launch, we add support for showing integration status with external metric providers such as Instana, Datadog ...etc in GetEC2InstanceRecommendations and ExportEC2InstanceRecommendations apis +* api-change:``connect``: You can programmatically create and manage prompts using APIs, for example, to extract prompts stored within Amazon Connect and add them to your Amazon S3 bucket. AWS CloudTrail, AWS CloudFormation and tagging are supported. +* api-change:``ec2``: Add support for i4g.large, i4g.xlarge, i4g.2xlarge, i4g.4xlarge, i4g.8xlarge and i4g.16xlarge instances powered by AWS Graviton2 processors that deliver up to 15% better compute performance than our other storage-optimized instances. +* api-change:``ecs``: Documentation only release to address various tickets. +* api-change:``mediaconvert``: This release introduces a new MXF Profile for XDCAM which is strictly compliant with the SMPTE RDD 9 standard and improved handling of output name modifiers. +* api-change:``rds``: RDS documentation update for the EngineVersion parameter of ModifyDBSnapshot +* api-change:``sagemaker-geospatial``: This release makes ExecutionRoleArn a required field in the StartEarthObservationJob API. +* api-change:``sts``: API updates for the AWS Security Token Service + + +1.29.135 +======== + +* api-change:``detective``: Added and updated API operations in Detective to support the integration of ASFF Security Hub findings. +* api-change:``directconnect``: This release includes an update to the mtu value for CreateTransitVirtualInterface from 9001 mtu to 8500 mtu. +* api-change:``glue``: Add Support for Tags for Custom Entity Types +* api-change:``secretsmanager``: Documentation updates for Secrets Manager +* api-change:``wafv2``: My AWS Service (placeholder) - You can now rate limit web requests based on aggregation keys other than IP addresses, and you can aggregate using combinations of keys. You can also rate limit all requests that match a scope-down statement, without further aggregation. + + +1.29.134 +======== + +* bugfix:EndpointProvider: Fixed bug in virtual addressing for S3 Buckets `#2938 `__ +* api-change:``athena``: You can now define custom spark properties at start of the session for use cases like cluster encryption, table formats, and general Spark tuning. +* api-change:``codecatalyst``: With this release, the users can list the active sessions connected to their Dev Environment on AWS CodeCatalyst +* api-change:``kafka``: Added a fix to make clusterarn a required field in ListClientVpcConnections and RejectClientVpcConnection APIs +* api-change:``rekognition``: This release adds a new EyeDirection attribute in Amazon Rekognition DetectFaces and IndexFaces APIs which predicts the yaw and pitch angles of a person's eye gaze direction for each face detected in the image. +* api-change:``rolesanywhere``: Adds support for custom notification settings in a trust anchor. Introduces PutNotificationSettings and ResetNotificationSettings API's. Updates DurationSeconds max value to 3600. +* api-change:``transfer``: This release introduces the ability to require both password and SSH key when users authenticate to your Transfer Family servers that use the SFTP protocol. + + +1.29.133 +======== + +* bugfix:endpoints: Include params set in provide-client-param event handlers in dynamic context params for endpoint resolution. +* api-change:``connect``: This release updates GetMetricDataV2 API, to support metric data up-to last 35 days +* api-change:``elasticache``: Added support to modify the cluster mode configuration for the existing ElastiCache ReplicationGroups. Customers can now modify the configuration from cluster mode disabled to cluster mode enabled. +* api-change:``es``: This release fixes DescribePackages API error with null filter value parameter. +* api-change:``health``: Add support for regional endpoints +* api-change:``ivs-realtime``: Add methods for inspecting and debugging stages: ListStageSessions, GetStageSession, ListParticipants, GetParticipant, and ListParticipantEvents. +* api-change:``omics``: This release provides support for Ready2Run and GPU workflows, an improved read set filter, the direct upload of read sets into Omics Storage, and annotation parsing for analytics stores. +* api-change:``opensearch``: This release fixes DescribePackages API error with null filter value parameter. +* api-change:``route53resolver``: Update FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``support``: This release adds 2 new Support APIs, DescribeCreateCaseOptions and DescribeSupportedLanguages. You can use these new APIs to get available support languages. + + +1.29.132 +======== + +* api-change:``emr``: Update emr client to latest version +* api-change:``rds``: Amazon Relational Database Service (RDS) updates for the new Aurora I/O-Optimized storage type for Amazon Aurora DB clusters +* api-change:``swf``: This release adds a new API parameter to exclude old history events from decision tasks. + + +1.29.131 +======== + +* enhancement:endpoints: Fix cache implementation to reduce memory consumption. +* api-change:``application-autoscaling``: With this release, Amazon SageMaker Serverless Inference customers can use Application Auto Scaling to auto scale the provisioned concurrency of their serverless endpoints. +* api-change:``glue``: This release adds AmazonRedshift Source and Target nodes in addition to DynamicTransform OutputSchemas +* api-change:``sagemaker``: This release includes support for (1) Provisioned Concurrency for Amazon SageMaker Serverless Inference and (2) UpdateEndpointWeightsAndCapacities API for Serverless endpoints. + + +1.29.130 +======== + +* api-change:``glue``: Support large worker types G.4x and G.8x for Glue Spark +* api-change:``guardduty``: Add AccessDeniedException 403 Error message code to support 3 Tagging related APIs +* api-change:``iotsitewise``: Provide support for 20,000 max results for GetAssetPropertyValueHistory/BatchGetAssetPropertyValueHistory and 15 minute aggregate resolution for GetAssetPropertyAggregates/BatchGetAssetPropertyAggregates +* api-change:``sts``: Documentation updates for AWS Security Token Service. + + +1.29.129 +======== + +* api-change:``ec2``: This release adds support the inf2 and trn1n instances. inf2 instances are purpose built for deep learning inference while trn1n instances are powered by AWS Trainium accelerators and they build on the capabilities of Trainium-powered trn1 instances. +* api-change:``inspector2``: Amazon Inspector now allows customers to search its vulnerability intelligence database if any of the Inspector scanning types are activated. +* api-change:``mediatailor``: This release adds support for AFTER_LIVE_EDGE mode configuration for avail suppression, and adding a fill-policy setting that sets the avail suppression to PARTIAL_AVAIL or FULL_AVAIL_ONLY when AFTER_LIVE_EDGE is enabled. +* api-change:``sqs``: Revert previous SQS protocol change. + + +1.29.128 +======== + +* bugfix:``sqs``: Rolled back recent change to wire format protocol + + +1.29.127 +======== + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``config``: Updated ResourceType enum with new resource types onboarded by AWS Config in April 2023. +* api-change:``connect``: Remove unused InvalidParameterException from CreateParticipant API +* api-change:``ecs``: Documentation update for new error type NamespaceNotFoundException for CreateCluster and UpdateCluster +* api-change:``network-firewall``: This release adds support for the Suricata REJECT option in midstream exception configurations. +* api-change:``opensearch``: DescribeDomainNodes: A new API that provides configuration information for nodes part of the domain +* api-change:``quicksight``: Add support for Topic, Dataset parameters and VPC +* api-change:``rekognition``: This release adds a new attribute FaceOccluded. Additionally, you can now select attributes individually (e.g. ["DEFAULT", "FACE_OCCLUDED", "AGE_RANGE"] instead of ["ALL"]), which can reduce response time. +* api-change:``s3``: Documentation updates for Amazon S3 +* api-change:``sagemaker``: We added support for ml.inf2 and ml.trn1 family of instances on Amazon SageMaker for deploying machine learning (ML) models for Real-time and Asynchronous inference. You can use these instances to achieve high performance at a low cost for generative artificial intelligence (AI) models. +* api-change:``securityhub``: Add support for Finding History. +* api-change:``sqs``: This release enables customers to call SQS using AWS JSON-1.0 protocol. + + +1.29.126 +======== + +* api-change:``appsync``: Private API support for AWS AppSync. With Private APIs, you can now create GraphQL APIs that can only be accessed from your Amazon Virtual Private Cloud ("VPC"). +* api-change:``ec2``: Adds an SDK paginator for GetNetworkInsightsAccessScopeAnalysisFindings +* api-change:``inspector2``: This feature provides deep inspection for linux based instance +* api-change:``iottwinmaker``: This release adds a field for GetScene API to return error code and message from dependency services. +* api-change:``network-firewall``: AWS Network Firewall now supports policy level HOME_NET variable overrides. +* api-change:``opensearch``: Amazon OpenSearch Service adds the option to deploy a domain across multiple Availability Zones, with each AZ containing a complete copy of data and with nodes in one AZ acting as a standby. This option provides 99.99% availability and consistent performance in the event of infrastructure failure. +* api-change:``wellarchitected``: This release deepens integration with AWS Service Catalog AppRegistry to improve workload resource discovery. + + +1.29.125 +======== + +* api-change:``appflow``: This release adds new API to cancel flow executions. +* api-change:``connect``: Amazon Connect Service Rules API update: Added OnContactEvaluationSubmit event source to support user configuring evaluation form rules. +* api-change:``ecs``: Documentation only update to address Amazon ECS tickets. +* api-change:``kendra``: AWS Kendra now supports configuring document fields/attributes via the GetQuerySuggestions API. You can now base query suggestions on the contents of document fields. +* api-change:``resiliencehub``: This release will improve resource level transparency in applications by discovering previously hidden resources. +* api-change:``sagemaker``: Amazon Sagemaker Autopilot supports training models with sample weights and additional objective metrics. + + +1.29.124 +======== + +* api-change:``compute-optimizer``: support for tag filtering within compute optimizer. ability to filter recommendation results by tag and tag key value pairs. ability to filter by inferred workload type added. +* api-change:``kms``: This release makes the NitroEnclave request parameter Recipient and the response field for CiphertextForRecipient available in AWS SDKs. It also adds the regex pattern for CloudHsmClusterId validation. + + +1.29.123 +======== + +* api-change:``appflow``: Adds Jwt Support for Salesforce Credentials. +* api-change:``athena``: You can now use capacity reservations on Amazon Athena to run SQL queries on fully-managed compute capacity. +* api-change:``directconnect``: This release corrects the jumbo frames MTU from 9100 to 8500. +* api-change:``efs``: Update efs client to latest version +* api-change:``grafana``: This release adds support for the grafanaVersion parameter in CreateWorkspace. +* api-change:``iot``: This release allows AWS IoT Core users to specify a TLS security policy when creating and updating AWS IoT Domain Configurations. +* api-change:``rekognition``: Added support for aggregating moderation labels by video segment timestamps for Stored Video Content Moderation APIs and added additional information about the job to all Stored Video Get API responses. +* api-change:``simspaceweaver``: Added a new CreateSnapshot API. For the StartSimulation API, SchemaS3Location is now optional, added a new SnapshotS3Location parameter. For the DescribeSimulation API, added SNAPSHOT_IN_PROGRESS simulation state, deprecated SchemaError, added new fields: StartError and SnapshotS3Location. +* api-change:``wafv2``: You can now associate a web ACL with a Verified Access instance. +* api-change:``workspaces``: Added Windows 11 to support Microsoft_Office_2019 + + +1.29.122 +======== + +* api-change:``ec2``: This release adds support for AMD SEV-SNP on EC2 instances. +* api-change:``emr-containers``: This release adds GetManagedEndpointSessionCredentials, a new API that allows customers to generate an auth token to connect to a managed endpoint, enabling features such as self-hosted Jupyter notebooks for EMR on EKS. +* api-change:``guardduty``: Added API support to initiate on-demand malware scan on specific resources. +* api-change:``iotdeviceadvisor``: AWS IoT Core Device Advisor now supports MQTT over WebSocket. With this update, customers can run all three test suites of AWS IoT Core Device Advisor - qualification, custom, and long duration tests - using Signature Version 4 for MQTT over WebSocket. +* api-change:``kafka``: Amazon MSK has added new APIs that allows multi-VPC private connectivity and cluster policy support for Amazon MSK clusters that simplify connectivity and access between your Apache Kafka clients hosted in different VPCs and AWS accounts and your Amazon MSK clusters. +* api-change:``lambda``: Add Java 17 (java17) support to AWS Lambda +* api-change:``marketplace-catalog``: Enabled Pagination for List Entities and List Change Sets operations +* api-change:``osis``: Documentation updates for OpenSearch Ingestion +* api-change:``qldb``: Documentation updates for Amazon QLDB +* api-change:``sagemaker``: Added ml.p4d.24xlarge and ml.p4de.24xlarge as supported instances for SageMaker Studio +* api-change:``xray``: Updated X-Ray documentation with Resource Policy API descriptions. + + +1.29.121 +======== + +* api-change:``osis``: Initial release for OpenSearch Ingestion + + +1.29.120 +======== + +* api-change:``chime-sdk-messaging``: Remove non actionable field from UpdateChannelReadMarker and DeleteChannelRequest. Add precise exceptions to DeleteChannel and DeleteStreamingConfigurations error cases. +* api-change:``connect``: Amazon Connect, Contact Lens Evaluation API release including ability to manage forms and to submit contact evaluations. +* api-change:``datasync``: This release adds 13 new APIs to support AWS DataSync Discovery GA. +* api-change:``ds``: New field added in AWS Managed Microsoft AD DescribeSettings response and regex pattern update for UpdateSettings value. Added length validation to RemoteDomainName. +* api-change:``pinpoint``: Adds support for journey runs and querying journey execution metrics based on journey runs. Adds execution metrics to campaign activities. Updates docs for Advanced Quiet Time. + + +1.29.119 +======== + +* api-change:``appflow``: Increased the max length for RefreshToken and AuthCode from 2048 to 4096. +* api-change:``codecatalyst``: Documentation updates for Amazon CodeCatalyst. +* api-change:``ec2``: API changes to AWS Verified Access related to identity providers' information. +* api-change:``mediaconvert``: This release introduces a noise reduction pre-filter, linear interpolation deinterlace mode, video pass-through, updated default job settings, and expanded LC-AAC Stereo audio bitrate ranges. +* api-change:``rekognition``: Added new status result to Liveness session status. + + +1.29.118 +======== + +* api-change:``connect``: This release adds a new API CreateParticipant. For Amazon Connect Chat, you can use this new API to customize chat flow experiences. +* api-change:``ecs``: Documentation update to address various Amazon ECS tickets. +* api-change:``fms``: AWS Firewall Manager adds support for multiple administrators. You can now delegate more than one administrator per organization. + + +1.29.117 +======== + +* api-change:``chime-sdk-media-pipelines``: This release adds support for specifying the recording file format in an S3 recording sink configuration. +* api-change:``chime-sdk-meetings``: Adds support for Hindi and Thai languages and additional Amazon Transcribe parameters to the StartMeetingTranscription API. +* api-change:``chime``: Adds support for Hindi and Thai languages and additional Amazon Transcribe parameters to the StartMeetingTranscription API. +* api-change:``gamelift``: Amazon GameLift supports creating Builds for Windows 2016 operating system. +* api-change:``guardduty``: This release adds support for the new Lambda Protection feature. +* api-change:``iot``: Support additional OTA states in GetOTAUpdate API +* api-change:``sagemaker``: Amazon SageMaker Canvas adds ModelRegisterSettings support for CanvasAppSettings. +* api-change:``snowball``: Adds support for Amazon S3 compatible storage. AWS Snow Family customers can now use Amazon S3 compatible storage on Snowball Edge devices. Also adds support for V3_5S. This is a refreshed AWS Snowball Edge Storage Optimized device type with 210TB SSD (customer usable). +* api-change:``wafv2``: You can now create encrypted API keys to use in a client application integration of the JavaScript CAPTCHA API . You can also retrieve a list of your API keys and the JavaScript application integration URL. + + +1.29.116 +======== + +* api-change:``comprehend``: This release supports native document models for custom classification, in addition to plain-text models. You train native document models using documents (PDF, Word, images) in their native format. +* api-change:``ecs``: This release supports the Account Setting "TagResourceAuthorization" that allows for enhanced Tagging security controls. +* api-change:``ram``: This release adds support for customer managed permissions. Customer managed permissions enable customers to author and manage tailored permissions for resources shared using RAM. +* api-change:``rds``: Adds support for the ImageId parameter of CreateCustomDBEngineVersion to RDS Custom for Oracle +* api-change:``s3``: Provides support for "Snow" Storage class. +* api-change:``s3control``: Provides support for overriding endpoint when region is "snow". This will enable bucket APIs for Amazon S3 Compatible storage on Snow Family devices. +* api-change:``secretsmanager``: Documentation updates for Secrets Manager + + +1.29.115 +======== + +* api-change:``appflow``: This release adds a Client Token parameter to the following AppFlow APIs: Create/Update Connector Profile, Create/Update Flow, Start Flow, Register Connector, Update Connector Registration. The Client Token parameter allows idempotent operations for these APIs. +* api-change:``drs``: Changed existing APIs and added new APIs to support using an account-level launch configuration template with AWS Elastic Disaster Recovery. +* api-change:``dynamodb``: Documentation updates for DynamoDB API +* api-change:``emr-serverless``: The GetJobRun API has been updated to include the job's billed resource utilization. This utilization shows the aggregate vCPU, memory and storage that AWS has billed for the job run. The billed resources include a 1-minute minimum usage for workers, plus additional storage over 20 GB per worker. +* api-change:``internetmonitor``: This release includes a new configurable value, TrafficPercentageToMonitor, which allows users to adjust the amount of traffic monitored by percentage +* api-change:``iotwireless``: Supports the new feature of LoRaWAN roaming, allows to configure MaxEirp for LoRaWAN gateway, and allows to configure PingSlotPeriod for LoRaWAN multicast group +* api-change:``lambda``: Add Python 3.10 (python3.10) support to AWS Lambda + + +1.29.114 +======== + +* api-change:``ecs``: This release supports ephemeral storage for AWS Fargate Windows containers. +* api-change:``lambda``: This release adds SnapStart related exceptions to InvokeWithResponseStream API. IAM access related documentation is also added for this API. +* api-change:``migration-hub-refactor-spaces``: Doc only update for Refactor Spaces environments without network bridge feature. +* api-change:``rds``: This release adds support of modifying the engine mode of database clusters. + + +1.29.113 +======== + +* api-change:``chime-sdk-voice``: This release adds tagging support for Voice Connectors and SIP Media Applications +* api-change:``mediaconnect``: Gateway is a new feature of AWS Elemental MediaConnect. Gateway allows the deployment of on-premises resources for the purpose of transporting live video to and from the AWS Cloud. + + +1.29.112 +======== + +* api-change:``groundstation``: AWS Ground Station Wideband DigIF GA Release +* api-change:``managedblockchain``: Removal of the Ropsten network. The Ethereum foundation ceased support of Ropsten on December 31st, 2022.. + + +1.29.111 +======== + +* api-change:``ecr-public``: This release will allow using registry alias as registryId in BatchDeleteImage request. +* api-change:``emr-serverless``: This release extends GetJobRun API to return job run timeout (executionTimeoutMinutes) specified during StartJobRun call (or default timeout of 720 minutes if none was specified). +* api-change:``events``: Update events client to latest version +* api-change:``iot-data``: This release adds support for MQTT5 user properties when calling the AWS IoT GetRetainedMessage API +* api-change:``wafv2``: For web ACLs that protect CloudFront protections, the default request body inspection size is now 16 KB, and you can use the new association configuration to increase the inspection size further, up to 64 KB. Sizes over 16 KB can incur additional costs. + + +1.29.110 +======== + +* api-change:``connect``: This release adds the ability to configure an agent's routing profile to receive contacts from multiple channels at the same time via extending the UpdateRoutingProfileConcurrency, CreateRoutingProfile and DescribeRoutingProfile APIs. +* api-change:``ecs``: This release adds support for enabling FIPS compliance on Amazon ECS Fargate tasks +* api-change:``marketplace-catalog``: Added three new APIs to support resource sharing: GetResourcePolicy, PutResourcePolicy, and DeleteResourcePolicy. Added new OwnershipType field to ListEntities request to let users filter on entities that are shared with them. Increased max page size of ListEntities response from 20 to 50 results. +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK now supports conversion of 608 paint-on captions to pop-on captions for SCC sources. +* api-change:``omics``: Remove unexpected API changes. +* api-change:``rekognition``: This release adds support for Face Liveness APIs in Amazon Rekognition. Updates UpdateStreamProcessor to return ResourceInUseException Exception. Minor updates to API documentation. + + +1.29.109 +======== + +* api-change:``dlm``: Updated timestamp format for GetLifecyclePolicy API +* api-change:``docdb``: This release adds a new parameter 'DBClusterParameterGroupName' to 'RestoreDBClusterFromSnapshot' API to associate the name of the DB cluster parameter group while performing restore. +* api-change:``fsx``: Amazon FSx for Lustre now supports creating data repository associations on Persistent_1 and Scratch_2 file systems. +* api-change:``lambda``: This release adds a new Lambda InvokeWithResponseStream API to support streaming Lambda function responses. The release also adds a new InvokeMode parameter to Function Url APIs to control whether the response will be streamed or buffered. +* api-change:``quicksight``: This release has two changes: adding the OR condition to tag-based RLS rules in CreateDataSet and UpdateDataSet; adding RefreshSchedule and Incremental RefreshProperties operations for users to programmatically configure SPICE dataset ingestions. +* api-change:``redshift-data``: Update documentation of API descriptions as needed in support of temporary credentials with IAM identity. +* api-change:``servicecatalog``: Updates description for property + + +1.29.108 +======== + +* api-change:``cloudformation``: Including UPDATE_COMPLETE as a failed status for DeleteStack waiter. +* api-change:``greengrassv2``: Add support for SUCCEEDED value in coreDeviceExecutionStatus field. Documentation updates for Greengrass V2. +* api-change:``proton``: This release adds support for the AWS Proton service sync feature. Service sync enables managing an AWS Proton service (creating and updating instances) and all of it's corresponding service instances from a Git repository. +* api-change:``rds``: Adds and updates the SDK examples + + +1.29.107 +======== + +* api-change:``apprunner``: App Runner adds support for seven new vCPU and memory configurations. +* api-change:``config``: This release adds resourceType enums for types released in March 2023. +* api-change:``ecs``: This is a document only updated to add information about Amazon Elastic Inference (EI). +* api-change:``identitystore``: Documentation updates for Identity Store CLI command reference. +* api-change:``ivs-realtime``: Fix ParticipantToken ExpirationTime format +* api-change:``network-firewall``: AWS Network Firewall now supports IPv6-only subnets. +* api-change:``servicecatalog``: removed incorrect product type value +* api-change:``vpc-lattice``: This release removes the entities in the API doc model package for auth policies. + + +1.29.106 +======== + +* api-change:``amplifyuibuilder``: Support StorageField and custom displays for data-bound options in form builder. Support non-string operands for predicates in collections. Support choosing client to get token from. +* api-change:``autoscaling``: Documentation updates for Amazon EC2 Auto Scaling +* api-change:``dataexchange``: This release updates the value of MaxResults. +* api-change:``ec2``: C6in, M6in, M6idn, R6in and R6idn bare metal instances are powered by 3rd Generation Intel Xeon Scalable processors and offer up to 200 Gbps of network bandwidth. +* api-change:``elastic-inference``: Updated public documentation for the Describe and Tagging APIs. +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``sagemaker``: Amazon SageMaker Asynchronous Inference now allows customer's to receive failure model responses in S3 and receive success/failure model responses in SNS notifications. +* api-change:``wafv2``: This release rolls back association config feature for webACLs that protect CloudFront protections. + + +1.29.105 +======== + +* api-change:``glue``: Add support for database-level federation +* api-change:``lakeformation``: Add support for database-level federation +* api-change:``license-manager``: This release adds grant override options to the CreateGrantVersion API. These options can be used to specify grant replacement behavior during grant activation. +* api-change:``mwaa``: This Amazon MWAA release adds the ability to customize the Apache Airflow environment by launching a shell script at startup. This shell script is hosted in your environment's Amazon S3 bucket. Amazon MWAA runs the script before installing requirements and initializing the Apache Airflow process. +* api-change:``servicecatalog``: This release introduces Service Catalog support for Terraform open source. It enables 1. The notify* APIs to Service Catalog. These APIs are used by the terraform engine to notify the result of the provisioning engine execution. 2. Adds a new TERRAFORM_OPEN_SOURCE product type in CreateProduct API. +* api-change:``wafv2``: For web ACLs that protect CloudFront protections, the default request body inspection size is now 16 KB, and you can use the new association configuration to increase the inspection size further, up to 64 KB. Sizes over 16 KB can incur additional costs. + + +1.29.104 +======== + +* api-change:``ec2``: Documentation updates for EC2 On Demand Capacity Reservations +* api-change:``internetmonitor``: This release adds a new feature for Amazon CloudWatch Internet Monitor that enables customers to deliver internet measurements to Amazon S3 buckets as well as CloudWatch Logs. +* api-change:``resiliencehub``: Adding EKS related documentation for appTemplateBody +* api-change:``s3``: Documentation updates for Amazon S3 +* api-change:``sagemaker-featurestore-runtime``: In this release, you can now chose between soft delete and hard delete when calling the DeleteRecord API, so you have more flexibility when it comes to managing online store data. +* api-change:``sms``: Deprecating AWS Server Migration Service. + + +1.29.103 +======== + +* api-change:``athena``: Make DefaultExecutorDpuSize and CoordinatorDpuSize fields optional in StartSession +* api-change:``autoscaling``: Amazon EC2 Auto Scaling now supports Elastic Load Balancing traffic sources with the AttachTrafficSources, DetachTrafficSources, and DescribeTrafficSources APIs. This release also introduces a new activity status, "WaitingForConnectionDraining", for VPC Lattice to the DescribeScalingActivities API. +* api-change:``batch``: This feature allows Batch on EKS to support configuration of Pod Labels through Metadata for Batch on EKS Jobs. +* api-change:``compute-optimizer``: This release adds support for HDD EBS volume types and io2 Block Express. We are also adding support for 61 new instance types and instances that have non consecutive runtime. +* api-change:``drs``: Adding a field to the replication configuration APIs to support the auto replicate new disks feature. We also deprecated RetryDataReplication. +* api-change:``ec2``: This release adds support for Tunnel Endpoint Lifecycle control, a new feature that provides Site-to-Site VPN customers with better visibility and control of their VPN tunnel maintenance updates. +* api-change:``emr``: Update emr client to latest version +* api-change:``glue``: This release adds support for AWS Glue Data Quality, which helps you evaluate and monitor the quality of your data and includes the API for creating, deleting, or updating data quality rulesets, runs and evaluations. +* api-change:``guardduty``: Added EKS Runtime Monitoring feature support to existing detector, finding APIs and introducing new Coverage APIs +* api-change:``imagebuilder``: Adds support for new image workflow details and image vulnerability detection. +* api-change:``ivs``: Amazon Interactive Video Service (IVS) now offers customers the ability to configure IVS channels to allow insecure RTMP ingest. +* api-change:``kendra``: AWS Kendra now supports featured results for a query. +* api-change:``network-firewall``: AWS Network Firewall added TLS inspection configurations to allow TLS traffic inspection. +* api-change:``sagemaker-geospatial``: Amazon SageMaker geospatial capabilities now supports server-side encryption with customer managed KMS key and SageMaker notebooks with a SageMaker geospatial image in a Amazon SageMaker Domain with VPC only mode. +* api-change:``vpc-lattice``: General Availability (GA) release of Amazon VPC Lattice +* api-change:``wellarchitected``: AWS Well-Architected SDK now supports getting consolidated report metrics and generating a consolidated report PDF. + + +1.29.102 +======== + +* api-change:``opensearchserverless``: This release includes two new exception types "ServiceQuotaExceededException" and "OcuLimitExceededException". +* api-change:``rds``: Add support for creating a read replica DB instance from a Multi-AZ DB cluster. + + +1.29.101 +======== + +* api-change:``iot-data``: Add endpoint ruleset support for cn-north-1. +* api-change:``ssm-contacts``: This release adds 12 new APIs as part of Oncall Schedule feature release, adds support for a new contact type: ONCALL_SCHEDULE. Check public documentation for AWS ssm-contacts for more information +* api-change:``ssm-incidents``: Increased maximum length of "TriggerDetails.rawData" to 10K characters and "IncidentSummary" to 8K characters. + + +1.29.100 +======== + +* api-change:``athena``: Enforces a minimal level of encryption for the workgroup for query and calculation results that are written to Amazon S3. When enabled, workgroup users can set encryption only to the minimum level set by the administrator or higher when they submit queries. +* api-change:``chime-sdk-voice``: Documentation updates for Amazon Chime SDK Voice. +* api-change:``connect``: This release introduces support for RelatedContactId in the StartChatContact API. Interactive message and interactive message response have been added to the list of supported message content types for this API as well. +* api-change:``connectparticipant``: This release provides an update to the SendMessage API to handle interactive message response content-types. +* api-change:``iotwireless``: Introducing new APIs that enable Sidewalk devices to communicate with AWS IoT Core through Sidewalk gateways. This will empower AWS customers to connect Sidewalk devices with other AWS IoT Services, creating possibilities for seamless integration and advanced device management. +* api-change:``medialive``: AWS Elemental MediaLive now supports ID3 tag insertion for audio only HLS output groups. AWS Elemental Link devices now support tagging. +* api-change:``sagemaker``: Fixed some improperly rendered links in SDK documentation. +* api-change:``securityhub``: Added new resource detail objects to ASFF, including resources for AwsEksCluster, AWSS3Bucket, AwsEc2RouteTable and AwsEC2Instance. +* api-change:``servicecatalog-appregistry``: In this release, we started supporting ARN in applicationSpecifier and attributeGroupSpecifier. GetAttributeGroup, ListAttributeGroups and ListAttributeGroupsForApplication APIs will now have CreatedBy field in the response. +* api-change:``voice-id``: Amazon Connect Voice ID now supports multiple fraudster watchlists. Every domain has a default watchlist where all existing fraudsters are placed by default. Custom watchlists may now be created, managed, and evaluated against for known fraudster detection. + + +1.29.99 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``comprehend``: This release adds a new field (FlywheelArn) to the EntitiesDetectionJobProperties object. The FlywheelArn field is returned in the DescribeEntitiesDetectionJob and ListEntitiesDetectionJobs responses when the EntitiesDetection job is started with a FlywheelArn instead of an EntityRecognizerArn . +* api-change:``rds``: Added error code CreateCustomDBEngineVersionFault for when the create custom engine version for Custom engines fails. + + +1.29.98 +======= + +* api-change:``batch``: This feature allows Batch to support configuration of ephemeral storage size for jobs running on FARGATE +* api-change:``chime-sdk-identity``: AppInstanceBots can be used to add a bot powered by Amazon Lex to chat channels. ExpirationSettings provides automatic resource deletion for AppInstanceUsers. +* api-change:``chime-sdk-media-pipelines``: This release adds Amazon Chime SDK call analytics. Call analytics include voice analytics, which provides speaker search and voice tone analysis. These capabilities can be used with Amazon Transcribe and Transcribe Call Analytics to generate machine-learning-powered insights from real-time audio. +* api-change:``chime-sdk-messaging``: ExpirationSettings provides automatic resource deletion for Channels. +* api-change:``chime-sdk-voice``: This release adds Amazon Chime SDK call analytics. Call analytics include voice analytics, which provides speaker search and voice tone analysis. These capabilities can be used with Amazon Transcribe and Transcribe Call Analytics to generate machine-learning-powered insights from real-time audio. +* api-change:``codeartifact``: Repository CreationTime is added to the CreateRepository and ListRepositories API responses. +* api-change:``guardduty``: Adds AutoEnableOrganizationMembers attribute to DescribeOrganizationConfiguration and UpdateOrganizationConfiguration APIs. +* api-change:``ivs-realtime``: Initial release of the Amazon Interactive Video Service RealTime API. +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK now supports passthrough of ID3v2 tags for audio inputs to audio-only HLS outputs. +* api-change:``sagemaker``: Amazon SageMaker Autopilot adds two new APIs - CreateAutoMLJobV2 and DescribeAutoMLJobV2. Amazon SageMaker Notebook Instances now supports the ml.geospatial.interactive instance type. +* api-change:``servicediscovery``: Reverted the throttling exception RequestLimitExceeded for AWS Cloud Map APIs introduced in SDK version 1.12.424 2023-03-09 to previous exception specified in the ErrorCode. +* api-change:``textract``: The AnalyzeDocument - Tables feature adds support for new elements in the API: table titles, footers, section titles, summary cells/tables, and table type. + + +1.29.97 +======= + +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``iottwinmaker``: This release adds support of adding metadata when creating a new scene or updating an existing scene. +* api-change:``networkmanager``: This release includes an update to create-transit-gateway-route-table-attachment, showing example usage for TransitGatewayRouteTableArn. +* api-change:``pipes``: This release improves validation on the ARNs in the API model +* api-change:``resiliencehub``: This release provides customers with the ability to import resources from within an EKS cluster and assess the resiliency of EKS cluster workloads. +* api-change:``ssm``: This Patch Manager release supports creating, updating, and deleting Patch Baselines for AmazonLinux2023, AlmaLinux. + + +1.29.96 +======= + +* api-change:``chime-sdk-messaging``: Amazon Chime SDK messaging customers can now manage streaming configuration for messaging data for archival and analysis. +* api-change:``cleanrooms``: GA Release of AWS Clean Rooms, Added Tagging Functionality +* api-change:``ec2``: This release adds support for AWS Network Firewall, AWS PrivateLink, and Gateway Load Balancers to Amazon VPC Reachability Analyzer, and it makes the path destination optional as long as a destination address in the filter at source is provided. +* api-change:``iotsitewise``: Provide support for tagging of data streams and enabling tag based authorization for property alias +* api-change:``mgn``: This release introduces the Import and export feature and expansion of the post-launch actions + + +1.29.95 +======= + +* api-change:``application-autoscaling``: With this release customers can now tag their Application Auto Scaling registered targets with key-value pairs and manage IAM permissions for all the tagged resources centrally. +* api-change:``neptune``: This release makes following few changes. db-cluster-identifier is now a required parameter of create-db-instance. describe-db-cluster will now return PendingModifiedValues and GlobalClusterIdentifier fields in the response. +* api-change:``s3outposts``: S3 On Outposts added support for endpoint status, and a failed endpoint reason, if any +* api-change:``workdocs``: This release adds a new API, SearchResources, which enable users to search through metadata and content of folders, documents, document versions and comments in a WorkDocs site. + + +1.29.94 +======= + +* api-change:``billingconductor``: This release adds a new filter to ListAccountAssociations API and a new filter to ListBillingGroups API. +* api-change:``config``: This release adds resourceType enums for types released from October 2022 through February 2023. +* api-change:``dms``: S3 setting to create AWS Glue Data Catalog. Oracle setting to control conversion of timestamp column. Support for Kafka SASL Plain authentication. Setting to map boolean from PostgreSQL to Redshift. SQL Server settings to force lob lookup on inline LOBs and to control access of database logs. + + +1.29.93 +======= + +* api-change:``guardduty``: Updated 9 APIs for feature enablement to reflect expansion of GuardDuty to features. Added new APIs and updated existing APIs to support RDS Protection GA. +* api-change:``resource-explorer-2``: Documentation updates for APIs. +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version + + +1.29.92 +======= + +* api-change:``migrationhubstrategy``: This release adds the binary analysis that analyzes IIS application DLLs on Windows and Java applications on Linux to provide anti-pattern report without configuring access to the source code. +* api-change:``s3control``: Added support for S3 Object Lambda aliases. +* api-change:``securitylake``: Make Create/Get/ListSubscribers APIs return resource share ARN and name so they can be used to validate the RAM resource share to accept. GetDatalake can be used to track status of UpdateDatalake and DeleteDatalake requests. + + +1.29.91 +======= + +* api-change:``application-autoscaling``: Application Auto Scaling customers can now use mathematical functions to customize the metric used with Target Tracking policies within the policy configuration itself, saving the cost and effort of publishing the customizations as a separate metric. +* api-change:``dataexchange``: This release enables data providers to license direct access to S3 objects encrypted with Customer Managed Keys (CMK) in AWS KMS through AWS Data Exchange. Subscribers can use these keys to decrypt, then use the encrypted S3 objects shared with them, without creating or managing copies. +* api-change:``directconnect``: describe-direct-connect-gateway-associations includes a new status, updating, indicating that the association is currently in-process of updating. +* api-change:``ec2``: This release adds a new DnsOptions key (PrivateDnsOnlyForInboundResolverEndpoint) to CreateVpcEndpoint and ModifyVpcEndpoint APIs. +* api-change:``iam``: Documentation only updates to correct customer-reported issues +* api-change:``keyspaces``: Adding support for client-side timestamps + + +1.29.90 +======= + +* api-change:``appintegrations``: Adds FileConfiguration to Amazon AppIntegrations CreateDataIntegration supporting scheduled downloading of third party files into Amazon Connect from sources such as Microsoft SharePoint. +* api-change:``lakeformation``: This release updates the documentation regarding Get/Update DataCellsFilter +* api-change:``s3control``: Added support for cross-account Multi-Region Access Points. Added support for S3 Replication for S3 on Outposts. +* api-change:``tnb``: This release adds tagging support to the following Network Instance APIs : Instantiate, Update, Terminate. +* api-change:``wisdom``: This release extends Wisdom CreateKnowledgeBase API to support SharePoint connector type by removing the @required trait for objectField + + +1.29.89 +======= + +* api-change:``ivschat``: This release adds a new exception returned when calling AWS IVS chat UpdateLoggingConfiguration. Now UpdateLoggingConfiguration can return ConflictException when invalid updates are made in sequence to Logging Configurations. +* api-change:``secretsmanager``: The type definitions of SecretString and SecretBinary now have a minimum length of 1 in the model to match the exception thrown when you pass in empty values. + + +1.29.88 +======= + +* api-change:``codeartifact``: This release introduces the generic package format, a mechanism for storing arbitrary binary assets. It also adds a new API, PublishPackageVersion, to allow for publishing generic packages. +* api-change:``connect``: This release adds a new API, GetMetricDataV2, which returns metric data for Amazon Connect. +* api-change:``evidently``: Updated entity override documentation +* api-change:``networkmanager``: This update provides example usage for TransitGatewayRouteTableArn. +* api-change:``quicksight``: This release has two changes: add state persistence feature for embedded dashboard and console in GenerateEmbedUrlForRegisteredUser API; add properties for hidden collapsed row dimensions in PivotTableOptions. +* api-change:``redshift-data``: Added support for Redshift Serverless workgroup-arn wherever the WorkgroupName parameter is available. +* api-change:``sagemaker``: Amazon SageMaker Inference now allows SSM access to customer's model container by setting the "EnableSSMAccess" parameter for a ProductionVariant in CreateEndpointConfig API. +* api-change:``servicediscovery``: Updated all AWS Cloud Map APIs to provide consistent throttling exception (RequestLimitExceeded) +* api-change:``sesv2``: This release introduces a new recommendation in Virtual Deliverability Manager Advisor, which detects missing or misconfigured Brand Indicator for Message Identification (BIMI) DNS records for customer sending identities. + + +1.29.87 +======= + +* api-change:``athena``: A new field SubstatementType is added to GetQueryExecution API, so customers have an error free way to detect the query type and interpret the result. +* api-change:``dynamodb``: Adds deletion protection support to DynamoDB tables. Tables with deletion protection enabled cannot be deleted. Deletion protection is disabled by default, can be enabled via the CreateTable or UpdateTable APIs, and is visible in TableDescription. This setting is not replicated for Global Tables. +* api-change:``ec2``: Introducing Amazon EC2 C7g, M7g and R7g instances, powered by the latest generation AWS Graviton3 processors and deliver up to 25% better performance over Graviton2-based instances. +* api-change:``lakeformation``: This release adds two new API support "GetDataCellsFiler" and "UpdateDataCellsFilter", and also updates the corresponding documentation. +* api-change:``mediapackage-vod``: This release provides the date and time VOD resources were created. +* api-change:``mediapackage``: This release provides the date and time live resources were created. +* api-change:``route53resolver``: Add dual-stack and IPv6 support for Route 53 Resolver Endpoint,Add IPv6 target IP in Route 53 Resolver Forwarding Rule +* api-change:``sagemaker``: There needs to be a user identity to specify the SageMaker user who perform each action regarding the entity. However, these is a not a unified concept of user identity across SageMaker service that could be used today. + + +1.29.86 +======= + +* api-change:``dms``: This release adds DMS Fleet Advisor Target Recommendation APIs and exposes functionality for DMS Fleet Advisor. It adds functionality to start Target Recommendation calculation. +* api-change:``location``: Documentation update for the release of 3 additional map styles for use with Open Data Maps: Open Data Standard Dark, Open Data Visualization Light & Open Data Visualization Dark. + + +1.29.85 +======= + +* api-change:``account``: AWS Account alternate contact email addresses can now have a length of 254 characters and contain the character "|". +* api-change:``ivs``: Updated text description in DeleteChannel, Stream, and StreamSummary. + + +1.29.84 +======= + +* api-change:``dynamodb``: Documentation updates for DynamoDB. +* api-change:``ec2``: This release adds support for a new boot mode for EC2 instances called 'UEFI Preferred'. +* api-change:``macie2``: Documentation updates for Amazon Macie +* api-change:``mediaconvert``: The AWS Elemental MediaConvert SDK has improved handling for different input and output color space combinations. +* api-change:``medialive``: AWS Elemental MediaLive adds support for Nielsen watermark timezones. +* api-change:``transcribe``: Amazon Transcribe now supports role access for these API operations: CreateVocabulary, UpdateVocabulary, CreateVocabularyFilter, and UpdateVocabularyFilter. + + +1.29.83 +======= + +* api-change:``iot``: A recurring maintenance window is an optional configuration used for rolling out the job document to all devices in the target group observing a predetermined start time, duration, and frequency that the maintenance window occurs. +* api-change:``migrationhubstrategy``: This release updates the File Import API to allow importing servers already discovered by customers with reduced pre-requisites. +* api-change:``organizations``: This release introduces a new reason code, ACCOUNT_CREATION_NOT_COMPLETE, to ConstraintViolationException in CreateOrganization API. +* api-change:``pi``: This release adds a new field PeriodAlignment to allow the customer specifying the returned timestamp of time periods to be either the start or end time. +* api-change:``pipes``: This release fixes some input parameter range and patterns. +* api-change:``sagemaker``: Add a new field "EndpointMetrics" in SageMaker Inference Recommender "ListInferenceRecommendationsJobSteps" API response. + + +1.29.82 +======= + +* api-change:``codecatalyst``: Published Dev Environments StopDevEnvironmentSession API +* api-change:``pricing``: This release adds 2 new APIs - ListPriceLists which returns a list of applicable price lists, and GetPriceListFileUrl which outputs a URL to retrieve your price lists from the generated file from ListPriceLists +* api-change:``s3outposts``: S3 on Outposts introduces a new API ListOutpostsWithS3, with this API you can list all your Outposts with S3 capacity. + + +1.29.81 +======= + +* enhancement:Documentation: Splits service documentation into multiple sub-pages for better organization and faster loading time. +* api-change:``comprehend``: Amazon Comprehend now supports flywheels to help you train and manage new model versions for custom models. +* api-change:``ec2``: This release allows IMDS support to be set to v2-only on an existing AMI, so that all future instances launched from that AMI will use IMDSv2 by default. +* api-change:``kms``: AWS KMS is deprecating the RSAES_PKCS1_V1_5 wrapping algorithm option in the GetParametersForImport API that is used in the AWS KMS Import Key Material feature. AWS KMS will end support for this wrapping algorithm by October 1, 2023. +* api-change:``lightsail``: This release adds Lightsail for Research feature support, such as GUI session access, cost estimates, stop instance on idle, and disk auto mount. +* api-change:``managedblockchain``: This release adds support for tagging to the accessor resource in Amazon Managed Blockchain +* api-change:``omics``: Minor model changes to accomodate batch imports feature + + +1.29.80 +======= + +* api-change:``devops-guru``: This release adds the description field on ListAnomaliesForInsight and DescribeAnomaly API responses for proactive anomalies. +* api-change:``drs``: New fields were added to reflect availability zone data in source server and recovery instance description commands responses, as well as source server launch status. +* api-change:``internetmonitor``: CloudWatch Internet Monitor is a a new service within CloudWatch that will help application developers and network engineers continuously monitor internet performance metrics such as availability and performance between their AWS-hosted applications and end-users of these applications +* api-change:``lambda``: This release adds the ability to create ESMs with Document DB change streams as event source. For more information see https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html. +* api-change:``mediaconvert``: The AWS Elemental MediaConvert SDK has added support for HDR10 to SDR tone mapping, and animated GIF video input sources. +* api-change:``timestream-write``: This release adds the ability to ingest batched historical data or migrate data in bulk from S3 into Timestream using CSV files. + + +1.29.79 +======= + +* api-change:``connect``: StartTaskContact API now supports linked task creation with a new optional RelatedContactId parameter +* api-change:``connectcases``: This release adds the ability to delete domains through the DeleteDomain API. For more information see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html +* api-change:``redshift``: Documentation updates for Redshift API bringing it in line with IAM best practices. +* api-change:``securityhub``: New Security Hub APIs and updates to existing APIs that help you consolidate control findings and enable and disable controls across all supported standards +* api-change:``servicecatalog``: Documentation updates for Service Catalog + + +1.29.78 +======= + +* api-change:``appflow``: This release enables the customers to choose whether to use Private Link for Metadata and Authorization call when using a private Salesforce connections +* api-change:``ecs``: This release supports deleting Amazon ECS task definitions that are in the INACTIVE state. +* api-change:``grafana``: Doc-only update. Updated information on attached role policies for customer provided roles +* api-change:``guardduty``: Updated API and data types descriptions for CreateFilter, UpdateFilter, and TriggerDetails. +* api-change:``iotwireless``: In this release, we add additional capabilities for the FUOTA which allows user to configure the fragment size, the sending interval and the redundancy ratio of the FUOTA tasks +* api-change:``location``: This release adds support for using Maps APIs with an API Key in addition to AWS Cognito. This includes support for adding, listing, updating and deleting API Keys. +* api-change:``macie2``: This release adds support for a new finding type, Policy:IAMUser/S3BucketSharedWithCloudFront, and S3 bucket metadata that indicates if a bucket is shared with an Amazon CloudFront OAI or OAC. +* api-change:``wafv2``: You can now associate an AWS WAF v2 web ACL with an AWS App Runner service. + + +1.29.77 +======= + +* api-change:``chime-sdk-voice``: This release introduces support for Voice Connector media metrics in the Amazon Chime SDK Voice namespace +* api-change:``cloudfront``: CloudFront now supports block lists in origin request policies so that you can forward all headers, cookies, or query string from viewer requests to the origin *except* for those specified in the block list. +* api-change:``datasync``: AWS DataSync has relaxed the minimum length constraint of AccessKey for Object Storage locations to 1. +* api-change:``opensearch``: This release lets customers configure Off-peak window and software update related properties for a new/existing domain. It enhances the capabilities of StartServiceSoftwareUpdate API; adds 2 new APIs - ListScheduledActions & UpdateScheduledAction; and allows Auto-tune to make use of Off-peak window. +* api-change:``rum``: CloudWatch RUM now supports CloudWatch Custom Metrics +* api-change:``ssm``: Document only update for Feb 2023 + + +1.29.76 +======= + +* api-change:``quicksight``: S3 data sources now accept a custom IAM role. +* api-change:``resiliencehub``: In this release we improved resilience hub application creation and maintenance by introducing new resource and app component crud APIs, improving visibility and maintenance of application input sources and added support for additional information attributes to be provided by customers. +* api-change:``securityhub``: Documentation updates for AWS Security Hub +* api-change:``tnb``: This is the initial SDK release for AWS Telco Network Builder (TNB). AWS Telco Network Builder is a network automation service that helps you deploy and manage telecom networks. + + +1.29.75 +======= + +* bugfix:SSO: Fixes aws/aws-cli`#7496 `__ by using the correct profile name rather than the one set in the session. +* api-change:``auditmanager``: This release introduces a ServiceQuotaExceededException to the UpdateAssessmentFrameworkShare API operation. +* api-change:``connect``: Reasons for failed diff has been approved by SDK Reviewer + + +1.29.74 +======= + +* api-change:``apprunner``: This release supports removing MaxSize limit for AutoScalingConfiguration. +* api-change:``glue``: Release of Delta Lake Data Lake Format for Glue Studio Service + + +1.29.73 +======= + +* api-change:``emr``: Update emr client to latest version +* api-change:``grafana``: With this release Amazon Managed Grafana now supports inbound Network Access Control that helps you to restrict user access to your Grafana workspaces +* api-change:``ivs``: Doc-only update. Updated text description in DeleteChannel, Stream, and StreamSummary. +* api-change:``wafv2``: Added a notice for account takeover prevention (ATP). The interface incorrectly lets you to configure ATP response inspection in regional web ACLs in Region US East (N. Virginia), without returning an error. ATP response inspection is only available in web ACLs that protect CloudFront distributions. + + +1.29.72 +======= + +* api-change:``cloudtrail``: This release adds an InsufficientEncryptionPolicyException type to the StartImport endpoint +* api-change:``efs``: Update efs client to latest version +* api-change:``frauddetector``: This release introduces Lists feature which allows customers to reference a set of values in Fraud Detector's rules. With Lists, customers can dynamically manage these attributes in real time. Lists can be created/deleted and its contents can be modified using the Fraud Detector API. +* api-change:``glue``: Fix DirectJDBCSource not showing up in CLI code gen +* api-change:``privatenetworks``: This release introduces a new StartNetworkResourceUpdate API, which enables return/replacement of hardware from a NetworkSite. +* api-change:``rds``: Database Activity Stream support for RDS for SQL Server. +* api-change:``wafv2``: For protected CloudFront distributions, you can now use the AWS WAF Fraud Control account takeover prevention (ATP) managed rule group to block new login attempts from clients that have recently submitted too many failed login attempts. + + +1.29.71 +======= + +* api-change:``appconfig``: AWS AppConfig now offers the option to set a version label on hosted configuration versions. Version labels allow you to identify specific hosted configuration versions based on an alternate versioning scheme that you define. +* api-change:``datasync``: With this launch, we are giving customers the ability to use older SMB protocol versions, enabling them to use DataSync to copy data to and from their legacy storage arrays. +* api-change:``ec2``: With this release customers can turn host maintenance on or off when allocating or modifying a supported dedicated host. Host maintenance is turned on by default for supported hosts. + + +1.29.70 +======= + +* api-change:``account``: This release of the Account Management API enables customers to view and manage whether AWS Opt-In Regions are enabled or disabled for their Account. For more information, see https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html +* api-change:``appconfigdata``: AWS AppConfig now offers the option to set a version label on hosted configuration versions. If a labeled hosted configuration version is deployed, its version label is available in the GetLatestConfiguration response. +* api-change:``snowball``: Adds support for EKS Anywhere on Snowball. AWS Snow Family customers can now install EKS Anywhere service on Snowball Edge Compute Optimized devices. + + +1.29.69 +======= + +* api-change:``autoscaling``: You can now either terminate/replace, ignore, or wait for EC2 Auto Scaling instances on standby or protected from scale in. Also, you can also roll back changes from a failed instance refresh. +* api-change:``connect``: This update provides the Wisdom session ARN for contacts enabled for Wisdom in the chat channel. +* api-change:``ec2``: Adds support for waiters that automatically poll for an imported snapshot until it reaches the completed state. +* api-change:``polly``: Amazon Polly adds two new neural Japanese voices - Kazuha, Tomoko +* api-change:``sagemaker``: Amazon SageMaker Autopilot adds support for selecting algorithms in CreateAutoMLJob API. +* api-change:``sns``: This release adds support for SNS X-Ray active tracing as well as other updates. + + +1.29.68 +======= + +* api-change:``chime-sdk-meetings``: Documentation updates for Chime Meetings SDK +* api-change:``emr-containers``: EMR on EKS allows configuring retry policies for job runs through the StartJobRun API. Using retry policies, a job cause a driver pod to be restarted automatically if it fails or is deleted. The job's status can be seen in the DescribeJobRun and ListJobRun APIs and monitored using CloudWatch events. +* api-change:``evidently``: Updated entity overrides parameter to accept up to 2500 overrides or a total of 40KB. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``lightsail``: Documentation updates for Lightsail +* api-change:``migration-hub-refactor-spaces``: This release adds support for creating environments with a network fabric type of NONE +* api-change:``workdocs``: Doc only update for the WorkDocs APIs. +* api-change:``workspaces``: Removed Windows Server 2016 BYOL and made changes based on IAM campaign. + + +1.29.67 +======= + +* api-change:``backup``: This release added one attribute (resource name) in the output model of our 9 existing APIs in AWS backup so that customers will see the resource name at the output. No input required from Customers. +* api-change:``cloudfront``: CloudFront Origin Access Control extends support to AWS Elemental MediaStore origins. +* api-change:``glue``: DirectJDBCSource + Glue 4.0 streaming options +* api-change:``lakeformation``: This release removes the LFTagpolicyResource expression limits. + + +1.29.66 +======= + +* api-change:``transfer``: Updated the documentation for the ImportCertificate API call, and added examples. + + +1.29.65 +======= + +* api-change:``compute-optimizer``: AWS Compute optimizer can now infer if Kafka is running on an instance. +* api-change:``customer-profiles``: This release deprecates the PartyType and Gender enum data types from the Profile model and replaces them with new PartyTypeString and GenderString attributes, which accept any string of length up to 255. +* api-change:``frauddetector``: My AWS Service (Amazon Fraud Detector) - This release introduces Cold Start Model Training which optimizes training for small datasets and adds intelligent methods for treating unlabeled data. You can now train Online Fraud Insights or Transaction Fraud Insights models with minimal historical-data. +* api-change:``mediaconvert``: The AWS Elemental MediaConvert SDK has added improved scene change detection capabilities and a bandwidth reduction filter, along with video quality enhancements, to the AVC encoder. +* api-change:``outposts``: Adds OrderType to Order structure. Adds PreviousOrderId and PreviousLineItemId to LineItem structure. Adds new line item status REPLACED. Increases maximum length of pagination token. + + +1.29.64 +======= + +* enhancement:AWSCRT: Upgrade awscrt version to 0.16.9 +* api-change:``proton``: Add new GetResourcesSummary API +* api-change:``redshift``: Corrects descriptions of the parameters for the API operations RestoreFromClusterSnapshot, RestoreTableFromClusterSnapshot, and CreateCluster. + + +1.29.63 +======= + +* api-change:``appconfig``: AWS AppConfig introduces KMS customer-managed key (CMK) encryption of configuration data, along with AWS Secrets Manager as a new configuration data source. S3 objects using SSE-KMS encryption and SSM Parameter Store SecureStrings are also now supported. +* api-change:``connect``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``ec2``: Documentation updates for EC2. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``keyspaces``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``quicksight``: QuickSight support for Radar Chart and Dashboard Publish Options +* api-change:``redshift``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``sso-admin``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. + + +1.29.62 +======= + +* bugfix:``s3``: boto3 no longer overwrites user supplied `Content-Encoding` with `aws-chunked` when user also supplies `ChecksumAlgorithm`. +* api-change:``devops-guru``: This release adds filter support ListAnomalyForInsight API. +* api-change:``forecast``: This release will enable customer select INCREMENTAL as ImportModel in Forecast's CreateDatasetImportJob API. Verified latest SDK containing required attribute, following https://w.amazon.com/bin/view/AWS-Seer/Launch/Trebuchet/ +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``mediatailor``: The AWS Elemental MediaTailor SDK for Channel Assembly has added support for program updates, and the ability to clip the end of VOD sources in programs. +* api-change:``sns``: Additional attributes added for set-topic-attributes. + + +1.29.61 +======= + +* api-change:``accessanalyzer``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``appsync``: This release introduces the feature to support EventBridge as AppSync data source. +* api-change:``cloudtrail-data``: Add CloudTrail Data Service to enable users to ingest activity events from non-AWS sources into CloudTrail Lake. +* api-change:``cloudtrail``: Add new "Channel" APIs to enable users to manage channels used for CloudTrail Lake integrations, and "Resource Policy" APIs to enable users to manage the resource-based permissions policy attached to a channel. +* api-change:``codeartifact``: This release introduces a new DeletePackage API, which enables deletion of a package and all of its versions from a repository. +* api-change:``connectparticipant``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``ec2``: This launch allows customers to associate up to 8 IP addresses to their NAT Gateways to increase the limit on concurrent connections to a single destination by eight times from 55K to 440K. +* api-change:``groundstation``: DigIF Expansion changes to the Customer APIs. +* api-change:``iot``: Added support for IoT Rules Engine Cloudwatch Logs action batch mode. +* api-change:``kinesis``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``opensearch``: Amazon OpenSearch Service adds the option for a VPC endpoint connection between two domains when the local domain uses OpenSearch version 1.3 or 2.3. You can now use remote reindex to copy indices from one VPC domain to another without a reverse proxy. +* api-change:``outposts``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``polly``: Amazon Polly adds two new neural American English voices - Ruth, Stephen +* api-change:``sagemaker``: Amazon SageMaker Automatic Model Tuning now supports more completion criteria for Hyperparameter Optimization. +* api-change:``securityhub``: New fields have been added to the AWS Security Finding Format. Compliance.SecurityControlId is a unique identifier for a security control across standards. Compliance.AssociatedStandards contains all enabled standards in which a security control is enabled. +* api-change:``support``: This fixes incorrect endpoint construction when a customer is explicitly setting a region. + + +1.29.60 +======= + +* api-change:``clouddirectory``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``cloudformation``: This feature provides a method of obtaining which regions a stackset has stack instances deployed in. +* api-change:``discovery``: Update ImportName validation to 255 from the current length of 100 +* api-change:``dlm``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``ec2``: We add Prefix Lists as a new route destination option for LocalGatewayRoutes. This will allow customers to create routes to Prefix Lists. Prefix List routes will allow customers to group individual CIDR routes with the same target into a single route. +* api-change:``imagebuilder``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``kafka``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``mediaconvert``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``swf``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. + + +1.29.59 +======= + +* api-change:``application-autoscaling``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``appstream``: Fixing the issue where Appstream waiters hang for fleet_started and fleet_stopped. +* api-change:``elasticbeanstalk``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``fis``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``glacier``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``greengrass``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. +* api-change:``greengrassv2``: Enabled FIPS endpoints for GovCloud (US) in SDK. +* api-change:``mediatailor``: This release introduces the As Run logging type, along with API and documentation updates. +* api-change:``outposts``: Adding support for payment term in GetOrder, CreateOrder responses. +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``sagemaker``: This release supports running SageMaker Training jobs with container images that are in a private Docker registry. +* api-change:``serverlessrepo``: Enabled FIPS endpoints for GovCloud (US) regions in SDK. + + +1.29.58 +======= + +* api-change:``events``: Update events client to latest version +* api-change:``iotfleetwise``: Add model validation to BatchCreateVehicle and BatchUpdateVehicle operations that invalidate requests with an empty vehicles list. +* api-change:``s3``: Allow FIPS to be used with path-style URLs. + + +1.29.57 +======= + +* api-change:``cloudformation``: Enabled FIPS aws-us-gov endpoints in SDK. +* api-change:``ec2``: This release adds new functionality that allows customers to provision IPv6 CIDR blocks through Amazon VPC IP Address Manager (IPAM) as well as allowing customers to utilize IPAM Resource Discovery APIs. +* api-change:``m2``: Add returnCode, batchJobIdentifier in GetBatchJobExecution response, for user to view the batch job execution result & unique identifier from engine. Also removed unused headers from REST APIs +* api-change:``polly``: Add 5 new neural voices - Sergio (es-ES), Andres (es-MX), Remi (fr-FR), Adriano (it-IT) and Thiago (pt-BR). +* api-change:``redshift-serverless``: Added query monitoring rules as possible parameters for create and update workgroup operations. +* api-change:``s3control``: Add additional endpoint tests for S3 Control. Fix missing endpoint parameters for PutBucketVersioning and GetBucketVersioning. Prior to this fix, those operations may have resulted in an invalid endpoint being resolved. +* api-change:``sagemaker``: SageMaker Inference Recommender now decouples from Model Registry and could accept Model Name to invoke inference recommendations job; Inference Recommender now provides CPU/Memory Utilization metrics data in recommendation output. +* api-change:``sts``: Doc only change to update wording in a key topic + + +1.29.56 +======= + +* api-change:``databrew``: Enabled FIPS us-gov-west-1 endpoints in SDK. +* api-change:``route53``: Amazon Route 53 now supports the Asia Pacific (Melbourne) Region (ap-southeast-4) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. +* api-change:``ssm-sap``: This release provides updates to documentation and support for listing operations performed by AWS Systems Manager for SAP. + + +1.29.55 +======= + +* api-change:``lambda``: Release Lambda RuntimeManagementConfig, enabling customers to better manage runtime updates to their Lambda functions. This release adds two new APIs, GetRuntimeManagementConfig and PutRuntimeManagementConfig, as well as support on existing Create/Get/Update function APIs. +* api-change:``sagemaker``: Amazon SageMaker Inference now supports P4de instance types. + + +1.29.54 +======= + +* api-change:``ec2``: C6in, M6in, M6idn, R6in and R6idn instances are powered by 3rd Generation Intel Xeon Scalable processors (code named Ice Lake) with an all-core turbo frequency of 3.5 GHz. +* api-change:``ivs``: API and Doc update. Update to arns field in BatchGetStreamKey. Also updates to operations and structures. +* api-change:``quicksight``: This release adds support for data bars in QuickSight table and increases pivot table field well limit. + + +1.29.53 +======= + +* api-change:``appflow``: Adding support for Salesforce Pardot connector in Amazon AppFlow. +* api-change:``codeartifact``: Documentation updates for CodeArtifact +* api-change:``connect``: Amazon Connect Chat introduces Persistent Chat, allowing customers to resume previous conversations with context and transcripts carried over from previous chats, eliminating the need to repeat themselves and allowing agents to provide personalized service with access to entire conversation history. +* api-change:``connectparticipant``: This release updates Amazon Connect Participant's GetTranscript api to provide transcripts of past chats on a persistent chat session. +* api-change:``ec2``: Adds SSM Parameter Resource Aliasing support to EC2 Launch Templates. Launch Templates can now store parameter aliases in place of AMI Resource IDs. CreateLaunchTemplateVersion and DescribeLaunchTemplateVersions now support a convenience flag, ResolveAlias, to return the resolved parameter value. +* api-change:``glue``: Release Glue Studio Hudi Data Lake Format for SDK/CLI +* api-change:``groundstation``: Add configurable prepass and postpass times for DataflowEndpointGroup. Add Waiter to allow customers to wait for a contact that was reserved through ReserveContact +* api-change:``logs``: Bug fix - Removed the regex pattern validation from CoralModel to avoid potential security issue. +* api-change:``medialive``: AWS Elemental MediaLive adds support for SCTE 35 preRollMilliSeconds. +* api-change:``opensearch``: This release adds the enhanced dry run option, that checks for validation errors that might occur when deploying configuration changes and provides a summary of these errors, if any. The feature will also indicate whether a blue/green deployment will be required to apply a change. +* api-change:``panorama``: Added AllowMajorVersionUpdate option to OTAJobConfig to make appliance software major version updates opt-in. +* api-change:``sagemaker``: HyperParameterTuningJobs now allow passing environment variables into the corresponding TrainingJobs + + +1.29.52 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``efs``: Update efs client to latest version +* api-change:``ivschat``: Updates the range for a Chat Room's maximumMessageRatePerSecond field. +* api-change:``wafv2``: Improved the visibility of the guidance for updating AWS WAF resources, such as web ACLs and rule groups. + + +1.29.51 +======= + +* api-change:``billingconductor``: This release adds support for SKU Scope for pricing plans. +* api-change:``cloud9``: Added minimum value to AutomaticStopTimeMinutes parameter. +* api-change:``imagebuilder``: Add support for AWS Marketplace product IDs as input during CreateImageRecipe for the parent-image parameter. Add support for listing third-party components. +* api-change:``network-firewall``: Network Firewall now allows creation of dual stack endpoints, enabling inspection of IPv6 traffic. + + +1.29.50 +======= + +* api-change:``connect``: This release updates the responses of UpdateContactFlowContent, UpdateContactFlowMetadata, UpdateContactFlowName and DeleteContactFlow API with empty responses. +* api-change:``ec2``: Documentation updates for EC2. +* api-change:``outposts``: This release adds POWER_30_KVA as an option for PowerDrawKva. PowerDrawKva is part of the RackPhysicalProperties structure in the CreateSite request. +* api-change:``resource-groups``: AWS Resource Groups customers can now turn on Group Lifecycle Events in their AWS account. When you turn this on, Resource Groups monitors your groups for changes to group state or membership. Those changes are sent to Amazon EventBridge as events that you can respond to using rules you create. + + +1.29.49 +======= + +* api-change:``cleanrooms``: Initial release of AWS Clean Rooms +* api-change:``lambda``: Add support for MaximumConcurrency parameter for SQS event source. Customers can now limit the maximum concurrent invocations for their SQS Event Source Mapping. +* api-change:``logs``: Bug fix: logGroupName is now not a required field in GetLogEvents, FilterLogEvents, GetLogGroupFields, and DescribeLogStreams APIs as logGroupIdentifier can be provided instead +* api-change:``mediaconvert``: The AWS Elemental MediaConvert SDK has added support for compact DASH manifest generation, audio normalization using TruePeak measurements, and the ability to clip the sample range in the color corrector. +* api-change:``secretsmanager``: Update documentation for new ListSecrets and DescribeSecret parameters + + +1.29.48 +======= + +* api-change:``kendra``: This release adds support to new document types - RTF, XML, XSLT, MS_EXCEL, CSV, JSON, MD + + +1.29.47 +======= + +* api-change:``location``: This release adds support for two new route travel models, Bicycle and Motorcycle which can be used with Grab data source. +* api-change:``rds``: This release adds support for configuring allocated storage on the CreateDBInstanceReadReplica, RestoreDBInstanceFromDBSnapshot, and RestoreDBInstanceToPointInTime APIs. + + +1.29.46 +======= + +* api-change:``ecr-public``: This release for Amazon ECR Public makes several change to bring the SDK into sync with the API. +* api-change:``kendra-ranking``: Introducing Amazon Kendra Intelligent Ranking, a new set of Kendra APIs that leverages Kendra semantic ranking capabilities to improve the quality of search results from other search services (i.e. OpenSearch, ElasticSearch, Solr). +* api-change:``network-firewall``: Network Firewall now supports the Suricata rule action reject, in addition to the actions pass, drop, and alert. +* api-change:``ram``: Enabled FIPS aws-us-gov endpoints in SDK. +* api-change:``workspaces-web``: This release adds support for a new portal authentication type: AWS IAM Identity Center (successor to AWS Single Sign-On). + + +1.29.45 +======= + +* api-change:``acm-pca``: Added revocation parameter validation: bucket names must match S3 bucket naming rules and CNAMEs conform to RFC2396 restrictions on the use of special characters in URIs. +* api-change:``auditmanager``: This release introduces a new data retention option in your Audit Manager settings. You can now use the DeregistrationPolicy parameter to specify if you want to delete your data when you deregister Audit Manager. + + +1.29.44 +======= + +* api-change:``amplifybackend``: Updated GetBackendAPIModels response to include ModelIntrospectionSchema json string +* api-change:``apprunner``: This release adds support of securely referencing secrets and configuration data that are stored in Secrets Manager and SSM Parameter Store by adding them as environment secrets in your App Runner service. +* api-change:``connect``: Documentation update for a new Initiation Method value in DescribeContact API +* api-change:``emr-serverless``: Adds support for customized images. You can now provide runtime images when creating or updating EMR Serverless Applications. +* api-change:``lightsail``: Documentation updates for Amazon Lightsail. +* api-change:``mwaa``: MWAA supports Apache Airflow version 2.4.3. +* api-change:``rds``: This release adds support for specifying which certificate authority (CA) to use for a DB instance's server certificate during DB instance creation, as well as other CA enhancements. + + +1.29.43 +======= + +* api-change:``application-autoscaling``: Customers can now use the existing DescribeScalingActivities API to also see the detailed and machine-readable reasons for Application Auto Scaling not scaling their resources and, if needed, take the necessary corrective actions. +* api-change:``logs``: Update to remove sequenceToken as a required field in PutLogEvents calls. +* api-change:``ssm``: Adding support for QuickSetup Document Type in Systems Manager + + +1.29.42 +======= + +* api-change:``securitylake``: Allow CreateSubscriber API to take string input that allows setting more descriptive SubscriberDescription field. Make souceTypes field required in model level for UpdateSubscriberRequest as it is required for every API call on the backend. Allow ListSubscribers take any String as nextToken param. + + +1.29.41 +======= + +* api-change:``cloudfront``: Extend response headers policy to support removing headers from viewer responses +* api-change:``iotfleetwise``: Update documentation - correct the epoch constant value of default value for expiryTime field in CreateCampaign request. + + +1.29.40 +======= + +* api-change:``apigateway``: Documentation updates for Amazon API Gateway +* api-change:``emr``: Update emr client to latest version +* api-change:``secretsmanager``: Added owning service filter, include planned deletion flag, and next rotation date response parameter in ListSecrets. +* api-change:``wisdom``: This release extends Wisdom CreateContent and StartContentUpload APIs to support PDF and MicrosoftWord docx document uploading. + + +1.29.39 +======= + +* api-change:``elasticache``: This release allows you to modify the encryption in transit setting, for existing Redis clusters. You can now change the TLS configuration of your Redis clusters without the need to re-build or re-provision the clusters or impact application availability. +* api-change:``network-firewall``: AWS Network Firewall now provides status messages for firewalls to help you troubleshoot when your endpoint fails. +* api-change:``rds``: This release adds support for Custom Engine Version (CEV) on RDS Custom SQL Server. +* api-change:``route53-recovery-control-config``: Added support for Python paginators in the route53-recovery-control-config List* APIs. + + +1.29.38 +======= + +* api-change:``memorydb``: This release adds support for MemoryDB Reserved nodes which provides a significant discount compared to on-demand node pricing. Reserved nodes are not physical nodes, but rather a billing discount applied to the use of on-demand nodes in your account. +* api-change:``transfer``: Add additional operations to throw ThrottlingExceptions + + +1.29.37 +======= + +* api-change:``connect``: Support for Routing Profile filter, SortCriteria, and grouping by Routing Profiles for GetCurrentMetricData API. Support for RoutingProfiles, UserHierarchyGroups, and Agents as filters, NextStatus and AgentStatusName for GetCurrentUserData. Adds ApproximateTotalCount to both APIs. +* api-change:``connectparticipant``: Amazon Connect Chat introduces the Message Receipts feature. This feature allows agents and customers to receive message delivered and read receipts after they send a chat message. +* api-change:``detective``: This release adds a missed AccessDeniedException type to several endpoints. +* api-change:``fsx``: Fix a bug where a recent release might break certain existing SDKs. +* api-change:``inspector2``: Amazon Inspector adds support for scanning NodeJS 18.x and Go 1.x AWS Lambda function runtimes. + + +1.29.36 +======= + +* api-change:``compute-optimizer``: This release enables AWS Compute Optimizer to analyze and generate optimization recommendations for ecs services running on Fargate. +* api-change:``connect``: Amazon Connect Chat introduces the Idle Participant/Autodisconnect feature, which allows users to set timeouts relating to the activity of chat participants, using the new UpdateParticipantRoleConfig API. +* api-change:``iotdeviceadvisor``: This release adds the following new features: 1) Documentation updates for IoT Device Advisor APIs. 2) Updated required request parameters for IoT Device Advisor APIs. 3) Added new service feature: ability to provide the test endpoint when customer executing the StartSuiteRun API. +* api-change:``kinesis-video-webrtc-storage``: Amazon Kinesis Video Streams offers capabilities to stream video and audio in real-time via WebRTC to the cloud for storage, playback, and analytical processing. Customers can use our enhanced WebRTC SDK and cloud APIs to enable real-time streaming, as well as media ingestion to the cloud. +* api-change:``rds``: Add support for managing master user password in AWS Secrets Manager for the DBInstance and DBCluster. +* api-change:``secretsmanager``: Documentation updates for Secrets Manager + + +1.29.35 +======= + +* api-change:``connect``: Amazon Connect Chat now allows for JSON (application/json) message types to be sent as part of the initial message in the StartChatContact API. +* api-change:``connectparticipant``: Amazon Connect Chat now allows for JSON (application/json) message types to be sent in the SendMessage API. +* api-change:``license-manager-linux-subscriptions``: AWS License Manager now offers cross-region, cross-account tracking of commercial Linux subscriptions on AWS. This includes subscriptions purchased as part of EC2 subscription-included AMIs, on the AWS Marketplace, or brought to AWS via Red Hat Cloud Access Program. +* api-change:``macie2``: This release adds support for analyzing Amazon S3 objects that use the S3 Glacier Instant Retrieval (Glacier_IR) storage class. +* api-change:``sagemaker``: This release enables adding RStudio Workbench support to an existing Amazon SageMaker Studio domain. It allows setting your RStudio on SageMaker environment configuration parameters and also updating the RStudioConnectUrl and RStudioPackageManagerUrl parameters for existing domains +* api-change:``scheduler``: Updated the ListSchedules and ListScheduleGroups APIs to allow the NamePrefix field to start with a number. Updated the validation for executionRole field to support any role name. +* api-change:``ssm``: Doc-only updates for December 2022. +* api-change:``support``: Documentation updates for the AWS Support API +* api-change:``transfer``: This release adds support for Decrypt as a workflow step type. + + +1.29.34 +======= + +* api-change:``batch``: Adds isCancelled and isTerminated to DescribeJobs response. +* api-change:``ec2``: Adds support for pagination in the EC2 DescribeImages API. +* api-change:``lookoutequipment``: This release adds support for listing inference schedulers by status. +* api-change:``medialive``: This release adds support for two new features to AWS Elemental MediaLive. First, you can now burn-in timecodes to your MediaLive outputs. Second, we now now support the ability to decode Dolby E audio when it comes in on an input. +* api-change:``nimble``: Amazon Nimble Studio now supports configuring session storage volumes and persistence, as well as backup and restore sessions through launch profiles. +* api-change:``resource-explorer-2``: Documentation updates for AWS Resource Explorer. +* api-change:``route53domains``: Use Route 53 domain APIs to change owner, create/delete DS record, modify IPS tag, resend authorization. New: AssociateDelegationSignerToDomain, DisassociateDelegationSignerFromDomain, PushDomain, ResendOperationAuthorization. Updated: UpdateDomainContact, ListOperations, CheckDomainTransferability. +* api-change:``sagemaker``: Amazon SageMaker Autopilot adds support for new objective metrics in CreateAutoMLJob API. +* api-change:``transcribe``: Enable our batch transcription jobs for Swedish and Vietnamese. + + +1.29.33 +======= + +* api-change:``athena``: Add missed InvalidRequestException in GetCalculationExecutionCode,StopCalculationExecution APIs. Correct required parameters (Payload and Type) in UpdateNotebook API. Change Notebook size from 15 Mb to 10 Mb. +* api-change:``ecs``: This release adds support for alarm-based rollbacks in ECS, a new feature that allows customers to add automated safeguards for Amazon ECS service rolling updates. +* api-change:``kinesis-video-webrtc-storage``: Amazon Kinesis Video Streams offers capabilities to stream video and audio in real-time via WebRTC to the cloud for storage, playback, and analytical processing. Customers can use our enhanced WebRTC SDK and cloud APIs to enable real-time streaming, as well as media ingestion to the cloud. +* api-change:``kinesisvideo``: Amazon Kinesis Video Streams offers capabilities to stream video and audio in real-time via WebRTC to the cloud for storage, playback, and analytical processing. Customers can use our enhanced WebRTC SDK and cloud APIs to enable real-time streaming, as well as media ingestion to the cloud. +* api-change:``rds``: Add support for --enable-customer-owned-ip to RDS create-db-instance-read-replica API for RDS on Outposts. +* api-change:``sagemaker``: AWS Sagemaker - Sagemaker Images now supports Aliases as secondary identifiers for ImageVersions. SageMaker Images now supports additional metadata for ImageVersions for better images management. + + +1.29.32 +======= + +* api-change:``appflow``: This release updates the ListConnectorEntities API action so that it returns paginated responses that customers can retrieve with next tokens. +* api-change:``cloudfront``: Updated documentation for CloudFront +* api-change:``datasync``: AWS DataSync now supports the use of tags with task executions. With this new feature, you can apply tags each time you execute a task, giving you greater control and management over your task executions. +* api-change:``efs``: Update efs client to latest version +* api-change:``guardduty``: This release provides the valid characters for the Description and Name field. +* api-change:``iotfleetwise``: Updated error handling for empty resource names in "UpdateSignalCatalog" and "GetModelManifest" operations. +* api-change:``sagemaker``: AWS sagemaker - Features: This release adds support for random seed, it's an integer value used to initialize a pseudo-random number generator. Setting a random seed will allow the hyperparameter tuning search strategies to produce more consistent configurations for the same tuning job. + + +1.29.31 +======= + +* api-change:``backup-gateway``: This release adds support for VMware vSphere tags, enabling customer to protect VMware virtual machines using tag-based policies for AWS tags mapped from vSphere tags. This release also adds support for customer-accessible gateway-hypervisor interaction log and upload bandwidth rate limit schedule. +* api-change:``connect``: Added support for "English - New Zealand" and "English - South African" to be used with Amazon Connect Custom Vocabulary APIs. +* api-change:``ecs``: This release adds support for container port ranges in ECS, a new capability that allows customers to provide container port ranges to simplify use cases where multiple ports are in use in a container. This release updates TaskDefinition mutation APIs and the Task description APIs. +* api-change:``eks``: Add support for Windows managed nodes groups. +* api-change:``glue``: This release adds support for AWS Glue Crawler with native DeltaLake tables, allowing Crawlers to classify Delta Lake format tables and catalog them for query engines to query against. +* api-change:``kinesis``: Added StreamARN parameter for Kinesis Data Streams APIs. Added a new opaque pagination token for ListStreams. SDKs will auto-generate Account Endpoint when accessing Kinesis Data Streams. +* api-change:``location``: This release adds support for a new style, "VectorOpenDataStandardLight" which can be used with the new data source, "Open Data Maps (Preview)". +* api-change:``m2``: Adds an optional create-only `KmsKeyId` property to Environment and Application resources. +* api-change:``sagemaker``: SageMaker Inference Recommender now allows customers to load tests their models on various instance types using private VPC. +* api-change:``securityhub``: Added new resource details objects to ASFF, including resources for AwsEc2LaunchTemplate, AwsSageMakerNotebookInstance, AwsWafv2WebAcl and AwsWafv2RuleGroup. +* api-change:``translate``: Raised the input byte size limit of the Text field in the TranslateText API to 10000 bytes. + + +1.29.30 +======= + +* api-change:``ce``: This release supports percentage-based thresholds on Cost Anomaly Detection alert subscriptions. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``networkmanager``: Appliance Mode support for AWS Cloud WAN. +* api-change:``redshift-data``: This release adds a new --client-token field to ExecuteStatement and BatchExecuteStatement operations. Customers can now run queries with the additional client token parameter to ensures idempotency. +* api-change:``sagemaker-metrics``: Update SageMaker Metrics documentation. + + +1.29.29 +======= + +* api-change:``cloudtrail``: Merging mainline branch for service model into mainline release branch. There are no new APIs. +* api-change:``rds``: This deployment adds ClientPasswordAuthType field to the Auth structure of the DBProxy. + + +1.29.28 +======= + +* bugfix:Endpoint provider: Updates ARN parsing ``resourceId`` delimiters +* api-change:``customer-profiles``: This release allows custom strings in PartyType and Gender through 2 new attributes in the CreateProfile and UpdateProfile APIs: PartyTypeString and GenderString. +* api-change:``ec2``: This release updates DescribeFpgaImages to show supported instance types of AFIs in its response. +* api-change:``kinesisvideo``: This release adds support for public preview of Kinesis Video Stream at Edge enabling customers to provide configuration for the Kinesis Video Stream EdgeAgent running on an on-premise IoT device. Customers can now locally record from cameras and stream videos to the cloud on configured schedule. +* api-change:``lookoutvision``: This documentation update adds kms:GenerateDataKey as a required permission to StartModelPackagingJob. +* api-change:``migration-hub-refactor-spaces``: This release adds support for Lambda alias service endpoints. Lambda alias ARNs can now be passed into CreateService. +* api-change:``rds``: Update the RDS API model to support copying option groups during the CopyDBSnapshot operation +* api-change:``rekognition``: Adds support for "aliases" and "categories", inclusion and exclusion filters for labels and label categories, and aggregating labels by video segment timestamps for Stored Video Label Detection APIs. +* api-change:``sagemaker-metrics``: This release introduces support SageMaker Metrics APIs. +* api-change:``wafv2``: Documents the naming requirement for logging destinations that you use with web ACLs. + + +1.29.27 +======= + +* api-change:``iotfleetwise``: Deprecated assignedValue property for actuators and attributes. Added a message to invalid nodes and invalid decoder manifest exceptions. +* api-change:``logs``: Doc-only update for CloudWatch Logs, for Tagging Permissions clarifications +* api-change:``medialive``: Link devices now support buffer size (latency) configuration. A higher latency value means a longer delay in transmitting from the device to MediaLive, but improved resiliency. A lower latency value means a shorter delay, but less resiliency. +* api-change:``mediapackage-vod``: This release provides the approximate number of assets in a packaging group. + + +1.29.26 +======= + +* enhancement:Endpoint Provider Standard Library: Correct spelling of 'library' in ``StandardLibrary`` class +* api-change:``autoscaling``: Adds support for metric math for target tracking scaling policies, saving you the cost and effort of publishing a custom metric to CloudWatch. Also adds support for VPC Lattice by adding the Attach/Detach/DescribeTrafficSources APIs and a new health check type to the CreateAutoScalingGroup API. +* api-change:``iottwinmaker``: This release adds the following new features: 1) New APIs for managing a continuous sync of assets and asset models from AWS IoT SiteWise. 2) Support user friendly names for component types (ComponentTypeName) and properties (DisplayName). +* api-change:``migrationhubstrategy``: This release adds known application filtering, server selection for assessments, support for potential recommendations, and indications for configuration and assessment status. For more information, see the AWS Migration Hub documentation at https://docs.aws.amazon.com/migrationhub/index.html + + +1.29.25 +======= + +* api-change:``ce``: This release adds the LinkedAccountName field to the GetAnomalies API response under RootCause +* api-change:``cloudfront``: Introducing UpdateDistributionWithStagingConfig that can be used to promote the staging configuration to the production. +* api-change:``eks``: Adds support for EKS add-ons configurationValues fields and DescribeAddonConfiguration function +* api-change:``kms``: Updated examples and exceptions for External Key Store (XKS). + + +1.29.24 +======= + +* api-change:``billingconductor``: This release adds the Tiering Pricing Rule feature. +* api-change:``connect``: This release provides APIs that enable you to programmatically manage rules for Contact Lens conversational analytics and third party applications. For more information, see https://docs.aws.amazon.com/connect/latest/APIReference/rules-api.html +* api-change:``dynamodb``: Endpoint Ruleset update: Use http instead of https for the "local" region. +* api-change:``dynamodbstreams``: Update dynamodbstreams client to latest version +* api-change:``rds``: This release adds the BlueGreenDeploymentNotFoundFault to the AddTagsToResource, ListTagsForResource, and RemoveTagsFromResource operations. +* api-change:``sagemaker-featurestore-runtime``: For online + offline Feature Groups, added ability to target PutRecord and DeleteRecord actions to only online store, or only offline store. If target store parameter is not specified, actions will apply to both stores. + + +1.29.23 +======= + +* api-change:``ce``: This release introduces two new APIs that offer a 1-click experience to refresh Savings Plans recommendations. The two APIs are StartSavingsPlansPurchaseRecommendationGeneration and ListSavingsPlansPurchaseRecommendationGeneration. +* api-change:``ec2``: Documentation updates for EC2. +* api-change:``ivschat``: Adds PendingVerification error type to messaging APIs to block the resource usage for accounts identified as being fraudulent. +* api-change:``rds``: This release adds the InvalidDBInstanceStateFault to the RestoreDBClusterFromSnapshot operation. +* api-change:``transcribe``: Amazon Transcribe now supports creating custom language models in the following languages: Japanese (ja-JP) and German (de-DE). + + +1.29.22 +======= + +* api-change:``appsync``: Fixes the URI for the evaluatecode endpoint to include the /v1 prefix (ie. "/v1/dataplane-evaluatecode"). +* api-change:``ecs``: Documentation updates for Amazon ECS +* api-change:``fms``: AWS Firewall Manager now supports Fortigate Cloud Native Firewall as a Service as a third-party policy type. +* api-change:``mediaconvert``: The AWS Elemental MediaConvert SDK has added support for configurable ID3 eMSG box attributes and the ability to signal them with InbandEventStream tags in DASH and CMAF outputs. +* api-change:``medialive``: Updates to Event Signaling and Management (ESAM) API and documentation. +* api-change:``polly``: Add language code for Finnish (fi-FI) +* api-change:``proton``: CreateEnvironmentAccountConnection RoleArn input is now optional +* api-change:``redshift-serverless``: Add Table Level Restore operations for Amazon Redshift Serverless. Add multi-port support for Amazon Redshift Serverless endpoints. Add Tagging support to Snapshots and Recovery Points in Amazon Redshift Serverless. +* api-change:``sns``: This release adds the message payload-filtering feature to the SNS Subscribe, SetSubscriptionAttributes, and GetSubscriptionAttributes API actions + + +1.29.21 +======= + +* api-change:``codecatalyst``: This release adds operations that support customers using the AWS Toolkits and Amazon CodeCatalyst, a unified software development service that helps developers develop, deploy, and maintain applications in the cloud. For more information, see the documentation. +* api-change:``comprehend``: Comprehend now supports semi-structured documents (such as PDF files or image files) as inputs for custom analysis using the synchronous APIs (ClassifyDocument and DetectEntities). +* api-change:``gamelift``: GameLift introduces a new feature, GameLift Anywhere. GameLift Anywhere allows you to integrate your own compute resources with GameLift. You can also use GameLift Anywhere to iteratively test your game servers without uploading the build to GameLift for every iteration. +* api-change:``pipes``: AWS introduces new Amazon EventBridge Pipes which allow you to connect sources (SQS, Kinesis, DDB, Kafka, MQ) to Targets (14+ EventBridge Targets) without any code, with filtering, batching, input transformation, and an optional Enrichment stage (Lambda, StepFunctions, ApiGateway, ApiDestinations) +* api-change:``stepfunctions``: Update stepfunctions client to latest version + + +1.29.20 +======= + +* api-change:``accessanalyzer``: This release adds support for S3 cross account access points. IAM Access Analyzer will now produce public or cross account findings when it detects bucket delegation to external account access points. +* api-change:``athena``: This release includes support for using Apache Spark in Amazon Athena. +* api-change:``dataexchange``: This release enables data providers to license direct access to data in their Amazon S3 buckets or AWS Lake Formation data lakes through AWS Data Exchange. Subscribers get read-only access to the data and can use it in downstream AWS services, like Amazon Athena, without creating or managing copies. +* api-change:``docdb-elastic``: Launched Amazon DocumentDB Elastic Clusters. You can now use the SDK to create, list, update and delete Amazon DocumentDB Elastic Cluster resources +* api-change:``glue``: This release adds support for AWS Glue Data Quality, which helps you evaluate and monitor the quality of your data and includes the API for creating, deleting, or updating data quality rulesets, runs and evaluations. +* api-change:``s3control``: Amazon S3 now supports cross-account access points. S3 bucket owners can now allow trusted AWS accounts to create access points associated with their bucket. +* api-change:``sagemaker-geospatial``: This release provides Amazon SageMaker geospatial APIs to build, train, deploy and visualize geospatial models. +* api-change:``sagemaker``: Added Models as part of the Search API. Added Model shadow deployments in realtime inference, and shadow testing in managed inference. Added support for shared spaces, geospatial APIs, Model Cards, AutoMLJobStep in pipelines, Git repositories on user profiles and domains, Model sharing in Jumpstart. + + +1.29.19 +======= + +* api-change:``ec2``: This release adds support for AWS Verified Access and the Hpc6id Amazon EC2 compute optimized instance type, which features 3rd generation Intel Xeon Scalable processors. +* api-change:``firehose``: Allow support for the Serverless offering for Amazon OpenSearch Service as a Kinesis Data Firehose delivery destination. +* api-change:``kms``: AWS KMS introduces the External Key Store (XKS), a new feature for customers who want to protect their data with encryption keys stored in an external key management system under their control. +* api-change:``omics``: Amazon Omics is a new, purpose-built service that can be used by healthcare and life science organizations to store, query, and analyze omics data. The insights from that data can be used to accelerate scientific discoveries and improve healthcare. +* api-change:``opensearchserverless``: Publish SDK for Amazon OpenSearch Serverless +* api-change:``securitylake``: Amazon Security Lake automatically centralizes security data from cloud, on-premises, and custom sources into a purpose-built data lake stored in your account. Security Lake makes it easier to analyze security data, so you can improve the protection of your workloads, applications, and data +* api-change:``simspaceweaver``: AWS SimSpace Weaver is a new service that helps customers build spatial simulations at new levels of scale - resulting in virtual worlds with millions of dynamic entities. See the AWS SimSpace Weaver developer guide for more details on how to get started. https://docs.aws.amazon.com/simspaceweaver + + +1.29.18 +======= + +* api-change:``arc-zonal-shift``: Amazon Route 53 Application Recovery Controller Zonal Shift is a new service that makes it easy to shift traffic away from an Availability Zone in a Region. See the developer guide for more information: https://docs.aws.amazon.com/r53recovery/latest/dg/what-is-route53-recovery.html +* api-change:``compute-optimizer``: Adds support for a new recommendation preference that makes it possible for customers to optimize their EC2 recommendations by utilizing an external metrics ingestion service to provide metrics. +* api-change:``config``: With this release, you can use AWS Config to evaluate your resources for compliance with Config rules before they are created or updated. Using Config rules in proactive mode enables you to test and build compliant resource templates or check resource configurations at the time they are provisioned. +* api-change:``ec2``: Introduces ENA Express, which uses AWS SRD and dynamic routing to increase throughput and minimize latency, adds support for trust relationships between Reachability Analyzer and AWS Organizations to enable cross-account analysis, and adds support for Infrastructure Performance metric subscriptions. +* api-change:``eks``: Adds support for additional EKS add-ons metadata and filtering fields +* api-change:``fsx``: This release adds support for 4GB/s / 160K PIOPS FSx for ONTAP file systems and 10GB/s / 350K PIOPS FSx for OpenZFS file systems (Single_AZ_2). For FSx for ONTAP, this also adds support for DP volumes, snapshot policy, copy tags to backups, and Multi-AZ route table updates. +* api-change:``glue``: This release allows the creation of Custom Visual Transforms (Dynamic Transforms) to be created via AWS Glue CLI/SDK. +* api-change:``inspector2``: This release adds support for Inspector to scan AWS Lambda. +* api-change:``lambda``: Adds support for Lambda SnapStart, which helps improve the startup performance of functions. Customers can now manage SnapStart based functions via CreateFunction and UpdateFunctionConfiguration APIs +* api-change:``license-manager-user-subscriptions``: AWS now offers fully-compliant, Amazon-provided licenses for Microsoft Office Professional Plus 2021 Amazon Machine Images (AMIs) on Amazon EC2. These AMIs are now available on the Amazon EC2 console and on AWS Marketplace to launch instances on-demand without any long-term licensing commitments. +* api-change:``macie2``: Added support for configuring Macie to continually sample objects from S3 buckets and inspect them for sensitive data. Results appear in statistics, findings, and other data that Macie provides. +* api-change:``quicksight``: This release adds new Describe APIs and updates Create and Update APIs to support the data model for Dashboards, Analyses, and Templates. +* api-change:``s3control``: Added two new APIs to support Amazon S3 Multi-Region Access Point failover controls: GetMultiRegionAccessPointRoutes and SubmitMultiRegionAccessPointRoutes. The failover control APIs are supported in the following Regions: us-east-1, us-west-2, eu-west-1, ap-southeast-2, and ap-northeast-1. +* api-change:``securityhub``: Adding StandardsManagedBy field to DescribeStandards API response + + +1.29.17 +======= + +* api-change:``backup``: AWS Backup introduces support for legal hold and application stack backups. AWS Backup Audit Manager introduces support for cross-Region, cross-account reports. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``drs``: Non breaking changes to existing APIs, and additional APIs added to support in-AWS failing back using AWS Elastic Disaster Recovery. +* api-change:``ecs``: This release adds support for ECS Service Connect, a new capability that simplifies writing and operating resilient distributed applications. This release updates the TaskDefinition, Cluster, Service mutation APIs with Service connect constructs and also adds a new ListServicesByNamespace API. +* api-change:``efs``: Update efs client to latest version +* api-change:``iot-data``: This release adds support for MQTT5 properties to AWS IoT HTTP Publish API. +* api-change:``iot``: Job scheduling enables the scheduled rollout of a Job with start and end times and a customizable end behavior when end time is reached. This is available for continuous and snapshot jobs. Added support for MQTT5 properties to AWS IoT TopicRule Republish Action. +* api-change:``iotwireless``: This release includes a new feature for customers to calculate the position of their devices by adding three new APIs: UpdateResourcePosition, GetResourcePosition, and GetPositionEstimate. +* api-change:``kendra``: Amazon Kendra now supports preview of table information from HTML tables in the search results. The most relevant cells with their corresponding rows, columns are displayed as a preview in the search result. The most relevant table cell or cells are also highlighted in table preview. +* api-change:``logs``: Updates to support CloudWatch Logs data protection and CloudWatch cross-account observability +* api-change:``mgn``: This release adds support for Application and Wave management. We also now support custom post-launch actions. +* api-change:``oam``: Amazon CloudWatch Observability Access Manager is a new service that allows configuration of the CloudWatch cross-account observability feature. +* api-change:``organizations``: This release introduces delegated administrator for AWS Organizations, a new feature to help you delegate the management of your Organizations policies, enabling you to govern your AWS organization in a decentralized way. You can now allow member accounts to manage Organizations policies. +* api-change:``rds``: This release enables new Aurora and RDS feature called Blue/Green Deployments that makes updates to databases safer, simpler and faster. +* api-change:``textract``: This release adds support for classifying and splitting lending documents by type, and extracting information by using the Analyze Lending APIs. This release also includes support for summarized information of the processed lending document package, in addition to per document results. +* api-change:``transcribe``: This release adds support for 'inputType' for post-call and real-time (streaming) Call Analytics within Amazon Transcribe. + + +1.29.16 +======= + +* api-change:``grafana``: This release includes support for configuring a Grafana workspace to connect to a datasource within a VPC as well as new APIs for configuring Grafana settings. +* api-change:``rbin``: This release adds support for Rule Lock for Recycle Bin, which allows you to lock retention rules so that they can no longer be modified or deleted. + + +1.29.15 +======= + +* bugfix:Endpoints: Resolve endpoint with default partition when no region is set +* bugfix:s3: fixes missing x-amz-content-sha256 header for s3 object lambda +* api-change:``appflow``: Adding support for Amazon AppFlow to transfer the data to Amazon Redshift databases through Amazon Redshift Data API service. This feature will support the Redshift destination connector on both public and private accessible Amazon Redshift Clusters and Amazon Redshift Serverless. +* api-change:``kinesisanalyticsv2``: Support for Apache Flink 1.15 in Kinesis Data Analytics. + + +1.29.14 +======= + +* api-change:``route53``: Amazon Route 53 now supports the Asia Pacific (Hyderabad) Region (ap-south-2) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. + + +1.29.13 +======= + +* api-change:``appflow``: AppFlow provides a new API called UpdateConnectorRegistration to update a custom connector that customers have previously registered. With this API, customers no longer need to unregister and then register a connector to make an update. +* api-change:``auditmanager``: This release introduces a new feature for Audit Manager: Evidence finder. You can now use evidence finder to quickly query your evidence, and add the matching evidence results to an assessment report. +* api-change:``chime-sdk-voice``: Amazon Chime Voice Connector, Voice Connector Group and PSTN Audio Service APIs are now available in the Amazon Chime SDK Voice namespace. See https://docs.aws.amazon.com/chime-sdk/latest/dg/sdk-available-regions.html for more details. +* api-change:``cloudfront``: CloudFront API support for staging distributions and associated traffic management policies. +* api-change:``connect``: Added AllowedAccessControlTags and TagRestrictedResource for Tag Based Access Control on Amazon Connect Webpage +* api-change:``dynamodb``: Updated minor fixes for DynamoDB documentation. +* api-change:``dynamodbstreams``: Update dynamodbstreams client to latest version +* api-change:``ec2``: This release adds support for copying an Amazon Machine Image's tags when copying an AMI. +* api-change:``glue``: AWSGlue Crawler - Adding support for Table and Column level Comments with database level datatypes for JDBC based crawler. +* api-change:``iot-roborunner``: AWS IoT RoboRunner is a new service that makes it easy to build applications that help multi-vendor robots work together seamlessly. See the IoT RoboRunner developer guide for more details on getting started. https://docs.aws.amazon.com/iotroborunner/latest/dev/iotroborunner-welcome.html +* api-change:``quicksight``: This release adds the following: 1) Asset management for centralized assets governance 2) QuickSight Q now supports public embedding 3) New Termination protection flag to mitigate accidental deletes 4) Athena data sources now accept a custom IAM role 5) QuickSight supports connectivity to Databricks +* api-change:``sagemaker``: Added DisableProfiler flag as a new field in ProfilerConfig +* api-change:``servicecatalog``: This release 1. adds support for Principal Name Sharing with Service Catalog portfolio sharing. 2. Introduces repo sourced products which are created and managed with existing SC APIs. These products are synced to external repos and auto create new product versions based on changes in the repo. +* api-change:``ssm-sap``: AWS Systems Manager for SAP provides simplified operations and management of SAP applications such as SAP HANA. With this release, SAP customers and partners can automate and simplify their SAP system administration tasks such as backup/restore of SAP HANA. +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``transfer``: Adds a NONE encryption algorithm type to AS2 connectors, providing support for skipping encryption of the AS2 message body when a HTTPS URL is also specified. + + +1.29.12 +======= + +* api-change:``amplify``: Adds a new value (WEB_COMPUTE) to the Platform enum that allows customers to create Amplify Apps with Server-Side Rendering support. +* api-change:``appflow``: AppFlow simplifies the preparation and cataloging of SaaS data into the AWS Glue Data Catalog where your data can be discovered and accessed by AWS analytics and ML services. AppFlow now also supports data field partitioning and file size optimization to improve query performance and reduce cost. +* api-change:``appsync``: This release introduces the APPSYNC_JS runtime, and adds support for JavaScript in AppSync functions and AppSync pipeline resolvers. +* api-change:``dms``: Adds support for Internet Protocol Version 6 (IPv6) on DMS Replication Instances +* api-change:``ec2``: This release adds a new optional parameter "privateIpAddress" for the CreateNatGateway API. PrivateIPAddress will allow customers to select a custom Private IPv4 address instead of having it be auto-assigned. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``emr-serverless``: Adds support for AWS Graviton2 based applications. You can now select CPU architecture when creating new applications or updating existing ones. +* api-change:``ivschat``: Adds LoggingConfiguration APIs for IVS Chat - a feature that allows customers to store and record sent messages in a chat room to S3 buckets, CloudWatch logs, or Kinesis firehose. +* api-change:``lambda``: Add Node 18 (nodejs18.x) support to AWS Lambda. +* api-change:``personalize``: This release provides support for creation and use of metric attributions in AWS Personalize +* api-change:``polly``: Add two new neural voices - Ola (pl-PL) and Hala (ar-AE). +* api-change:``rum``: CloudWatch RUM now supports custom events. To use custom events, create an app monitor or update an app monitor with CustomEvent Status as ENABLED. +* api-change:``s3control``: Added 34 new S3 Storage Lens metrics to support additional customer use cases. +* api-change:``secretsmanager``: Documentation updates for Secrets Manager. +* api-change:``securityhub``: Added SourceLayerArn and SourceLayerHash field for security findings. Updated AwsLambdaFunction Resource detail +* api-change:``servicecatalog-appregistry``: This release adds support for tagged resource associations, which allows you to associate a group of resources with a defined resource tag key and value to the application. +* api-change:``sts``: Documentation updates for AWS Security Token Service. +* api-change:``textract``: This release adds support for specifying and extracting information from documents using the Signatures feature within Analyze Document API +* api-change:``workspaces``: The release introduces CreateStandbyWorkspaces, an API that allows you to create standby WorkSpaces associated with a primary WorkSpace in another Region. DescribeWorkspaces now includes related WorkSpaces properties. DescribeWorkspaceBundles and CreateWorkspaceBundle now return more bundle details. + + +1.29.11 +======= + +* api-change:``batch``: Documentation updates related to Batch on EKS +* api-change:``billingconductor``: This release adds a new feature BillingEntity pricing rule. +* api-change:``cloudformation``: Added UnsupportedTarget HandlerErrorCode for use with CFN Resource Hooks +* api-change:``comprehendmedical``: This release supports new set of entities and traits. It also adds new category (BEHAVIORAL_ENVIRONMENTAL_SOCIAL). +* api-change:``connect``: This release adds a new MonitorContact API for initiating monitoring of ongoing Voice and Chat contacts. +* api-change:``eks``: Adds support for customer-provided placement groups for Kubernetes control plane instances when creating local EKS clusters on Outposts +* api-change:``elasticache``: for Redis now supports AWS Identity and Access Management authentication access to Redis clusters starting with redis-engine version 7.0 +* api-change:``iottwinmaker``: This release adds the following: 1) ExecuteQuery API allows users to query their AWS IoT TwinMaker Knowledge Graph 2) Pricing plan APIs allow users to configure and manage their pricing mode 3) Support for property groups and tabular property values in existing AWS IoT TwinMaker APIs. +* api-change:``personalize-events``: This release provides support for creation and use of metric attributions in AWS Personalize +* api-change:``proton``: Add support for sorting and filtering in ListServiceInstances +* api-change:``rds``: This release adds support for container databases (CDBs) to Amazon RDS Custom for Oracle. A CDB contains one PDB at creation. You can add more PDBs using Oracle SQL. You can also customize your database installation by setting the Oracle base, Oracle home, and the OS user name and group. +* api-change:``ssm-incidents``: Add support for PagerDuty integrations on ResponsePlan, IncidentRecord, and RelatedItem APIs +* api-change:``ssm``: This release adds support for cross account access in CreateOpsItem, UpdateOpsItem and GetOpsItem. It introduces new APIs to setup resource policies for SSM resources: PutResourcePolicy, GetResourcePolicies and DeleteResourcePolicy. +* api-change:``transfer``: Allow additional operations to throw ThrottlingException +* api-change:``xray``: This release adds new APIs - PutResourcePolicy, DeleteResourcePolicy, ListResourcePolicies for supporting resource based policies for AWS X-Ray. + + +1.29.10 +======= + +* bugfix:s3: fixes missing x-amz-content-sha256 header for s3 on outpost +* enhancement:sso: Add support for loading sso-session profiles from the aws config +* api-change:``connect``: This release updates the APIs: UpdateInstanceAttribute, DescribeInstanceAttribute, and ListInstanceAttributes. You can use it to programmatically enable/disable enhanced contact monitoring using attribute type ENHANCED_CONTACT_MONITORING on the specified Amazon Connect instance. +* api-change:``greengrassv2``: Adds new parent target ARN paramater to CreateDeployment, GetDeployment, and ListDeployments APIs for the new subdeployments feature. +* api-change:``route53``: Amazon Route 53 now supports the Europe (Spain) Region (eu-south-2) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. +* api-change:``workspaces``: This release introduces ModifyCertificateBasedAuthProperties, a new API that allows control of certificate-based auth properties associated with a WorkSpaces directory. The DescribeWorkspaceDirectories API will now additionally return certificate-based auth properties in its responses. + + +1.29.9 +====== + +* api-change:``customer-profiles``: This release enhances the SearchProfiles API by providing functionality to search for profiles using multiple keys and logical operators. +* api-change:``lakeformation``: This release adds a new parameter "Parameters" in the DataLakeSettings. +* api-change:``managedblockchain``: Updating the API docs data type: NetworkEthereumAttributes, and the operations DeleteNode, and CreateNode to also include the supported Goerli network. +* api-change:``proton``: Add support for CodeBuild Provisioning +* api-change:``rds``: This release adds support for restoring an RDS Multi-AZ DB cluster snapshot to a Single-AZ deployment or a Multi-AZ DB instance deployment. +* api-change:``workdocs``: Added 2 new document related operations, DeleteDocumentVersion and RestoreDocumentVersions. +* api-change:``xray``: This release enhances GetServiceGraph API to support new type of edge to represent links between SQS and Lambda in event-driven applications. + + +1.29.8 +====== + +* api-change:``glue``: Added links related to enabling job bookmarks. +* api-change:``iot``: This release add new api listRelatedResourcesForAuditFinding and new member type IssuerCertificates for Iot device device defender Audit. +* api-change:``license-manager``: AWS License Manager now supports onboarded Management Accounts or Delegated Admins to view granted licenses aggregated from all accounts in the organization. +* api-change:``marketplace-catalog``: Added three new APIs to support tagging and tag-based authorization: TagResource, UntagResource, and ListTagsForResource. Added optional parameters to the StartChangeSet API to support tagging a resource while making a request to create it. +* api-change:``rekognition``: Adding support for ImageProperties feature to detect dominant colors and image brightness, sharpness, and contrast, inclusion and exclusion filters for labels and label categories, new fields to the API response, "aliases" and "categories" +* api-change:``securityhub``: Documentation updates for Security Hub +* api-change:``ssm-incidents``: RelatedItems now have an ID field which can be used for referencing them else where. Introducing event references in TimelineEvent API and increasing maximum length of "eventData" to 12K characters. + + +1.29.7 +====== + +* api-change:``autoscaling``: This release adds a new price capacity optimized allocation strategy for Spot Instances to help customers optimize provisioning of Spot Instances via EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. It allocates Spot Instances based on both spare capacity availability and Spot Instance price. +* api-change:``ec2``: This release adds a new price capacity optimized allocation strategy for Spot Instances to help customers optimize provisioning of Spot Instances via EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. It allocates Spot Instances based on both spare capacity availability and Spot Instance price. +* api-change:``ecs``: This release adds support for task scale-in protection with updateTaskProtection and getTaskProtection APIs. UpdateTaskProtection API can be used to protect a service managed task from being terminated by scale-in events and getTaskProtection API to get the scale-in protection status of a task. +* api-change:``es``: Amazon OpenSearch Service now offers managed VPC endpoints to connect to your Amazon OpenSearch Service VPC-enabled domain in a Virtual Private Cloud (VPC). This feature allows you to privately access OpenSearch Service domain without using public IPs or requiring traffic to traverse the Internet. +* api-change:``resource-explorer-2``: Text only updates to some Resource Explorer descriptions. +* api-change:``scheduler``: AWS introduces the new Amazon EventBridge Scheduler. EventBridge Scheduler is a serverless scheduler that allows you to create, run, and manage tasks from one central, managed service. + + +1.29.6 +====== + +* api-change:``connect``: This release adds new fields SignInUrl, UserArn, and UserId to GetFederationToken response payload. +* api-change:``connectcases``: This release adds the ability to disable templates through the UpdateTemplate API. Disabling templates prevents customers from creating cases using the template. For more information see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html +* api-change:``ec2``: Amazon EC2 Trn1 instances, powered by AWS Trainium chips, are purpose built for high-performance deep learning training. u-24tb1.112xlarge and u-18tb1.112xlarge High Memory instances are purpose-built to run large in-memory databases. +* api-change:``groundstation``: This release adds the preview of customer-provided ephemeris support for AWS Ground Station, allowing space vehicle owners to provide their own position and trajectory information for a satellite. +* api-change:``mediapackage-vod``: This release adds "IncludeIframeOnlyStream" for Dash endpoints. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.29.5 +====== + +* api-change:``acm``: Support added for requesting elliptic curve certificate key algorithm types P-256 (EC_prime256v1) and P-384 (EC_secp384r1). +* api-change:``billingconductor``: This release adds the Recurring Custom Line Item feature along with a new API ListCustomLineItemVersions. +* api-change:``ec2``: This release enables sharing of EC2 Placement Groups across accounts and within AWS Organizations using Resource Access Manager +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version +* api-change:``fms``: AWS Firewall Manager now supports importing existing AWS Network Firewall firewalls into Firewall Manager policies. +* api-change:``lightsail``: This release adds support for Amazon Lightsail to automate the delegation of domains registered through Amazon Route 53 to Lightsail DNS management and to automate record creation for DNS validation of Lightsail SSL/TLS certificates. +* api-change:``opensearch``: Amazon OpenSearch Service now offers managed VPC endpoints to connect to your Amazon OpenSearch Service VPC-enabled domain in a Virtual Private Cloud (VPC). This feature allows you to privately access OpenSearch Service domain without using public IPs or requiring traffic to traverse the Internet. +* api-change:``polly``: Amazon Polly adds new voices: Elin (sv-SE), Ida (nb-NO), Laura (nl-NL) and Suvi (fi-FI). They are available as neural voices only. +* api-change:``resource-explorer-2``: This is the initial SDK release for AWS Resource Explorer. AWS Resource Explorer lets your users search for and discover your AWS resources across the AWS Regions in your account. +* api-change:``route53``: Amazon Route 53 now supports the Europe (Zurich) Region (eu-central-2) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. + + +1.29.4 +====== + +* api-change:``athena``: Adds support for using Query Result Reuse +* api-change:``autoscaling``: This release adds support for two new attributes for attribute-based instance type selection - NetworkBandwidthGbps and AllowedInstanceTypes. +* api-change:``cloudtrail``: This release includes support for configuring a delegated administrator to manage an AWS Organizations organization CloudTrail trails and event data stores, and AWS Key Management Service encryption of CloudTrail Lake event data stores. +* api-change:``ec2``: This release adds support for two new attributes for attribute-based instance type selection - NetworkBandwidthGbps and AllowedInstanceTypes. +* api-change:``elasticache``: Added support for IPv6 and dual stack for Memcached and Redis clusters. Customers can now launch new Redis and Memcached clusters with IPv6 and dual stack networking support. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``mediaconvert``: The AWS Elemental MediaConvert SDK has added support for setting the SDR reference white point for HDR conversions and conversion of HDR10 to DolbyVision without mastering metadata. +* api-change:``ssm``: This release includes support for applying a CloudWatch alarm to multi account multi region Systems Manager Automation +* api-change:``wafv2``: The geo match statement now adds labels for country and region. You can match requests at the region level by combining a geo match statement with label match statements. +* api-change:``wellarchitected``: This release adds support for integrations with AWS Trusted Advisor and AWS Service Catalog AppRegistry to improve workload discovery and speed up your workload reviews. +* api-change:``workspaces``: This release adds protocols attribute to workspaces properties data type. This enables customers to migrate workspaces from PC over IP (PCoIP) to WorkSpaces Streaming Protocol (WSP) using create and modify workspaces public APIs. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.29.3 +====== + +* api-change:``ec2``: This release adds API support for the recipient of an AMI account share to remove shared AMI launch permissions. +* api-change:``emr-containers``: Adding support for Job templates. Job templates allow you to create and store templates to configure Spark applications parameters. This helps you ensure consistent settings across applications by reusing and enforcing configuration overrides in data pipelines. +* api-change:``logs``: Doc-only update for bug fixes and support of export to buckets encrypted with SSE-KMS +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.29.2 +====== + +* api-change:``memorydb``: Adding support for r6gd instances for MemoryDB Redis with data tiering. In a cluster with data tiering enabled, when available memory capacity is exhausted, the least recently used data is automatically tiered to solid state drives for cost-effective capacity scaling with minimal performance impact. +* api-change:``sagemaker``: Amazon SageMaker now supports running training jobs on ml.trn1 instance types. +* api-change:``endpoint-rules``: Update endpoint-rules client to latest version + + +1.29.1 +====== + +* api-change:``iotsitewise``: This release adds the ListAssetModelProperties and ListAssetProperties APIs. You can list all properties that belong to a single asset model or asset using these two new APIs. +* api-change:``s3control``: S3 on Outposts launches support for Lifecycle configuration for Outposts buckets. With S3 Lifecycle configuration, you can mange objects so they are stored cost effectively. You can manage objects using size-based rules and specify how many noncurrent versions bucket will retain. +* api-change:``sagemaker``: This release updates Framework model regex for ModelPackage to support new Framework version xgboost, sklearn. +* api-change:``ssm-incidents``: Adds support for tagging replication-set on creation. + + +1.29.0 +====== + +* feature:Endpoints: Migrate all services to use new AWS Endpoint Resolution framework +* Enhancement:Endpoints: Discontinued use of `sslCommonName` hosts as detailed in 1.27.0 (see `#2705 `__ for more info) +* api-change:``rds``: Relational Database Service - This release adds support for configuring Storage Throughput on RDS database instances. +* api-change:``textract``: Add ocr results in AnalyzeIDResponse as blocks + + +1.28.5 +====== + +* api-change:``apprunner``: This release adds support for private App Runner services. Services may now be configured to be made private and only accessible from a VPC. The changes include a new VpcIngressConnection resource and several new and modified APIs. +* api-change:``connect``: Amazon connect now support a new API DismissUserContact to dismiss or remove terminated contacts in Agent CCP +* api-change:``ec2``: Elastic IP transfer is a new Amazon VPC feature that allows you to transfer your Elastic IP addresses from one AWS Account to another. +* api-change:``iot``: This release adds the Amazon Location action to IoT Rules Engine. +* api-change:``logs``: SDK release to support tagging for destinations and log groups with TagResource. Also supports tag on create with PutDestination. +* api-change:``sesv2``: This release includes support for interacting with the Virtual Deliverability Manager, allowing you to opt in/out of the feature and to retrieve recommendations and metric data. +* api-change:``textract``: This release introduces additional support for 30+ normalized fields such as vendor address and currency. It also includes OCR output in the response and accuracy improvements for the already supported fields in previous version + + +1.28.4 +====== + +* api-change:``apprunner``: AWS App Runner adds .NET 6, Go 1, PHP 8.1 and Ruby 3.1 runtimes. +* api-change:``appstream``: This release includes CertificateBasedAuthProperties in CreateDirectoryConfig and UpdateDirectoryConfig. +* api-change:``cloud9``: Update to the documentation section of the Cloud9 API Reference guide. +* api-change:``cloudformation``: This release adds more fields to improves visibility of AWS CloudFormation StackSets information in following APIs: ListStackInstances, DescribeStackInstance, ListStackSetOperationResults, ListStackSetOperations, DescribeStackSetOperation. +* api-change:``gamesparks``: Add LATEST as a possible GameSDK Version on snapshot +* api-change:``mediatailor``: This release introduces support for SCTE-35 segmentation descriptor messages which can be sent within time signal messages. + + +1.28.3 +====== + +* api-change:``ec2``: Feature supports the replacement of instance root volume using an updated AMI without requiring customers to stop their instance. +* api-change:``fms``: Add support NetworkFirewall Managed Rule Group Override flag in GetViolationDetails API +* api-change:``glue``: Added support for custom datatypes when using custom csv classifier. +* api-change:``redshift``: This release clarifies use for the ElasticIp parameter of the CreateCluster and RestoreFromClusterSnapshot APIs. +* api-change:``sagemaker``: This change allows customers to provide a custom entrypoint script for the docker container to be run while executing training jobs, and provide custom arguments to the entrypoint script. +* api-change:``wafv2``: This release adds the following: Challenge rule action, to silently verify client browsers; rule group rule action override to any valid rule action, not just Count; token sharing between protected applications for challenge/CAPTCHA token; targeted rules option for Bot Control managed rule group. + + +1.28.2 +====== + +* api-change:``iam``: Doc only update that corrects instances of CLI not using an entity. +* api-change:``kafka``: This release adds support for Tiered Storage. UpdateStorage allows you to control the Storage Mode for supported storage tiers. +* api-change:``neptune``: Added a new cluster-level attribute to set the capacity range for Neptune Serverless instances. +* api-change:``sagemaker``: Amazon SageMaker Automatic Model Tuning now supports specifying Grid Search strategy for tuning jobs, which evaluates all hyperparameter combinations exhaustively based on the categorical hyperparameters provided. + + +1.28.1 +====== + +* api-change:``accessanalyzer``: This release adds support for six new resource types in IAM Access Analyzer to help you easily identify public and cross-account access to your AWS resources. Updated service API, documentation, and paginators. +* api-change:``location``: Added new map styles with satellite imagery for map resources using HERE as a data provider. +* api-change:``mediatailor``: This release is a documentation update +* api-change:``rds``: Relational Database Service - This release adds support for exporting DB cluster data to Amazon S3. +* api-change:``workspaces``: This release adds new enums for supporting Workspaces Core features, including creating Manual running mode workspaces, importing regular Workspaces Core images and importing g4dn Workspaces Core images. + + +1.28.0 +====== + +* feature:Endpoints: Implemented new endpoint ruleset system to dynamically derive endpoints and settings for services +* api-change:``acm-pca``: AWS Private Certificate Authority (AWS Private CA) now offers usage modes which are combination of features to address specific use cases. +* api-change:``batch``: This release adds support for AWS Batch on Amazon EKS. +* api-change:``datasync``: Added support for self-signed certificates when using object storage locations; added BytesCompressed to the TaskExecution response. +* api-change:``sagemaker``: SageMaker Inference Recommender now supports a new API ListInferenceRecommendationJobSteps to return the details of all the benchmark we create for an inference recommendation job. + + +1.27.96 +======= + +* api-change:``cognito-idp``: This release adds a new "DeletionProtection" field to the UserPool in Cognito. Application admins can configure this value with either ACTIVE or INACTIVE value. Setting this field to ACTIVE will prevent a user pool from accidental deletion. +* api-change:``sagemaker``: CreateInferenceRecommenderjob API now supports passing endpoint details directly, that will help customers to identify the max invocation and max latency they can achieve for their model and the associated endpoint along with getting recommendations on other instances. + + +1.27.95 +======= + +* api-change:``devops-guru``: This release adds information about the resources DevOps Guru is analyzing. +* api-change:``globalaccelerator``: Global Accelerator now supports AddEndpoints and RemoveEndpoints operations for standard endpoint groups. +* api-change:``resiliencehub``: In this release, we are introducing support for regional optimization for AWS Resilience Hub applications. It also includes a few documentation updates to improve clarity. +* api-change:``rum``: CloudWatch RUM now supports Extended CloudWatch Metrics with Additional Dimensions + + +1.27.94 +======= + +* api-change:``chime-sdk-messaging``: Documentation updates for Chime Messaging SDK +* api-change:``cloudtrail``: This release includes support for exporting CloudTrail Lake query results to an Amazon S3 bucket. +* api-change:``config``: This release adds resourceType enums for AppConfig, AppSync, DataSync, EC2, EKS, Glue, GuardDuty, SageMaker, ServiceDiscovery, SES, Route53 types. +* api-change:``connect``: This release adds API support for managing phone numbers that can be used across multiple AWS regions through telephony traffic distribution. +* api-change:``events``: Update events client to latest version +* api-change:``managedblockchain``: Adding new Accessor APIs for Amazon Managed Blockchain +* api-change:``s3``: Updates internal logic for constructing API endpoints. We have added rule-based endpoints and internal model parameters. +* api-change:``s3control``: Updates internal logic for constructing API endpoints. We have added rule-based endpoints and internal model parameters. +* api-change:``support-app``: This release adds the RegisterSlackWorkspaceForOrganization API. You can use the API to register a Slack workspace for an AWS account that is part of an organization. +* api-change:``workspaces-web``: WorkSpaces Web now supports user access logging for recording session start, stop, and URL navigation. + + +1.27.93 +======= + +* api-change:``frauddetector``: Documentation Updates for Amazon Fraud Detector +* api-change:``sagemaker``: This change allows customers to enable data capturing while running a batch transform job, and configure monitoring schedule to monitoring the captured data. +* api-change:``servicediscovery``: Updated the ListNamespaces API to support the NAME and HTTP_NAME filters, and the BEGINS_WITH filter condition. +* api-change:``sesv2``: This release allows subscribers to enable Dedicated IPs (managed) to send email via a fully managed dedicated IP experience. It also adds identities' VerificationStatus in the response of GetEmailIdentity and ListEmailIdentities APIs, and ImportJobs counts in the response of ListImportJobs API. + + +1.27.92 +======= + +* api-change:``greengrass``: This change allows customers to specify FunctionRuntimeOverride in FunctionDefinitionVersion. This configuration can be used if the runtime on the device is different from the AWS Lambda runtime specified for that function. +* api-change:``sagemaker``: This release adds support for C7g, C6g, C6gd, C6gn, M6g, M6gd, R6g, and R6gn Graviton instance types in Amazon SageMaker Inference. + + +1.27.91 +======= + +* api-change:``mediaconvert``: MediaConvert now supports specifying the minimum percentage of the HRD buffer available at the end of each encoded video segment. + + +1.27.90 +======= + +* api-change:``amplifyuibuilder``: We are releasing the ability for fields to be configured as arrays. +* api-change:``appflow``: With this update, you can choose which Salesforce API is used by Amazon AppFlow to transfer data to or from your Salesforce account. You can choose the Salesforce REST API or Bulk API 2.0. You can also choose for Amazon AppFlow to pick the API automatically. +* api-change:``connect``: This release adds support for a secondary email and a mobile number for Amazon Connect instance users. +* api-change:``ds``: This release adds support for describing and updating AWS Managed Microsoft AD set up. +* api-change:``ecs``: Documentation update to address tickets. +* api-change:``guardduty``: Add UnprocessedDataSources to CreateDetectorResponse which specifies the data sources that couldn't be enabled during the CreateDetector request. In addition, update documentations. +* api-change:``iam``: Documentation updates for the AWS Identity and Access Management API Reference. +* api-change:``iotfleetwise``: Documentation update for AWS IoT FleetWise +* api-change:``medialive``: AWS Elemental MediaLive now supports forwarding SCTE-35 messages through the Event Signaling and Management (ESAM) API, and can read those SCTE-35 messages from an inactive source. +* api-change:``mediapackage-vod``: This release adds SPEKE v2 support for MediaPackage VOD. Speke v2 is an upgrade to the existing SPEKE API to support multiple encryption keys, based on an encryption contract selected by the customer. +* api-change:``panorama``: Pause and resume camera stream processing with SignalApplicationInstanceNodeInstances. Reboot an appliance with CreateJobForDevices. More application state information in DescribeApplicationInstance response. +* api-change:``rds-data``: Doc update to reflect no support for schema parameter on BatchExecuteStatement API +* api-change:``ssm-incidents``: Update RelatedItem enum to support Tasks +* api-change:``ssm``: Support of AmazonLinux2022 by Patch Manager +* api-change:``transfer``: This release adds an option for customers to configure workflows that are triggered when files are only partially received from a client due to premature session disconnect. +* api-change:``translate``: This release enables customers to specify multiple target languages in asynchronous batch translation requests. +* api-change:``wisdom``: This release updates the GetRecommendations API to include a trigger event list for classifying and grouping recommendations. + + +1.27.89 +======= + +* api-change:``codeguru-reviewer``: Documentation update to replace broken link. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``greengrassv2``: This release adds error status details for deployments and components that failed on a device and adds features to improve visibility into component installation. +* api-change:``quicksight``: Amazon QuickSight now supports SecretsManager Secret ARN in place of CredentialPair for DataSource creation and update. This release also has some minor documentation updates and removes CountryCode as a required parameter in GeoSpatialColumnGroup + + +1.27.88 +======= + +* api-change:``resiliencehub``: Documentation change for AWS Resilience Hub. Doc-only update to fix Documentation layout + + +1.27.87 +======= + +* api-change:``glue``: This SDK release adds support to sync glue jobs with source control provider. Additionally, a new parameter called SourceControlDetails will be added to Job model. +* api-change:``network-firewall``: StreamExceptionPolicy configures how AWS Network Firewall processes traffic when a network connection breaks midstream +* api-change:``outposts``: This release adds the Asset state information to the ListAssets response. The ListAssets request supports filtering on Asset state. + + +1.27.86 +======= + +* api-change:``connect``: Updated the CreateIntegrationAssociation API to support the CASES_DOMAIN IntegrationType. +* api-change:``connectcases``: This release adds APIs for Amazon Connect Cases. Cases allows your agents to quickly track and manage customer issues that require multiple interactions, follow-up tasks, and teams in your contact center. For more information, see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html +* api-change:``ec2``: Added EnableNetworkAddressUsageMetrics flag for ModifyVpcAttribute, DescribeVpcAttribute APIs. +* api-change:``ecs``: Documentation updates to address various Amazon ECS tickets. +* api-change:``s3control``: S3 Object Lambda adds support to allow customers to intercept HeadObject and ListObjects requests and introduce their own compute. These requests were previously proxied to S3. +* api-change:``workmail``: This release adds support for impersonation roles in Amazon WorkMail. + + +1.27.85 +======= + +* api-change:``accessanalyzer``: AWS IAM Access Analyzer policy validation introduces new checks for role trust policies. As customers author a policy, IAM Access Analyzer policy validation evaluates the policy for any issues to make it easier for customers to author secure policies. +* api-change:``ec2``: Adding an imdsSupport attribute to EC2 AMIs +* api-change:``snowball``: Adds support for V3_5C. This is a refreshed AWS Snowball Edge Compute Optimized device type with 28TB SSD, 104 vCPU and 416GB memory (customer usable). + + +1.27.84 +======= + +* api-change:``codedeploy``: This release allows you to override the alarm configurations when creating a deployment. +* api-change:``devops-guru``: This release adds filter feature on AddNotificationChannel API, enable customer to configure the SNS notification messages by Severity or MessageTypes +* api-change:``dlm``: This release adds support for archival of single-volume snapshots created by Amazon Data Lifecycle Manager policies +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``sagemaker``: A new parameter called ExplainerConfig is added to CreateEndpointConfig API to enable SageMaker Clarify online explainability feature. +* api-change:``sso-oidc``: Documentation updates for the IAM Identity Center OIDC CLI Reference. + + +1.27.83 +======= + +* api-change:``acm``: This update returns additional certificate details such as certificate SANs and allows sorting in the ListCertificates API. +* api-change:``ec2``: u-3tb1 instances are powered by Intel Xeon Platinum 8176M (Skylake) processors and are purpose-built to run large in-memory databases. +* api-change:``emr-serverless``: This release adds API support to debug Amazon EMR Serverless jobs in real-time with live application UIs +* api-change:``fsx``: This release adds support for Amazon File Cache. +* api-change:``migrationhuborchestrator``: Introducing AWS MigrationHubOrchestrator. This is the first public release of AWS MigrationHubOrchestrator. +* api-change:``polly``: Added support for the new Cantonese voice - Hiujin. Hiujin is available as a Neural voice only. +* api-change:``proton``: This release adds an option to delete pipeline provisioning repositories using the UpdateAccountSettings API +* api-change:``sagemaker``: SageMaker Training Managed Warm Pools let you retain provisioned infrastructure to reduce latency for repetitive training workloads. +* api-change:``secretsmanager``: Documentation updates for Secrets Manager +* api-change:``translate``: This release enables customers to access control rights on Translate resources like Parallel Data and Custom Terminology using Tag Based Authorization. +* api-change:``workspaces``: This release includes diagnostic log uploading feature. If it is enabled, the log files of WorkSpaces Windows client will be sent to Amazon WorkSpaces automatically for troubleshooting. You can use modifyClientProperty api to enable/disable this feature. + + +1.27.82 +======= + +* api-change:``ce``: This release is to support retroactive Cost Categories. The new field will enable you to retroactively apply new and existing cost category rules to previous months. +* api-change:``kendra``: My AWS Service (placeholder) - Amazon Kendra now provides a data source connector for DropBox. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-dropbox.html +* api-change:``location``: This release adds place IDs, which are unique identifiers of places, along with a new GetPlace operation, which can be used with place IDs to find a place again later. UnitNumber and UnitType are also added as new properties of places. + + +1.27.81 +======= + +* api-change:``cur``: This release adds two new support regions(me-central-1/eu-south-2) for OSG. +* api-change:``iotfleetwise``: General availability (GA) for AWS IoT Fleetwise. It adds AWS IoT Fleetwise to AWS SDK. For more information, see https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/Welcome.html. +* api-change:``ssm``: This release includes support for applying a CloudWatch alarm to Systems Manager capabilities like Automation, Run Command, State Manager, and Maintenance Windows. + + +1.27.80 +======= + +* api-change:``apprunner``: AWS App Runner adds a Node.js 16 runtime. +* api-change:``ec2``: Letting external AWS customers provide ImageId as a Launch Template override in FleetLaunchTemplateOverridesRequest +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``lightsail``: This release adds Instance Metadata Service (IMDS) support for Lightsail instances. +* api-change:``nimble``: Amazon Nimble Studio adds support for on-demand Amazon Elastic Compute Cloud (EC2) G3 and G5 instances, allowing customers to utilize additional GPU instance types for their creative projects. +* api-change:``ssm``: This release adds new SSM document types ConformancePackTemplate and CloudFormation +* api-change:``wafv2``: Add the default specification for ResourceType in ListResourcesForWebACL. + + +1.27.79 +======= + +* api-change:``backup-gateway``: Changes include: new GetVirtualMachineApi to fetch a single user's VM, improving ListVirtualMachines to fetch filtered VMs as well as all VMs, and improving GetGatewayApi to now also return the gateway's MaintenanceStartTime. +* api-change:``devicefarm``: This release adds the support for VPC-ENI based connectivity for private devices on AWS Device Farm. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``glue``: Added support for S3 Event Notifications for Catalog Target Crawlers. +* api-change:``identitystore``: Documentation updates for the Identity Store CLI Reference. + + +1.27.78 +======= + +* api-change:``comprehend``: Amazon Comprehend now supports synchronous mode for targeted sentiment API operations. +* api-change:``s3control``: S3 on Outposts launches support for object versioning for Outposts buckets. With S3 Versioning, you can preserve, retrieve, and restore every version of every object stored in your buckets. You can recover from both unintended user actions and application failures. +* api-change:``sagemaker``: SageMaker now allows customization on Canvas Application settings, including enabling/disabling time-series forecasting and specifying an Amazon Forecast execution role at both the Domain and UserProfile levels. + + +1.27.77 +======= + +* api-change:``ec2``: This release adds support for blocked paths to Amazon VPC Reachability Analyzer. + + +1.27.76 +======= + +* api-change:``cloudtrail``: This release includes support for importing existing trails into CloudTrail Lake. +* api-change:``ec2``: This release adds CapacityAllocations field to DescribeCapacityReservations +* api-change:``mediaconnect``: This change allows the customer to use the SRT Caller protocol as part of their flows +* api-change:``rds``: This release adds support for Amazon RDS Proxy with SQL Server compatibility. + + +1.27.75 +======= + +* api-change:``codestar-notifications``: This release adds tag based access control for the UntagResource API. +* api-change:``ecs``: This release supports new task definition sizes. + + +1.27.74 +======= + +* api-change:``dynamodb``: Increased DynamoDB transaction limit from 25 to 100. +* api-change:``ec2``: This feature allows customers to create tags for vpc-endpoint-connections and vpc-endpoint-service-permissions. +* api-change:``sagemaker``: Amazon SageMaker Automatic Model Tuning now supports specifying Hyperband strategy for tuning jobs, which uses a multi-fidelity based tuning strategy to stop underperforming hyperparameter configurations early. + + +1.27.73 +======= + +* api-change:``amplifyuibuilder``: Amplify Studio UIBuilder is introducing forms functionality. Forms can be configured from Data Store models, JSON, or from scratch. These forms can then be generated in your project and used like any other React components. +* api-change:``ec2``: This update introduces API operations to manage and create local gateway route tables, CoIP pools, and VIF group associations. + + +1.27.72 +======= + +* api-change:``customer-profiles``: Added isUnstructured in response for Customer Profiles Integration APIs +* api-change:``drs``: Fixed the data type of lagDuration that is returned in Describe Source Server API +* api-change:``ec2``: Two new features for local gateway route tables: support for static routes targeting Elastic Network Interfaces and direct VPC routing. +* api-change:``evidently``: This release adds support for the client-side evaluation - powered by AWS AppConfig feature. +* api-change:``kendra``: This release enables our customer to choose the option of Sharepoint 2019 for the on-premise Sharepoint connector. +* api-change:``transfer``: This release introduces the ability to have multiple server host keys for any of your Transfer Family servers that use the SFTP protocol. + + +1.27.71 +======= + +* api-change:``eks``: Adding support for local Amazon EKS clusters on Outposts + + +1.27.70 +======= + +* api-change:``cloudtrail``: This release adds CloudTrail getChannel and listChannels APIs to allow customer to view the ServiceLinkedChannel configurations. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``pi``: Increases the maximum values of two RDS Performance Insights APIs. The maximum value of the Limit parameter of DimensionGroup is 25. The MaxResult maximum is now 25 for the following APIs: DescribeDimensionKeys, GetResourceMetrics, ListAvailableResourceDimensions, and ListAvailableResourceMetrics. +* api-change:``redshift``: This release updates documentation for AQUA features and other description updates. + + +1.27.69 +======= + +* api-change:``ec2``: This release adds support to send VPC Flow Logs to kinesis-data-firehose as new destination type +* api-change:``emr-containers``: EMR on EKS now allows running Spark SQL using the newly introduced Spark SQL Job Driver in the Start Job Run API +* api-change:``lookoutmetrics``: Release dimension value filtering feature to allow customers to define dimension filters for including only a subset of their dataset to be used by LookoutMetrics. +* api-change:``medialive``: This change exposes API settings which allow Dolby Atmos and Dolby Vision to be used when running a channel using Elemental Media Live +* api-change:``route53``: Amazon Route 53 now supports the Middle East (UAE) Region (me-central-1) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. +* api-change:``sagemaker``: This release adds Mode to AutoMLJobConfig. +* api-change:``ssm``: This release adds support for Systems Manager State Manager Association tagging. + + +1.27.68 +======= + +* api-change:``dataexchange``: Documentation updates for AWS Data Exchange. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``eks``: Adds support for EKS Addons ResolveConflicts "preserve" flag. Also adds new update failed status for EKS Addons. +* api-change:``fsx``: Documentation update for Amazon FSx. +* api-change:``inspector2``: This release adds new fields like fixAvailable, fixedInVersion and remediation to the finding model. The requirement to have vulnerablePackages in the finding model has also been removed. The documentation has been updated to reflect these changes. +* api-change:``iotsitewise``: Allow specifying units in Asset Properties +* api-change:``sagemaker``: SageMaker Hosting now allows customization on ML instance storage volume size, model data download timeout and inference container startup ping health check timeout for each ProductionVariant in CreateEndpointConfig API. +* api-change:``sns``: Amazon SNS introduces the Data Protection Policy APIs, which enable customers to attach a data protection policy to an SNS topic. This allows topic owners to enable the new message data protection feature to audit and block sensitive data that is exchanged through their topics. + + +1.27.67 +======= + +* api-change:``identitystore``: Documentation updates for the Identity Store CLI Reference. +* api-change:``sagemaker``: This release adds HyperParameterTuningJob type in Search API. + + +1.27.66 +======= + +* api-change:``cognito-idp``: This release adds a new "AuthSessionValidity" field to the UserPoolClient in Cognito. Application admins can configure this value for their users' authentication duration, which is currently fixed at 3 minutes, up to 15 minutes. Setting this field will also apply to the SMS MFA authentication flow. +* api-change:``connect``: This release adds search APIs for Routing Profiles and Queues, which can be used to search for those resources within a Connect Instance. +* api-change:``mediapackage``: Added support for AES_CTR encryption to CMAF origin endpoints +* api-change:``sagemaker``: This release enables administrators to attribute user activity and API calls from Studio notebooks, Data Wrangler and Canvas to specific users even when users share the same execution IAM role. ExecutionRoleIdentityConfig at Sagemaker domain level enables this feature. + + +1.27.65 +======= + +* api-change:``codeguru-reviewer``: Documentation updates to fix formatting issues in CLI and SDK documentation. +* api-change:``controltower``: This release contains the first SDK for AWS Control Tower. It introduces a new set of APIs: EnableControl, DisableControl, GetControlOperation, and ListEnabledControls. +* api-change:``route53``: Documentation updates for Amazon Route 53. + + +1.27.64 +======= + +* api-change:``cloudfront``: Update API documentation for CloudFront origin access control (OAC) +* api-change:``identitystore``: Expand IdentityStore API to support Create, Read, Update, Delete and Get operations for User, Group and GroupMembership resources. +* api-change:``iotthingsgraph``: This release deprecates all APIs of the ThingsGraph service +* api-change:``ivs``: IVS Merge Fragmented Streams. This release adds support for recordingReconnectWindow field in IVS recordingConfigurations. For more information see https://docs.aws.amazon.com/ivs/latest/APIReference/Welcome.html +* api-change:``rds-data``: Documentation updates for RDS Data API +* api-change:``sagemaker``: SageMaker Inference Recommender now accepts Inference Recommender fields: Domain, Task, Framework, SamplePayloadUrl, SupportedContentTypes, SupportedInstanceTypes, directly in our CreateInferenceRecommendationsJob API through ContainerConfig + + +1.27.63 +======= + +* enhancement:Endpoints: Deprecate SSL common name +* api-change:``greengrassv2``: Adds topologyFilter to ListInstalledComponentsRequest which allows filtration of components by ROOT or ALL (including root and dependency components). Adds lastStatusChangeTimestamp to ListInstalledComponents response to show the last time a component changed state on a device. +* api-change:``identitystore``: Documentation updates for the Identity Store CLI Reference. +* api-change:``lookoutequipment``: This release adds new apis for providing labels. +* api-change:``macie2``: This release of the Amazon Macie API adds support for using allow lists to define specific text and text patterns to ignore when inspecting data sources for sensitive data. +* api-change:``sso-admin``: Documentation updates for the AWS IAM Identity Center CLI Reference. +* api-change:``sso``: Documentation updates for the AWS IAM Identity Center Portal CLI Reference. + + +1.27.62 +======= + +* api-change:``fsx``: Documentation updates for Amazon FSx for NetApp ONTAP. +* api-change:``voice-id``: Amazon Connect Voice ID now detects voice spoofing. When a prospective fraudster tries to spoof caller audio using audio playback or synthesized speech, Voice ID will return a risk score and outcome to indicate the how likely it is that the voice is spoofed. + + +1.27.61 +======= + +* api-change:``mediapackage``: This release adds Ads AdTriggers and AdsOnDeliveryRestrictions to describe calls for CMAF endpoints on MediaPackage. +* api-change:``rds``: Removes support for RDS Custom from DBInstanceClass in ModifyDBInstance + + +1.27.60 +======= + +* enhancement:Identity: TokenProvider added for bearer auth support +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``gamelift``: This release adds support for eight EC2 local zones as fleet locations; Atlanta, Chicago, Dallas, Denver, Houston, Kansas City (us-east-1-mci-1a), Los Angeles, and Phoenix. It also adds support for C5d, C6a, C6i, and R5d EC2 instance families. +* api-change:``iotwireless``: This release includes a new feature for the customers to enable the LoRa gateways to send out beacons for Class B devices and an option to select one or more gateways for Class C devices when sending the LoRaWAN downlink messages. +* api-change:``ivschat``: Documentation change for IVS Chat API Reference. Doc-only update to add a paragraph on ARNs to the Welcome section. +* api-change:``panorama``: Support sorting and filtering in ListDevices API, and add more fields to device listings and single device detail +* api-change:``sso-oidc``: Updated required request parameters on IAM Identity Center's OIDC CreateToken action. + + +1.27.59 +======= + +* api-change:``cloudfront``: Adds support for CloudFront origin access control (OAC), making it possible to restrict public access to S3 bucket origins in all AWS Regions, those with SSE-KMS, and more. +* api-change:``config``: AWS Config now supports ConformancePackTemplate documents in SSM Docs for the deployment and update of conformance packs. +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``ivs``: Documentation Change for IVS API Reference - Doc-only update to type field description for CreateChannel and UpdateChannel actions and for Channel data type. Also added Amazon Resource Names (ARNs) paragraph to Welcome section. +* api-change:``quicksight``: Added a new optional property DashboardVisual under ExperienceConfiguration parameter of GenerateEmbedUrlForAnonymousUser and GenerateEmbedUrlForRegisteredUser API operations. This supports embedding of specific visuals in QuickSight dashboards. +* api-change:``transfer``: Documentation updates for AWS Transfer Family + + +1.27.58 +======= + +* api-change:``rds``: RDS for Oracle supports Oracle Data Guard switchover and read replica backups. +* api-change:``sso-admin``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) + + +1.27.57 +======= + +* api-change:``docdb``: Update document for volume clone +* api-change:``ec2``: R6a instances are powered by 3rd generation AMD EPYC (Milan) processors delivering all-core turbo frequency of 3.6 GHz. C6id, M6id, and R6id instances are powered by 3rd generation Intel Xeon Scalable processor (Ice Lake) delivering all-core turbo frequency of 3.5 GHz. +* api-change:``forecast``: releasing What-If Analysis APIs and update ARN regex pattern to be more strict in accordance with security recommendation +* api-change:``forecastquery``: releasing What-If Analysis APIs +* api-change:``iotsitewise``: Enable non-unique asset names under different hierarchies +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``securityhub``: Added new resource details objects to ASFF, including resources for AwsBackupBackupVault, AwsBackupBackupPlan and AwsBackupRecoveryPoint. Added FixAvailable, FixedInVersion and Remediation to Vulnerability. +* api-change:``support-app``: This is the initial SDK release for the AWS Support App in Slack. + + +1.27.56 +======= + +* api-change:``connect``: This release adds SearchSecurityProfiles API which can be used to search for Security Profile resources within a Connect Instance. +* api-change:``ivschat``: Documentation Change for IVS Chat API Reference - Doc-only update to change text/description for tags field. +* api-change:``kendra``: This release adds support for a new authentication type - Personal Access Token (PAT) for confluence server. +* api-change:``lookoutmetrics``: This release is to make GetDataQualityMetrics API publicly available. + + +1.27.55 +======= + +* api-change:``chime-sdk-media-pipelines``: The Amazon Chime SDK now supports live streaming of real-time video from the Amazon Chime SDK sessions to streaming platforms such as Amazon IVS and Amazon Elemental MediaLive. We have also added support for concatenation to create a single media capture file. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``cognito-idp``: This change is being made simply to fix the public documentation based on the models. We have included the PasswordChange and ResendCode events, along with the Pass, Fail and InProgress status. We have removed the Success and Failure status which are never returned by our APIs. +* api-change:``dynamodb``: This release adds support for importing data from S3 into a new DynamoDB table +* api-change:``ec2``: This release adds support for VPN log options , a new feature allowing S2S VPN connections to send IKE activity logs to CloudWatch Logs +* api-change:``networkmanager``: Add TransitGatewayPeeringAttachmentId property to TransitGatewayPeering Model + + +1.27.54 +======= + +* api-change:``appmesh``: AWS App Mesh release to support Multiple Listener and Access Log Format feature +* api-change:``connectcampaigns``: Updated exceptions for Amazon Connect Outbound Campaign api's. +* api-change:``kendra``: This release adds Zendesk connector (which allows you to specify Zendesk SAAS platform as data source), Proxy Support for Sharepoint and Confluence Server (which allows you to specify the proxy configuration if proxy is required to connect to your Sharepoint/Confluence Server as data source). +* api-change:``lakeformation``: This release adds a new API support "AssumeDecoratedRoleWithSAML" and also release updates the corresponding documentation. +* api-change:``lambda``: Added support for customization of Consumer Group ID for MSK and Kafka Event Source Mappings. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``rds``: Adds support for Internet Protocol Version 6 (IPv6) for RDS Aurora database clusters. +* api-change:``secretsmanager``: Documentation updates for Secrets Manager. + + +1.27.53 +======= + +* api-change:``rekognition``: This release adds APIs which support copying an Amazon Rekognition Custom Labels model and managing project policies across AWS account. +* api-change:``servicecatalog``: Documentation updates for Service Catalog + + +1.27.52 +======= + +* enhancement:AWSCRT: Upgrade awscrt version to 0.14.0 +* api-change:``cloudfront``: Adds Http 3 support to distributions +* api-change:``identitystore``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* api-change:``sso``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* api-change:``wisdom``: This release introduces a new API PutFeedback that allows submitting feedback to Wisdom on content relevance. + + +1.27.51 +======= + +* api-change:``amp``: This release adds log APIs that allow customers to manage logging for their Amazon Managed Service for Prometheus workspaces. +* api-change:``chime-sdk-messaging``: The Amazon Chime SDK now supports channels with up to one million participants with elastic channels. +* api-change:``ivs``: Updates various list api MaxResults ranges +* api-change:``personalize-runtime``: This release provides support for promotions in AWS Personalize runtime. +* api-change:``rds``: Adds support for RDS Custom to DBInstanceClass in ModifyDBInstance + + +1.27.50 +======= + +* api-change:``backupstorage``: This is the first public release of AWS Backup Storage. We are exposing some previously-internal APIs for use by external services. These APIs are not meant to be used directly by customers. +* api-change:``glue``: Add support for Python 3.9 AWS Glue Python Shell jobs +* api-change:``privatenetworks``: This is the initial SDK release for AWS Private 5G. AWS Private 5G is a managed service that makes it easy to deploy, operate, and scale your own private mobile network at your on-premises location. + + +1.27.49 +======= + +* api-change:``dlm``: This release adds support for excluding specific data (non-boot) volumes from multi-volume snapshot sets created by snapshot lifecycle policies +* api-change:``ec2``: This release adds support for excluding specific data (non-root) volumes from multi-volume snapshot sets created from instances. + + +1.27.48 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``location``: Amazon Location Service now allows circular geofences in BatchPutGeofence, PutGeofence, and GetGeofence APIs. +* api-change:``sagemaker-a2i-runtime``: Fix bug with parsing ISO-8601 CreationTime in Java SDK in DescribeHumanLoop +* api-change:``sagemaker``: Amazon SageMaker Automatic Model Tuning now supports specifying multiple alternate EC2 instance types to make tuning jobs more robust when the preferred instance type is not available due to insufficient capacity. + + +1.27.47 +======= + +* api-change:``glue``: Add an option to run non-urgent or non-time sensitive Glue Jobs on spare capacity +* api-change:``identitystore``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* api-change:``iotwireless``: AWS IoT Wireless release support for sidewalk data reliability. +* api-change:``pinpoint``: Adds support for Advance Quiet Time in Journeys. Adds RefreshOnSegmentUpdate and WaitForQuietTime to JourneyResponse. +* api-change:``quicksight``: A series of documentation updates to the QuickSight API reference. +* api-change:``sso-admin``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* api-change:``sso-oidc``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* api-change:``sso``: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) + + +1.27.46 +======= + +* enhancement:Lambda: Add support for Trace ID in Lambda environments +* api-change:``chime-sdk-meetings``: Adds support for Tags on Amazon Chime SDK WebRTC sessions +* api-change:``config``: Add resourceType enums for Athena, GlobalAccelerator, Detective and EC2 types +* api-change:``dms``: Documentation updates for Database Migration Service (DMS). +* api-change:``iot``: The release is to support attach a provisioning template to CACert for JITP function, Customer now doesn't have to hardcode a roleArn and templateBody during register a CACert to enable JITP. + + +1.27.45 +======= + +* api-change:``cognito-idp``: Add a new exception type, ForbiddenException, that is returned when request is not allowed +* api-change:``wafv2``: You can now associate an AWS WAF web ACL with an Amazon Cognito user pool. + + +1.27.44 +======= + +* api-change:``license-manager-user-subscriptions``: This release supports user based subscription for Microsoft Visual Studio Professional and Enterprise on EC2. +* api-change:``personalize``: This release adds support for incremental bulk ingestion for the Personalize CreateDatasetImportJob API. + + +1.27.43 +======= + +* api-change:``config``: Documentation update for PutConfigRule and PutOrganizationConfigRule +* api-change:``workspaces``: This release introduces ModifySamlProperties, a new API that allows control of SAML properties associated with a WorkSpaces directory. The DescribeWorkspaceDirectories API will now additionally return SAML properties in its responses. + + +1.27.42 +======= + +* bugfix:TraceId: Rollback bugfix for obeying _X_AMZN_TRACE_ID env var + + +1.27.41 +======= + +* bugfix:Config: Obey _X_AMZN_TRACE_ID environment variable instead of _X_AMZ_TRACE_ID +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``fsx``: Documentation updates for Amazon FSx +* api-change:``shield``: AWS Shield Advanced now supports filtering for ListProtections and ListProtectionGroups. + + +1.27.40 +======= + +* api-change:``ec2``: Documentation updates for VM Import/Export. +* api-change:``es``: This release adds support for gp3 EBS (Elastic Block Store) storage. +* api-change:``lookoutvision``: This release introduces support for image segmentation models and updates CPU accelerator options for models hosted on edge devices. +* api-change:``opensearch``: This release adds support for gp3 EBS (Elastic Block Store) storage. + + +1.27.39 +======= + +* api-change:``auditmanager``: This release adds an exceeded quota exception to several APIs. We added a ServiceQuotaExceededException for the following operations: CreateAssessment, CreateControl, CreateAssessmentFramework, and UpdateAssessmentStatus. +* api-change:``chime``: Chime VoiceConnector will now support ValidateE911Address which will allow customers to prevalidate their addresses included in their SIP invites for emergency calling +* api-change:``config``: This release adds ListConformancePackComplianceScores API to support the new compliance score feature, which provides a percentage of the number of compliant rule-resource combinations in a conformance pack compared to the number of total possible rule-resource combinations in the conformance pack. +* api-change:``globalaccelerator``: Global Accelerator now supports dual-stack accelerators, enabling support for IPv4 and IPv6 traffic. +* api-change:``marketplace-catalog``: The SDK for the StartChangeSet API will now automatically set and use an idempotency token in the ClientRequestToken request parameter if the customer does not provide it. +* api-change:``polly``: Amazon Polly adds new English and Hindi voice - Kajal. Kajal is available as Neural voice only. +* api-change:``ssm``: Adding doc updates for OpsCenter support in Service Setting actions. +* api-change:``workspaces``: Added CreateWorkspaceImage API to create a new WorkSpace image from an existing WorkSpace. + + +1.27.38 +======= + +* api-change:``appsync``: Adds support for a new API to evaluate mapping templates with mock data, allowing you to remotely unit test your AppSync resolvers and functions. +* api-change:``detective``: Added the ability to get data source package information for the behavior graph. Graph administrators can now start (or stop) optional datasources on the behavior graph. +* api-change:``guardduty``: Amazon GuardDuty introduces a new Malware Protection feature that triggers malware scan on selected EC2 instance resources, after the service detects a potentially malicious activity. +* api-change:``lookoutvision``: This release introduces support for the automatic scaling of inference units used by Amazon Lookout for Vision models. +* api-change:``macie2``: This release adds support for retrieving (revealing) sample occurrences of sensitive data that Amazon Macie detects and reports in findings. +* api-change:``rds``: Adds support for using RDS Proxies with RDS for MariaDB databases. +* api-change:``rekognition``: This release introduces support for the automatic scaling of inference units used by Amazon Rekognition Custom Labels models. +* api-change:``securityhub``: Documentation updates for AWS Security Hub +* api-change:``transfer``: AWS Transfer Family now supports Applicability Statement 2 (AS2), a network protocol used for the secure and reliable transfer of critical Business-to-Business (B2B) data over the public internet using HTTP/HTTPS as the transport mechanism. + + +1.27.37 +======= + +* api-change:``autoscaling``: Documentation update for Amazon EC2 Auto Scaling. + + +1.27.36 +======= + +* api-change:``account``: This release enables customers to manage the primary contact information for their AWS accounts. For more information, see https://docs.aws.amazon.com/accounts/latest/reference/API_Operations.html +* api-change:``ec2``: Added support for EC2 M1 Mac instances. For more information, please visit aws.amazon.com/mac. +* api-change:``iotdeviceadvisor``: Added new service feature (Early access only) - Long Duration Test, where customers can test the IoT device to observe how it behaves when the device is in operation for longer period. +* api-change:``medialive``: Link devices now support remote rebooting. Link devices now support maintenance windows. Maintenance windows allow a Link device to install software updates without stopping the MediaLive channel. The channel will experience a brief loss of input from the device while updates are installed. +* api-change:``rds``: This release adds the "ModifyActivityStream" API with support for audit policy state locking and unlocking. +* api-change:``transcribe``: Remove unsupported language codes for StartTranscriptionJob and update VocabularyFileUri for UpdateMedicalVocabulary + + +1.27.35 +======= + +* api-change:``athena``: This feature allows customers to retrieve runtime statistics for completed queries +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``dms``: Documentation updates for Database Migration Service (DMS). +* api-change:``docdb``: Enable copy-on-write restore type +* api-change:``ec2-instance-connect``: This release includes a new exception type "EC2InstanceUnavailableException" for SendSSHPublicKey and SendSerialConsoleSSHPublicKey APIs. +* api-change:``frauddetector``: The release introduces Account Takeover Insights (ATI) model. The ATI model detects fraud relating to account takeover. This release also adds support for new variable types: ARE_CREDENTIALS_VALID and SESSION_ID and adds new structures to Model Version APIs. +* api-change:``iotsitewise``: Added asynchronous API to ingest bulk historical and current data into IoT SiteWise. +* api-change:``kendra``: Amazon Kendra now provides Oauth2 support for SharePoint Online. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-sharepoint.html +* api-change:``network-firewall``: Network Firewall now supports referencing dynamic IP sets from stateful rule groups, for IP sets stored in Amazon VPC prefix lists. +* api-change:``rds``: Adds support for creating an RDS Proxy for an RDS for MariaDB database. + + +1.27.34 +======= + +* api-change:``acm-pca``: AWS Certificate Manager (ACM) Private Certificate Authority (PCA) documentation updates +* api-change:``iot``: GA release the ability to enable/disable IoT Fleet Indexing for Device Defender and Named Shadow information, and search them through IoT Fleet Indexing APIs. This includes Named Shadow Selection as a part of the UpdateIndexingConfiguration API. + + +1.27.33 +======= + +* api-change:``devops-guru``: Added new APIs for log anomaly detection feature. +* api-change:``glue``: Documentation updates for AWS Glue Job Timeout and Autoscaling +* api-change:``sagemaker-edge``: Amazon SageMaker Edge Manager provides lightweight model deployment feature to deploy machine learning models on requested devices. +* api-change:``sagemaker``: Fixed an issue with cross account QueryLineage +* api-change:``workspaces``: Increased the character limit of the login message from 850 to 2000 characters. + + +1.27.32 +======= + +* api-change:``discovery``: Add AWS Agentless Collector details to the GetDiscoverySummary API response +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``elasticache``: Adding AutoMinorVersionUpgrade in the DescribeReplicationGroups API +* api-change:``kms``: Added support for the SM2 KeySpec in China Partition Regions +* api-change:``mediapackage``: This release adds "IncludeIframeOnlyStream" for Dash endpoints and increases the number of supported video and audio encryption presets for Speke v2 +* api-change:``sagemaker``: Amazon SageMaker Edge Manager provides lightweight model deployment feature to deploy machine learning models on requested devices. +* api-change:``sso-admin``: AWS SSO now supports attaching customer managed policies and a permissions boundary to your permission sets. This release adds new API operations to manage and view the customer managed policies and the permissions boundary for a given permission set. + + +1.27.31 +======= + +* api-change:``datasync``: Documentation updates for AWS DataSync regarding configuring Amazon FSx for ONTAP location security groups and SMB user permissions. +* api-change:``drs``: Changed existing APIs to allow choosing a dynamic volume type for replicating volumes, to reduce costs for customers. +* api-change:``evidently``: This release adds support for the new segmentation feature. +* api-change:``wafv2``: This SDK release provide customers ability to add sensitivity level for WAF SQLI Match Statements. + + +1.27.30 +======= + +* api-change:``athena``: This release updates data types that contain either QueryExecutionId, NamedQueryId or ExpectedBucketOwner. Ids must be between 1 and 128 characters and contain only non-whitespace characters. ExpectedBucketOwner must be 12-digit string. +* api-change:``codeartifact``: This release introduces Package Origin Controls, a mechanism used to counteract Dependency Confusion attacks. Adds two new APIs, PutPackageOriginConfiguration and DescribePackage, and updates the ListPackage, DescribePackageVersion and ListPackageVersion APIs in support of the feature. +* api-change:``config``: Update ResourceType enum with values for Route53Resolver, Batch, DMS, Workspaces, Stepfunctions, SageMaker, ElasticLoadBalancingV2, MSK types +* api-change:``ec2``: This release adds flow logs for Transit Gateway to allow customers to gain deeper visibility and insights into network traffic through their Transit Gateways. +* api-change:``fms``: Adds support for strict ordering in stateful rule groups in Network Firewall policies. +* api-change:``glue``: This release adds an additional worker type for Glue Streaming jobs. +* api-change:``inspector2``: This release adds support for Inspector V2 scan configurations through the get and update configuration APIs. Currently this allows configuring ECR automated re-scan duration to lifetime or 180 days or 30 days. +* api-change:``kendra``: This release adds AccessControlConfigurations which allow you to redefine your document level access control without the need for content re-indexing. +* api-change:``nimble``: Amazon Nimble Studio adds support for IAM-based access to AWS resources for Nimble Studio components and custom studio components. Studio Component scripts use these roles on Nimble Studio workstation to mount filesystems, access S3 buckets, or other configured resources in the Studio's AWS account +* api-change:``outposts``: This release adds the ShipmentInformation and AssetInformationList fields to the GetOrder API response. +* api-change:``sagemaker``: This release adds support for G5, P4d, and C6i instance types in Amazon SageMaker Inference and increases the number of hyperparameters that can be searched from 20 to 30 in Amazon SageMaker Automatic Model Tuning + + +1.27.29 +======= + +* api-change:``appconfig``: Adding Create, Get, Update, Delete, and List APIs for new two new resources: Extensions and ExtensionAssociations. + + +1.27.28 +======= + +* api-change:``networkmanager``: This release adds general availability API support for AWS Cloud WAN. + + +1.27.27 +======= + +* api-change:``ec2``: Build, manage, and monitor a unified global network that connects resources running across your cloud and on-premises environments using the AWS Cloud WAN APIs. +* api-change:``redshift-serverless``: Removed prerelease language for GA launch. +* api-change:``redshift``: This release adds a new --snapshot-arn field for describe-cluster-snapshots, describe-node-configuration-options, restore-from-cluster-snapshot, authorize-snapshot-acsess, and revoke-snapshot-acsess APIs. It allows customers to give a Redshift snapshot ARN or a Redshift Serverless ARN as input. + + +1.27.26 +======= + +* api-change:``backup``: This release adds support for authentication using IAM user identity instead of passed IAM role, identified by excluding the IamRoleArn field in the StartRestoreJob API. This feature applies to only resource clients with a destructive restore nature (e.g. SAP HANA). + + +1.27.25 +======= + +* api-change:``chime-sdk-meetings``: Adds support for AppKeys and TenantIds in Amazon Chime SDK WebRTC sessions +* api-change:``dms``: New api to migrate event subscriptions to event bridge rules +* api-change:``iot``: This release adds support to register a CA certificate without having to provide a verification certificate. This also allows multiple AWS accounts to register the same CA in the same region. +* api-change:``iotwireless``: Adds 5 APIs: PutPositionConfiguration, GetPositionConfiguration, ListPositionConfigurations, UpdatePosition, GetPosition for the new Positioning Service feature which enables customers to configure solvers to calculate position of LoRaWAN devices, or specify position of LoRaWAN devices & gateways. +* api-change:``sagemaker``: Heterogeneous clusters: the ability to launch training jobs with multiple instance types. This enables running component of the training job on the instance type that is most suitable for it. e.g. doing data processing and augmentation on CPU instances and neural network training on GPU instances + + +1.27.24 +======= + +* api-change:``cloudformation``: My AWS Service (placeholder) - Add a new feature Account-level Targeting for StackSet operation +* api-change:``synthetics``: This release introduces Group feature, which enables users to group cross-region canaries. + + +1.27.23 +======= + +* api-change:``config``: Updating documentation service limits +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``quicksight``: This release allows customers to programmatically create QuickSight accounts with Enterprise and Enterprise + Q editions. It also releases allowlisting domains for embedding QuickSight dashboards at runtime through the embedding APIs. +* api-change:``rds``: Adds waiters support for DBCluster. +* api-change:``rolesanywhere``: IAM Roles Anywhere allows your workloads such as servers, containers, and applications to obtain temporary AWS credentials and use the same IAM roles and policies that you have configured for your AWS workloads to access AWS resources. +* api-change:``ssm-incidents``: Adds support for tagging incident-record on creation by providing incident tags in the template within a response-plan. + + +1.27.22 +======= + +* api-change:``dms``: Added new features for AWS DMS version 3.4.7 that includes new endpoint settings for S3, OpenSearch, Postgres, SQLServer and Oracle. +* api-change:``rds``: Adds support for additional retention periods to Performance Insights. + + +1.27.21 +======= + +* api-change:``athena``: This feature introduces the API support for Athena's parameterized query and BatchGetPreparedStatement API. +* api-change:``customer-profiles``: This release adds the optional MinAllowedConfidenceScoreForMerging parameter to the CreateDomain, UpdateDomain, and GetAutoMergingPreview APIs in Customer Profiles. This parameter is used as a threshold to influence the profile auto-merging step of the Identity Resolution process. +* api-change:``emr``: Update emr client to latest version +* api-change:``glue``: This release adds tag as an input of CreateDatabase +* api-change:``kendra``: Amazon Kendra now provides a data source connector for alfresco +* api-change:``mwaa``: Documentation updates for Amazon Managed Workflows for Apache Airflow. +* api-change:``pricing``: Documentation update for GetProducts Response. +* api-change:``wellarchitected``: Added support for UpdateGlobalSettings API. Added status filter to ListWorkloadShares and ListLensShares. +* api-change:``workmail``: This release adds support for managing user availability configurations in Amazon WorkMail. + + +1.27.20 +======= + +* api-change:``appstream``: Includes support for StreamingExperienceSettings in CreateStack and UpdateStack APIs +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``medialive``: This release adds support for automatic renewal of MediaLive reservations at the end of each reservation term. Automatic renewal is optional. This release also adds support for labelling accessibility-focused audio and caption tracks in HLS outputs. +* api-change:``redshift-serverless``: Add new API operations for Amazon Redshift Serverless, a new way of using Amazon Redshift without needing to manually manage provisioned clusters. The new operations let you interact with Redshift Serverless resources, such as create snapshots, list VPC endpoints, delete resource policies, and more. +* api-change:``sagemaker``: This release adds: UpdateFeatureGroup, UpdateFeatureMetadata, DescribeFeatureMetadata APIs; FeatureMetadata type in Search API; LastModifiedTime, LastUpdateStatus, OnlineStoreTotalSizeBytes in DescribeFeatureGroup API. +* api-change:``translate``: Added ListLanguages API which can be used to list the languages supported by Translate. + + +1.27.19 +======= + +* api-change:``datasync``: AWS DataSync now supports Amazon FSx for NetApp ONTAP locations. +* api-change:``ec2``: This release adds a new spread placement group to EC2 Placement Groups: host level spread, which spread instances between physical hosts, available to Outpost customers only. CreatePlacementGroup and DescribePlacementGroups APIs were updated with a new parameter: SpreadLevel to support this feature. +* api-change:``finspace-data``: Release new API GetExternalDataViewAccessDetails +* api-change:``polly``: Add 4 new neural voices - Pedro (es-US), Liam (fr-CA), Daniel (de-DE) and Arthur (en-GB). + + +1.27.18 +======= + +* api-change:``iot``: This release ease the restriction for the input of tag value to align with AWS standard, now instead of min length 1, we change it to min length 0. + + +1.27.17 +======= + +* api-change:``glue``: This release enables the new ListCrawls API for viewing the AWS Glue Crawler run history. +* api-change:``rds-data``: Documentation updates for RDS Data API + + +1.27.16 +======= + +* api-change:``lookoutequipment``: This release adds visualizations to the scheduled inference results. Users will be able to see interference results, including diagnostic results from their running inference schedulers. +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has released support for automatic DolbyVision metadata generation when converting HDR10 to DolbyVision. +* api-change:``mgn``: New and modified APIs for the Post-Migration Framework +* api-change:``migration-hub-refactor-spaces``: This release adds the new API UpdateRoute that allows route to be updated to ACTIVE/INACTIVE state. In addition, CreateRoute API will now allow users to create route in ACTIVE/INACTIVE state. +* api-change:``sagemaker``: SageMaker Ground Truth now supports Virtual Private Cloud. Customers can launch labeling jobs and access to their private workforce in VPC mode. + + +1.27.15 +======= + +* api-change:``apigateway``: Documentation updates for Amazon API Gateway +* api-change:``pricing``: This release introduces 1 update to the GetProducts API. The serviceCode attribute is now required when you use the GetProductsRequest. +* api-change:``transfer``: Until today, the service supported only RSA host keys and user keys. Now with this launch, Transfer Family has expanded the support for ECDSA and ED25519 host keys and user keys, enabling customers to support a broader set of clients by choosing RSA, ECDSA, and ED25519 host and user keys. + + +1.27.14 +======= + +* api-change:``ec2``: This release adds support for Private IP VPNs, a new feature allowing S2S VPN connections to use private ip addresses as the tunnel outside ip address over Direct Connect as transport. +* api-change:``ecs``: Amazon ECS UpdateService now supports the following parameters: PlacementStrategies, PlacementConstraints and CapacityProviderStrategy. +* api-change:``wellarchitected``: Adds support for lens tagging, Adds support for multiple helpful-resource urls and multiple improvement-plan urls. + + +1.27.13 +======= + +* api-change:``ds``: This release adds support for describing and updating AWS Managed Microsoft AD settings +* api-change:``kafka``: Documentation updates to use Az Id during cluster creation. +* api-change:``outposts``: This release adds the AssetLocation structure to the ListAssets response. AssetLocation includes the RackElevation for an Asset. + + +1.27.12 +======= + +* api-change:``connect``: This release updates these APIs: UpdateInstanceAttribute, DescribeInstanceAttribute and ListInstanceAttributes. You can use it to programmatically enable/disable High volume outbound communications using attribute type HIGH_VOLUME_OUTBOUND on the specified Amazon Connect instance. +* api-change:``connectcampaigns``: Added Amazon Connect high volume outbound communications SDK. +* api-change:``dynamodb``: Doc only update for DynamoDB service +* api-change:``dynamodbstreams``: Update dynamodbstreams client to latest version + + +1.27.11 +======= + +* api-change:``redshift-data``: This release adds a new --workgroup-name field to operations that connect to an endpoint. Customers can now execute queries against their serverless workgroups. +* api-change:``secretsmanager``: Documentation updates for Secrets Manager +* api-change:``securityhub``: Added Threats field for security findings. Added new resource details for ECS Container, ECS Task, RDS SecurityGroup, Kinesis Stream, EC2 TransitGateway, EFS AccessPoint, CloudFormation Stack, CloudWatch Alarm, VPC Peering Connection and WAF Rules + + +1.27.10 +======= + +* api-change:``finspace-data``: This release adds a new set of APIs, GetPermissionGroup, DisassociateUserFromPermissionGroup, AssociateUserToPermissionGroup, ListPermissionGroupsByUser, ListUsersByPermissionGroup. +* api-change:``guardduty``: Adds finding fields available from GuardDuty Console. Adds FreeTrial related operations. Deprecates the use of various APIs related to Master Accounts and Replace them with Administrator Accounts. +* api-change:``servicecatalog-appregistry``: This release adds a new API ListAttributeGroupsForApplication that returns associated attribute groups of an application. In addition, the UpdateApplication and UpdateAttributeGroup APIs will not allow users to update the 'Name' attribute. +* api-change:``workspaces``: Added new field "reason" to OperationNotSupportedException. Receiving this exception in the DeregisterWorkspaceDirectory API will now return a reason giving more context on the failure. + + +1.27.9 +====== + +* api-change:``budgets``: Add a budgets ThrottlingException. Update the CostFilters value pattern. +* api-change:``lookoutmetrics``: Adding filters to Alert and adding new UpdateAlert API. +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added support for rules that constrain Automatic-ABR rendition selection when generating ABR package ladders. + + +1.27.8 +====== + +* api-change:``outposts``: This release adds API operations AWS uses to install Outpost servers. + + +1.27.7 +====== + +* api-change:``frauddetector``: Documentation updates for Amazon Fraud Detector (AWSHawksNest) + + +1.27.6 +====== + +* api-change:``chime-sdk-meetings``: Adds support for live transcription in AWS GovCloud (US) Regions. + + +1.27.5 +====== + +* api-change:``dms``: This release adds DMS Fleet Advisor APIs and exposes functionality for DMS Fleet Advisor. It adds functionality to create and modify fleet advisor instances, and to collect and analyze information about the local data infrastructure. +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``m2``: AWS Mainframe Modernization service is a managed mainframe service and set of tools for planning, migrating, modernizing, and running mainframe workloads on AWS +* api-change:``neptune``: This release adds support for Neptune to be configured as a global database, with a primary DB cluster in one region, and up to five secondary DB clusters in other regions. +* api-change:``redshift``: Adds new API GetClusterCredentialsWithIAM to return temporary credentials. + + +1.27.4 +====== + +* api-change:``auditmanager``: This release introduces 2 updates to the Audit Manager API. The roleType and roleArn attributes are now required when you use the CreateAssessment or UpdateAssessment operation. We also added a throttling exception to the RegisterAccount API operation. +* api-change:``ce``: Added two new APIs to support cost allocation tags operations: ListCostAllocationTags, UpdateCostAllocationTagsStatus. + + +1.27.3 +====== + +* api-change:``chime-sdk-messaging``: This release adds support for searching channels by members via the SearchChannels API, removes required restrictions for Name and Mode in UpdateChannel API and enhances CreateChannel API by exposing member and moderator list as well as channel id as optional parameters. +* api-change:``connect``: This release adds a new API, GetCurrentUserData, which returns real-time details about users' current activity. + + +1.27.2 +====== + +* api-change:``codeartifact``: Documentation updates for CodeArtifact +* api-change:``voice-id``: Added a new attribute ServerSideEncryptionUpdateDetails to Domain and DomainSummary. +* api-change:``proton``: Add new "Components" API to enable users to Create, Delete and Update AWS Proton components. +* api-change:``connect``: This release adds the following features: 1) New APIs to manage (create, list, update) task template resources, 2) Updates to startTaskContact API to support task templates, and 3) new TransferContact API to programmatically transfer in-progress tasks via a contact flow. +* api-change:``application-insights``: Provide Account Level onboarding support through CFN/CLI +* api-change:``kendra``: Amazon Kendra now provides a data source connector for GitHub. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-github.html + + +1.27.1 +====== + +* api-change:``backup-gateway``: Adds GetGateway and UpdateGatewaySoftwareNow API and adds hypervisor name to UpdateHypervisor API +* api-change:``forecast``: Added Format field to Import and Export APIs in Amazon Forecast. Added TimeSeriesSelector to Create Forecast API. +* api-change:``chime-sdk-meetings``: Adds support for centrally controlling each participant's ability to send and receive audio, video and screen share within a WebRTC session. Attendee capabilities can be specified when the attendee is created and updated during the session with the new BatchUpdateAttendeeCapabilitiesExcept API. +* api-change:``route53``: Add new APIs to support Route 53 IP Based Routing + + +1.27.0 +====== + +* api-change:``iotsitewise``: This release adds the following new optional field to the IoT SiteWise asset resource: assetDescription. +* api-change:``lookoutmetrics``: Adding backtest mode to detectors using the Cloudwatch data source. +* api-change:``transcribe``: Amazon Transcribe now supports automatic language identification for multi-lingual audio in batch mode. +* feature:Python: Dropped support for Python 3.6 +* api-change:``cognito-idp``: Amazon Cognito now supports IP Address propagation for all unauthenticated APIs (e.g. SignUp, ForgotPassword). +* api-change:``drs``: Changed existing APIs and added new APIs to accommodate using multiple AWS accounts with AWS Elastic Disaster Recovery. +* api-change:``sagemaker``: Amazon SageMaker Notebook Instances now support Jupyter Lab 3. + + +1.26.10 +======= + +* api-change:``sagemaker``: Amazon SageMaker Notebook Instances now allows configuration of Instance Metadata Service version and Amazon SageMaker Studio now supports G5 instance types. +* api-change:``appflow``: Adding the following features/changes: Parquet output that preserves typing from the source connector, Failed executions threshold before deactivation for scheduled flows, increasing max size of access and refresh token from 2048 to 4096 +* api-change:``datasync``: AWS DataSync now supports TLS encryption in transit, file system policies and access points for EFS locations. +* api-change:``emr-serverless``: This release adds support for Amazon EMR Serverless, a serverless runtime environment that simplifies running analytics applications using the latest open source frameworks such as Apache Spark and Apache Hive. + + +1.26.9 +====== + +* api-change:``lightsail``: Amazon Lightsail now supports the ability to configure a Lightsail Container Service to pull images from Amazon ECR private repositories in your account. +* api-change:``emr-serverless``: This release adds support for Amazon EMR Serverless, a serverless runtime environment that simplifies running analytics applications using the latest open source frameworks such as Apache Spark and Apache Hive. +* api-change:``ec2``: C7g instances, powered by the latest generation AWS Graviton3 processors, provide the best price performance in Amazon EC2 for compute-intensive workloads. +* api-change:``forecast``: Introduced a new field in Auto Predictor as Time Alignment Boundary. It helps in aligning the timestamps generated during Forecast exports + + +1.26.8 +====== + +* api-change:``secretsmanager``: Documentation updates for Secrets Manager +* api-change:``fsx``: This release adds root squash support to FSx for Lustre to restrict root level access from clients by mapping root users to a less-privileged user/group with limited permissions. +* api-change:``lookoutmetrics``: Adding AthenaSourceConfig for MetricSet APIs to support Athena as a data source. +* api-change:``voice-id``: VoiceID will now automatically expire Speakers if they haven't been accessed for Enrollment, Re-enrollment or Successful Auth for three years. The Speaker APIs now return a "LastAccessedAt" time for Speakers, and the EvaluateSession API returns "SPEAKER_EXPIRED" Auth Decision for EXPIRED Speakers. +* api-change:``cloudformation``: Add a new parameter statusReason to DescribeStackSetOperation output for additional details +* api-change:``apigateway``: Documentation updates for Amazon API Gateway +* api-change:``apprunner``: Documentation-only update added for CodeConfiguration. +* api-change:``sagemaker``: Amazon SageMaker Autopilot adds support for manually selecting features from the input dataset using the CreateAutoMLJob API. + + +1.26.7 +====== + +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added support for rules that constrain Automatic-ABR rendition selection when generating ABR package ladders. +* api-change:``cognito-idp``: Amazon Cognito now supports requiring attribute verification (ex. email and phone number) before update. +* api-change:``networkmanager``: This release adds Multi Account API support for a TGW Global Network, to enable and disable AWSServiceAccess with AwsOrganizations for Network Manager service and dependency CloudFormation StackSets service. +* api-change:``ivschat``: Doc-only update. For MessageReviewHandler structure, added timeout period in the description of the fallbackResult field +* api-change:``ec2``: Stop Protection feature enables customers to protect their instances from accidental stop actions. + + +1.26.6 +====== + +* api-change:``elasticache``: Added support for encryption in transit for Memcached clusters. Customers can now launch Memcached cluster with encryption in transit enabled when using Memcached version 1.6.12 or later. +* api-change:``forecast``: New APIs for Monitor that help you understand how your predictors perform over time. +* api-change:``personalize``: Adding modelMetrics as part of DescribeRecommender API response for Personalize. + + +1.26.5 +====== + +* api-change:``comprehend``: Comprehend releases 14 new entity types for DetectPiiEntities and ContainsPiiEntities APIs. +* api-change:``logs``: Doc-only update to publish the new valid values for log retention + + +1.26.4 +====== + +* api-change:``gamesparks``: This release adds an optional DeploymentResult field in the responses of GetStageDeploymentIntegrationTests and ListStageDeploymentIntegrationTests APIs. +* enhancement:StreamingBody: Allow StreamingBody to be used as a context manager +* api-change:``lookoutmetrics``: In this release we added SnsFormat to SNSConfiguration to support human readable alert. + + +1.26.3 +====== + +* api-change:``greengrassv2``: This release adds the new DeleteDeployment API operation that you can use to delete deployment resources. This release also adds support for discontinued AWS-provided components, so AWS can communicate when a component has any issues that you should consider before you deploy it. +* api-change:``quicksight``: API UpdatePublicSharingSettings enables IAM admins to enable/disable account level setting for public access of dashboards. When enabled, owners/co-owners for dashboards can enable public access on their dashboards. These dashboards can only be accessed through share link or embedding. +* api-change:``appmesh``: This release updates the existing Create and Update APIs for meshes and virtual nodes by adding a new IP preference field. This new IP preference field can be used to control the IP versions being used with the mesh and allows for IPv6 support within App Mesh. +* api-change:``batch``: Documentation updates for AWS Batch. +* api-change:``iotevents-data``: Introducing new API for deleting detectors: BatchDeleteDetector. +* api-change:``transfer``: AWS Transfer Family now supports SetStat server configuration option, which provides the ability to ignore SetStat command issued by file transfer clients, enabling customers to upload files without any errors. + + +1.26.2 +====== + +* api-change:``kms``: Add HMAC best practice tip, annual rotation of AWS managed keys. +* api-change:``glue``: This release adds a new optional parameter called codeGenNodeConfiguration to CRUD job APIs that allows users to manage visual jobs via APIs. The updated CreateJob and UpdateJob will create jobs that can be viewed in Glue Studio as a visual graph. GetJob can be used to get codeGenNodeConfiguration. + + +1.26.1 +====== + +* api-change:``resiliencehub``: In this release, we are introducing support for Amazon Elastic Container Service, Amazon Route 53, AWS Elastic Disaster Recovery, AWS Backup in addition to the existing supported Services. This release also supports Terraform file input from S3 and scheduling daily assessments +* api-change:``servicecatalog``: Updated the descriptions for the ListAcceptedPortfolioShares API description and the PortfolioShareType parameters. +* api-change:``discovery``: Add Migration Evaluator Collector details to the GetDiscoverySummary API response +* api-change:``sts``: Documentation updates for AWS Security Token Service. +* api-change:``workspaces-web``: Amazon WorkSpaces Web now supports Administrator timeout control +* api-change:``rekognition``: Documentation updates for Amazon Rekognition. +* api-change:``cloudfront``: Introduced a new error (TooLongCSPInResponseHeadersPolicy) that is returned when the value of the Content-Security-Policy header in a response headers policy exceeds the maximum allowed length. + + +1.26.0 +====== + +* feature:Loaders: Support for loading gzip compressed model files. +* api-change:``grafana``: This release adds APIs for creating and deleting API keys in an Amazon Managed Grafana workspace. + + +1.25.13 +======= + +* api-change:``ivschat``: Documentation-only updates for IVS Chat API Reference. +* api-change:``lambda``: Lambda releases NodeJs 16 managed runtime to be available in all commercial regions. +* api-change:``kendra``: Amazon Kendra now provides a data source connector for Jira. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-jira.html +* api-change:``transfer``: AWS Transfer Family now accepts ECDSA keys for server host keys +* api-change:``iot``: Documentation update for China region ListMetricValues for IoT +* api-change:``workspaces``: Increased the character limit of the login message from 600 to 850 characters. +* api-change:``finspace-data``: We've now deprecated CreateSnapshot permission for creating a data view, instead use CreateDataView permission. +* api-change:``lightsail``: This release adds support to include inactive database bundles in the response of the GetRelationalDatabaseBundles request. +* api-change:``outposts``: Documentation updates for AWS Outposts. +* api-change:``ec2``: This release introduces a target type Gateway Load Balancer Endpoint for mirrored traffic. Customers can now specify GatewayLoadBalancerEndpoint option during the creation of a traffic mirror target. +* api-change:``ssm-incidents``: Adding support for dynamic SSM Runbook parameter values. Updating validation pattern for engagements. Adding ConflictException to UpdateReplicationSet API contract. + + +1.25.12 +======= + +* api-change:``secretsmanager``: Doc only update for Secrets Manager that fixes several customer-reported issues. +* api-change:``ec2``: This release updates AWS PrivateLink APIs to support IPv6 for PrivateLink Services and Endpoints of type 'Interface'. + + +1.25.11 +======= + +* api-change:``migration-hub-refactor-spaces``: AWS Migration Hub Refactor Spaces documentation only update to fix a formatting issue. +* api-change:``ec2``: Added support for using NitroTPM and UEFI Secure Boot on EC2 instances. +* api-change:``emr``: Update emr client to latest version +* api-change:``compute-optimizer``: Documentation updates for Compute Optimizer +* api-change:``eks``: Adds BOTTLEROCKET_ARM_64_NVIDIA and BOTTLEROCKET_x86_64_NVIDIA AMI types to EKS managed nodegroups + + +1.25.10 +======= + +* api-change:``evidently``: Add detail message inside GetExperimentResults API response to indicate experiment result availability +* api-change:``ssm-contacts``: Fixed an error in the DescribeEngagement example for AWS Incident Manager. +* api-change:``cloudcontrol``: SDK release for Cloud Control API to include paginators for Python SDK. + + +1.25.9 +====== + +* api-change:``rds``: Various documentation improvements. +* api-change:``redshift``: Introduces new field 'LoadSampleData' in CreateCluster operation. Customers can now specify 'LoadSampleData' option during creation of a cluster, which results in loading of sample data in the cluster that is created. +* api-change:``ec2``: Add new state values for IPAMs, IPAM Scopes, and IPAM Pools. +* api-change:``mediapackage``: This release adds Dvb Dash 2014 as an available profile option for Dash Origin Endpoints. +* api-change:``securityhub``: Documentation updates for Security Hub API reference +* api-change:``location``: Amazon Location Service now includes a MaxResults parameter for ListGeofences requests. + + +1.25.8 +====== + +* api-change:``ec2``: Amazon EC2 I4i instances are powered by 3rd generation Intel Xeon Scalable processors and feature up to 30 TB of local AWS Nitro SSD storage +* api-change:``kendra``: AWS Kendra now supports hierarchical facets for a query. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/filtering.html +* api-change:``iot``: AWS IoT Jobs now allows you to create up to 100,000 active continuous and snapshot jobs by using concurrency control. +* api-change:``datasync``: AWS DataSync now supports a new ObjectTags Task API option that can be used to control whether Object Tags are transferred. + + +1.25.7 +====== + +* api-change:``ssm``: This release adds the TargetMaps parameter in SSM State Manager API. +* api-change:``backup``: Adds support to 2 new filters about job complete time for 3 list jobs APIs in AWS Backup +* api-change:``lightsail``: Documentation updates for Lightsail +* api-change:``iotsecuretunneling``: This release introduces a new API RotateTunnelAccessToken that allow revoking the existing tokens and generate new tokens + + +1.25.6 +====== + +* api-change:``ec2``: Adds support for allocating Dedicated Hosts on AWS Outposts. The AllocateHosts API now accepts an OutpostArn request parameter, and the DescribeHosts API now includes an OutpostArn response parameter. +* api-change:``s3``: Documentation only update for doc bug fixes for the S3 API docs. +* api-change:``kinesisvideo``: Add support for multiple image feature related APIs for configuring image generation and notification of a video stream. Add "GET_IMAGES" to the list of supported API names for the GetDataEndpoint API. +* api-change:``sagemaker``: SageMaker Autopilot adds new metrics for all candidate models generated by Autopilot experiments; RStudio on SageMaker now allows users to bring your own development environment in a custom image. +* api-change:``kinesis-video-archived-media``: Add support for GetImages API for retrieving images from a video stream + + +1.25.5 +====== + +* api-change:``organizations``: This release adds the INVALID_PAYMENT_INSTRUMENT as a fail reason and an error message. +* api-change:``synthetics``: CloudWatch Synthetics has introduced a new feature to provide customers with an option to delete the underlying resources that Synthetics canary creates when the user chooses to delete the canary. +* api-change:``outposts``: This release adds a new API called ListAssets to the Outposts SDK, which lists the hardware assets in an Outpost. + + +1.25.4 +====== + +* api-change:``rds``: Feature - Adds support for Internet Protocol Version 6 (IPv6) on RDS database instances. +* api-change:``codeguru-reviewer``: Amazon CodeGuru Reviewer now supports suppressing recommendations from being generated on specific files and directories. +* api-change:``ssm``: Update the StartChangeRequestExecution, adding TargetMaps to the Runbook parameter +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK nows supports creation of Dolby Vision profile 8.1, the ability to generate black frames of video, and introduces audio-only DASH and CMAF support. +* api-change:``wafv2``: You can now inspect all request headers and all cookies. You can now specify how to handle oversize body contents in your rules that inspect the body. + + +1.25.3 +====== + +* api-change:``auditmanager``: This release adds documentation updates for Audit Manager. We provided examples of how to use the Custom_ prefix for the keywordValue attribute. We also provided more details about the DeleteAssessmentReport operation. +* api-change:``network-firewall``: AWS Network Firewall adds support for stateful threat signature AWS managed rule groups. +* api-change:``ec2``: This release adds support to query the public key and creation date of EC2 Key Pairs. Additionally, the format (pem or ppk) of a key pair can be specified when creating a new key pair. +* api-change:``braket``: This release enables Braket Hybrid Jobs with Embedded Simulators to have multiple instances. +* api-change:``guardduty``: Documentation update for API description. +* api-change:``connect``: This release introduces an API for changing the current agent status of a user in Connect. + + +1.25.2 +====== + +* api-change:``rekognition``: This release adds support to configure stream-processor resources for label detections on streaming-videos. UpateStreamProcessor API is also launched with this release, which could be used to update an existing stream-processor. +* api-change:``cloudtrail``: Increases the retention period maximum to 2557 days. Deprecates unused fields of the ListEventDataStores API response. Updates documentation. +* api-change:``lookoutequipment``: This release adds the following new features: 1) Introduces an option for automatic schema creation 2) Now allows for Ingestion of data containing most common errors and allows automatic data cleaning 3) Introduces new API ListSensorStatistics that gives further information about the ingested data +* api-change:``iotwireless``: Add list support for event configurations, allow to get and update event configurations by resource type, support LoRaWAN events; Make NetworkAnalyzerConfiguration as a resource, add List, Create, Delete API support; Add FCntStart attribute support for ABP WirelessDevice. +* api-change:``amplify``: Documentation only update to support the Amplify GitHub App feature launch +* api-change:``chime-sdk-media-pipelines``: For Amazon Chime SDK meetings, the Amazon Chime Media Pipelines SDK allows builders to capture audio, video, and content share streams. You can also capture meeting events, live transcripts, and data messages. The pipelines save the artifacts to an Amazon S3 bucket that you designate. +* api-change:``sagemaker``: Amazon SageMaker Autopilot adds support for custom validation dataset and validation ratio through the CreateAutoMLJob and DescribeAutoMLJob APIs. + + +1.25.1 +====== + +* api-change:``lightsail``: This release adds support for Lightsail load balancer HTTP to HTTPS redirect and TLS policy configuration. +* api-change:``sagemaker``: SageMaker Inference Recommender now accepts customer KMS key ID for encryption of endpoints and compilation outputs created during inference recommendation. +* api-change:``pricing``: Documentation updates for Price List API +* api-change:``glue``: This release adds documentation for the APIs to create, read, delete, list, and batch read of AWS Glue custom patterns, and for Lake Formation configuration settings in the AWS Glue crawler. +* api-change:``cloudfront``: CloudFront now supports the Server-Timing header in HTTP responses sent from CloudFront. You can use this header to view metrics that help you gain insights about the behavior and performance of CloudFront. To use this header, enable it in a response headers policy. +* api-change:``ivschat``: Adds new APIs for IVS Chat, a feature for building interactive chat experiences alongside an IVS broadcast. +* api-change:``network-firewall``: AWS Network Firewall now enables customers to use a customer managed AWS KMS key for the encryption of their firewall resources. + + +1.25.0 +====== + +* api-change:``gamelift``: Documentation updates for Amazon GameLift. +* api-change:``mq``: This release adds the CRITICAL_ACTION_REQUIRED broker state and the ActionRequired API property. CRITICAL_ACTION_REQUIRED informs you when your broker is degraded. ActionRequired provides you with a code which you can use to find instructions in the Developer Guide on how to resolve the issue. +* feature:IMDS: Added resiliency mechanisms to IMDS Credential Fetcher +* api-change:``securityhub``: Security Hub now lets you opt-out of auto-enabling the defaults standards (CIS and FSBP) in accounts that are auto-enabled with Security Hub via Security Hub's integration with AWS Organizations. +* api-change:``connect``: This release adds SearchUsers API which can be used to search for users with a Connect Instance +* api-change:``rds-data``: Support to receive SQL query results in the form of a simplified JSON string. This enables developers using the new JSON string format to more easily convert it to an object using popular JSON string parsing libraries. + + +1.24.46 +======= + +* api-change:``chime-sdk-meetings``: Include additional exceptions types. +* api-change:``ec2``: Adds support for waiters that automatically poll for a deleted NAT Gateway until it reaches the deleted state. + + +1.24.45 +======= + +* api-change:``wisdom``: This release updates the GetRecommendations API to include a trigger event list for classifying and grouping recommendations. +* api-change:``elasticache``: Doc only update for ElastiCache +* api-change:``iottwinmaker``: General availability (GA) for AWS IoT TwinMaker. For more information, see https://docs.aws.amazon.com/iot-twinmaker/latest/apireference/Welcome.html +* api-change:``secretsmanager``: Documentation updates for Secrets Manager +* api-change:``mediatailor``: This release introduces tiered channels and adds support for live sources. Customers using a STANDARD channel can now create programs using live sources. +* api-change:``storagegateway``: This release adds support for minimum of 5 character length virtual tape barcodes. +* api-change:``lookoutmetrics``: Added DetectMetricSetConfig API for detecting configuration required for creating metric set from provided S3 data source. +* api-change:``iotsitewise``: This release adds 3 new batch data query APIs : BatchGetAssetPropertyValue, BatchGetAssetPropertyValueHistory and BatchGetAssetPropertyAggregates +* api-change:``glue``: This release adds APIs to create, read, delete, list, and batch read of Glue custom entity types + + +1.24.44 +======= + +* api-change:``macie2``: Sensitive data findings in Amazon Macie now indicate how Macie found the sensitive data that produced a finding (originType). +* api-change:``rds``: Added a new cluster-level attribute to set the capacity range for Aurora Serverless v2 instances. +* api-change:``mgn``: Removed required annotation from input fields in Describe operations requests. Added quotaValue to ServiceQuotaExceededException +* api-change:``connect``: This release adds APIs to search, claim, release, list, update, and describe phone numbers. You can also use them to associate and disassociate contact flows to phone numbers. + + +1.24.43 +======= + +* api-change:``textract``: This release adds support for specifying and extracting information from documents using the Queries feature within Analyze Document API +* api-change:``worklink``: Amazon WorkLink is no longer supported. This will be removed in a future version of the SDK. +* api-change:``ssm``: Added offset support for specifying the number of days to wait after the date and time specified by a CRON expression when creating SSM association. +* api-change:``autoscaling``: EC2 Auto Scaling now adds default instance warm-up times for all scaling activities, health check replacements, and other replacement events in the Auto Scaling instance lifecycle. +* api-change:``personalize``: Adding StartRecommender and StopRecommender APIs for Personalize. +* api-change:``kendra``: Amazon Kendra now provides a data source connector for Quip. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-quip.html +* api-change:``polly``: Amazon Polly adds new Austrian German voice - Hannah. Hannah is available as Neural voice only. +* api-change:``transfer``: This release contains corrected HomeDirectoryMappings examples for several API functions: CreateAccess, UpdateAccess, CreateUser, and UpdateUser,. +* api-change:``kms``: Adds support for KMS keys and APIs that generate and verify HMAC codes +* api-change:``redshift``: Introduces new fields for LogDestinationType and LogExports on EnableLogging requests and Enable/Disable/DescribeLogging responses. Customers can now select CloudWatch Logs as a destination for their Audit Logs. + + +1.24.42 +======= + +* api-change:``lightsail``: This release adds support to describe the synchronization status of the account-level block public access feature for your Amazon Lightsail buckets. +* api-change:``rds``: Removes Amazon RDS on VMware with the deletion of APIs related to Custom Availability Zones and Media installation +* api-change:``athena``: This release adds subfields, ErrorMessage, Retryable, to the AthenaError response object in the GetQueryExecution API when a query fails. + + +1.24.41 +======= + +* api-change:``batch``: Enables configuration updates for compute environments with BEST_FIT_PROGRESSIVE and SPOT_CAPACITY_OPTIMIZED allocation strategies. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``appstream``: Includes updates for create and update fleet APIs to manage the session scripts locations for Elastic fleets. +* api-change:``glue``: Auto Scaling for Glue version 3.0 and later jobs to dynamically scale compute resources. This SDK change provides customers with the auto-scaled DPU usage +* api-change:``appflow``: Enables users to pass custom token URL parameters for Oauth2 authentication during create connector profile + + +1.24.40 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``fsx``: This release adds support for deploying FSx for ONTAP file systems in a single Availability Zone. + + +1.24.39 +======= + +* api-change:``ec2``: X2idn and X2iedn instances are powered by 3rd generation Intel Xeon Scalable processors with an all-core turbo frequency up to 3.5 GHzAmazon EC2. C6a instances are powered by 3rd generation AMD EPYC processors. +* api-change:``devops-guru``: This release adds new APIs DeleteInsight to deletes the insight along with the associated anomalies, events and recommendations. +* api-change:``efs``: Update efs client to latest version +* api-change:``iottwinmaker``: This release adds the following new features: 1) ListEntities API now supports search using ExternalId. 2) BatchPutPropertyValue and GetPropertyValueHistory API now allows users to represent time in sub-second level precisions. + + +1.24.38 +======= + +* api-change:``amplifyuibuilder``: In this release, we have added the ability to bind events to component level actions. +* api-change:``apprunner``: This release adds tracing for App Runner services with X-Ray using AWS Distro for OpenTelemetry. New APIs: CreateObservabilityConfiguration, DescribeObservabilityConfiguration, ListObservabilityConfigurations, and DeleteObservabilityConfiguration. Updated APIs: CreateService and UpdateService. +* api-change:``workspaces``: Added API support that allows customers to create GPU-enabled WorkSpaces using EC2 G4dn instances. + + +1.24.37 +======= + +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added support for the pass-through of WebVTT styling to WebVTT outputs, pass-through of KLV metadata to supported formats, and improved filter support for processing 444/RGB content. +* api-change:``wafv2``: Add a new CurrentDefaultVersion field to ListAvailableManagedRuleGroupVersions API response; add a new VersioningSupported boolean to each ManagedRuleGroup returned from ListAvailableManagedRuleGroups API response. +* api-change:``mediapackage-vod``: This release adds ScteMarkersSource as an available field for Dash Packaging Configurations. When set to MANIFEST, MediaPackage will source the SCTE-35 markers from the manifest. When set to SEGMENTS, MediaPackage will source the SCTE-35 markers from the segments. + + +1.24.36 +======= + +* api-change:``apigateway``: ApiGateway CLI command get-usage now includes usagePlanId, startDate, and endDate fields in the output to match documentation. +* api-change:``personalize``: This release provides tagging support in AWS Personalize. +* api-change:``pi``: Adds support for DocumentDB to the Performance Insights API. +* api-change:``events``: Update events client to latest version +* api-change:``docdb``: Added support to enable/disable performance insights when creating or modifying db instances +* api-change:``sagemaker``: Amazon Sagemaker Notebook Instances now supports G5 instance types + + +1.24.35 +======= + +* bugfix:Proxy: Fix failure case for IP proxy addresses using TLS-in-TLS. `boto/botocore#2652 `__ +* api-change:``config``: Add resourceType enums for AWS::EMR::SecurityConfiguration and AWS::SageMaker::CodeRepository +* api-change:``panorama``: Added Brand field to device listings. +* api-change:``lambda``: This release adds new APIs for creating and managing Lambda Function URLs and adds a new FunctionUrlAuthType parameter to the AddPermission API. Customers can use Function URLs to create built-in HTTPS endpoints on their functions. +* api-change:``kendra``: Amazon Kendra now provides a data source connector for Box. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-box.html + + +1.24.34 +======= + +* api-change:``securityhub``: Added additional ASFF details for RdsSecurityGroup AutoScalingGroup, ElbLoadBalancer, CodeBuildProject and RedshiftCluster. +* api-change:``fsx``: Provide customers more visibility into file system status by adding new "Misconfigured Unavailable" status for Amazon FSx for Windows File Server. +* api-change:``s3control``: Documentation-only update for doc bug fixes for the S3 Control API docs. +* api-change:``datasync``: AWS DataSync now supports Amazon FSx for OpenZFS locations. + + +1.24.33 +======= + +* api-change:``iot``: AWS IoT - AWS IoT Device Defender adds support to list metric datapoints collected for IoT devices through the ListMetricValues API +* api-change:``servicecatalog``: This release adds ProvisioningArtifictOutputKeys to DescribeProvisioningParameters to reference the outputs of a Provisioned Product and deprecates ProvisioningArtifactOutputs. +* api-change:``sms``: Revised product update notice for SMS console deprecation. +* api-change:``proton``: SDK release to support tagging for AWS Proton Repository resource +* enhancement:AWSCRT: Upgrade awscrt version to 0.13.8 + + +1.24.32 +======= + +* api-change:``connect``: This release updates these APIs: UpdateInstanceAttribute, DescribeInstanceAttribute and ListInstanceAttributes. You can use it to programmatically enable/disable multi-party conferencing using attribute type MULTI_PARTY_CONFERENCING on the specified Amazon Connect instance. + + +1.24.31 +======= + +* api-change:``cloudcontrol``: SDK release for Cloud Control API in Amazon Web Services China (Beijing) Region, operated by Sinnet, and Amazon Web Services China (Ningxia) Region, operated by NWCD +* api-change:``pinpoint-sms-voice-v2``: Amazon Pinpoint now offers a version 2.0 suite of SMS and voice APIs, providing increased control over sending and configuration. This release is a new SDK for sending SMS and voice messages called PinpointSMSVoiceV2. +* api-change:``workspaces``: Added APIs that allow you to customize the logo, login message, and help links in the WorkSpaces client login page. To learn more, visit https://docs.aws.amazon.com/workspaces/latest/adminguide/customize-branding.html +* api-change:``route53-recovery-cluster``: This release adds a new API "ListRoutingControls" to list routing control states using the highly reliable Route 53 ARC data plane endpoints. +* api-change:``databrew``: This AWS Glue Databrew release adds feature to support ORC as an input format. +* api-change:``auditmanager``: This release adds documentation updates for Audit Manager. The updates provide data deletion guidance when a customer deregisters Audit Manager or deregisters a delegated administrator. +* api-change:``grafana``: This release adds tagging support to the Managed Grafana service. New APIs: TagResource, UntagResource and ListTagsForResource. Updates: add optional field tags to support tagging while calling CreateWorkspace. + + +1.24.30 +======= + +* api-change:``iot-data``: Update the default AWS IoT Core Data Plane endpoint from VeriSign signed to ATS signed. If you have firewalls with strict egress rules, configure the rules to grant you access to data-ats.iot.[region].amazonaws.com or data-ats.iot.[region].amazonaws.com.cn. +* api-change:``ec2``: This release simplifies the auto-recovery configuration process enabling customers to set the recovery behavior to disabled or default +* api-change:``fms``: AWS Firewall Manager now supports the configuration of third-party policies that can use either the centralized or distributed deployment models. +* api-change:``fsx``: This release adds support for modifying throughput capacity for FSx for ONTAP file systems. +* api-change:``iot``: Doc only update for IoT that fixes customer-reported issues. + + +1.24.29 +======= + +* api-change:``organizations``: This release provides the new CloseAccount API that enables principals in the management account to close any member account within an organization. + + +1.24.28 +======= + +* api-change:``medialive``: This release adds support for selecting a maintenance window. +* api-change:``acm-pca``: Updating service name entities + + +1.24.27 +======= + +* api-change:``ec2``: This is release adds support for Amazon VPC Reachability Analyzer to analyze path through a Transit Gateway. +* api-change:``ssm``: This Patch Manager release supports creating, updating, and deleting Patch Baselines for Rocky Linux OS. +* api-change:``batch``: Bug Fix: Fixed a bug where shapes were marked as unboxed and were not serialized and sent over the wire, causing an API error from the service. + + +1.24.26 +======= + +* api-change:``lambda``: Adds support for increased ephemeral storage (/tmp) up to 10GB for Lambda functions. Customers can now provision up to 10 GB of ephemeral storage per function instance, a 20x increase over the previous limit of 512 MB. +* api-change:``config``: Added new APIs GetCustomRulePolicy and GetOrganizationCustomRulePolicy, and updated existing APIs PutConfigRule, DescribeConfigRule, DescribeConfigRuleEvaluationStatus, PutOrganizationConfigRule, DescribeConfigRule to support a new feature for building AWS Config rules with AWS CloudFormation Guard +* api-change:``transcribe``: This release adds an additional parameter for subtitling with Amazon Transcribe batch jobs: outputStartIndex. + + +1.24.25 +======= + +* api-change:``redshift``: This release adds a new [--encrypted | --no-encrypted] field in restore-from-cluster-snapshot API. Customers can now restore an unencrypted snapshot to a cluster encrypted with AWS Managed Key or their own KMS key. +* api-change:``ebs``: Increased the maximum supported value for the Timeout parameter of the StartSnapshot API from 60 minutes to 4320 minutes. Changed the HTTP error code for ConflictException from 503 to 409. +* api-change:``gamesparks``: Released the preview of Amazon GameSparks, a fully managed AWS service that provides a multi-service backend for game developers. +* api-change:``elasticache``: Doc only update for ElastiCache +* api-change:``transfer``: Documentation updates for AWS Transfer Family to describe how to remove an associated workflow from a server. +* api-change:``auditmanager``: This release updates 1 API parameter, the SnsArn attribute. The character length and regex pattern for the SnsArn attribute have been updated, which enables you to deselect an SNS topic when using the UpdateSettings operation. +* api-change:``ssm``: Update AddTagsToResource, ListTagsForResource, and RemoveTagsFromResource APIs to reflect the support for tagging Automation resources. Includes other minor documentation updates. + + +1.24.24 +======= + +* api-change:``location``: Amazon Location Service now includes a MaxResults parameter for GetDevicePositionHistory requests. +* api-change:``polly``: Amazon Polly adds new Catalan voice - Arlet. Arlet is available as Neural voice only. +* api-change:``lakeformation``: The release fixes the incorrect permissions called out in the documentation - DESCRIBE_TAG, ASSOCIATE_TAG, DELETE_TAG, ALTER_TAG. This trebuchet release fixes the corresponding SDK and documentation. +* api-change:``ecs``: Documentation only update to address tickets +* api-change:``ce``: Added three new APIs to support tagging and resource-level authorization on Cost Explorer resources: TagResource, UntagResource, ListTagsForResource. Added optional parameters to CreateCostCategoryDefinition, CreateAnomalySubscription and CreateAnomalyMonitor APIs to support Tag On Create. + + +1.24.23 +======= + +* api-change:``ram``: Document improvements to the RAM API operations and parameter descriptions. +* api-change:``ecr``: This release includes a fix in the DescribeImageScanFindings paginated output. +* api-change:``quicksight``: AWS QuickSight Service Features - Expand public API support for group management. +* api-change:``chime-sdk-meetings``: Add support for media replication to link multiple WebRTC media sessions together to reach larger and global audiences. Participants connected to a replica session can be granted access to join the primary session and can switch sessions with their existing WebRTC connection +* api-change:``mediaconnect``: This release adds support for selecting a maintenance window. + + +1.24.22 +======= + +* enhancement:jmespath: Add env markers to get working version of jmespath for python 3.6 +* api-change:``glue``: Added 9 new APIs for AWS Glue Interactive Sessions: ListSessions, StopSession, CreateSession, GetSession, DeleteSession, RunStatement, GetStatement, ListStatements, CancelStatement + + +1.24.21 +======= + +* enhancement:Dependency: Added support for jmespath 1.0 +* api-change:``amplifybackend``: Adding the ability to customize Cognito verification messages for email and SMS in CreateBackendAuth and UpdateBackendAuth. Adding deprecation documentation for ForgotPassword in CreateBackendAuth and UpdateBackendAuth +* api-change:``acm-pca``: AWS Certificate Manager (ACM) Private Certificate Authority (CA) now supports customizable certificate subject names and extensions. +* api-change:``ssm-incidents``: Removed incorrect validation pattern for IncidentRecordSource.invokedBy +* api-change:``billingconductor``: This is the initial SDK release for AWS Billing Conductor. The AWS Billing Conductor is a customizable billing service, allowing you to customize your billing data to match your desired business structure. +* api-change:``s3outposts``: S3 on Outposts is releasing a new API, ListSharedEndpoints, that lists all endpoints associated with S3 on Outpost, that has been shared by Resource Access Manager (RAM). + + +1.24.20 +======= + +* api-change:``robomaker``: This release deprecates ROS, Ubuntu and Gazbeo from RoboMaker Simulation Service Software Suites in favor of user-supplied containers and Relaxed Software Suites. +* api-change:``dataexchange``: This feature enables data providers to use the RevokeRevision operation to revoke subscriber access to a given revision. Subscribers are unable to interact with assets within a revoked revision. +* api-change:``ec2``: Adds the Cascade parameter to the DeleteIpam API. Customers can use this parameter to automatically delete their IPAM, including non-default scopes, pools, cidrs, and allocations. There mustn't be any pools provisioned in the default public scope to use this parameter. +* api-change:``cognito-idp``: Updated EmailConfigurationType and SmsConfigurationType to reflect that you can now choose Amazon SES and Amazon SNS resources in the same Region. +* enhancement:AWSCRT: Upgrade awscrt extra to 0.13.5 +* api-change:``location``: New HERE style "VectorHereExplore" and "VectorHereExploreTruck". +* api-change:``ecs``: Documentation only update to address tickets +* api-change:``keyspaces``: Fixing formatting issues in CLI and SDK documentation +* api-change:``rds``: Various documentation improvements + + +1.24.19 +======= + +* api-change:``kendra``: Amazon Kendra now provides a data source connector for Slack. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-slack.html +* api-change:``timestream-query``: Amazon Timestream Scheduled Queries now support Timestamp datatype in a multi-measure record. +* enhancement:Stubber: Added support for modeled exception fields when adding errors to a client stub. Implements boto/boto3`#3178 `__. +* api-change:``elasticache``: Doc only update for ElastiCache +* api-change:``config``: Add resourceType enums for AWS::ECR::PublicRepository and AWS::EC2::LaunchTemplate + + +1.24.18 +======= + +* api-change:``outposts``: This release adds address filters for listSites +* api-change:``lambda``: Adds PrincipalOrgID support to AddPermission API. Customers can use it to manage permissions to lambda functions at AWS Organizations level. +* api-change:``secretsmanager``: Documentation updates for Secrets Manager. +* api-change:``connect``: This release adds support for enabling Rich Messaging when starting a new chat session via the StartChatContact API. Rich Messaging enables the following formatting options: bold, italics, hyperlinks, bulleted lists, and numbered lists. +* api-change:``chime``: Chime VoiceConnector Logging APIs will now support MediaMetricLogs. Also CreateMeetingDialOut now returns AccessDeniedException. + + +1.24.17 +======= + +* api-change:``transcribe``: Documentation fix for API `StartMedicalTranscriptionJobRequest`, now showing min sample rate as 16khz +* api-change:``transfer``: Adding more descriptive error types for managed workflows +* api-change:``lexv2-models``: Update lexv2-models client to latest version + + +1.24.16 +======= + +* api-change:``comprehend``: Amazon Comprehend now supports extracting the sentiment associated with entities such as brands, products and services from text documents. + + +1.24.15 +======= + +* api-change:``eks``: Introducing a new enum for NodeGroup error code: Ec2SubnetMissingIpv6Assignment +* api-change:``keyspaces``: Adding link to CloudTrail section in Amazon Keyspaces Developer Guide +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added support for reading timecode from AVCHD sources and now provides the ability to segment WebVTT at the same interval as the video and audio in HLS packages. + + +1.24.14 +======= + +* api-change:``chime-sdk-meetings``: Adds support for Transcribe language identification feature to the StartMeetingTranscription API. +* api-change:``ecs``: Amazon ECS UpdateService API now supports additional parameters: loadBalancers, propagateTags, enableECSManagedTags, and serviceRegistries +* api-change:``migration-hub-refactor-spaces``: AWS Migration Hub Refactor Spaces documentation update. + + +1.24.13 +======= + +* api-change:``synthetics``: Allow custom handler function. +* api-change:``transfer``: Add waiters for server online and offline. +* api-change:``devops-guru``: Amazon DevOps Guru now integrates with Amazon CodeGuru Profiler. You can view CodeGuru Profiler recommendations for your AWS Lambda function in DevOps Guru. This feature is enabled by default for new customers as of 3/4/2022. Existing customers can enable this feature with UpdateEventSourcesConfig. +* api-change:``macie``: Amazon Macie Classic (macie) has been discontinued and is no longer available. A new Amazon Macie (macie2) is now available with significant design improvements and additional features. +* api-change:``ec2``: Documentation updates for Amazon EC2. +* api-change:``sts``: Documentation updates for AWS Security Token Service. +* api-change:``connect``: This release updates the *InstanceStorageConfig APIs so they support a new ResourceType: REAL_TIME_CONTACT_ANALYSIS_SEGMENTS. Use this resource type to enable streaming for real-time contact analysis and to associate the Kinesis stream where real-time contact analysis segments will be published. + + +1.24.12 +======= + +* api-change:``greengrassv2``: Doc only update that clarifies Create Deployment section. +* api-change:``fsx``: This release adds support for data repository associations to use root ("/") as the file system path +* api-change:``kendra``: Amazon Kendra now suggests spell corrections for a query. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/query-spell-check.html +* api-change:``appflow``: Launching Amazon AppFlow Marketo as a destination connector SDK. +* api-change:``timestream-query``: Documentation only update for SDK and CLI + + +1.24.11 +======= + +* api-change:``gamelift``: Minor updates to address errors. +* api-change:``cloudtrail``: Add bytesScanned field into responses of DescribeQuery and GetQueryResults. +* api-change:``athena``: This release adds support for S3 Object Ownership by allowing the S3 bucket owner full control canned ACL to be set when Athena writes query results to S3 buckets. +* api-change:``keyspaces``: This release adds support for data definition language (DDL) operations +* api-change:``ecr``: This release adds support for tracking images lastRecordedPullTime. + + +1.24.10 +======= + +* api-change:``mediapackage``: This release adds Hybridcast as an available profile option for Dash Origin Endpoints. +* api-change:``rds``: Documentation updates for Multi-AZ DB clusters. +* api-change:``mgn``: Add support for GP3 and IO2 volume types. Add bootMode to LaunchConfiguration object (and as a parameter to UpdateLaunchConfigurationRequest). +* api-change:``kafkaconnect``: Adds operation for custom plugin deletion (DeleteCustomPlugin) and adds new StateDescription field to DescribeCustomPlugin and DescribeConnector responses to return errors from asynchronous resource creation. + + +1.24.9 +====== + +* api-change:``finspace-data``: Add new APIs for managing Users and Permission Groups. +* api-change:``amplify``: Add repositoryCloneMethod field for hosting an Amplify app. This field shows what authorization method is used to clone the repo: SSH, TOKEN, or SIGV4. +* api-change:``fsx``: This release adds support for the following FSx for OpenZFS features: snapshot lifecycle transition messages, force flag for deleting file systems with child resources, LZ4 data compression, custom record sizes, and unsetting volume quotas and reservations. +* api-change:``fis``: This release adds logging support for AWS Fault Injection Simulator experiments. Experiment templates can now be configured to send experiment activity logs to Amazon CloudWatch Logs or to an S3 bucket. +* api-change:``route53-recovery-cluster``: This release adds a new API option to enable overriding safety rules to allow routing control state updates. +* api-change:``amplifyuibuilder``: We are adding the ability to configure workflows and actions for components. +* api-change:``athena``: This release adds support for updating an existing named query. +* api-change:``ec2``: This release adds support for new AMI property 'lastLaunchedTime' +* api-change:``servicecatalog-appregistry``: AppRegistry is deprecating Application and Attribute-Group Name update feature. In this release, we are marking the name attributes for Update APIs as deprecated to give a heads up to our customers. + + +1.24.8 +====== + +* api-change:``elasticache``: Doc only update for ElastiCache +* api-change:``panorama``: Added NTP server configuration parameter to ProvisionDevice operation. Added alternate software fields to DescribeDevice response + + +1.24.7 +====== + +* api-change:``route53``: SDK doc update for Route 53 to update some parameters with new information. +* api-change:``databrew``: This AWS Glue Databrew release adds feature to merge job outputs into a max number of files for S3 File output type. +* api-change:``transfer``: Support automatic pagination when listing AWS Transfer Family resources. +* api-change:``s3control``: Amazon S3 Batch Operations adds support for new integrity checking capabilities in Amazon S3. +* api-change:``s3``: This release adds support for new integrity checking capabilities in Amazon S3. You can choose from four supported checksum algorithms for data integrity checking on your upload and download requests. In addition, AWS SDK can automatically calculate a checksum as it streams data into S3 +* api-change:``fms``: AWS Firewall Manager now supports the configuration of AWS Network Firewall policies with either centralized or distributed deployment models. This release also adds support for custom endpoint configuration, where you can choose which Availability Zones to create firewall endpoints in. +* api-change:``lightsail``: This release adds support to delete and create Lightsail default key pairs that you can use with Lightsail instances. +* api-change:``autoscaling``: You can now hibernate instances in a warm pool to stop instances without deleting their RAM contents. You can now also return instances to the warm pool on scale in, instead of always terminating capacity that you will need later. + + +1.24.6 +====== + +* api-change:``transfer``: The file input selection feature provides the ability to use either the originally uploaded file or the output file from the previous workflow step, enabling customers to make multiple copies of the original file while keeping the source file intact for file archival. +* api-change:``lambda``: Lambda releases .NET 6 managed runtime to be available in all commercial regions. +* api-change:``textract``: Added support for merged cells and column header for table response. + + +1.24.5 +====== + +* api-change:``translate``: This release enables customers to use translation settings for formality customization in their synchronous translation output. +* api-change:``wafv2``: Updated descriptions for logging configuration. +* api-change:``apprunner``: AWS App Runner adds a Java platform (Corretto 8, Corretto 11 runtimes) and a Node.js 14 runtime. + + +1.24.4 +====== + +* api-change:``imagebuilder``: This release adds support to enable faster launching for Windows AMIs created by EC2 Image Builder. +* api-change:``customer-profiles``: This release introduces apis CreateIntegrationWorkflow, DeleteWorkflow, ListWorkflows, GetWorkflow and GetWorkflowSteps. These apis are used to manage and view integration workflows. +* api-change:``dynamodb``: DynamoDB ExecuteStatement API now supports Limit as a request parameter to specify the maximum number of items to evaluate. If specified, the service will process up to the Limit and the results will include a LastEvaluatedKey value to continue the read in a subsequent operation. + + +1.24.3 +====== + +* api-change:``transfer``: Properties for Transfer Family used with SFTP, FTP, and FTPS protocols. Display Banners are bodies of text that can be displayed before and/or after a user authenticates onto a server using one of the previously mentioned protocols. +* api-change:``gamelift``: Increase string list limit from 10 to 100. +* api-change:``budgets``: This change introduces DescribeBudgetNotificationsForAccount API which returns budget notifications for the specified account + + +1.24.2 +====== + +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``redshift``: SDK release for Cross region datasharing and cost-control for cross region datasharing +* api-change:``evidently``: Add support for filtering list of experiments and launches by status +* api-change:``backup``: AWS Backup add new S3_BACKUP_OBJECT_FAILED and S3_RESTORE_OBJECT_FAILED event types in BackupVaultNotifications events list. + + +1.24.1 +====== + +* api-change:``ec2``: Documentation updates for EC2. +* api-change:``budgets``: Adds support for auto-adjusting budgets, a new budget method alongside fixed and planned. Auto-adjusting budgets introduces new metadata to configure a budget limit baseline using a historical lookback average or current period forecast. +* api-change:``ce``: AWS Cost Anomaly Detection now supports SNS FIFO topic subscribers. +* api-change:``glue``: Support for optimistic locking in UpdateTable +* api-change:``ssm``: Assorted ticket fixes and updates for AWS Systems Manager. + + +1.24.0 +====== + +* api-change:``appflow``: Launching Amazon AppFlow SAP as a destination connector SDK. +* feature:Parser: Adding support for parsing int/long types in rest-json response headers. +* api-change:``rds``: Adds support for determining which Aurora PostgreSQL versions support Babelfish. +* api-change:``athena``: This release adds a subfield, ErrorType, to the AthenaError response object in the GetQueryExecution API when a query fails. + + +1.23.54 +======= + +* api-change:``ssm``: Documentation updates for AWS Systems Manager. + + +1.23.53 +======= + +* api-change:``cloudformation``: This SDK release adds AWS CloudFormation Hooks HandlerErrorCodes +* api-change:``lookoutvision``: This release makes CompilerOptions in Lookout for Vision's StartModelPackagingJob's Configuration object optional. +* api-change:``pinpoint``: This SDK release adds a new paramater creation date for GetApp and GetApps Api call +* api-change:``sns``: Customer requested typo fix in API documentation. +* api-change:``wafv2``: Adds support for AWS WAF Fraud Control account takeover prevention (ATP), with configuration options for the new managed rule group AWSManagedRulesATPRuleSet and support for application integration SDKs for Android and iOS mobile apps. + + +1.23.52 +======= + +* api-change:``cloudformation``: This SDK release is for the feature launch of AWS CloudFormation Hooks. + + +1.23.51 +======= + +* api-change:``kendra``: Amazon Kendra now provides a data source connector for Amazon FSx. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-fsx.html +* api-change:``apprunner``: This release adds support for App Runner to route outbound network traffic of a service through an Amazon VPC. New API: CreateVpcConnector, DescribeVpcConnector, ListVpcConnectors, and DeleteVpcConnector. Updated API: CreateService, DescribeService, and UpdateService. +* api-change:``s3control``: This release adds support for S3 Batch Replication. Batch Replication lets you replicate existing objects, already replicated objects to new destinations, and objects that previously failed to replicate. Customers will receive object-level visibility of progress and a detailed completion report. +* api-change:``sagemaker``: Autopilot now generates an additional report with information on the performance of the best model, such as a Confusion matrix and Area under the receiver operating characteristic (AUC-ROC). The path to the report can be found in CandidateArtifactLocations. + + +1.23.50 +======= + +* api-change:``auditmanager``: This release updates 3 API parameters. UpdateAssessmentFrameworkControlSet now requires the controls attribute, and CreateAssessmentFrameworkControl requires the id attribute. Additionally, UpdateAssessmentFramework now has a minimum length constraint for the controlSets attribute. +* api-change:``synthetics``: Adding names parameters to the Describe APIs. +* api-change:``ssm-incidents``: Update RelatedItem enum to support SSM Automation +* api-change:``events``: Update events client to latest version +* enhancement:Lambda Request Header: Adding request header for Lambda recursion detection. + + +1.23.49 +======= + +* api-change:``athena``: You can now optionally specify the account ID that you expect to be the owner of your query results output location bucket in Athena. If the account ID of the query results bucket owner does not match the specified account ID, attempts to output to the bucket will fail with an S3 permissions error. +* api-change:``rds``: updates for RDS Custom for Oracle 12.1 support +* api-change:``lakeformation``: Add support for calling Update Table Objects without a TransactionId. + + +1.23.48 +======= + +* api-change:``ec2``: adds support for AMIs in Recycle Bin +* api-change:``robomaker``: The release deprecates the use various APIs of RoboMaker Deployment Service in favor of AWS IoT GreenGrass v2.0. +* api-change:``meteringmarketplace``: Add CustomerAWSAccountId to ResolveCustomer API response and increase UsageAllocation limit to 2500. +* api-change:``rbin``: Add EC2 Image recycle bin support. + + +1.23.47 +======= + +* api-change:``emr``: Update emr client to latest version +* api-change:``personalize``: Adding minRecommendationRequestsPerSecond attribute to recommender APIs. +* enhancement:Request headers: Adding request headers with retry information. +* api-change:``appflow``: Launching Amazon AppFlow Custom Connector SDK. +* api-change:``dynamodb``: Documentation update for DynamoDB Java SDK. +* api-change:``iot``: This release adds support for configuring AWS IoT logging level per client ID, source IP, or principal ID. +* api-change:``comprehend``: Amazon Comprehend now supports sharing and importing custom trained models from one AWS account to another within the same region. +* api-change:``ce``: Doc-only update for Cost Explorer API that adds INVOICING_ENTITY dimensions +* api-change:``fis``: Added GetTargetResourceType and ListTargetResourceTypesAPI actions. These actions return additional details about resource types and parameters that can be targeted by FIS actions. Added a parameters field for the targets that can be specified in experiment templates. +* api-change:``es``: Allows customers to get progress updates for blue/green deployments +* api-change:``glue``: Launch Protobuf support for AWS Glue Schema Registry +* api-change:``elasticache``: Documentation update for AWS ElastiCache + + +1.23.46 +======= + +* api-change:``appconfigdata``: Documentation updates for AWS AppConfig Data. +* api-change:``athena``: This release adds a field, AthenaError, to the GetQueryExecution response object when a query fails. +* api-change:``appconfig``: Documentation updates for AWS AppConfig +* api-change:``cognito-idp``: Doc updates for Cognito user pools API Reference. +* api-change:``secretsmanager``: Feature are ready to release on Jan 28th +* api-change:``sagemaker``: This release added a new NNA accelerator compilation support for Sagemaker Neo. + + +1.23.45 +======= + +* api-change:``ec2``: X2ezn instances are powered by Intel Cascade Lake CPUs that deliver turbo all core frequency of up to 4.5 GHz and up to 100 Gbps of networking bandwidth +* api-change:``kafka``: Amazon MSK has updated the CreateCluster and UpdateBrokerStorage API that allows you to specify volume throughput during cluster creation and broker volume updates. +* api-change:``connect``: This release adds support for configuring a custom chat duration when starting a new chat session via the StartChatContact API. The default value for chat duration is 25 hours, minimum configurable value is 1 hour (60 minutes) and maximum configurable value is 7 days (10,080 minutes). +* api-change:``amplify``: Doc only update to the description of basicauthcredentials to describe the required encoding and format. +* api-change:``opensearch``: Allows customers to get progress updates for blue/green deployments + + +1.23.44 +======= + +* api-change:``frauddetector``: Added new APIs for viewing past predictions and obtaining prediction metadata including prediction explanations: ListEventPredictions and GetEventPredictionMetadata +* api-change:``ebs``: Documentation updates for Amazon EBS Direct APIs. +* api-change:``codeguru-reviewer``: Added failure state and adjusted timeout in waiter +* api-change:``securityhub``: Adding top level Sample boolean field +* api-change:``sagemaker``: API changes relating to Fail steps in model building pipeline and add PipelineExecutionFailureReason in PipelineExecutionSummary. + + +1.23.43 +======= + +* api-change:``fsx``: This release adds support for growing SSD storage capacity and growing/shrinking SSD IOPS for FSx for ONTAP file systems. +* api-change:``efs``: Update efs client to latest version +* api-change:``connect``: This release adds support for custom vocabularies to be used with Contact Lens. Custom vocabularies improve transcription accuracy for one or more specific words. +* api-change:``guardduty``: Amazon GuardDuty expands threat detection coverage to protect Amazon Elastic Kubernetes Service (EKS) workloads. + + +1.23.42 +======= + +* api-change:``route53-recovery-readiness``: Updated documentation for Route53 Recovery Readiness APIs. + + +1.23.41 +======= + +* enhancement:Exceptions: ProxyConnectionError previously provided the full proxy URL. User info will now be appropriately masked if needed. +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added support for 4K AV1 output resolutions & 10-bit AV1 color, the ability to ingest sidecar Dolby Vision XML metadata files, and the ability to flag WebVTT and IMSC tracks for accessibility in HLS. +* api-change:``transcribe``: Add support for granular PIIEntityTypes when using Batch ContentRedaction. + + +1.23.40 +======= + +* api-change:``guardduty``: Amazon GuardDuty findings now include remoteAccountDetails under AwsApiCallAction section if instance credential is exfiltrated. +* api-change:``connect``: This release adds tagging support for UserHierarchyGroups resource. +* api-change:``mediatailor``: This release adds support for multiple Segment Delivery Configurations. Users can provide a list of names and URLs when creating or editing a source location. When retrieving content, users can send a header to choose which URL should be used to serve content. +* api-change:``fis``: Added action startTime and action endTime timestamp fields to the ExperimentAction object +* api-change:``ec2``: C6i, M6i and R6i instances are powered by a third-generation Intel Xeon Scalable processor (Ice Lake) delivering all-core turbo frequency of 3.5 GHz + + +1.23.39 +======= + +* api-change:``macie2``: This release of the Amazon Macie API introduces stricter validation of requests to create custom data identifiers. +* api-change:``ec2-instance-connect``: Adds support for ED25519 keys. PushSSHPublicKey Availability Zone parameter is now optional. Adds EC2InstanceStateInvalidException for instances that are not running. This was previously a service exception, so this may require updating your code to handle this new exception. + + +1.23.38 +======= + +* api-change:``ivs``: This release adds support for the new Thumbnail Configuration property for Recording Configurations. For more information see https://docs.aws.amazon.com/ivs/latest/userguide/record-to-s3.html +* api-change:``storagegateway``: Documentation update for adding bandwidth throttling support for S3 File Gateways. +* api-change:``location``: This release adds the CalculateRouteMatrix API which calculates routes for the provided departure and destination positions. The release also deprecates the use of pricing plan across all verticals. +* api-change:``cloudtrail``: This release fixes a documentation bug in the description for the readOnly field selector in advanced event selectors. The description now clarifies that users omit the readOnly field selector to select both Read and Write management events. +* api-change:``ec2``: Add support for AWS Client VPN client login banner and session timeout. + + +1.23.37 +======= + +* enhancement:Configuration: Adding support for `defaults_mode` configuration. The `defaults_mode` will be used to determine how certain default configuration options are resolved in the SDK. + + +1.23.36 +======= + +* api-change:``config``: Update ResourceType enum with values for CodeDeploy, EC2 and Kinesis resources +* api-change:``application-insights``: Application Insights support for Active Directory and SharePoint +* api-change:``honeycode``: Added read and write api support for multi-select picklist. And added errorcode field to DescribeTableDataImportJob API output, when import job fails. +* api-change:``ram``: This release adds the ListPermissionVersions API which lists the versions for a given permission. +* api-change:``lookoutmetrics``: This release adds a new DeactivateAnomalyDetector API operation. + + +1.23.35 +======= + +* api-change:``pinpoint``: Adds JourneyChannelSettings to WriteJourneyRequest +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``nimble``: Amazon Nimble Studio now supports validation for Launch Profiles. Launch Profiles now report static validation results after create/update to detect errors in network or active directory configuration. +* api-change:``glue``: This SDK release adds support to pass run properties when starting a workflow run +* api-change:``ssm``: AWS Systems Manager adds category support for DescribeDocument API +* api-change:``elasticache``: AWS ElastiCache for Redis has added a new Engine Log LogType in LogDelivery feature. You can now publish the Engine Log from your Amazon ElastiCache for Redis clusters to Amazon CloudWatch Logs and Amazon Kinesis Data Firehose. + + +1.23.34 +======= + +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``elasticache``: Doc only update for ElastiCache +* api-change:``honeycode``: Honeycode is releasing new APIs to allow user to create, delete and list tags on resources. +* api-change:``ec2``: Hpc6a instances are powered by a third-generation AMD EPYC processors (Milan) delivering all-core turbo frequency of 3.4 GHz +* api-change:``fms``: Shield Advanced policies for Amazon CloudFront resources now support automatic application layer DDoS mitigation. The max length for SecurityServicePolicyData ManagedServiceData is now 8192 characters, instead of 4096. +* api-change:``pi``: This release adds three Performance Insights APIs. Use ListAvailableResourceMetrics to get available metrics, GetResourceMetadata to get feature metadata, and ListAvailableResourceDimensions to list available dimensions. The AdditionalMetrics field in DescribeDimensionKeys retrieves per-SQL metrics. + + +1.23.33 +======= + +* api-change:``finspace-data``: Documentation updates for FinSpace. +* api-change:``rds``: This release adds the db-proxy event type to support subscribing to RDS Proxy events. +* api-change:``ce``: Doc only update for Cost Explorer API that fixes missing clarifications for MatchOptions definitions +* api-change:``kendra``: Amazon Kendra now supports advanced query language and query-less search. +* api-change:``workspaces``: Introducing new APIs for Workspaces audio optimization with Amazon Connect: CreateConnectClientAddIn, DescribeConnectClientAddIns, UpdateConnectClientAddIn and DeleteConnectClientAddIn. +* api-change:``iotevents-data``: This release provides documentation updates for Timer.timestamp in the IoT Events API Reference Guide. +* api-change:``ec2``: EC2 Capacity Reservations now supports RHEL instance platforms (RHEL with SQL Server Standard, RHEL with SQL Server Enterprise, RHEL with SQL Server Web, RHEL with HA, RHEL with HA and SQL Server Standard, RHEL with HA and SQL Server Enterprise) + + +1.23.32 +======= + +* api-change:``ec2``: New feature: Updated EC2 API to support faster launching for Windows images. Optimized images are pre-provisioned, using snapshots to launch instances up to 65% faster. +* api-change:``compute-optimizer``: Adds support for new Compute Optimizer capability that makes it easier for customers to optimize their EC2 instances by leveraging multiple CPU architectures. +* api-change:``lookoutmetrics``: This release adds FailureType in the response of DescribeAnomalyDetector. +* api-change:``databrew``: This SDK release adds support for specifying a Bucket Owner for an S3 location. +* api-change:``transcribe``: Documentation updates for Amazon Transcribe. + + +1.23.31 +======= + +* api-change:``medialive``: This release adds support for selecting the Program Date Time (PDT) Clock source algorithm for HLS outputs. + + +1.23.30 +======= + +* api-change:``ec2``: This release introduces On-Demand Capacity Reservation support for Cluster Placement Groups, adds Tags on instance Metadata, and includes documentation updates for Amazon EC2. +* api-change:``mediatailor``: This release adds support for filler slate when updating MediaTailor channels that use the linear playback mode. +* api-change:``opensearch``: Amazon OpenSearch Service adds support for Fine Grained Access Control for existing domains running Elasticsearch version 6.7 and above +* api-change:``iotwireless``: Downlink Queue Management feature provides APIs for customers to manage the queued messages destined to device inside AWS IoT Core for LoRaWAN. Customer can view, delete or purge the queued message(s). It allows customer to preempt the queued messages and let more urgent messages go through. +* api-change:``es``: Amazon OpenSearch Service adds support for Fine Grained Access Control for existing domains running Elasticsearch version 6.7 and above +* api-change:``mwaa``: This release adds a "Source" field that provides the initiator of an update, such as due to an automated patch from AWS or due to modification via Console or API. +* api-change:``appsync``: AppSync: AWS AppSync now supports configurable batching sizes for AWS Lambda resolvers, Direct AWS Lambda resolvers and pipeline functions + + +1.23.29 +======= + +* api-change:``cloudtrail``: This release adds support for CloudTrail Lake, a new feature that lets you run SQL-based queries on events that you have aggregated into event data stores. New APIs have been added for creating and managing event data stores, and creating, running, and managing queries in CloudTrail Lake. +* api-change:``iot``: This release adds an automatic retry mechanism for AWS IoT Jobs. You can now define a maximum number of retries for each Job rollout, along with the criteria to trigger the retry for FAILED/TIMED_OUT/ALL(both FAILED an TIMED_OUT) job. +* api-change:``ec2``: This release adds a new API called ModifyVpcEndpointServicePayerResponsibility which allows VPC endpoint service owners to take payer responsibility of their VPC Endpoint connections. +* api-change:``snowball``: Updating validation rules for interfaces used in the Snowball API to tighten security of service. +* api-change:``lakeformation``: Add new APIs for 3rd Party Support for Lake Formation +* api-change:``appstream``: Includes APIs for App Entitlement management regarding entitlement and entitled application association. +* api-change:``eks``: Amazon EKS now supports running applications using IPv6 address space +* api-change:``quicksight``: Multiple Doc-only updates for Amazon QuickSight. +* api-change:``ecs``: Documentation update for ticket fixes. +* api-change:``sagemaker``: Amazon SageMaker now supports running training jobs on ml.g5 instance types. +* api-change:``glue``: Add Delta Lake target support for Glue Crawler and 3rd Party Support for Lake Formation + + +1.23.28 +======= + +* api-change:``rekognition``: This release introduces a new field IndexFacesModelVersion, which is the version of the face detect and storage model that was used when indexing the face vector. +* api-change:``s3``: Minor doc-based updates based on feedback bugs received. +* enhancement:JSONFileCache: Add support for __delitem__ in JSONFileCache +* api-change:``s3control``: Documentation updates for the renaming of Glacier to Glacier Flexible Retrieval. + + +1.23.27 +======= + +* api-change:``sagemaker``: The release allows users to pass pipeline definitions as Amazon S3 locations and control the pipeline execution concurrency using ParallelismConfiguration. It also adds support of EMR jobs as pipeline steps. +* api-change:``rds``: Multiple doc-only updates for Relational Database Service (RDS) +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added strength levels to the Sharpness Filter and now permits OGG files to be specified as sidecar audio inputs. +* api-change:``greengrassv2``: This release adds the API operations to manage the Greengrass role associated with your account and to manage the core device connectivity information. Greengrass V2 customers can now depend solely on Greengrass V2 SDK for all the API operations needed to manage their fleets. +* api-change:``detective``: Added and updated API operations to support the Detective integration with AWS Organizations. New actions are used to manage the delegated administrator account and the integration configuration. + + +1.23.26 +======= + +* api-change:``nimble``: Amazon Nimble Studio adds support for users to upload files during a streaming session using NICE DCV native client or browser. +* api-change:``chime-sdk-messaging``: The Amazon Chime SDK now supports updating message attributes via channel flows +* api-change:``imagebuilder``: Added a note to infrastructure configuration actions and data types concerning delivery of Image Builder event messages to encrypted SNS topics. The key that's used to encrypt the SNS topic must reside in the account that Image Builder runs under. +* api-change:``workmail``: This release allows customers to change their email monitoring configuration in Amazon WorkMail. +* api-change:``transfer``: Property for Transfer Family used with the FTPS protocol. TLS Session Resumption provides a mechanism to resume or share a negotiated secret key between the control and data connection for an FTPS session. +* api-change:``lookoutmetrics``: This release adds support for Causal Relationships. Added new ListAnomalyGroupRelatedMetrics API operation and InterMetricImpactDetails API data type +* api-change:``mediaconnect``: You can now use the Fujitsu-QoS protocol for your MediaConnect sources and outputs to transport content to and from Fujitsu devices. +* api-change:``qldb``: Amazon QLDB now supports journal exports in JSON and Ion Binary formats. This release adds an optional OutputFormat parameter to the ExportJournalToS3 API. + + +1.23.25 +======= + +* api-change:``customer-profiles``: This release adds an optional parameter, ObjectTypeNames to the PutIntegration API to support multiple object types per integration option. Besides, this release introduces Standard Order Objects which contain data from third party systems and each order object belongs to a specific profile. +* api-change:``sagemaker``: This release adds a new ContentType field in AutoMLChannel for SageMaker CreateAutoMLJob InputDataConfig. +* api-change:``forecast``: Adds ForecastDimensions field to the DescribeAutoPredictorResponse +* api-change:``securityhub``: Added new resource details objects to ASFF, including resources for Firewall, and RuleGroup, FirewallPolicy Added additional details for AutoScalingGroup, LaunchConfiguration, and S3 buckets. +* api-change:``location``: Making PricingPlan optional as part of create resource API. +* api-change:``redshift``: This release adds API support for managed Redshift datashares. Customers can now interact with a Redshift datashare that is managed by a different service, such as AWS Data Exchange. +* api-change:``apigateway``: Documentation updates for Amazon API Gateway +* api-change:``devops-guru``: Adds Tags support to DescribeOrganizationResourceCollectionHealth +* api-change:``imagebuilder``: This release adds support for importing and exporting VM Images as part of the Image Creation workflow via EC2 VM Import/Export. +* api-change:``datasync``: AWS DataSync now supports FSx Lustre Locations. +* api-change:``finspace-data``: Make dataset description optional and allow s3 export for dataviews + + +1.23.24 +======= + +* api-change:``secretsmanager``: Documentation updates for Secrets Manager + + +1.23.23 +======= + +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``network-firewall``: This release adds support for managed rule groups. +* api-change:``route53-recovery-control-config``: This release adds tagging supports to Route53 Recovery Control Configuration. New APIs: TagResource, UntagResource and ListTagsForResource. Updates: add optional field `tags` to support tagging while calling CreateCluster, CreateControlPanel and CreateSafetyRule. +* api-change:``ec2``: Adds waiters support for internet gateways. +* api-change:``sms``: This release adds SMS discontinuation information to the API and CLI references. +* api-change:``route53domains``: Amazon Route 53 domain registration APIs now support filtering and sorting in the ListDomains API, deleting a domain by using the DeleteDomain API and getting domain pricing information by using the ListPrices API. +* api-change:``savingsplans``: Adds the ability to specify Savings Plans hourly commitments using five digits after the decimal point. + + +1.23.22 +======= + +* api-change:``lookoutvision``: This release adds new APIs for packaging an Amazon Lookout for Vision model as an AWS IoT Greengrass component. +* api-change:``sagemaker``: This release added a new Ambarella device(amba_cv2) compilation support for Sagemaker Neo. +* api-change:``comprehendmedical``: This release adds a new set of APIs (synchronous and batch) to support the SNOMED-CT ontology. +* api-change:``health``: Documentation updates for AWS Health +* api-change:``logs``: This release adds AWS Organizations support as condition key in destination policy for cross account Subscriptions in CloudWatch Logs. +* api-change:``outposts``: This release adds the UpdateOutpost API. +* api-change:``support``: Documentation updates for AWS Support. +* api-change:``iot``: This release allows customer to enable caching of custom authorizer on HTTP protocol for clients that use persistent or Keep-Alive connection in order to reduce the number of Lambda invocations. + + +1.23.21 +======= + +* api-change:``location``: This release adds support for Accuracy position filtering, position metadata and autocomplete for addresses and points of interest based on partial or misspelled free-form text. +* api-change:``appsync``: AWS AppSync now supports custom domain names, allowing you to associate a domain name that you own with an AppSync API in your account. +* api-change:``route53``: Add PriorRequestNotComplete exception to UpdateHostedZoneComment API + + +1.23.20 +======= + +* api-change:``rekognition``: This release added new KnownGender types for Celebrity Recognition. + + +1.23.19 +======= + +* api-change:``ram``: This release adds the ability to use the new ResourceRegionScope parameter on List operations that return lists of resources or resource types. This new parameter filters the results by letting you differentiate between global or regional resource types. +* api-change:``networkmanager``: This release adds API support for AWS Cloud WAN. +* api-change:``amplifyuibuilder``: This release introduces the actions and data types for the new Amplify UI Builder API. The Amplify UI Builder API provides a programmatic interface for creating and configuring user interface (UI) component libraries and themes for use in Amplify applications. + + +1.23.18 +======= + +* api-change:``sagemaker``: This release enables - 1/ Inference endpoint configuration recommendations and ability to run custom load tests to meet performance needs. 2/ Deploy serverless inference endpoints. 3/ Query, filter and retrieve end-to-end ML lineage graph, and incorporate model quality/bias detection in ML workflow. +* api-change:``kendra``: Experience Builder allows customers to build search applications without writing code. Analytics Dashboard provides quality and usability metrics for Kendra indexes. Custom Document Enrichment allows customers to build a custom ingestion pipeline to pre-process documents and generate metadata. +* api-change:``directconnect``: Adds SiteLink support to private and transit virtual interfaces. SiteLink is a new Direct Connect feature that allows routing between Direct Connect points of presence. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``ec2``: This release adds support for Amazon VPC IP Address Manager (IPAM), which enables you to plan, track, and monitor IP addresses for your workloads. This release also adds support for VPC Network Access Analyzer, which enables you to analyze network access to resources in your Virtual Private Clouds. +* api-change:``shield``: This release adds API support for Automatic Application Layer DDoS Mitigation for AWS Shield Advanced. Customers can now enable automatic DDoS mitigation in count or block mode for layer 7 protected resources. +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``devops-guru``: DevOps Guru now provides detailed, database-specific analyses of performance issues and recommends corrective actions for Amazon Aurora database instances with Performance Insights turned on. You can also use AWS tags to choose which resources to analyze and define your applications. +* api-change:``dynamodb``: Add support for Table Classes and introduce the Standard Infrequent Access table class. + + +1.23.17 +======= + +* api-change:``s3``: Introduce Amazon S3 Glacier Instant Retrieval storage class and a new setting in S3 Object Ownership to disable ACLs for bucket and the objects in it. +* api-change:``backup-gateway``: Initial release of AWS Backup gateway which enables you to centralize and automate protection of on-premises VMware and VMware Cloud on AWS workloads using AWS Backup. +* api-change:``iot``: Added the ability to enable/disable IoT Fleet Indexing for Device Defender and Named Shadow information, and search them through IoT Fleet Indexing APIs. +* api-change:``ec2``: This release adds support for Is4gen and Im4gn instances. This release also adds a new subnet attribute, enableLniAtDeviceIndex, to support local network interfaces, which are logical networking components that connect an EC2 instance to your on-premises network. +* api-change:``outposts``: This release adds the SupportedHardwareType parameter to CreateOutpost. +* api-change:``storagegateway``: Added gateway type VTL_SNOW. Added new SNOWBALL HostEnvironment for gateways running on a Snowball device. Added new field HostEnvironmentId to serve as an identifier for the HostEnvironment on which the gateway is running. +* api-change:``kinesis``: Amazon Kinesis Data Streams now supports on demand streams. +* api-change:``glue``: Support for DataLake transactions +* api-change:``accessanalyzer``: AWS IAM Access Analyzer now supports policy validation for resource policies attached to S3 buckets and access points. You can run additional policy checks by specifying the S3 resource type you want to attach to your resource policy. +* api-change:``lakeformation``: This release adds support for row and cell-based access control in Lake Formation. It also adds support for Lake Formation Governed Tables, which support ACID transactions and automatic storage optimizations. +* api-change:``kafka``: This release adds three new V2 APIs. CreateClusterV2 for creating both provisioned and serverless clusters. DescribeClusterV2 for getting information about provisioned and serverless clusters and ListClustersV2 for listing all clusters (both provisioned and serverless) in your account. +* api-change:``redshift-data``: Data API now supports serverless queries. +* api-change:``snowball``: Tapeball is to integrate tape gateway onto snowball, it enables customer to transfer local data on the tape to snowball,and then ingest the data into tape gateway on the cloud. +* api-change:``workspaces-web``: This is the initial SDK release for Amazon WorkSpaces Web. Amazon WorkSpaces Web is a low-cost, fully managed WorkSpace built to deliver secure web-based workloads and software-as-a-service (SaaS) application access to users within existing web browsers. +* api-change:``iottwinmaker``: AWS IoT TwinMaker makes it faster and easier to create, visualize and monitor digital twins of real-world systems like buildings, factories and industrial equipment to optimize operations. Learn more: https://docs.aws.amazon.com/iot-twinmaker/latest/apireference/Welcome.html (New Service) (Preview) +* api-change:``fsx``: This release adds support for the FSx for OpenZFS file system type, FSx for Lustre file systems with the Persistent_2 deployment type, and FSx for Lustre file systems with Amazon S3 data repository associations and automatic export policies. + + +1.23.16 +======= + +* api-change:``s3``: Amazon S3 Event Notifications adds Amazon EventBridge as a destination and supports additional event types. The PutBucketNotificationConfiguration API can now skip validation of Amazon SQS, Amazon SNS and AWS Lambda destinations. +* api-change:``wellarchitected``: This update provides support for Well-Architected API users to use custom lens features. +* api-change:``rum``: This is the first public release of CloudWatch RUM +* api-change:``rbin``: This release adds support for Recycle Bin. +* api-change:``iotsitewise``: AWS IoT SiteWise now supports retention configuration for the hot tier storage. +* api-change:``compute-optimizer``: Adds support for the enhanced infrastructure metrics paid feature. Also adds support for two new sets of resource efficiency metrics, including savings opportunity metrics and performance improvement opportunity metrics. +* api-change:``ecr``: This release adds supports for pull through cache rules and enhanced scanning. +* api-change:``evidently``: Introducing Amazon CloudWatch Evidently. This is the first public release of Amazon CloudWatch Evidently. +* api-change:``inspector2``: This release adds support for the new Amazon Inspector API. The new Amazon Inspector can automatically discover and scan Amazon EC2 instances and Amazon ECR container images for software vulnerabilities and unintended network exposure, and report centralized findings across multiple AWS accounts. +* api-change:``ssm``: Added two new attributes to DescribeInstanceInformation called SourceId and SourceType along with new string filters SourceIds and SourceTypes to filter instance records. +* api-change:``ec2``: This release adds support for G5g and M6a instances. This release also adds support for Amazon EBS Snapshots Archive, a feature that enables you to archive your EBS snapshots; and Recycle Bin, a feature that enables you to protect your EBS snapshots against accidental deletion. +* api-change:``dataexchange``: This release enables providers and subscribers to use Data Set, Job, and Asset operations to work with API assets from Amazon API Gateway. In addition, this release enables subscribers to use the SendApiAsset operation to invoke a provider's Amazon API Gateway API that they are entitled to. + + +1.23.15 +======= + +* api-change:``migration-hub-refactor-spaces``: This is the initial SDK release for AWS Migration Hub Refactor Spaces +* api-change:``textract``: This release adds support for synchronously analyzing identity documents through a new API: AnalyzeID +* api-change:``personalize-runtime``: This release adds inference support for Recommenders. +* api-change:``personalize``: This release adds API support for Recommenders and BatchSegmentJobs. + + +1.23.14 +======= + +* api-change:``autoscaling``: Documentation updates for Amazon EC2 Auto Scaling. +* api-change:``mgn``: Application Migration Service now supports an additional replication method that does not require agent installation on each source server. This option is available for source servers running on VMware vCenter versions 6.7 and 7.0. +* api-change:``ec2``: Documentation updates for EC2. +* api-change:``iotdeviceadvisor``: Documentation update for Device Advisor GetEndpoint API +* api-change:``pinpoint``: Added a One-Time Password (OTP) management feature. You can use the Amazon Pinpoint API to generate OTP codes and send them to your users as SMS messages. Your apps can then call the API to verify the OTP codes that your users input +* api-change:``outposts``: This release adds new APIs for working with Outpost sites and orders. + + +1.23.13 +======= + +* api-change:``timestream-query``: Releasing Amazon Timestream Scheduled Queries. It makes real-time analytics more performant and cost-effective for customers by calculating and storing frequently accessed aggregates, and other computations, typically used in operational dashboards, business reports, and other analytics applications +* api-change:``elasticache``: Doc only update for ElastiCache +* api-change:``proton``: This release adds APIs for getting the outputs and provisioned stacks for Environments, Pipelines, and ServiceInstances. You can now add tags to EnvironmentAccountConnections. It also adds APIs for working with PR-based provisioning. Also, it adds APIs for syncing templates with a git repository. +* api-change:``translate``: This release enables customers to use translation settings to mask profane words and phrases in their translation output. +* api-change:``lambda``: Remove Lambda function url apis +* api-change:``imagebuilder``: This release adds support for sharing AMIs with Organizations within an EC2 Image Builder Distribution Configuration. +* api-change:``customer-profiles``: This release introduces a new auto-merging feature for profile matching. The auto-merging configurations can be set via CreateDomain API or UpdateDomain API. You can use GetIdentityResolutionJob API and ListIdentityResolutionJobs API to fetch job status. +* api-change:``autoscaling``: Customers can now configure predictive scaling policies to proactively scale EC2 Auto Scaling groups based on any CloudWatch metrics that more accurately represent the load on the group than the four predefined metrics. They can also use math expressions to further customize the metrics. +* api-change:``timestream-write``: This release adds support for multi-measure records and magnetic store writes. Multi-measure records allow customers to store multiple measures in a single table row. Magnetic store writes enable customers to write late arrival data (data with timestamp in the past) directly into the magnetic store. +* api-change:``iotsitewise``: AWS IoT SiteWise now accepts data streams that aren't associated with any asset properties. You can organize data by updating data stream associations. + + +1.23.12 +======= + +* api-change:``redshift``: This release adds support for reserved node exchange with restore/resize +* api-change:``elasticache``: Adding support for r6gd instances for Redis with data tiering. In a cluster with data tiering enabled, when available memory capacity is exhausted, the least recently used data is automatically tiered to solid state drives for cost-effective capacity scaling with minimal performance impact. +* api-change:``opensearch``: This release adds an optional parameter dry-run for the UpdateDomainConfig API to perform basic validation checks, and detect the deployment type that will be required for the configuration change, without actually applying the change. +* api-change:``backup``: This release adds new opt-in settings for advanced features for DynamoDB backups +* api-change:``iot``: This release introduces a new feature, Managed Job Template, for AWS IoT Jobs Service. Customers can now use service provided managed job templates to easily create jobs for supported standard job actions. +* api-change:``iotwireless``: Two new APIs, GetNetworkAnalyzerConfiguration and UpdateNetworkAnalyzerConfiguration, are added for the newly released Network Analyzer feature which enables customers to view real-time frame information and logs from LoRaWAN devices and gateways. +* api-change:``workspaces``: Documentation updates for Amazon WorkSpaces +* api-change:``s3``: Introduce two new Filters to S3 Lifecycle configurations - ObjectSizeGreaterThan and ObjectSizeLessThan. Introduce a new way to trigger actions on noncurrent versions by providing the number of newer noncurrent versions along with noncurrent days. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``macie2``: Documentation updates for Amazon Macie +* api-change:``ec2``: This release adds a new parameter ipv6Native to the allow creation of IPv6-only subnets using the CreateSubnet operation, and the operation ModifySubnetAttribute includes new parameters to modify subnet attributes to use resource-based naming and enable DNS resolutions for Private DNS name. +* api-change:``sqs``: Amazon SQS adds a new queue attribute, SqsManagedSseEnabled, which enables server-side queue encryption using SQS owned encryption keys. +* api-change:``ecs``: Documentation update for ARM support on Amazon ECS. +* api-change:``sts``: Documentation updates for AWS Security Token Service. +* api-change:``finspace-data``: Update documentation for createChangeset API. +* api-change:``dynamodb``: DynamoDB PartiQL now supports ReturnConsumedCapacity, which returns capacity units consumed by PartiQL APIs if the request specified returnConsumedCapacity parameter. PartiQL APIs include ExecuteStatement, BatchExecuteStatement, and ExecuteTransaction. +* api-change:``lambda``: Release Lambda event source filtering for SQS, Kinesis Streams, and DynamoDB Streams. +* api-change:``iotdeviceadvisor``: This release introduces a new feature for Device Advisor: ability to execute multiple test suites in parallel for given customer account. You can use GetEndpoint API to get the device-level test endpoint and call StartSuiteRun with "parallelRun=true" to run suites in parallel. +* api-change:``rds``: Adds support for Multi-AZ DB clusters for RDS for MySQL and RDS for PostgreSQL. + + +1.23.11 +======= + +* api-change:``connect``: This release adds support for UpdateContactFlowMetadata, DeleteContactFlow and module APIs. For details, see the Release Notes in the Amazon Connect Administrator Guide. +* api-change:``dms``: Added new S3 endpoint settings to allow to convert the current UTC time into a specified time zone when a date partition folder is created. Using with 'DatePartitionedEnabled'. +* api-change:``es``: This release adds an optional parameter dry-run for the UpdateElasticsearchDomainConfig API to perform basic validation checks, and detect the deployment type that will be required for the configuration change, without actually applying the change. +* api-change:``ssm``: Adds new parameter to CreateActivation API . This parameter is for "internal use only". +* api-change:``chime-sdk-meetings``: Added new APIs for enabling Echo Reduction with Voice Focus. +* api-change:``eks``: Adding missing exceptions to RegisterCluster operation +* api-change:``quicksight``: Add support for Exasol data source, 1 click enterprise embedding and email customization. +* api-change:``cloudformation``: This release include SDK changes for the feature launch of Stack Import to Service Managed StackSet. +* api-change:``rds``: Adds local backup support to Amazon RDS on AWS Outposts. +* api-change:``braket``: This release adds support for Amazon Braket Hybrid Jobs. +* api-change:``s3control``: Added Amazon CloudWatch publishing option for S3 Storage Lens metrics. +* api-change:``finspace-data``: Add new APIs for managing Datasets, Changesets, and Dataviews. + + +1.23.10 +======= + +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``cloudformation``: The StackSets ManagedExecution feature will allow concurrency for non-conflicting StackSet operations and queuing the StackSet operations that conflict at a given time for later execution. +* api-change:``redshift``: Added support of default IAM role for CreateCluster, RestoreFromClusterSnapshot and ModifyClusterIamRoles APIs +* api-change:``lambda``: Add support for Lambda Function URLs. Customers can use Function URLs to create built-in HTTPS endpoints on their functions. +* api-change:``appstream``: Includes APIs for managing resources for Elastic fleets: applications, app blocks, and application-fleet associations. +* api-change:``medialive``: This release adds support for specifying a SCTE-35 PID on input. MediaLive now supports SCTE-35 PID selection on inputs containing one or more active SCTE-35 PIDs. +* api-change:``batch``: Documentation updates for AWS Batch. +* api-change:``application-insights``: Application Insights now supports monitoring for HANA + + +1.23.9 +====== + +* api-change:``ivs``: Add APIs for retrieving stream session information and support for filtering live streams by health. For more information, see https://docs.aws.amazon.com/ivs/latest/userguide/stream-health.html +* api-change:``lambda``: Added support for CLIENT_CERTIFICATE_TLS_AUTH and SERVER_ROOT_CA_CERTIFICATE as SourceAccessType for MSK and Kafka event source mappings. +* api-change:``chime``: Adds new Transcribe API parameters to StartMeetingTranscription, including support for content identification and redaction (PII & PHI), partial results stabilization, and custom language models. +* api-change:``chime-sdk-meetings``: Adds new Transcribe API parameters to StartMeetingTranscription, including support for content identification and redaction (PII & PHI), partial results stabilization, and custom language models. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``auditmanager``: This release introduces a new feature for Audit Manager: Dashboard views. You can now view insights data for your active assessments, and quickly identify non-compliant evidence that needs to be remediated. +* api-change:``databrew``: This SDK release adds the following new features: 1) PII detection in profile jobs, 2) Data quality rules, enabling validation of data quality in profile jobs, 3) SQL query-based datasets for Amazon Redshift and Snowflake data sources, and 4) Connecting DataBrew datasets with Amazon AppFlow flows. +* api-change:``redshift-data``: Rolling back Data API serverless features until dependencies are live. +* api-change:``kafka``: Amazon MSK has added a new API that allows you to update the connectivity settings for an existing cluster to enable public accessibility. +* api-change:``forecast``: NEW CreateExplanability API that helps you understand how attributes such as price, promotion, etc. contributes to your forecasted values; NEW CreateAutoPredictor API that trains up to 40% more accurate forecasting model, saves up to 50% of retraining time, and provides model level explainability. +* api-change:``appconfig``: Add Type to support feature flag configuration profiles + + +1.23.8 +====== + +* api-change:``appconfigdata``: AWS AppConfig Data is a new service that allows you to retrieve configuration deployed by AWS AppConfig. See the AppConfig user guide for more details on getting started. https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html +* api-change:``drs``: Introducing AWS Elastic Disaster Recovery (AWS DRS), a new service that minimizes downtime and data loss with fast, reliable recovery of on-premises and cloud-based applications using affordable storage, minimal compute, and point-in-time recovery. +* api-change:``apigateway``: Documentation updates for Amazon API Gateway. +* api-change:``sns``: Amazon SNS introduces the PublishBatch API, which enables customers to publish up to 10 messages per API request. The new API is valid for Standard and FIFO topics. +* api-change:``redshift-data``: Data API now supports serverless requests. +* api-change:``amplifybackend``: New APIs to support the Amplify Storage category. Add and manage file storage in your Amplify app backend. + + +1.23.7 +====== + +* api-change:``location``: This release adds the support for Relevance, Distance, Time Zone, Language and Interpolated Address for Geocoding and Reverse Geocoding. +* api-change:``cloudtrail``: CloudTrail Insights now supports ApiErrorRateInsight, which enables customers to identify unusual activity in their AWS account based on API error codes and their rate. + + +1.23.6 +====== + +* api-change:``migrationhubstrategy``: AWS SDK for Migration Hub Strategy Recommendations. It includes APIs to start the portfolio assessment, import portfolio data for assessment, and to retrieve recommendations. For more information, see the AWS Migration Hub documentation at https://docs.aws.amazon.com/migrationhub/index.html +* api-change:``ec2``: Adds a new VPC Subnet attribute "EnableDns64." When enabled on IPv6 Subnets, the Amazon-Provided DNS Resolver returns synthetic IPv6 addresses for IPv4-only destinations. +* api-change:``wafv2``: Your options for logging web ACL traffic now include Amazon CloudWatch Logs log groups and Amazon S3 buckets. +* api-change:``dms``: Add Settings in JSON format for the source GCP MySQL endpoint +* api-change:``ssm``: Adds support for Session Reason and Max Session Duration for Systems Manager Session Manager. +* api-change:``appstream``: This release includes support for images of AmazonLinux2 platform type. +* api-change:``eks``: Adding Tags support to Cluster Registrations. +* api-change:``transfer``: AWS Transfer Family now supports integrating a custom identity provider using AWS Lambda + + +1.23.5 +====== + +* api-change:``ec2``: C6i instances are powered by a third-generation Intel Xeon Scalable processor (Ice Lake) delivering all-core turbo frequency of 3.5 GHz. G5 instances feature up to 8 NVIDIA A10G Tensor Core GPUs and second generation AMD EPYC processors. +* api-change:``ssm``: This Patch Manager release supports creating Patch Baselines for RaspberryPi OS (formerly Raspbian) +* api-change:``devops-guru``: Add support for cross account APIs. +* api-change:``connect``: This release adds APIs for creating and managing scheduled tasks. Additionally, adds APIs to describe and update a contact and list associated references. +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added automatic modes for GOP configuration and added the ability to ingest screen recordings generated by Safari on MacOS 12 Monterey. + + +1.23.4 +====== + +* api-change:``dynamodb``: Updated Help section for "dynamodb update-contributor-insights" API +* api-change:``ec2``: This release provides an additional route target for the VPC route table. +* api-change:``translate``: This release enables customers to import Multi-Directional Custom Terminology and use Multi-Directional Custom Terminology in both real-time translation and asynchronous batch translation. + + +1.23.3 +====== + +* api-change:``backup``: AWS Backup SDK provides new options when scheduling backups: select supported services and resources that are assigned to a particular tag, linked to a combination of tags, or can be identified by a partial tag value, and exclude resources from their assignments. +* api-change:``ecs``: This release adds support for container instance health. +* api-change:``resiliencehub``: Initial release of AWS Resilience Hub, a managed service that enables you to define, validate, and track the resilience of your applications on AWS + + +1.23.2 +====== + +* api-change:``batch``: Adds support for scheduling policy APIs. +* api-change:``health``: Documentation updates for AWS Health. +* api-change:``greengrassv2``: This release adds support for Greengrass core devices running Windows. You can now specify name of a Windows user to run a component. + + +1.23.1 +====== + +* bugfix:urllib3: Fix NO_OP_TICKET import bug in older versions of urllib3 + + +1.23.0 +====== + +* feature:EndpointResolver: Adding support for resolving modeled FIPS and Dualstack endpoints. +* feature:``six``: Updated vendored version of ``six`` from 1.10.0 to 1.16.0 +* api-change:``sagemaker``: SageMaker CreateEndpoint and UpdateEndpoint APIs now support additional deployment configuration to manage traffic shifting options and automatic rollback monitoring. DescribeEndpoint now shows new in-progress deployment details with stage status. +* api-change:``chime-sdk-meetings``: Updated format validation for ids and regions. +* api-change:``wafv2``: You can now configure rules to run a CAPTCHA check against web requests and, as needed, send a CAPTCHA challenge to the client. +* api-change:``ec2``: This release adds internal validation on the GatewayAssociationState field + + +1.22.12 +======= + +* api-change:``ec2``: DescribeInstances now returns customer-owned IP addresses for instances running on an AWS Outpost. +* api-change:``translate``: This release enable customers to use their own KMS keys to encrypt output files when they submit a batch transform job. +* api-change:``resourcegroupstaggingapi``: Documentation updates and improvements. + + +1.22.11 +======= + +* api-change:``chime-sdk-meetings``: The Amazon Chime SDK Meetings APIs allow software developers to create meetings and attendees for interactive audio, video, screen and content sharing in custom meeting applications which use the Amazon Chime SDK. +* api-change:``sagemaker``: ListDevices and DescribeDevice now show Edge Manager agent version. +* api-change:``connect``: This release adds CRUD operation support for Security profile resource in Amazon Connect +* api-change:``iotwireless``: Adding APIs for the FUOTA (firmware update over the air) and multicast for LoRaWAN devices and APIs to support event notification opt-in feature for Sidewalk related events. A few existing APIs need to be modified for this new feature. +* api-change:``ec2``: This release adds a new instance replacement strategy for EC2 Fleet, Spot Fleet. Now you can select an action to perform when your instance gets a rebalance notification. EC2 Fleet, Spot Fleet can launch a replacement then terminate the instance that received notification after a termination delay + + +1.22.10 +======= + +* api-change:``finspace``: Adds superuser and data-bundle parameters to CreateEnvironment API +* api-change:``connectparticipant``: This release adds a new boolean attribute - Connect Participant - to the CreateParticipantConnection API, which can be used to mark the participant as connected. +* api-change:``datasync``: AWS DataSync now supports Hadoop Distributed File System (HDFS) Locations +* api-change:``macie2``: This release adds support for specifying the severity of findings that a custom data identifier produces, based on the number of occurrences of text that matches the detection criteria. + + +1.22.9 +====== + +* api-change:``cloudfront``: CloudFront now supports response headers policies to add HTTP headers to the responses that CloudFront sends to viewers. You can use these policies to add CORS headers, control browser caching, and more, without modifying your origin or writing any code. +* api-change:``connect``: Amazon Connect Chat now supports real-time message streaming. +* api-change:``nimble``: Amazon Nimble Studio adds support for users to stop and start streaming sessions. + + +1.22.8 +====== + +* api-change:``rekognition``: This Amazon Rekognition Custom Labels release introduces the management of datasets with projects +* api-change:``networkmanager``: This release adds API support to aggregate resources, routes, and telemetry data across a Global Network. +* api-change:``lightsail``: This release adds support to enable access logging for buckets in the Lightsail object storage service. +* api-change:``neptune``: Adds support for major version upgrades to ModifyDbCluster API + + +1.22.7 +====== + +* api-change:``transcribe``: Transcribe and Transcribe Call Analytics now support automatic language identification along with custom vocabulary, vocabulary filter, custom language model and PII redaction. +* api-change:``application-insights``: Added Monitoring support for SQL Server Failover Cluster Instance. Additionally, added a new API to allow one-click monitoring of containers resources. +* api-change:``rekognition``: This release added new attributes to Rekognition Video GetCelebrityRecognition API operations. +* api-change:``connect``: Amazon Connect Chat now supports real-time message streaming. +* api-change:``ec2``: Support added for AMI sharing with organizations and organizational units in ModifyImageAttribute API + + +1.22.6 +====== + +* api-change:``gamelift``: Added support for Arm-based AWS Graviton2 instances, such as M6g, C6g, and R6g. +* api-change:``ecs``: Amazon ECS now supports running Fargate tasks on Windows Operating Systems Families which includes Windows Server 2019 Core and Windows Server 2019 Full. +* api-change:``sagemaker``: This release adds support for RStudio on SageMaker. +* api-change:``connectparticipant``: This release adds a new boolean attribute - Connect Participant - to the CreateParticipantConnection API, which can be used to mark the participant as connected. +* api-change:``ec2``: Added new read-only DenyAllIGWTraffic network interface attribute. Added support for DL1 24xlarge instances powered by Habana Gaudi Accelerators for deep learning model training workloads +* api-change:``ssm-incidents``: Updating documentation, adding new field to ConflictException to indicate earliest retry timestamp for some operations, increase maximum length of nextToken fields + + +1.22.5 +====== + +* api-change:``autoscaling``: This release adds support for attribute-based instance type selection, a new EC2 Auto Scaling feature that lets customers express their instance requirements as a set of attributes, such as vCPU, memory, and storage. +* api-change:``ec2``: This release adds: attribute-based instance type selection for EC2 Fleet, Spot Fleet, a feature that lets customers express instance requirements as attributes like vCPU, memory, and storage; and Spot placement score, a feature that helps customers identify an optimal location to run Spot workloads. +* api-change:``eks``: EKS managed node groups now support BOTTLEROCKET_x86_64 and BOTTLEROCKET_ARM_64 AMI types. +* api-change:``sagemaker``: This release allows customers to describe one or more versioned model packages through BatchDescribeModelPackage, update project via UpdateProject, modify and read customer metadata properties using Create, Update and Describe ModelPackage and enables cross account registration of model packages. +* enhancement:Session: Added `get_partition_for_region` allowing partition lookup by region name. +* api-change:``textract``: This release adds support for asynchronously analyzing invoice and receipt documents through two new APIs: StartExpenseAnalysis and GetExpenseAnalysis + + +1.22.4 +====== + +* api-change:``emr-containers``: This feature enables auto-generation of certificate to secure the managed-endpoint and removes the need for customer provided certificate-arn during managed-endpoint setup. +* api-change:``chime-sdk-messaging``: The Amazon Chime SDK now supports push notifications through Amazon Pinpoint +* api-change:``chime-sdk-identity``: The Amazon Chime SDK now supports push notifications through Amazon Pinpoint + + +1.22.3 +====== + +* api-change:``rds``: This release adds support for Amazon RDS Custom, which is a new RDS management type that gives you full access to your database and operating system. For more information, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-custom.html +* api-change:``auditmanager``: This release introduces a new feature for Audit Manager: Custom framework sharing. You can now share your custom frameworks with another AWS account, or replicate them into another AWS Region under your own account. +* api-change:``ec2``: This release adds support to create a VPN Connection that is not attached to a Gateway at the time of creation. Use this to create VPNs associated with Core Networks, or modify your VPN and attach a gateway using the modify API after creation. +* api-change:``route53resolver``: New API for ResolverConfig, which allows autodefined rules for reverse DNS resolution to be disabled for a VPC + + +1.22.2 +====== + +* api-change:``quicksight``: Added QSearchBar option for GenerateEmbedUrlForRegisteredUser ExperienceConfiguration to support Q search bar embedding +* api-change:``auditmanager``: This release introduces character restrictions for ControlSet names. We updated regex patterns for the following attributes: ControlSet, CreateAssessmentFrameworkControlSet, and UpdateAssessmentFrameworkControlSet. +* api-change:``chime``: Chime VoiceConnector and VoiceConnectorGroup APIs will now return an ARN. + + +1.22.1 +====== + +* api-change:``connect``: Released Amazon Connect hours of operation API for general availability (GA). This API also supports AWS CloudFormation. For more information, see Amazon Connect Resource Type Reference in the AWS CloudFormation User Guide. + + +1.22.0 +====== + +* api-change:``appflow``: Feature to add support for JSON-L format for S3 as a source. +* api-change:``mediapackage-vod``: MediaPackage passes through digital video broadcasting (DVB) subtitles into the output. +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added support for specifying caption time delta in milliseconds and the ability to apply color range legalization to source content other than AVC video. +* api-change:``mediapackage``: When enabled, MediaPackage passes through digital video broadcasting (DVB) subtitles into the output. +* api-change:``panorama``: General availability for AWS Panorama. AWS SDK for Panorama includes APIs to manage your devices and nodes, and deploy computer vision applications to the edge. For more information, see the AWS Panorama documentation at http://docs.aws.amazon.com/panorama +* feature:Serialization: rest-json serialization defaults aligned across AWS SDKs +* api-change:``directconnect``: This release adds 4 new APIS, which needs to be public able +* api-change:``securityhub``: Added support for cross-Region finding aggregation, which replicates findings from linked Regions to a single aggregation Region. Added operations to view, enable, update, and delete the finding aggregation. + + +1.21.65 +======= + +* api-change:``dataexchange``: This release adds support for our public preview of AWS Data Exchange for Amazon Redshift. This enables data providers to list products including AWS Data Exchange datashares for Amazon Redshift, giving subscribers read-only access to provider data in Amazon Redshift. +* api-change:``chime-sdk-messaging``: The Amazon Chime SDK now allows developers to execute business logic on in-flight messages before they are delivered to members of a messaging channel with channel flows. + + +1.21.64 +======= + +* api-change:``quicksight``: AWS QuickSight Service Features - Add IP Restriction UI and public APIs support. +* enchancement:AWSCRT: Upgrade awscrt extra to 0.12.5 +* api-change:``ivs``: Bug fix: remove unsupported maxResults and nextToken pagination parameters from ListTagsForResource + + +1.21.63 +======= + +* api-change:``efs``: Update efs client to latest version +* api-change:``glue``: Enable S3 event base crawler API. + + +1.21.62 +======= + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``autoscaling``: Amazon EC2 Auto Scaling now supports filtering describe Auto Scaling groups API using tags +* api-change:``sagemaker``: This release updates the provisioning artifact ID to an optional parameter in CreateProject API. The provisioning artifact ID defaults to the latest provisioning artifact ID of the product if you don't provide one. +* api-change:``robomaker``: Adding support to GPU simulation jobs as well as non-ROS simulation jobs. + + +1.21.61 +======= + +* api-change:``config``: Adding Config support for AWS::OpenSearch::Domain +* api-change:``ec2``: This release adds support for additional VPC Flow Logs delivery options to S3, such as Apache Parquet formatted files, Hourly partitions and Hive-compatible S3 prefixes +* api-change:``storagegateway``: Adding support for Audit Logs on NFS shares and Force Closing Files on SMB shares. +* api-change:``workmail``: This release adds APIs for adding, removing and retrieving details of mail domains +* api-change:``kinesisanalyticsv2``: Support for Apache Flink 1.13 in Kinesis Data Analytics. Changed the required status of some Update properties to better fit the corresponding Create properties. + + +1.21.60 +======= + +* api-change:``cloudsearch``: Adds an additional validation exception for Amazon CloudSearch configuration APIs for better error handling. +* api-change:``ecs``: Documentation only update to address tickets. +* api-change:``mediatailor``: MediaTailor now supports ad prefetching. +* api-change:``ec2``: EncryptionSupport for InstanceStorageInfo added to DescribeInstanceTypes API + + +1.21.59 +======= + +* api-change:``elbv2``: Update elbv2 client to latest version +* bugfix:Signing: SigV4QueryAuth and CrtSigV4QueryAuth now properly respect AWSRequest.params while signing boto/botocore`#2521 `__ +* api-change:``medialive``: This release adds support for Transport Stream files as an input type to MediaLive encoders. +* api-change:``ec2``: Documentation update for Amazon EC2. +* api-change:``frauddetector``: New model type: Transaction Fraud Insights, which is optimized for online transaction fraud. Stored Events, which allows customers to send and store data directly within Amazon Fraud Detector. Batch Import, which allows customers to upload a CSV file of historic event data for processing and storage + + +1.21.58 +======= + +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``secretsmanager``: Documentation updates for Secrets Manager +* api-change:``securityhub``: Added new resource details objects to ASFF, including resources for WAF rate-based rules, EC2 VPC endpoints, ECR repositories, EKS clusters, X-Ray encryption, and OpenSearch domains. Added additional details for CloudFront distributions, CodeBuild projects, ELB V2 load balancers, and S3 buckets. +* api-change:``mediaconvert``: AWS Elemental MediaConvert has added the ability to set account policies which control access restrictions for HTTP, HTTPS, and S3 content sources. +* api-change:``ec2``: This release removes a requirement for filters on SearchLocalGatewayRoutes operations. + + +1.21.57 +======= + +* api-change:``kendra``: Amazon Kendra now supports indexing and querying documents in different languages. +* api-change:``grafana``: Initial release of the SDK for Amazon Managed Grafana API. +* api-change:``firehose``: Allow support for Amazon Opensearch Service(successor to Amazon Elasticsearch Service) as a Kinesis Data Firehose delivery destination. +* api-change:``backup``: Launch of AWS Backup Vault Lock, which protects your backups from malicious and accidental actions, works with existing backup policies, and helps you meet compliance requirements. +* api-change:``schemas``: Removing unused request/response objects. +* api-change:``chime``: This release enables customers to configure Chime MediaCapturePipeline via API. + + +1.21.56 +======= + +* api-change:``sagemaker``: This release adds a new TrainingInputMode FastFile for SageMaker Training APIs. +* api-change:``amplifybackend``: Adding a new field 'AmplifyFeatureFlags' to the response of the GetBackend operation. It will return a stringified version of the cli.json file for the given Amplify project. +* api-change:``fsx``: This release adds support for Lustre 2.12 to FSx for Lustre. +* api-change:``kendra``: Amazon Kendra now supports integration with AWS SSO + + +1.21.55 +======= + +* api-change:``workmail``: This release allows customers to change their inbound DMARC settings in Amazon WorkMail. +* api-change:``location``: Add support for PositionFiltering. +* api-change:``application-autoscaling``: With this release, Application Auto Scaling adds support for Amazon Neptune. Customers can now automatically add or remove Read Replicas of their Neptune clusters to keep the average CPU Utilization at the target value specified by the customers. +* api-change:``ec2``: Released Capacity Reservation Fleet, a feature of Amazon EC2 Capacity Reservations, which provides a way to manage reserved capacity across instance types. For more information: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-fleets.html +* api-change:``glue``: This release adds tag as an input of CreateConnection +* api-change:``backup``: AWS Backup Audit Manager framework report. + + +1.21.54 +======= + +* api-change:``codebuild``: CodeBuild now allows you to select how batch build statuses are sent to the source provider for a project. +* api-change:``efs``: Update efs client to latest version +* api-change:``kms``: Added SDK examples for ConnectCustomKeyStore, CreateCustomKeyStore, CreateKey, DeleteCustomKeyStore, DescribeCustomKeyStores, DisconnectCustomKeyStore, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GetPublicKey, ReplicateKey, Sign, UpdateCustomKeyStore and Verify APIs + + +1.21.53 +======= + +* api-change:``synthetics``: CloudWatch Synthetics now enables customers to choose a customer managed AWS KMS key or an Amazon S3-managed key instead of an AWS managed key (default) for the encryption of artifacts that the canary stores in Amazon S3. CloudWatch Synthetics also supports artifact S3 location updation now. +* api-change:``ssm``: When "AutoApprovable" is true for a Change Template, then specifying --auto-approve (boolean) in Start-Change-Request-Execution will create a change request that bypasses approver review. (except for change calendar restrictions) +* api-change:``apprunner``: This release contains several minor bug fixes. + + +1.21.52 +======= + +* api-change:``network-firewall``: This release adds support for strict ordering for stateful rule groups. Using strict ordering, stateful rules are evaluated in the exact order in which you provide them. +* api-change:``dataexchange``: This release enables subscribers to set up automatic exports of newly published revisions using the new EventAction API. +* api-change:``workmail``: This release adds support for mobile device access overrides management in Amazon WorkMail. +* api-change:``account``: This release of the Account Management API enables customers to manage the alternate contacts for their AWS accounts. For more information, see https://docs.aws.amazon.com/accounts/latest/reference/accounts-welcome.html +* api-change:``workspaces``: Added CreateUpdatedWorkspaceImage API to update WorkSpace images with latest software and drivers. Updated DescribeWorkspaceImages API to display if there are updates available for WorkSpace images. +* api-change:``cloudcontrol``: Initial release of the SDK for AWS Cloud Control API +* api-change:``macie2``: Amazon S3 bucket metadata now indicates whether an error or a bucket's permissions settings prevented Amazon Macie from retrieving data about the bucket or the bucket's objects. + + +1.21.51 +======= + +* api-change:``lambda``: Adds support for Lambda functions powered by AWS Graviton2 processors. Customers can now select the CPU architecture for their functions. +* api-change:``sesv2``: This release includes the ability to use 2048 bits RSA key pairs for DKIM in SES, either with Easy DKIM or Bring Your Own DKIM. +* api-change:``amp``: This release adds alert manager and rule group namespace APIs + + +1.21.50 +======= + +* api-change:``transfer``: Added changes for managed workflows feature APIs. +* api-change:``imagebuilder``: Fix description for AmiDistributionConfiguration Name property, which actually refers to the output AMI name. Also updated for consistent terminology to use "base" image, and another update to fix description text. + + +1.21.49 +======= + +* api-change:``appintegrations``: The Amazon AppIntegrations service enables you to configure and reuse connections to external applications. +* api-change:``wisdom``: Released Amazon Connect Wisdom, a feature of Amazon Connect, which provides real-time recommendations and search functionality in general availability (GA). For more information, see https://docs.aws.amazon.com/wisdom/latest/APIReference/Welcome.html. +* api-change:``pinpoint``: Added support for journey with contact center activity +* api-change:``voice-id``: Released the Amazon Voice ID SDK, for usage with the Amazon Connect Voice ID feature released for Amazon Connect. +* api-change:``connect``: This release updates a set of APIs: CreateIntegrationAssociation, ListIntegrationAssociations, CreateUseCase, and StartOutboundVoiceContact. You can use it to create integrations with Amazon Pinpoint for the Amazon Connect Campaigns use case, Amazon Connect Voice ID, and Amazon Connect Wisdom. +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.21.48 +======= + +* api-change:``license-manager``: AWS License Manager now allows customers to get the LicenseArn in the Checkout API Response. +* api-change:``ec2``: DescribeInstances now returns Platform Details, Usage Operation, and Usage Operation Update Time. + + +1.21.47 +======= + +* api-change:``mediaconvert``: This release adds style and positioning support for caption or subtitle burn-in from rich text sources such as TTML. This release also introduces configurable image-based trick play track generation. +* api-change:``appsync``: Documented the new OpenSearchServiceDataSourceConfig data type. Added deprecation notes to the ElasticsearchDataSourceConfig data type. +* api-change:``ssm``: Added cutoff behavior support for preventing new task invocations from starting when the maintenance window cutoff time is reached. + + +1.21.46 +======= + +* api-change:``imagebuilder``: This feature adds support for specifying GP3 volume throughput and configuring instance metadata options for instances launched by EC2 Image Builder. +* api-change:``wafv2``: Added the regex match rule statement, for matching web requests against a single regular expression. +* api-change:``mediatailor``: This release adds support to configure logs for playback configuration. +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``iam``: Added changes to OIDC API about not using port numbers in the URL. +* api-change:``license-manager``: AWS License Manager now allows customers to change their Windows Server or SQL license types from Bring-Your-Own-License (BYOL) to License Included or vice-versa (using the customer's media). +* api-change:``mediapackage-vod``: MediaPackage VOD will now return the current processing statuses of an asset's endpoints. The status can be QUEUED, PROCESSING, PLAYABLE, or FAILED. + + +1.21.45 +======= + +* api-change:``comprehend``: Amazon Comprehend now supports versioning of custom models, improved training with ONE_DOC_PER_FILE text documents for custom entity recognition, ability to provide specific test sets during training, and live migration to new model endpoints. +* api-change:``iot``: This release adds support for verifying, viewing and filtering AWS IoT Device Defender detect violations with four verification states. +* api-change:``ecr``: This release adds additional support for repository replication +* api-change:``ec2``: This update adds support for downloading configuration templates using new APIs (GetVpnConnectionDeviceTypes and GetVpnConnectionDeviceSampleConfiguration) and Internet Key Exchange version 2 (IKEv2) parameters for many popular CGW devices. + + +1.21.44 +======= + +* api-change:``opensearch``: This release adds an optional parameter in the ListDomainNames API to filter domains based on the engine type (OpenSearch/Elasticsearch). +* api-change:``es``: This release adds an optional parameter in the ListDomainNames API to filter domains based on the engine type (OpenSearch/Elasticsearch). +* api-change:``dms``: Optional flag force-planned-failover added to reboot-replication-instance API call. This flag can be used to test a planned failover scenario used during some maintenance operations. + + +1.21.43 +======= + +* api-change:``kafkaconnect``: This is the initial SDK release for Amazon Managed Streaming for Apache Kafka Connect (MSK Connect). +* api-change:``macie2``: This release adds support for specifying which managed data identifiers are used by a classification job, and retrieving a list of managed data identifiers that are available. +* api-change:``robomaker``: Adding support to create container based Robot and Simulation applications by introducing an environment field +* api-change:``s3``: Add support for access point arn filtering in S3 CW Request Metrics +* api-change:``transcribe``: This release adds support for subtitling with Amazon Transcribe batch jobs. +* api-change:``sagemaker``: Add API for users to retry a failed pipeline execution or resume a stopped one. +* api-change:``pinpoint``: This SDK release adds a new feature for Pinpoint campaigns, in-app messaging. + + +1.21.42 +======= + +* api-change:``sagemaker``: This release adds support for "Project Search" +* api-change:``ec2``: This release adds support for vt1 3xlarge, 6xlarge and 24xlarge instances powered by Xilinx Alveo U30 Media Accelerators for video transcoding workloads +* api-change:``wafv2``: This release adds support for including rate based rules in a rule group. +* api-change:``chime``: Adds support for SipHeaders parameter for CreateSipMediaApplicationCall. +* api-change:``comprehend``: Amazon Comprehend now allows you to train and run PDF and Word documents for custom entity recognition. With PDF and Word formats, you can extract information from documents containing headers, lists and tables. + + +1.21.41 +======= + +* api-change:``iot``: AWS IoT Rules Engine adds OpenSearch action. The OpenSearch rule action lets you stream data from IoT sensors and applications to Amazon OpenSearch Service which is a successor to Amazon Elasticsearch Service. +* api-change:``ec2``: Adds support for T3 instances on Amazon EC2 Dedicated Hosts. +* enhancement:Tagged Unions: Introducing support for the `union` trait on structures in request and response objects. + + +1.21.40 +======= + +* api-change:``cloudformation``: Doc only update for CloudFormation that fixes several customer-reported issues. +* api-change:``rds``: This release adds support for providing a custom timeout value for finding a scaling point during autoscaling in Aurora Serverless v1. +* api-change:``ecr``: This release updates terminology around KMS keys. +* api-change:``sagemaker``: This release adds support for "Lifecycle Configurations" to SageMaker Studio +* api-change:``transcribe``: This release adds an API option for startTranscriptionJob and startMedicalTranscriptionJob that allows the user to specify encryption context key value pairs for batch jobs. +* api-change:``quicksight``: Add new data source type for Amazon OpenSearch (successor to Amazon ElasticSearch). + + +1.21.39 +======= + +* api-change:``emr``: Update emr client to latest version +* api-change:``codeguru-reviewer``: The Amazon CodeGuru Reviewer API now includes the RuleMetadata data object and a Severity attribute on a RecommendationSummary object. A RuleMetadata object contains information about a rule that generates a recommendation. Severity indicates how severe the issue associated with a recommendation is. +* api-change:``lookoutequipment``: Added OffCondition parameter to CreateModel API + + +1.21.38 +======= + +* api-change:``opensearch``: Updated Configuration APIs for Amazon OpenSearch Service (successor to Amazon Elasticsearch Service) +* api-change:``ram``: A minor text-only update that fixes several customer issues. +* api-change:``kafka``: Amazon MSK has added a new API that allows you to update the encrypting and authentication settings for an existing cluster. + + +1.21.37 +======= + +* api-change:``elasticache``: Doc only update for ElastiCache +* api-change:``amp``: This release adds tagging support for Amazon Managed Service for Prometheus workspace. +* api-change:``forecast``: Predictor creation now supports selecting an accuracy metric to optimize in AutoML and hyperparameter optimization. This release adds additional accuracy metrics for predictors - AverageWeightedQuantileLoss, MAPE and MASE. +* api-change:``xray``: Updated references to AWS KMS keys and customer managed keys to reflect current terminology. +* api-change:``ssm-contacts``: Added SDK examples for SSM-Contacts. +* api-change:``mediapackage``: SPEKE v2 support for live CMAF packaging type. SPEKE v2 is an upgrade to the existing SPEKE API to support multiple encryption keys, it supports live DASH currently. +* api-change:``eks``: Adding RegisterCluster and DeregisterCluster operations, to support connecting external clusters to EKS. + + +1.21.36 +======= + +* api-change:``chime-sdk-identity``: Documentation updates for Chime +* api-change:``chime-sdk-messaging``: Documentation updates for Chime +* api-change:``outposts``: This release adds a new API CreateOrder. +* api-change:``frauddetector``: Enhanced GetEventPrediction API response to include risk scores from imported SageMaker models +* api-change:``codeguru-reviewer``: Added support for CodeInconsistencies detectors + + +1.21.35 +======= + +* api-change:``acm-pca``: Private Certificate Authority Service now allows customers to enable an online certificate status protocol (OCSP) responder service on their private certificate authorities. Customers can also optionally configure a custom CNAME for their OCSP responder. +* api-change:``s3control``: S3 Multi-Region Access Points provide a single global endpoint to access a data set that spans multiple S3 buckets in different AWS Regions. +* api-change:``accessanalyzer``: Updates service API, documentation, and paginators to support multi-region access points from Amazon S3. +* api-change:``schemas``: This update include the support for Schema Discoverer to discover the events sent to the bus from another account. The feature will be enabled by default when discoverer is created or updated but can also be opt-in or opt-out by specifying the value for crossAccount. +* api-change:``securityhub``: New ASFF Resources: AwsAutoScalingLaunchConfiguration, AwsEc2VpnConnection, AwsEcrContainerImage. Added KeyRotationStatus to AwsKmsKey. Added AccessControlList, BucketLoggingConfiguration,BucketNotificationConfiguration and BucketNotificationConfiguration to AwsS3Bucket. +* enhancement:s3: Added support for S3 Multi-Region Access Points +* api-change:``efs``: Update efs client to latest version +* api-change:``transfer``: AWS Transfer Family introduces Managed Workflows for creating, executing, monitoring, and standardizing post file transfer processing +* api-change:``ebs``: Documentation updates for Amazon EBS direct APIs. +* api-change:``quicksight``: This release adds support for referencing parent datasets as sources in a child dataset. +* api-change:``fsx``: Announcing Amazon FSx for NetApp ONTAP, a new service that provides fully managed shared storage in the AWS Cloud with the data access and management capabilities of ONTAP. +* enhancement:Signers: Added support for Sigv4a Signing Algorithm +* api-change:``lex-models``: Lex now supports Korean (ko-KR) locale. + + +1.21.34 +======= + +* api-change:``ec2``: Added LaunchTemplate support for the IMDS IPv6 endpoint +* api-change:``cloudtrail``: Documentation updates for CloudTrail +* api-change:``mediatailor``: This release adds support for wall clock programs in LINEAR channels. +* api-change:``config``: Documentation updates for config +* api-change:``servicecatalog-appregistry``: Introduction of GetAssociatedResource API and GetApplication response extension for Resource Groups support. + + +1.21.33 +======= + +* api-change:``iot``: Added Create/Update/Delete/Describe/List APIs for a new IoT resource named FleetMetric. Added a new Fleet Indexing query API named GetBucketsAggregation. Added a new field named DisconnectedReason in Fleet Indexing query response. Updated their related documentations. +* api-change:``polly``: Amazon Polly adds new South African English voice - Ayanda. Ayanda is available as Neural voice only. +* api-change:``compute-optimizer``: Documentation updates for Compute Optimizer +* api-change:``sqs``: Amazon SQS adds a new queue attribute, RedriveAllowPolicy, which includes the dead-letter queue redrive permission parameters. It defines which source queues can specify dead-letter queues as a JSON object. +* api-change:``memorydb``: Documentation updates for MemoryDB + + +1.21.32 +======= + +* api-change:``codebuild``: Documentation updates for CodeBuild +* api-change:``firehose``: This release adds the Dynamic Partitioning feature to Kinesis Data Firehose service for S3 destinations. +* api-change:``kms``: This release has changes to KMS nomenclature to remove the word master from both the "Customer master key" and "CMK" abbreviation and replace those naming conventions with "KMS key". +* api-change:``cloudformation``: AWS CloudFormation allows you to iteratively develop your applications when failures are encountered without rolling back successfully provisioned resources. By specifying stack failure options, you can troubleshoot resources in a CREATE_FAILED or UPDATE_FAILED status. + + +1.21.31 +======= + +* api-change:``s3``: Documentation updates for Amazon S3. +* api-change:``emr``: Update emr client to latest version +* api-change:``ec2``: This release adds the BootMode flag to the ImportImage API and showing the detected BootMode of an ImportImage task. + + +1.21.30 +======= + +* api-change:``transcribe``: This release adds support for batch transcription in six new languages - Afrikaans, Danish, Mandarin Chinese (Taiwan), New Zealand English, South African English, and Thai. +* api-change:``rekognition``: This release added new attributes to Rekognition RecognizeCelebities and GetCelebrityInfo API operations. +* api-change:``ec2``: Support added for resizing VPC prefix lists +* api-change:``compute-optimizer``: Adds support for 1) the AWS Graviton (AWS_ARM64) recommendation preference for Amazon EC2 instance and Auto Scaling group recommendations, and 2) the ability to get the enrollment statuses for all member accounts of an organization. + + +1.21.29 +======= + +* api-change:``fms``: AWS Firewall Manager now supports triggering resource cleanup workflow when account or resource goes out of policy scope for AWS WAF, Security group, AWS Network Firewall, and Amazon Route 53 Resolver DNS Firewall policies. +* api-change:``ec2``: Support added for IMDS IPv6 endpoint +* api-change:``datasync``: Added include filters to CreateTask and UpdateTask, and added exclude filters to StartTaskExecution, giving customers more granular control over how DataSync transfers files, folders, and objects. +* api-change:``events``: AWS CWEvents adds an enum of EXTERNAL for EcsParameters LaunchType for PutTargets API + + +1.21.28 +======= + +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added MBAFF encoding support for AVC video and the ability to pass encryption context from the job settings to S3. +* api-change:``polly``: Amazon Polly adds new New Zealand English voice - Aria. Aria is available as Neural voice only. +* api-change:``transcribe``: This release adds support for feature tagging with Amazon Transcribe batch jobs. +* api-change:``ssm``: Updated Parameter Store property for logging improvements. +* api-change:``iot-data``: Updated Publish with support for new Retain flag and added two new API operations: GetRetainedMessage, ListRetainedMessages. + + +1.21.27 +======= + +* api-change:``dms``: Amazon AWS DMS service now support Redis target endpoint migration. Now S3 endpoint setting is capable to setup features which are used to be configurable only in extract connection attributes. +* api-change:``frauddetector``: Updated an element of the DescribeModelVersion API response (LogitMetrics -> logOddsMetrics) for clarity. Added new exceptions to several APIs to protect against unlikely scenarios. +* api-change:``iotsitewise``: Documentation updates for AWS IoT SiteWise +* api-change:``dlm``: Added AMI deprecation support for Amazon Data Lifecycle Manager EBS-backed AMI policies. +* api-change:``glue``: Add support for Custom Blueprints +* api-change:``apigateway``: Adding some of the pending releases (1) Adding WAF Filter to GatewayResponseType enum (2) Ensuring consistent error model for all operations (3) Add missing BRE to GetVpcLink operation +* api-change:``backup``: AWS Backup - Features: Evaluate your backup activity and generate audit reports. + + +1.21.26 +======= + +* api-change:``eks``: Adds support for EKS add-ons "preserve" flag, which allows customers to maintain software on their EKS clusters after removing it from EKS add-ons management. +* api-change:``comprehend``: Add tagging support for Comprehend async inference job. +* api-change:``robomaker``: Documentation updates for RoboMaker +* api-change:``ec2``: encryptionInTransitSupported added to DescribeInstanceTypes API + + +1.21.25 +======= + +* api-change:``ec2``: The ImportImage API now supports the ability to create AMIs with AWS-managed licenses for Microsoft SQL Server for both Windows and Linux. +* api-change:``memorydb``: AWS MemoryDB SDK now supports all APIs for newly launched MemoryDB service. +* api-change:``application-autoscaling``: This release extends Application Auto Scaling support for replication group of Amazon ElastiCache Redis clusters. Auto Scaling monitors and automatically expands node group count and number of replicas per node group when a critical usage threshold is met or according to customer-defined schedule. +* api-change:``appflow``: This release adds support for SAPOData connector and extends Veeva connector for document extraction. + + +1.21.24 +======= + +* api-change:``codebuild``: CodeBuild now allows you to make the build results for your build projects available to the public without requiring access to an AWS account. +* api-change:``route53``: Documentation updates for route53 +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``route53resolver``: Documentation updates for Route 53 Resolver +* api-change:``sagemaker``: Amazon SageMaker now supports Asynchronous Inference endpoints. Adds PlatformIdentifier field that allows Notebook Instance creation with different platform selections. Increases the maximum number of containers in multi-container endpoints to 15. Adds more instance types to InstanceType field. + + +1.21.23 +======= + +* api-change:``cloud9``: Added DryRun parameter to CreateEnvironmentEC2 API. Added ManagedCredentialsActions parameter to UpdateEnvironment API +* api-change:``ec2``: This release adds support for EC2 ED25519 key pairs for authentication +* api-change:``clouddirectory``: Documentation updates for clouddirectory +* api-change:``ce``: This release is a new feature for Cost Categories: Split charge rules. Split charge rules enable you to allocate shared costs between your cost category values. +* api-change:``logs``: Documentation-only update for CloudWatch Logs + + +1.21.22 +======= + +* api-change:``iotsitewise``: AWS IoT SiteWise added query window for the interpolation interval. AWS IoT SiteWise computes each interpolated value by using data points from the timestamp of each interval minus the window to the timestamp of each interval plus the window. +* api-change:``s3``: Documentation updates for Amazon S3 +* api-change:``codebuild``: CodeBuild now allows you to select how batch build statuses are sent to the source provider for a project. +* api-change:``ds``: This release adds support for describing client authentication settings. +* api-change:``config``: Update ResourceType enum with values for Backup Plan, Selection, Vault, RecoveryPoint; ECS Cluster, Service, TaskDefinition; EFS AccessPoint, FileSystem; EKS Cluster; ECR Repository resources +* api-change:``license-manager``: AWS License Manager now allows end users to call CheckoutLicense API using new CheckoutType PERPETUAL. Perpetual checkouts allow sellers to check out a quantity of entitlements to be drawn down for consumption. + + +1.21.21 +======= + +* api-change:``quicksight``: Documentation updates for QuickSight. +* api-change:``emr``: Update emr client to latest version +* api-change:``customer-profiles``: This release introduces Standard Profile Objects, namely Asset and Case which contain values populated by data from third party systems and belong to a specific profile. This release adds an optional parameter, ObjectFilter to the ListProfileObjects API in order to search for these Standard Objects. +* api-change:``elasticache``: This release adds ReplicationGroupCreateTime field to ReplicationGroup which indicates the UTC time when ElastiCache ReplicationGroup is created + + +1.21.20 +======= + +* api-change:``sagemaker``: Amazon SageMaker Autopilot adds new metrics for all candidate models generated by Autopilot experiments. +* api-change:``apigatewayv2``: Adding support for ACM imported or private CA certificates for mTLS enabled domain names +* api-change:``apigateway``: Adding support for ACM imported or private CA certificates for mTLS enabled domain names +* api-change:``databrew``: This SDK release adds support for the output of a recipe job results to Tableau Hyper format. +* api-change:``lambda``: Lambda Python 3.9 runtime launch + + +1.21.19 +======= + +* api-change:``snow-device-management``: AWS Snow Family customers can remotely monitor and operate their connected AWS Snowcone devices. +* api-change:``ecs``: Documentation updates for ECS. +* api-change:``nimble``: Add new attribute 'ownedBy' in Streaming Session APIs. 'ownedBy' represents the AWS SSO Identity Store User ID of the owner of the Streaming Session resource. +* api-change:``codebuild``: CodeBuild now allows you to make the build results for your build projects available to the public without requiring access to an AWS account. +* api-change:``ebs``: Documentation updates for Amazon EBS direct APIs. +* api-change:``route53``: Documentation updates for route53 + + +1.21.18 +======= + +* api-change:``chime``: Add support for "auto" in Region field of StartMeetingTranscription API request. +* enchancement:Client: Improve client performance by caching _alias_event_name on EventAliaser + + +1.21.17 +======= + +* api-change:``wafv2``: This release adds APIs to support versioning feature of AWS WAF Managed rule groups +* api-change:``rekognition``: This release adds support for four new types of segments (opening credits, content segments, slates, and studio logos), improved accuracy for credits and shot detection and new filters to control black frame detection. +* api-change:``ssm``: Documentation updates for AWS Systems Manager. + + +1.21.16 +======= + +* api-change:``synthetics``: Documentation updates for Visual Monitoring feature and other doc ticket fixes. +* api-change:``chime-sdk-identity``: The Amazon Chime SDK Identity APIs allow software developers to create and manage unique instances of their messaging applications. +* api-change:``chime-sdk-messaging``: The Amazon Chime SDK Messaging APIs allow software developers to send and receive messages in custom messaging applications. +* api-change:``connect``: This release adds support for agent status and hours of operation. For details, see the Release Notes in the Amazon Connect Administrator Guide. +* api-change:``lightsail``: This release adds support to track when a bucket access key was last used. +* api-change:``athena``: Documentation updates for Athena. + + +1.21.15 +======= + +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``autoscaling``: EC2 Auto Scaling adds configuration checks and Launch Template validation to Instance Refresh. + + +1.21.14 +======= + +* api-change:``rds``: This release adds AutomaticRestartTime to the DescribeDBInstances and DescribeDBClusters operations. AutomaticRestartTime indicates the time when a stopped DB instance or DB cluster is restarted automatically. +* api-change:``imagebuilder``: Updated list actions to include a list of valid filters that can be used in the request. +* api-change:``transcribe``: This release adds support for call analytics (batch) within Amazon Transcribe. +* api-change:``events``: Update events client to latest version +* api-change:``ssm-incidents``: Documentation updates for Incident Manager. + + +1.21.13 +======= + +* api-change:``redshift``: API support for Redshift Data Sharing feature. +* api-change:``iotsitewise``: My AWS Service (placeholder) - This release introduces custom Intervals and offset for tumbling window in metric for AWS IoT SiteWise. +* api-change:``glue``: Add ConcurrentModificationException to create-table, delete-table, create-database, update-database, delete-database +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added control over the passthrough of XDS captions metadata to outputs. +* api-change:``proton``: Docs only add idempotent create apis + + +1.21.12 +======= + +* api-change:``ssm-contacts``: Added new attribute in AcceptCode API. AcceptCodeValidation takes in two values - ENFORCE, IGNORE. ENFORCE forces validation of accept code and IGNORE ignores it which is also the default behavior; Corrected TagKeyList length from 200 to 50 +* api-change:``greengrassv2``: This release adds support for component system resource limits and idempotent Create operations. You can now specify the maximum amount of CPU and memory resources that each component can use. + + +1.21.11 +======= + +* api-change:``appsync``: AWS AppSync now supports a new authorization mode allowing you to define your own authorization logic using an AWS Lambda function. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``secretsmanager``: Add support for KmsKeyIds in the ListSecretVersionIds API response +* api-change:``sagemaker``: API changes with respect to Lambda steps in model building pipelines. Adds several waiters to async Sagemaker Image APIs. Add more instance types to AppInstanceType field + + +1.21.10 +======= + +* api-change:``savingsplans``: Documentation update for valid Savings Plans offering ID pattern +* api-change:``ec2``: This release adds support for G4ad xlarge and 2xlarge instances powered by AMD Radeon Pro V520 GPUs and AMD 2nd Generation EPYC processors +* api-change:``chime``: Adds support for live transcription of meetings with Amazon Transcribe and Amazon Transcribe Medical. The new APIs, StartMeetingTranscription and StopMeetingTranscription, control the generation of user-attributed transcriptions sent to meeting clients via Amazon Chime SDK data messages. +* api-change:``iotsitewise``: Added support for AWS IoT SiteWise Edge. You can now create an AWS IoT SiteWise gateway that runs on AWS IoT Greengrass V2. With the gateway, you can collect local server and equipment data, process the data, and export the selected data from the edge to the AWS Cloud. +* api-change:``iot``: Increase maximum credential duration of role alias to 12 hours. + + +1.21.9 +====== + +* api-change:``sso-admin``: Documentation updates for arn:aws:trebuchet:::service:v1:03a2216d-1cda-4696-9ece-1387cb6f6952 +* api-change:``cloudformation``: SDK update to support Importing existing Stacks to new/existing Self Managed StackSet - Stack Import feature. + + +1.21.8 +====== + +* api-change:``route53``: This release adds support for the RECOVERY_CONTROL health check type to be used in conjunction with Route53 Application Recovery Controller. +* api-change:``iotwireless``: Add SidewalkManufacturingSn as an identifier to allow Customer to query WirelessDevice, in the response, AmazonId is added in the case that Sidewalk device is return. +* api-change:``route53-recovery-control-config``: Amazon Route 53 Application Recovery Controller's routing control - Routing Control Configuration APIs help you create and delete clusters, control panels, routing controls and safety rules. State changes (On/Off) of routing controls are not part of configuration APIs. +* api-change:``route53-recovery-readiness``: Amazon Route 53 Application Recovery Controller's readiness check capability continually monitors resource quotas, capacity, and network routing policies to ensure that the recovery environment is scaled and configured to take over when needed. +* api-change:``quicksight``: Add support to use row-level security with tags when embedding dashboards for users not provisioned in QuickSight +* api-change:``iotanalytics``: IoT Analytics now supports creating a dataset resource with IoT SiteWise MultiLayerStorage data stores, enabling customers to query industrial data within the service. This release includes adding JOIN functionality for customers to query multiple data sources in a dataset. +* api-change:``shield``: Change name of DDoS Response Team (DRT) to Shield Response Team (SRT) +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``redshift-data``: Added structures to support new Data API operation BatchExecuteStatement, used to execute multiple SQL statements within a single transaction. +* api-change:``route53-recovery-cluster``: Amazon Route 53 Application Recovery Controller's routing control - Routing Control Data Plane APIs help you update the state (On/Off) of the routing controls to reroute traffic across application replicas in a 100% available manner. +* api-change:``batch``: Add support for ListJob filters + + +1.21.7 +====== + +* api-change:``s3control``: S3 Access Point aliases can be used anywhere you use S3 bucket names to access data in S3 +* api-change:``textract``: Adds support for AnalyzeExpense, a new API to extract relevant data such as contact information, items purchased, and vendor name, from almost any invoice or receipt without the need for any templates or configuration. +* api-change:``proton``: Documentation-only update links +* api-change:``identitystore``: Documentation updates for SSO API Ref. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``synthetics``: CloudWatch Synthetics now supports visual testing in its canaries. + + +1.21.6 +====== + +* api-change:``securityhub``: Added product name, company name, and Region fields for security findings. Added details objects for RDS event subscriptions and AWS ECS services. Added fields to the details for AWS Elasticsearch domains. +* api-change:``imagebuilder``: Update to documentation to reapply missing change to SSM uninstall switch default value and improve description. +* api-change:``s3outposts``: Add on-premise access type support for endpoints + + +1.21.5 +====== + +* api-change:``medialive``: MediaLive now supports passing through style data on WebVTT caption outputs. +* api-change:``databrew``: This SDK release adds two new features: 1) Output to Native JDBC destinations and 2) Adding configurations to profile jobs +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``s3control``: Documentation updates for Amazon S3-control +* api-change:``ec2``: This release allows customers to assign prefixes to their elastic network interface and to reserve IP blocks in their subnet CIDRs. These reserved blocks can be used to assign prefixes to elastic network interfaces or be excluded from auto-assignment. +* api-change:``qldb``: Amazon QLDB now supports ledgers encrypted with customer managed KMS keys. Changes in CreateLedger, UpdateLedger and DescribeLedger APIs to support the changes. + + +1.21.4 +====== + +* api-change:``kendra``: Amazon Kendra now provides a data source connector for Amazon WorkDocs. For more information, see https://docs.aws.amazon.com/kendra/latest/dg/data-source-workdocs.html +* api-change:``proton``: Documentation updates for AWS Proton +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``rds``: Adds the OriginalSnapshotCreateTime field to the DBSnapshot response object. This field timestamps the underlying data of a snapshot and doesn't change when the snapshot is copied. +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``lambda``: New ResourceConflictException error code for PutFunctionEventInvokeConfig, UpdateFunctionEventInvokeConfig, and DeleteFunctionEventInvokeConfig operations. +* api-change:``codebuild``: AWS CodeBuild now allows you to set the access permissions for build artifacts, project artifacts, and log files that are uploaded to an Amazon S3 bucket that is owned by another account. +* api-change:``personalize``: My AWS Service (placeholder) - Making minProvisionedTPS an optional parameter when creating a campaign. If not provided, it defaults to 1. +* api-change:``emr``: Update emr client to latest version + + +1.21.3 +====== + +* api-change:``compute-optimizer``: Documentation updates for Compute Optimizer +* api-change:``ec2``: Added idempotency to the CreateVolume API using the ClientToken request parameter + + +1.21.2 +====== + +* api-change:``imagebuilder``: Documentation updates for reversal of default value for additional instance configuration SSM switch, plus improved descriptions for semantic versioning. +* api-change:``directconnect``: Documentation updates for directconnect +* api-change:``health``: In the Health API, the maximum number of entities for the EventFilter and EntityFilter data types has changed from 100 to 99. This change is related to an internal optimization of the AWS Health service. +* api-change:``robomaker``: This release allows customers to create a new version of WorldTemplates with support for Doors. +* api-change:``location``: Add five new API operations: UpdateGeofenceCollection, UpdateMap, UpdatePlaceIndex, UpdateRouteCalculator, UpdateTracker. +* api-change:``emr-containers``: Updated DescribeManagedEndpoint and ListManagedEndpoints to return failureReason and stateDetails in API response. + + +1.21.1 +====== + +* api-change:``appintegrations``: Documentation update for AppIntegrations Service +* api-change:``chime``: This SDK release adds Account Status as one of the attributes in Account API response +* api-change:``auditmanager``: This release relaxes the S3 URL character restrictions in AWS Audit Manager. Regex patterns have been updated for the following attributes: s3RelativePath, destination, and s3ResourcePath. 'AWS' terms have also been replaced with entities to align with China Rebrand documentation efforts. + + +1.21.0 +====== + +* api-change:``ec2``: This feature enables customers to specify weekly recurring time window(s) for scheduled events that reboot, stop or terminate EC2 instances. +* api-change:``cognito-idp``: Documentation updates for cognito-idp +* api-change:``ecs``: Documentation updates for support of awsvpc mode on Windows. +* api-change:``lex-models``: Lex now supports the en-IN locale +* api-change:``iotsitewise``: Update the default endpoint for the APIs used to manage asset models, assets, gateways, tags, and account configurations. If you have firewalls with strict egress rules, configure the rules to grant you access to api.iotsitewise.[region].amazonaws.com or api.iotsitewise.[cn-region].amazonaws.com.cn. +* feature:Python: Dropped support for Python 2.7 + + +1.20.112 +======== + +* api-change:``dms``: Release of feature needed for ECA-Endpoint settings. This allows customer to delete a field in endpoint settings by using --exact-settings flag in modify-endpoint api. This also displays default values for certain required fields of endpoint settings in describe-endpoint-settings api. +* api-change:``glue``: Add support for Event Driven Workflows +* api-change:``acm``: Added support for RSA 3072 SSL certificate import +* api-change:``healthlake``: General availability for Amazon HealthLake. StartFHIRImportJob and StartFHIRExportJob APIs now require AWS KMS parameter. For more information, see the Amazon HealthLake Documentation https://docs.aws.amazon.com/healthlake/index.html. +* api-change:``wellarchitected``: This update provides support for Well-Architected API users to mark answer choices as not applicable. +* api-change:``lightsail``: This release adds support for the Amazon Lightsail object storage service, which allows you to create buckets and store objects. + + +1.20.111 +======== + +* api-change:``amplifybackend``: Added Sign in with Apple OAuth provider. +* api-change:``redshift``: Release new APIs to support new Redshift feature - Authentication Profile +* api-change:``ssm``: Changes to OpsCenter APIs to support a new feature, operational insights. +* api-change:``lex-models``: Customers can now migrate bots built with Lex V1 APIs to V2 APIs. This release adds APIs to initiate and manage the migration of a bot. +* api-change:``directconnect``: This release adds a new filed named awsLogicalDeviceId that it displays the AWS Direct Connect endpoint which terminates a physical connection's BGP Sessions. +* api-change:``pricing``: Documentation updates for api.pricing + + +1.20.110 +======== + +* api-change:``eks``: Documentation updates for Wesley to support the parallel node upgrade feature. +* api-change:``kendra``: Amazon Kendra now supports Principal Store + + +1.20.109 +======== + +* api-change:``sagemaker``: Releasing new APIs related to Tuning steps in model building pipelines. +* api-change:``frauddetector``: This release adds support for ML Explainability to display model variable importance value in Amazon Fraud Detector. +* api-change:``mediaconvert``: MediaConvert now supports color, style and position information passthrough from 608 and Teletext to SRT and WebVTT subtitles. MediaConvert now also supports Automatic QVBR quality levels for QVBR RateControlMode. + + +1.20.108 +======== + +* api-change:``eks``: Added waiters for EKS FargateProfiles. +* api-change:``outposts``: Added property filters for listOutposts +* api-change:``fms``: AWS Firewall Manager now supports route table monitoring, and provides remediation action recommendations to security administrators for AWS Network Firewall policies with misconfigured routes. +* api-change:``mediatailor``: Add ListAlerts for Channel, Program, Source Location, and VOD Source to return alerts for resources. +* api-change:``devops-guru``: Add AnomalyReportedTimeRange field to include open and close time of anomalies. +* api-change:``ssm-contacts``: Updated description for CreateContactChannel contactId. + + +1.20.107 +======== + +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``sts``: Documentation updates for AWS Security Token Service. +* api-change:``mq``: adds support for modifying the maintenance window for brokers. +* api-change:``cloudfront``: Amazon CloudFront now provides two new APIs, ListConflictingAliases and AssociateAlias, that help locate and move Alternate Domain Names (CNAMEs) if you encounter the CNAMEAlreadyExists error code. +* api-change:``chime``: Releasing new APIs for AWS Chime MediaCapturePipeline +* api-change:``iotsitewise``: This release add storage configuration APIs for AWS IoT SiteWise. +* api-change:``storagegateway``: Adding support for oplocks for SMB file shares, S3 Access Point and S3 Private Link for all file shares and IP address support for file system associations +* api-change:``ec2``: This release adds resource ids and tagging support for VPC security group rules. + + +1.20.106 +======== + +* api-change:``lambda``: Added support for AmazonMQRabbitMQ as an event source. Added support for VIRTUAL_HOST as SourceAccessType for streams event source mappings. +* api-change:``imagebuilder``: Adds support for specifying parameters to customize components for recipes. Expands configuration of the Amazon EC2 instances that are used for building and testing images, including the ability to specify commands to run on launch, and more control over installation and removal of the SSM agent. +* api-change:``mgn``: Bug fix: Remove not supported EBS encryption type "NONE" +* api-change:``eks``: Adding new error code UnsupportedAddonModification for Addons in EKS +* api-change:``macie2``: Sensitive data findings in Amazon Macie now include enhanced location data for JSON and JSON Lines files +* api-change:``sns``: Documentation updates for Amazon SNS. + + +1.20.105 +======== + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``ec2``: This release removes network-insights-boundary + + +1.20.104 +======== + +* api-change:``sagemaker``: SageMaker model registry now supports up to 5 containers and associated environment variables. +* api-change:``sqs``: Documentation updates for Amazon SQS. +* api-change:``ec2``: Adding a new reserved field to support future infrastructure improvements for Amazon EC2 Fleet. + + +1.20.103 +======== + +* api-change:``autoscaling``: Amazon EC2 Auto Scaling infrastructure improvements and optimizations. +* api-change:``kendra``: Amazon Kendra Enterprise Edition now offered in smaller more granular units to enable customers with smaller workloads. Virtual Storage Capacity units now offer scaling in increments of 100,000 documents (up to 30GB) per unit and Virtual Query Units offer scaling increments of 8,000 queries per day. +* api-change:``mediapackage-vod``: Add support for Widevine DRM on CMAF packaging configurations. Both Widevine and FairPlay DRMs can now be used simultaneously, with CBCS encryption. +* api-change:``ssm-contacts``: Fixes the tag key length range to 128 chars, tag value length to 256 chars; Adds support for UTF-8 chars for contact and channel names, Allows users to unset name in UpdateContact API; Adds throttling exception to StopEngagement API, validation exception to APIs UntagResource, ListTagsForResource +* api-change:``databrew``: Adds support for the output of job results to the AWS Glue Data Catalog. +* api-change:``servicediscovery``: AWS Cloud Map now allows configuring the TTL of the SOA record for a hosted zone to control the negative caching for new services. + + +1.20.102 +======== + +* api-change:``sagemaker``: Sagemaker Neo now supports running compilation jobs using customer's Amazon VPC +* api-change:``glue``: Add JSON Support for Glue Schema Registry +* api-change:``redshift``: Added InvalidClusterStateFault to the DisableLogging API, thrown when calling the API on a non available cluster. +* api-change:``mediaconvert``: MediaConvert adds support for HDR10+, ProRes 4444, and XAVC outputs, ADM/DAMF support for Dolby Atmos ingest, and alternative audio and WebVTT caption ingest via HLS inputs. MediaConvert also now supports creating trickplay outputs for Roku devices for HLS, CMAF, and DASH output groups. + + +1.20.101 +======== + +* api-change:``proton``: Added waiters for template registration, service operations, and environment deployments. +* api-change:``amplifybackend``: Imports an existing backend authentication resource. +* api-change:``snowball``: AWS Snow Family customers can remotely monitor and operate their connected AWS Snowcone devices. AWS Snowball Edge Storage Optimized customers can now import and export their data using NFS. + + +1.20.100 +======== + +* api-change:``chime``: Adds EventIngestionUrl field to MediaPlacement +* api-change:``cloud9``: Minor update to AWS Cloud9 documentation to allow correct parsing of outputted text +* api-change:``connect``: Released Amazon Connect quick connects management API for general availability (GA). For more information, see https://docs.aws.amazon.com/connect/latest/APIReference/Welcome.html +* api-change:``dax``: Add support for encryption in transit to DAX clusters. +* api-change:``wafv2``: Added support for 15 new text transformation. +* api-change:``kendra``: Amazon Kendra now supports SharePoint 2013 and SharePoint 2016 when using a SharePoint data source. +* api-change:``securityhub``: Added new resource details for ECS clusters and ECS task definitions. Added additional information for S3 buckets, Elasticsearch domains, and API Gateway V2 stages. +* api-change:``transfer``: Customers can successfully use legacy clients with Transfer Family endpoints enabled for FTPS and FTP behind routers, firewalls, and load balancers by providing a Custom IP address used for data channel communication. +* api-change:``codebuild``: BucketOwnerAccess is currently not supported + + +1.20.99 +======= + +* api-change:``docdb``: DocumentDB documentation-only edits +* api-change:``cloud9``: Updated documentation for CreateEnvironmentEC2 to explain that because Amazon Linux AMI has ended standard support as of December 31, 2020, we recommend you choose Amazon Linux 2--which includes long term support through 2023--for new AWS Cloud9 environments. +* api-change:``quicksight``: Releasing new APIs for AWS QuickSight Folders +* api-change:``mediatailor``: Update GetChannelSchedule to return information on ad breaks. +* api-change:``cloudfront``: Amazon CloudFront adds support for a new security policy, TLSv1.2_2021. +* api-change:``license-manager``: AWS License Manager now allows license administrators and end users to communicate to each other by setting custom status reasons when updating the status on a granted license. +* api-change:``ec2``: This release adds support for provisioning your own IP (BYOIP) range in multiple regions. This feature is in limited Preview for this release. Contact your account manager if you are interested in this feature. +* api-change:``events``: Added the following parameters to ECS targets: CapacityProviderStrategy, EnableECSManagedTags, EnableExecuteCommand, PlacementConstraints, PlacementStrategy, PropagateTags, ReferenceId, and Tags +* api-change:``cloudsearch``: This release replaces previous generation CloudSearch instances with equivalent new instances that provide better stability at the same price. +* api-change:``codeguru-reviewer``: Adds support for S3 based full repository analysis and changed lines scan. + + +1.20.98 +======= + +* api-change:``cloudformation``: CloudFormation registry service now supports 3rd party public type sharing + + +1.20.97 +======= + +* api-change:``kendra``: Amazon Kendra now supports the indexing of web documents for search through the web crawler. +* api-change:``sagemaker``: Enable ml.g4dn instance types for SageMaker Batch Transform and SageMaker Processing +* api-change:``rds``: This release enables Database Activity Streams for RDS Oracle +* api-change:``chime``: This release adds a new API UpdateSipMediaApplicationCall, to update an in-progress call for SipMediaApplication. + + +1.20.96 +======= + +* api-change:``kms``: Adds support for multi-Region keys +* api-change:``ec2``: This release adds support for VLAN-tagged network traffic over an Elastic Network Interface (ENI). This feature is in limited Preview for this release. Contact your account manager if you are interested in this feature. +* api-change:``rds``: This release enables fast cloning in Aurora Serverless. You can now clone between Aurora Serverless clusters and Aurora Provisioned clusters. +* api-change:``mediatailor``: Adds AWS Secrets Manager Access Token Authentication for Source Locations + + +1.20.95 +======= + +* api-change:``redshift-data``: Redshift Data API service now supports SQL parameterization. +* api-change:``connect``: This release adds new sets of APIs: AssociateBot, DisassociateBot, and ListBots. You can use it to programmatically add an Amazon Lex bot or Amazon Lex V2 bot on the specified Amazon Connect instance +* api-change:``ec2``: EC2 M5n, M5dn, R5n, R5dn metal instances with 100 Gbps network performance and Elastic Fabric Adapter (EFA) for ultra low latency +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``lexv2-models``: Update lexv2-models client to latest version + + +1.20.94 +======= + +* api-change:``lookoutmetrics``: Added "LEARNING" status for anomaly detector and updated description for "Offset" parameter in MetricSet APIs. +* api-change:``iotanalytics``: Adds support for data store partitions. +* api-change:``greengrassv2``: We have verified the APIs being released here and are ready to release + + +1.20.93 +======= + +* api-change:``ec2``: Amazon EC2 adds new AMI property to flag outdated AMIs +* api-change:``medialive``: AWS MediaLive now supports OCR-based conversion of DVB-Sub and SCTE-27 image-based source captions to WebVTT, and supports ingest of ad avail decorations in HLS input manifests. +* api-change:``mediaconnect``: When you enable source failover, you can now designate one of two sources as the primary source. You can choose between two failover modes to prevent any disruption to the video stream. Merge combines the sources into a single stream. Failover allows switching between a primary and a backup stream. + + +1.20.92 +======= + +* api-change:``sagemaker``: Using SageMaker Edge Manager with AWS IoT Greengrass v2 simplifies accessing, maintaining, and deploying models to your devices. You can now create deployable IoT Greengrass components during edge packaging jobs. You can choose to create a device fleet with or without creating an AWS IoT role alias. +* api-change:``appmesh``: AppMesh now supports additional routing capabilities in match and rewrites for Gateway Routes and Routes. Additionally, App Mesh also supports specifying DNS Response Types in Virtual Nodes. +* api-change:``redshift``: Added InvalidClusterStateFault to the ModifyAquaConfiguration API, thrown when calling the API on a non available cluster. +* api-change:``chime``: This SDK release adds support for UpdateAccount API to allow users to update their default license on Chime account. +* api-change:``ec2``: This release adds a new optional parameter connectivityType (public, private) for the CreateNatGateway API. Private NatGateway does not require customers to attach an InternetGateway to the VPC and can be used for communication with other VPCs and on-premise networks. +* api-change:``ram``: AWS Resource Access Manager (RAM) is releasing new field isResourceTypeDefault in ListPermissions and GetPermission response, and adding permissionArn parameter to GetResourceShare request to filter by permission attached +* api-change:``sagemaker-featurestore-runtime``: Release BatchGetRecord API for AWS SageMaker Feature Store Runtime. +* api-change:``cognito-idp``: Amazon Cognito now supports targeted sign out through refresh token revocation +* api-change:``appflow``: Adding MAP_ALL task type support. +* api-change:``managedblockchain``: This release supports KMS customer-managed Customer Master Keys (CMKs) on member-specific Hyperledger Fabric resources. + + +1.20.91 +======= + +* api-change:``transfer``: Documentation updates for the AWS Transfer Family service. +* api-change:``personalize-events``: Support for unstructured text inputs in the items dataset to to automatically extract key information from product/content description as an input when creating solution versions. +* api-change:``proton``: This is the initial SDK release for AWS Proton +* api-change:``kendra``: AWS Kendra now supports checking document status. + + +1.20.90 +======= + +* api-change:``fsx``: This release adds support for auditing end-user access to files, folders, and file shares using Windows event logs, enabling customers to meet their security and compliance needs. +* api-change:``servicecatalog``: increase max pagesize for List/Search apis +* api-change:``macie2``: This release of the Amazon Macie API introduces stricter validation of S3 object criteria for classification jobs. +* api-change:``cognito-idp``: Documentation updates for cognito-idp + + +1.20.89 +======= + +* api-change:``sagemaker``: AWS SageMaker - Releasing new APIs related to Callback steps in model building pipelines. Adds experiment integration to model building pipelines. +* api-change:``glue``: Add SampleSize variable to S3Target to enable s3-sampling feature through API. +* api-change:``personalize``: Update regex validation in kmsKeyArn and s3 path API parameters for AWS Personalize APIs +* api-change:``eks``: Added updateConfig option that allows customers to control upgrade velocity in Managed Node Group. + + +1.20.88 +======= + +* api-change:``rds``: Documentation updates for RDS: fixing an outdated link to the RDS documentation in DBInstance$DBInstanceStatus +* api-change:``pi``: The new GetDimensionKeyDetails action retrieves the attributes of the specified dimension group for a DB instance or data source. +* api-change:``cloudtrail``: AWS CloudTrail supports data events on new service resources, including Amazon DynamoDB tables and S3 Object Lambda access points. +* api-change:``medialive``: Add support for automatically setting the H.264 adaptive quantization and GOP B-frame fields. +* api-change:``autoscaling``: Documentation updates for Amazon EC2 Auto Scaling +* api-change:``qldb``: Documentation updates for Amazon QLDB + + +1.20.87 +======= + +* api-change:``s3``: S3 Inventory now supports Bucket Key Status +* api-change:``s3control``: Amazon S3 Batch Operations now supports S3 Bucket Keys. +* api-change:``route53resolver``: Documentation updates for Route 53 Resolver +* api-change:``ssm``: Documentation updates for ssm to fix customer reported issue +* api-change:``forecast``: Added optional field AutoMLOverrideStrategy to CreatePredictor API that allows users to customize AutoML strategy. If provided in CreatePredictor request, this field is visible in DescribePredictor and GetAccuracyMetrics responses. + + +1.20.86 +======= + +* api-change:``autoscaling``: You can now launch EC2 instances with GP3 volumes when using Auto Scaling groups with Launch Configurations +* api-change:``lightsail``: Documentation updates for Lightsail +* api-change:``ecs``: Documentation updates for Amazon ECS. +* api-change:``docdb``: This SDK release adds support for DocDB global clusters. +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``braket``: Introduction of a RETIRED status for devices. + + +1.20.85 +======= + +* api-change:``sns``: This release adds SMS sandbox in Amazon SNS and the ability to view all configured origination numbers. The SMS sandbox provides a safe environment for sending SMS messages, without risking your reputation as an SMS sender. +* api-change:``polly``: Amazon Polly adds new Canadian French voice - Gabrielle. Gabrielle is available as Neural voice only. +* api-change:``ec2``: Added idempotency to CreateNetworkInterface using the ClientToken parameter. +* api-change:``iotwireless``: Added six new public customer logging APIs to allow customers to set/get/reset log levels at resource type and resource id level. The log level set from the APIs will be used to filter log messages that can be emitted to CloudWatch in customer accounts. +* api-change:``servicediscovery``: Bugfixes - The DiscoverInstances API operation now provides an option to return all instances for health-checked services when there are no healthy instances available. + + +1.20.84 +======= + +* api-change:``lookoutmetrics``: Allowing dot(.) character in table name for RDS and Redshift as source connector. +* api-change:``location``: Adds support for calculation of routes, resource tagging and customer provided KMS keys. +* api-change:``datasync``: Added SecurityDescriptorCopyFlags option that allows for control of which components of SMB security descriptors are copied from source to destination objects. + + +1.20.83 +======= + +* api-change:``iotevents-data``: Releasing new APIs for AWS IoT Events Alarms +* api-change:``devicefarm``: Introduces support for using our desktop testing service with applications hosted within your Virtual Private Cloud (VPC). +* api-change:``kendra``: Amazon Kendra now suggests popular queries in order to help guide query typing and help overall accuracy. +* api-change:``iotsitewise``: IoT SiteWise Monitor Portal API updates to add alarms feature configuration. +* api-change:``resource-groups``: Documentation updates for Resource Groups. +* api-change:``lightsail``: Documentation updates for Lightsail +* api-change:``iotevents``: Releasing new APIs for AWS IoT Events Alarms +* api-change:``fsx``: This release adds LZ4 data compression support to FSx for Lustre to reduce storage consumption of both file system storage and file system backups. +* api-change:``sqs``: Documentation updates for Amazon SQS for General Availability of high throughput for FIFO queues. + + +1.20.82 +======= + +* api-change:``ec2``: This release removes resource ids and tagging support for VPC security group rules. + + +1.20.81 +======= + +* api-change:``qldb``: Support STANDARD permissions mode in CreateLedger and DescribeLedger. Add UpdateLedgerPermissionsMode to update permissions mode on existing ledgers. +* api-change:``cloudfront``: Documentation fix for CloudFront +* api-change:``outposts``: Add ConflictException to DeleteOutpost, CreateOutpost +* api-change:``mwaa``: Adds scheduler count selection for Environments using Airflow version 2.0.2 or later. +* api-change:``ec2``: This release adds resource ids and tagging support for VPC security group rules. +* api-change:``ecs``: The release adds support for registering External instances to your Amazon ECS clusters. +* api-change:``acm-pca``: This release enables customers to store CRLs in S3 buckets with Block Public Access enabled. The release adds the S3ObjectAcl parameter to the CreateCertificateAuthority and UpdateCertificateAuthority APIs to allow customers to choose whether their CRL will be publicly available. + + +1.20.80 +======= + +* api-change:``transfer``: AWS Transfer Family customers can now use AWS Managed Active Directory or AD Connector to authenticate their end users, enabling seamless migration of file transfer workflows that rely on AD authentication, without changing end users' credentials or needing a custom authorizer. +* api-change:``iot``: This release includes support for a new feature: Job templates for AWS IoT Device Management Jobs. The release includes job templates as a new resource and APIs for managing job templates. +* api-change:``workspaces``: Adds support for Linux device types in WorkspaceAccessProperties + + +1.20.79 +======= + +* api-change:``quicksight``: Add new parameters on RegisterUser and UpdateUser APIs to assign or update external ID associated to QuickSight users federated through web identity. +* api-change:``ce``: Introduced FindingReasonCodes, PlatformDifferences, DiskResourceUtilization and NetworkResourceUtilization to GetRightsizingRecommendation action +* api-change:``compute-optimizer``: Adds support for 1) additional instance types, 2) additional instance metrics, 3) finding reasons for instance recommendations, and 4) platform differences between a current instance and a recommended instance type. +* api-change:``ec2``: This release adds support for creating and managing EC2 On-Demand Capacity Reservations on Outposts. +* api-change:``logs``: This release provides dimensions and unit support for metric filters. + + +1.20.78 +======= + +* api-change:``efs``: Update efs client to latest version +* api-change:``s3``: Documentation updates for Amazon S3 +* api-change:``forecast``: Updated attribute statistics in DescribeDatasetImportJob response to support Long values +* api-change:``opsworkscm``: New PUPPET_API_CRL attribute returned by DescribeServers API; new EngineVersion of 2019 available for Puppet Enterprise servers. + + +1.20.77 +======= + +* api-change:``personalize``: Added new API to stop a solution version creation that is pending or in progress for Amazon Personalize +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``quicksight``: Add ARN based Row Level Security support to CreateDataSet/UpdateDataSet APIs. +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). + + +1.20.76 +======= + +* api-change:``kinesisanalyticsv2``: Kinesis Data Analytics now allows rapid iteration on Apache Flink stream processing through the Kinesis Data Analytics Studio feature. +* api-change:``rekognition``: Amazon Rekognition Custom Labels adds support for customer managed encryption, using AWS Key Management Service, of image files copied into the service and files written back to the customer. +* api-change:``iam``: Add pagination to ListUserTags operation +* api-change:``eks``: Update the EKS AddonActive waiter. +* api-change:``autoscaling``: With this release, customers can easily use Predictive Scaling as a policy directly through Amazon EC2 Auto Scaling configurations to proactively scale their applications ahead of predicted demand. +* api-change:``lightsail``: Documentation updates for Amazon Lightsail. + + +1.20.75 +======= + +* api-change:``support``: Documentation updates for support +* api-change:``apprunner``: AWS App Runner is a service that provides a fast, simple, and cost-effective way to deploy from source code or a container image directly to a scalable and secure web application in the AWS Cloud. +* api-change:``compute-optimizer``: This release enables compute optimizer to support exporting recommendations to Amazon S3 for EBS volumes and Lambda Functions. +* api-change:``personalize``: Amazon Personalize now supports the ability to optimize a solution for a custom objective in addition to maximizing relevance. +* api-change:``license-manager``: AWS License Manager now supports periodic report generation. +* api-change:``iotsitewise``: Documentation updates for AWS IoT SiteWise. +* api-change:``lexv2-models``: Update lexv2-models client to latest version + + +1.20.74 +======= + +* api-change:``mediaconnect``: MediaConnect now supports JPEG XS for AWS Cloud Digital Interface (AWS CDI) uncompressed workflows, allowing you to establish a bridge between your on-premises live video network and the AWS Cloud. +* api-change:``sagemaker-a2i-runtime``: Documentation updates for Amazon A2I Runtime model +* api-change:``applicationcostprofiler``: APIs for AWS Application Cost Profiler. +* api-change:``neptune``: Neptune support for CopyTagsToSnapshots +* api-change:``iotdeviceadvisor``: AWS IoT Core Device Advisor is fully managed test capability for IoT devices. Device manufacturers can use Device Advisor to test their IoT devices for reliable and secure connectivity with AWS IoT. +* api-change:``elasticache``: Documentation updates for elasticache + + +1.20.73 +======= + +* api-change:``events``: Update InputTransformer variable limit from 10 to 100 variables. +* enhancement:``s3``: Block endpoint resolution of clients configured with S3 pseudo-regions (e.g. ``aws-global``, ``s3-external-1``) that will never resolve to a correct access point endpoint. +* api-change:``macie2``: This release of the Amazon Macie API adds support for defining run-time, S3 bucket criteria for classification jobs. It also adds resources for querying data about AWS resources that Macie monitors. +* api-change:``es``: Adds support for cold storage. +* api-change:``securityhub``: Updated descriptions to add notes on array lengths. +* api-change:``detective``: Updated descriptions of array parameters to add the restrictions on the array and value lengths. +* api-change:``transcribe``: Transcribe Medical now supports identification of PHI entities within transcripts +* api-change:``imagebuilder``: Text-only updates for bundled documentation feedback tickets - spring 2021. +* enhancement:FIPS: Add validation to only attempt to connect to FIPS endpoints with a FIPS pseudo-region if the pseudo-region is explicitly known to the SDK. + + +1.20.72 +======= + +* api-change:``ec2``: High Memory virtual instances are powered by Intel Sky Lake CPUs and offer up to 12TB of memory. + + +1.20.71 +======= + +* api-change:``ssm-incidents``: AWS Systems Manager Incident Manager enables faster resolution of critical application availability and performance issues, management of contacts and post-incident analysis +* api-change:``ssm-contacts``: AWS Systems Manager Incident Manager enables faster resolution of critical application availability and performance issues, management of contacts and post incident analysis +* api-change:``s3control``: Documentation updates for Amazon S3-control + + +1.20.70 +======= + +* api-change:``mediaconvert``: AWS Elemental MediaConvert SDK has added support for Kantar SNAP File Audio Watermarking with a Kantar Watermarking account, and Display Definition Segment(DDS) segment data controls for DVB-Sub caption outputs. +* api-change:``ecs``: This release contains updates for Amazon ECS. +* api-change:``codeartifact``: Documentation updates for CodeArtifact +* api-change:``eks``: This release updates create-nodegroup and update-nodegroup-config APIs for adding/updating taints on managed nodegroups. +* api-change:``iotwireless``: Add three new optional fields to support filtering and configurable sub-band in WirelessGateway APIs. The filtering is for all the RF region supported. The sub-band configuration is only applicable to LoRa gateways of US915 or AU915 RF region. +* api-change:``ssm``: This release adds new APIs to associate, disassociate and list related items in SSM OpsCenter; and this release adds DisplayName as a version-level attribute for SSM Documents and introduces two new document types: ProblemAnalysis, ProblemAnalysisTemplate. +* api-change:``kinesisanalyticsv2``: Amazon Kinesis Analytics now supports ListApplicationVersions and DescribeApplicationVersion API for Apache Flink applications +* api-change:``config``: Adds paginator to multiple APIs: By default, the paginator allows user to iterate over the results and allows the CLI to return up to 1000 results. + + +1.20.69 +======= + +* api-change:``lakeformation``: This release adds Tag Based Access Control to AWS Lake Formation service +* api-change:``lookoutmetrics``: Enforcing UUID style for parameters that are already in UUID format today. Documentation specifying eventual consistency of lookoutmetrics resources. +* api-change:``connect``: Adds tagging support for Connect APIs CreateIntegrationAssociation and CreateUseCase. + + +1.20.68 +======= + +* api-change:``servicediscovery``: Bugfix: Improved input validation for RegisterInstance action, InstanceId field +* api-change:``kafka``: IAM Access Control for Amazon MSK enables you to create clusters that use IAM to authenticate clients and to allow or deny Apache Kafka actions for those clients. +* api-change:``ssm``: SSM feature release - ChangeCalendar integration with StateManager. +* api-change:``snowball``: AWS Snow Family adds APIs for ordering and managing Snow jobs with long term pricing + + +1.20.67 +======= + +* api-change:``auditmanager``: This release updates the CreateAssessmentFrameworkControlSet and UpdateAssessmentFrameworkControlSet API data types. For both of these data types, the control set name is now a required attribute. +* api-change:``nimble``: Documentation Updates for Amazon Nimble Studio. +* api-change:``kinesisanalyticsv2``: Amazon Kinesis Analytics now supports RollbackApplication for Apache Flink applications to revert the application to the previous running version +* api-change:``sagemaker``: Amazon SageMaker Autopilot now provides the ability to automatically deploy the best model to an endpoint + + +1.20.66 +======= + +* api-change:``finspace``: Documentation updates for FinSpace API. +* api-change:``finspace-data``: Documentation updates for FinSpaceData API. + + +1.20.65 +======= + +* api-change:``devops-guru``: Added GetCostEstimation and StartCostEstimation to get the monthly resource usage cost and added ability to view resource health by AWS service name and to search insights be AWS service name. +* api-change:``acm-pca``: This release adds the KeyStorageSecurityStandard parameter to the CreateCertificateAuthority API to allow customers to mandate a security standard to which the CA key will be stored within. +* api-change:``health``: Documentation updates for health +* api-change:``chime``: This release adds the ability to search for and order international phone numbers for Amazon Chime SIP media applications. +* api-change:``sagemaker``: Enable retrying Training and Tuning Jobs that fail with InternalServerError by setting RetryStrategy. + + +1.20.64 +======= + +* api-change:``finspace-data``: Update FinSpace Data serviceAbbreviation + + +1.20.63 +======= + +* api-change:``finspace-data``: This is the initial SDK release for the data APIs for Amazon FinSpace. Amazon FinSpace is a data management and analytics application for the financial services industry (FSI). +* api-change:``mturk``: Update mturk client to latest version +* api-change:``chime``: Added new BatchCreateChannelMembership API to support multiple membership creation for channels +* api-change:``finspace``: This is the initial SDK release for the management APIs for Amazon FinSpace. Amazon FinSpace is a data management and analytics service for the financial services industry (FSI). +* api-change:``securityhub``: Updated ASFF to add the following new resource details objects: AwsEc2NetworkAcl, AwsEc2Subnet, and AwsElasticBeanstalkEnvironment. + + +1.20.62 +======= + +* api-change:``personalize``: Update URL for dataset export job documentation. +* api-change:``marketplace-catalog``: Allows user defined names for Changes in a ChangeSet. Users can use ChangeNames to reference properties in another Change within a ChangeSet. This feature allows users to make changes to an entity when the entity identifier is not yet available while constructing the StartChangeSet request. +* api-change:``forecast``: Added new DeleteResourceTree operation that helps in deleting all the child resources of a given resource including the given resource. +* api-change:``robomaker``: Adds ROS2 Foxy as a supported Robot Software Suite Version and Gazebo 11 as a supported Simulation Software Suite Version +* api-change:``cloudfront``: CloudFront now supports CloudFront Functions, a native feature of CloudFront that enables you to write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations. +* api-change:``customer-profiles``: This release introduces GetMatches and MergeProfiles APIs to fetch and merge duplicate profiles + + +1.20.61 +======= + +* api-change:``macie2``: The Amazon Macie API now provides S3 bucket metadata that indicates whether a bucket policy requires server-side encryption of objects when objects are uploaded to the bucket. +* api-change:``organizations``: Minor text updates for AWS Organizations API Reference +* api-change:``ecs``: Add support for EphemeralStorage on TaskDefinition and TaskOverride +* api-change:``chime``: Increase AppInstanceUserId length to 64 characters + + +1.20.60 +======= + +* api-change:``connect``: Updated max number of tags that can be attached from 200 to 50. MaxContacts is now an optional parameter for the UpdateQueueMaxContact API. +* api-change:``mediapackage-vod``: MediaPackage now offers the option to place your Sequence Parameter Set (SPS), Picture Parameter Set (PPS), and Video Parameter Set (VPS) encoder metadata in every video segment instead of in the init fragment for DASH and CMAF endpoints. +* api-change:``nimble``: Amazon Nimble Studio is a virtual studio service that empowers visual effects, animation, and interactive content teams to create content securely within a scalable, private cloud service. +* api-change:``iotsitewise``: AWS IoT SiteWise interpolation API will get interpolated values for an asset property per specified time interval during a period of time. +* api-change:``cloudformation``: Add CallAs parameter to GetTemplateSummary to enable use with StackSets delegated administrator integration + + +1.20.59 +======= + +* api-change:``auditmanager``: This release restricts using backslashes in control, assessment, and framework names. The controlSetName field of the UpdateAssessmentFrameworkControlSet API now allows strings without backslashes. + + +1.20.58 +======= + +* api-change:``ec2``: Adding support for Red Hat Enterprise Linux with HA for Reserved Instances. +* api-change:``iotwireless``: Add a new optional field MessageType to support Sidewalk devices in SendDataToWirelessDevice API +* api-change:``kinesisanalyticsv2``: Amazon Kinesis Data Analytics now supports custom application maintenance configuration using UpdateApplicationMaintenanceConfiguration API for Apache Flink applications. Customers will have visibility when their application is under maintenance status using 'MAINTENANCE' application status. +* api-change:``personalize``: Added support for exporting data imported into an Amazon Personalize dataset to a specified data source (Amazon S3 bucket). +* api-change:``mediaconvert``: Documentation updates for mediaconvert +* api-change:``codeguru-reviewer``: Include KMS Key Details in Repository Association APIs to enable usage of customer managed KMS Keys. +* api-change:``glue``: Adding Kafka Client Auth Related Parameters +* api-change:``eks``: This release updates existing Amazon EKS input validation so customers will see an InvalidParameterException instead of a ParamValidationError when they enter 0 for minSize and/or desiredSize. It also adds LaunchTemplate information to update responses and a new "CUSTOM" value for AMIType. + + +1.20.57 +======= + +* api-change:``mediapackage``: Add support for Widevine DRM on CMAF origin endpoints. Both Widevine and FairPlay DRMs can now be used simultaneously, with CBCS encryption. +* api-change:``sns``: Amazon SNS adds two new attributes, TemplateId and EntityId, for using sender IDs to send SMS messages to destinations in India. + + +1.20.56 +======= + +* api-change:``forecast``: This release adds EstimatedTimeRemaining minutes field to the DescribeDatasetImportJob, DescribePredictor, DescribeForecast API response which denotes the time remaining to complete the job IN_PROGRESS. +* api-change:``securityhub``: Replaced the term "master" with "administrator". Added new actions to replace AcceptInvitation, GetMasterAccount, and DisassociateFromMasterAccount. In Member, replaced MasterId with AdministratorId. +* api-change:``cognito-idp``: Documentation updates for cognito-idp +* api-change:``elasticache``: This release introduces log delivery of Redis slow log from Amazon ElastiCache. + + +1.20.55 +======= + +* api-change:``detective``: Added parameters to track the data volume in bytes for a member account. Deprecated the existing parameters that tracked the volume as a percentage of the allowed volume for a behavior graph. Changes reflected in MemberDetails object. +* api-change:``redshift``: Add operations: AddPartner, DescribePartners, DeletePartner, and UpdatePartnerStatus to support tracking integration status with data partners. +* api-change:``groundstation``: Support new S3 Recording Config allowing customers to write downlink data directly to S3. +* api-change:``kendra``: Amazon Kendra now enables users to override index-level boosting configurations for each query. +* api-change:``cloudformation``: Added support for creating and updating stack sets with self-managed permissions from templates that reference macros. + + +1.20.54 +======= + +* api-change:``savingsplans``: Added support for Amazon SageMaker in Machine Learning Savings Plans +* api-change:``ce``: Adding support for Sagemaker savings plans in GetSavingsPlansPurchaseRecommendation API + + +1.20.53 +======= + +* api-change:``sts``: STS now supports assume role with Web Identity using JWT token length upto 20000 characters +* api-change:``dms``: AWS DMS added support of TLS for Kafka endpoint. Added Describe endpoint setting API for DMS endpoints. + + +1.20.52 +======= + +* api-change:``mediaconnect``: For flows that use Listener protocols, you can now easily locate an output's outbound IP address for a private internet. Additionally, MediaConnect now supports the Waiters feature that makes it easier to poll for the status of a flow until it reaches its desired state. +* api-change:``config``: Add exception for DeleteRemediationConfiguration and DescribeRemediationExecutionStatus +* api-change:``route53``: Documentation updates for route53 +* api-change:``codestar-connections``: This release adds tagging support for CodeStar Connections Host resources + + +1.20.51 +======= + +* api-change:``lightsail``: Documentation updates for Amazon Lightsail. +* api-change:``sts``: This release adds the SourceIdentity parameter that can be set when assuming a role. +* api-change:``comprehendmedical``: The InferICD10CM API now returns TIME_EXPRESSION entities that refer to medical conditions. +* api-change:``rds``: Clarify that enabling or disabling automated backups causes a brief downtime, not an outage. +* api-change:``redshift``: Added support to enable AQUA in Amazon Redshift clusters. + + +1.20.50 +======= + +* api-change:``fsx``: Support for cross-region and cross-account backup copies +* api-change:``codebuild``: AWS CodeBuild now allows you to set the access permissions for build artifacts, project artifacts, and log files that are uploaded to an Amazon S3 bucket that is owned by another account. + + +1.20.49 +======= + +* api-change:``redshift``: Add support for case sensitive table level restore +* api-change:``ec2``: Add paginator support to DescribeStoreImageTasks and update documentation. +* api-change:``shield``: CreateProtection now throws InvalidParameterException instead of InternalErrorException when system tags (tag with keys prefixed with "aws:") are passed in. + + +1.20.48 +======= + +* api-change:``lookoutequipment``: This release introduces support for Amazon Lookout for Equipment. +* api-change:``kinesis-video-archived-media``: Documentation updates for archived.kinesisvideo +* api-change:``robomaker``: This release allows RoboMaker customers to specify custom tools to run with their simulation job +* api-change:``appstream``: This release provides support for image updates +* api-change:``ram``: Documentation updates for AWS RAM resource sharing +* api-change:``customer-profiles``: Documentation updates for Put-Integration API +* api-change:``autoscaling``: Amazon EC2 Auto Scaling announces Warm Pools that help applications to scale out faster by pre-initializing EC2 instances and save money by requiring fewer continuously running instances + + +1.20.47 +======= + +* api-change:``storagegateway``: File Gateway APIs now support FSx for Windows as a cloud storage. +* api-change:``accessanalyzer``: IAM Access Analyzer now analyzes your CloudTrail events to identify actions and services that have been used by an IAM entity (user or role) and generates an IAM policy that is based on that activity. +* api-change:``elasticache``: This release adds tagging support for all AWS ElastiCache resources except Global Replication Groups. +* api-change:``ivs``: This release adds support for the Auto-Record to S3 feature. Amazon IVS now enables you to save your live video to Amazon S3. +* api-change:``mgn``: Add new service - Application Migration Service. + + +1.20.46 +======= + +* api-change:``ssm``: Supports removing a label or labels from a parameter, enables ScheduledEndTime and ChangeDetails for StartChangeRequestExecution API, supports critical/security/other noncompliant count for patch API. +* api-change:``medialive``: MediaLive VPC outputs update to include Availability Zones, Security groups, Elastic Network Interfaces, and Subnet Ids in channel response +* api-change:``ec2``: This release adds support for storing EBS-backed AMIs in S3 and restoring them from S3 to enable cross-partition copying of AMIs +* api-change:``cloud9``: Documentation updates for Cloud9 + + +1.20.45 +======= + +* api-change:``auditmanager``: AWS Audit Manager has updated the GetAssessment API operation to include a new response field called userRole. The userRole field indicates the role information and IAM ARN of the API caller. +* api-change:``medialive``: MediaLive now support HTML5 Motion Graphics overlay +* api-change:``appflow``: Added destination properties for Zendesk. + + +1.20.44 +======= + +* api-change:``mediapackage``: SPEKE v2 is an upgrade to the existing SPEKE API to support multiple encryption keys, based on an encryption contract selected by the customer. +* api-change:``imagebuilder``: This release adds support for Block Device Mappings for container image builds, and adds distribution configuration support for EC2 launch templates in AMI builds. + + +1.20.43 +======= + +* api-change:``route53resolver``: Route 53 Resolver DNS Firewall is a firewall service that allows you to filter and regulate outbound DNS traffic for your VPCs. +* api-change:``mediaconvert``: MediaConvert now supports HLS ingest, sidecar WebVTT ingest, Teletext color & style passthrough to TTML subtitles, TTML to WebVTT subtitle conversion with style, & DRC profiles in AC3 audio. +* api-change:``lightsail``: - This release adds support for state detail for Amazon Lightsail container services. +* api-change:``kendra``: AWS Kendra's ServiceNow data source now supports OAuth 2.0 authentication and knowledge article filtering via a ServiceNow query. +* api-change:``lex-models``: Lex now supports the ja-JP locale +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``fms``: Added Firewall Manager policy support for AWS Route 53 Resolver DNS Firewall. +* api-change:``ec2``: VPC Flow Logs Service adds a new API, GetFlowLogsIntegrationTemplate, which generates CloudFormation templates for Athena. For more info, see https://docs.aws.amazon.com/console/vpc/flow-logs/athena +* api-change:``wafv2``: Added support for ScopeDownStatement for ManagedRuleGroups, Labels, LabelMatchStatement, and LoggingFilter. For more information on these features, see the AWS WAF Developer Guide. + + +1.20.42 +======= + +* api-change:``iot``: Added ability to prefix search on attribute value for ListThings API. +* api-change:``pricing``: Minor documentation and link updates. +* api-change:``transcribe``: Amazon Transcribe now supports creating custom language models in the following languages: British English (en-GB), Australian English (en-AU), Indian Hindi (hi-IN), and US Spanish (es-US). +* api-change:``cloudhsm``: Minor documentation and link updates. +* api-change:``comprehend``: Support for customer managed KMS encryption of Comprehend custom models +* api-change:``cognito-sync``: Minor documentation updates and link updates. +* api-change:``batch``: AWS Batch adds support for Amazon EFS File System +* api-change:``detective``: Added the ability to assign tag values to Detective behavior graphs. Tag values can be used for attribute-based access control, and for cost allocation for billing. +* api-change:``iotwireless``: Add Sidewalk support to APIs: GetWirelessDevice, ListWirelessDevices, GetWirelessDeviceStatistics. Add Gateway connection status in GetWirelessGatewayStatistics API. +* api-change:``cloudformation``: 1. Added a new parameter RegionConcurrencyType in OperationPreferences. 2. Changed the name of AccountUrl to AccountsUrl in DeploymentTargets parameter. +* api-change:``cloud9``: Add ImageId input parameter to CreateEnvironmentEC2 endpoint. New parameter enables creation of environments with different AMIs. +* api-change:``directconnect``: This release adds MACsec support to AWS Direct Connect +* api-change:``redshift``: Enable customers to share access to their Redshift clusters from other VPCs (including VPCs from other accounts). +* api-change:``workmail``: This release adds support for mobile device access rules management in Amazon WorkMail. +* api-change:``datapipeline``: Minor documentation updates and link updates. +* api-change:``machinelearning``: Minor documentation updates and link updates. + + +1.20.41 +======= + +* api-change:``sagemaker``: Amazon SageMaker Autopilot now supports 1) feature importance reports for AutoML jobs and 2) PartialFailures for AutoML jobs +* api-change:``ec2-instance-connect``: Adding support to push SSH keys to the EC2 serial console in order to allow an SSH connection to your Amazon EC2 instance's serial port. +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``databrew``: This SDK release adds two new dataset features: 1) support for specifying a database connection as a dataset input 2) support for dynamic datasets that accept configurable parameters in S3 path. +* api-change:``frauddetector``: This release adds support for Batch Predictions in Amazon Fraud Detector. +* api-change:``ec2``: ReplaceRootVolume feature enables customers to replace the EBS root volume of a running instance to a previously known state. Add support to grant account-level access to the EC2 serial console +* api-change:``config``: Adding new APIs to support ConformancePack Compliance CI in Aggregators +* api-change:``pinpoint``: Added support for journey pause/resume, journey updatable import segment and journey quiet time wait. + + +1.20.40 +======= + +* api-change:``wafv2``: Added custom request handling and custom response support in rule actions and default action; Added the option to inspect the web request body as parsed and filtered JSON. +* api-change:``iam``: AWS Identity and Access Management GetAccessKeyLastUsed API will throw a custom error if customer public key is not found for access keys. +* api-change:``glue``: Allow Dots in Registry and Schema Names for CreateRegistry, CreateSchema; Fixed issue when duplicate keys are present and not returned as part of QuerySchemaVersionMetadata. +* api-change:``docdb``: This release adds support for Event Subscriptions to DocumentDB. +* api-change:``location``: Amazon Location added support for specifying pricing plan information on resources in alignment with our cost model. + + +1.20.39 +======= + +* api-change:``iotwireless``: Support tag-on-create for WirelessDevice. +* api-change:``customer-profiles``: This release adds an optional parameter named FlowDefinition in PutIntegrationRequest. +* api-change:``events``: Add support for SageMaker Model Builder Pipelines Targets to EventBridge +* api-change:``transcribe``: Amazon Transcribe now supports tagging words that match your vocabulary filter for batch transcription. + + +1.20.38 +======= + +* api-change:``lookoutmetrics``: Allowing uppercase alphabets for RDS and Redshift database names. + + +1.20.37 +======= + +* api-change:``sqs``: Documentation updates for Amazon SQS +* api-change:``rekognition``: This release introduces AWS tagging support for Amazon Rekognition collections, stream processors, and Custom Label models. +* api-change:``sagemaker``: This feature allows customer to specify the environment variables in their CreateTrainingJob requests. +* api-change:``medialive``: EML now supports handling HDR10 and HLG 2020 color space from a Link input. +* api-change:``lookoutmetrics``: Amazon Lookout for Metrics is now generally available. You can use Lookout for Metrics to monitor your data for anomalies. For more information, see the Amazon Lookout for Metrics Developer Guide. +* api-change:``alexaforbusiness``: Added support for enabling and disabling data retention in the CreateProfile and UpdateProfile APIs and retrieving the state of data retention for a profile in the GetProfile API. + + +1.20.36 +======= + +* api-change:``ssm``: This release allows SSM Explorer customers to enable OpsData sources across their organization when creating a resource data sync. +* api-change:``route53``: Documentation updates for route53 +* bugfix:S3: Fix an issue with XML newline normalization in PutBucketLifecycleConfiguration requests. +* api-change:``s3``: Documentation updates for Amazon S3 +* api-change:``s3control``: Documentation updates for s3-control +* api-change:``ec2``: maximumEfaInterfaces added to DescribeInstanceTypes API +* api-change:``greengrass``: Updated the parameters to make name required for CreateGroup API. + + +1.20.35 +======= + +* api-change:``ce``: You can now create cost categories with inherited value rules and specify default values for any uncategorized costs. +* api-change:``fis``: Updated maximum allowed size of action parameter from 64 to 1024 +* api-change:``redshift``: Removed APIs to control AQUA on clusters. +* api-change:``iam``: Documentation updates for IAM operations and descriptions. +* api-change:``gamelift``: GameLift adds support for using event notifications to monitor game session placements. Specify an SNS topic or use CloudWatch Events to track activity for a game session queue. + + +1.20.34 +======= + +* api-change:``ec2``: This release adds support for UEFI boot on selected AMD- and Intel-based EC2 instances. +* api-change:``redshift``: Added support to enable AQUA in Amazon Redshift clusters. +* api-change:``codeartifact``: Documentation updates for CodeArtifact +* api-change:``macie2``: This release of the Amazon Macie API adds support for publishing sensitive data findings to AWS Security Hub and specifying which categories of findings to publish to Security Hub. + + +1.20.33 +======= + +* api-change:``sagemaker``: Adding authentication support for pulling images stored in private Docker registries to build containers for real-time inference. +* api-change:``ec2``: X2gd instances are the next generation of memory-optimized instances powered by AWS-designed, Arm-based AWS Graviton2 processors. + + +1.20.32 +======= + +* bugfix:s3: Updated mislabeled exceptions for S3 Object Lambda + + +1.20.31 +======= + +* api-change:``autoscaling``: Amazon EC2 Auto Scaling Instance Refresh now supports phased deployments. +* api-change:``s3``: S3 Object Lambda is a new S3 feature that enables users to apply their own custom code to process the output of a standard S3 GET request by automatically invoking a Lambda function with a GET request +* api-change:``redshift``: Add new fields for additional information about VPC endpoint for clusters with reallocation enabled, and a new field for total storage capacity for all clusters. +* api-change:``s3control``: S3 Object Lambda is a new S3 feature that enables users to apply their own custom code to process the output of a standard S3 GET request by automatically invoking a Lambda function with a GET request +* api-change:``securityhub``: New object for separate provider and customer values. New objects track S3 Public Access Block configuration and identify sensitive data. BatchImportFinding requests are limited to 100 findings. + + +1.20.30 +======= + +* api-change:``sagemaker``: Support new target device ml_eia2 in SageMaker CreateCompilationJob API +* api-change:``batch``: Making serviceRole an optional parameter when creating a compute environment. If serviceRole is not provided then Service Linked Role will be created (or reused if it already exists). + + +1.20.29 +======= + +* api-change:``lambda``: Allow empty list for function response types +* api-change:``iam``: Documentation updates for AWS Identity and Access Management (IAM). +* api-change:``mediaconnect``: This release adds support for the SRT-listener protocol on sources and outputs. +* api-change:``accessanalyzer``: This release adds support for the ValidatePolicy API. IAM Access Analyzer is adding over 100 policy checks and actionable recommendations that help you validate your policies during authoring. +* api-change:``mediatailor``: MediaTailor channel assembly is a new manifest-only service that allows you to assemble linear streams using your existing VOD content. +* api-change:``mwaa``: This release adds UPDATE_FAILED and UNAVAILABLE MWAA environment states. +* api-change:``gamelift``: GameLift expands to six new AWS Regions, adds support for multi-location fleets to streamline management of hosting resources, and lets you customize more of the game session placement process. + + +1.20.28 +======= + +* api-change:``fis``: Initial release of AWS Fault Injection Simulator, a managed service that enables you to perform fault injection experiments on your AWS workloads +* api-change:``codedeploy``: AWS CodeDeploy can now detect instances running an outdated revision of your application and automatically update them with the latest revision. +* api-change:``emr``: Update emr client to latest version +* api-change:``ecs``: This is for ecs exec feature release which includes two new APIs - execute-command and update-cluster and an AWS CLI customization for execute-command API + + +1.20.27 +======= + +* api-change:``mediatailor``: MediaTailor channel assembly is a new manifest-only service that allows you to assemble linear streams using your existing VOD content. +* api-change:``workspaces``: Adds API support for WorkSpaces bundle management operations. +* api-change:``cur``: - Added optional billingViewArn field for OSG. + + +1.20.26 +======= + +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``network-firewall``: Update network-firewall client to latest version + + +1.20.25 +======= + +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``backup``: Update backup client to latest version + + +1.20.24 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``codeguruprofiler``: Update codeguruprofiler client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``iotwireless``: Update iotwireless client to latest version +* api-change:``efs``: Update efs client to latest version + + +1.20.23 +======= + +* api-change:``lambda``: Update lambda client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version + + +1.20.22 +======= + +* api-change:``license-manager``: Update license-manager client to latest version +* api-change:``network-firewall``: Update network-firewall client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``athena``: Update athena client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``shield``: Update shield client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``appflow``: Update appflow client to latest version + + +1.20.21 +======= + +* api-change:``servicediscovery``: Update servicediscovery client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``mwaa``: Update mwaa client to latest version + + +1.20.20 +======= + +* api-change:``forecast``: Update forecast client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``acm``: Update acm client to latest version +* api-change:``wellarchitected``: Update wellarchitected client to latest version + + +1.20.19 +======= + +* api-change:``iotwireless``: Update iotwireless client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* bugfix:S3: Fix an issue with XML newline normalization that could result in the DeleteObjects operation incorrectly deleting the wrong keys. +* api-change:``managedblockchain``: Update managedblockchain client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version +* api-change:``datasync``: Update datasync client to latest version + + +1.20.18 +======= + +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.20.17 +======= + +* api-change:``s3``: Update s3 client to latest version +* api-change:``sso-admin``: Update sso-admin client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``emr``: Update emr client to latest version + + +1.20.16 +======= + +* api-change:``databrew``: Update databrew client to latest version +* api-change:``detective``: Update detective client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``transfer``: Update transfer client to latest version + + +1.20.15 +======= + +* api-change:``es``: Update es client to latest version +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version +* api-change:``appflow``: Update appflow client to latest version +* api-change:``ecr-public``: Update ecr-public client to latest version +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version + + +1.20.14 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``redshift-data``: Update redshift-data client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``iotevents``: Update iotevents client to latest version +* api-change:``connect``: Update connect client to latest version + + +1.20.13 +======= + +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.20.12 +======= + +* api-change:``rds``: Update rds client to latest version + + +1.20.11 +======= + +* api-change:``health``: Update health client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.20.10 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``lookoutvision``: Update lookoutvision client to latest version + + +1.20.9 +====== + +* api-change:``devops-guru``: Update devops-guru client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.20.8 +====== + +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``redshift-data``: Update redshift-data client to latest version +* api-change:``workmailmessageflow``: Update workmailmessageflow client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version + + +1.20.7 +====== + +* api-change:``personalize-events``: Update personalize-events client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``detective``: Update detective client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.20.6 +====== + +* api-change:``databrew``: Update databrew client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.20.5 +====== + +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``qldb-session``: Update qldb-session client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``gamelift``: Update gamelift client to latest version + + +1.20.4 +====== + +* api-change:``dataexchange``: Update dataexchange client to latest version +* api-change:``cloudtrail``: Update cloudtrail client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``ivs``: Update ivs client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``elasticache``: Update elasticache client to latest version + + +1.20.3 +====== + +* api-change:``macie``: Update macie client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.20.2 +====== + +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``appflow``: Update appflow client to latest version +* api-change:``emr-containers``: Update emr-containers client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``athena``: Update athena client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.20.1 +====== + +* api-change:``lambda``: Update lambda client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``databrew``: Update databrew client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``workmail``: Update workmail client to latest version +* api-change:``auditmanager``: Update auditmanager client to latest version +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version + + +1.20.0 +====== + +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``lookoutvision``: Update lookoutvision client to latest version +* api-change:``organizations``: Update organizations client to latest version +* feature:Python: Dropped support for Python 3.4 and 3.5 +* api-change:``s3control``: Update s3control client to latest version +* api-change:``rds-data``: Update rds-data client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``location``: Update location client to latest version +* enhancement:s3: Amazon S3 now supports AWS PrivateLink, providing direct access to S3 via a private endpoint within your virtual private network. +* api-change:``iotwireless``: Update iotwireless client to latest version + + +1.19.63 +======= + +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``connect``: Update connect client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.19.62 +======= + +* api-change:``wellarchitected``: Update wellarchitected client to latest version +* api-change:``managedblockchain``: Update managedblockchain client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``databrew``: Update databrew client to latest version +* bugfix:Validator: Fix showing incorrect max-value in error message for range and length value validation +* api-change:``iot``: Update iot client to latest version +* api-change:``robomaker``: Update robomaker client to latest version + + +1.19.61 +======= + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``customer-profiles``: Update customer-profiles client to latest version +* api-change:``sesv2``: Update sesv2 client to latest version +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``es``: Update es client to latest version + + +1.19.60 +======= + +* api-change:``backup``: Update backup client to latest version + + +1.19.59 +======= + +* api-change:``greengrassv2``: Update greengrassv2 client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``lexv2-runtime``: Update lexv2-runtime client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``lexv2-models``: Update lexv2-models client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.19.58 +======= + +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version + + +1.19.57 +======= + +* api-change:``acm-pca``: Update acm-pca client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.19.56 +======= + +* api-change:``sns``: Update sns client to latest version + + +1.19.55 +======= + +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``cognito-identity``: Update cognito-identity client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.19.54 +======= + +* api-change:``frauddetector``: Update frauddetector client to latest version +* api-change:``personalize``: Update personalize client to latest version + + +1.19.53 +======= + +* api-change:``appstream``: Update appstream client to latest version +* api-change:``auditmanager``: Update auditmanager client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``lightsail``: Update lightsail client to latest version + + +1.19.52 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``kms``: Update kms client to latest version + + +1.19.51 +======= + +* api-change:``devops-guru``: Update devops-guru client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.19.50 +======= + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``transfer``: Update transfer client to latest version +* api-change:``autoscaling-plans``: Update autoscaling-plans client to latest version + + +1.19.49 +======= + +* api-change:``ce``: Update ce client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.19.48 +======= + +* api-change:``healthlake``: Update healthlake client to latest version +* api-change:``cloudsearch``: Update cloudsearch client to latest version + + +1.19.47 +======= + +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.19.46 +======= + +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``elasticache``: Update elasticache client to latest version + + +1.19.45 +======= + +* api-change:``acm-pca``: Update acm-pca client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version + + +1.19.44 +======= + +* api-change:``cloudfront``: Update cloudfront client to latest version + + +1.19.43 +======= + +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``dms``: Update dms client to latest version + + +1.19.42 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``iotwireless``: Update iotwireless client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``connect``: Update connect client to latest version +* api-change:``elasticache``: Update elasticache client to latest version + + +1.19.41 +======= + +* api-change:``config``: Update config client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``managedblockchain``: Update managedblockchain client to latest version +* api-change:``service-quotas``: Update service-quotas client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``connectparticipant``: Update connectparticipant client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``qldb-session``: Update qldb-session client to latest version +* api-change:``outposts``: Update outposts client to latest version +* api-change:``servicecatalog-appregistry``: Update servicecatalog-appregistry client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``apigateway``: Update apigateway client to latest version + + +1.19.40 +======= + +* api-change:``rds``: Update rds client to latest version +* bugfix:SSO: Fixed timestamp format for SSO credential expirations +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.19.39 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``route53resolver``: Update route53resolver client to latest version +* api-change:``sqs``: Update sqs client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.19.38 +======= + +* api-change:``ce``: Update ce client to latest version +* api-change:``amp``: Update amp client to latest version +* api-change:``location``: Update location client to latest version +* api-change:``wellarchitected``: Update wellarchitected client to latest version +* api-change:``quicksight``: Update quicksight client to latest version + + +1.19.37 +======= + +* api-change:``iotwireless``: Update iotwireless client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``greengrassv2``: Update greengrassv2 client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``iotdeviceadvisor``: Update iotdeviceadvisor client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``amp``: Update amp client to latest version +* api-change:``iotfleethub``: Update iotfleethub client to latest version + + +1.19.36 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* api-change:``devops-guru``: Update devops-guru client to latest version + + +1.19.35 +======= + +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``pi``: Update pi client to latest version +* api-change:``cloudtrail``: Update cloudtrail client to latest version + + +1.19.34 +======= + +* api-change:``networkmanager``: Update networkmanager client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.19.33 +======= + +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.19.32 +======= + +* api-change:``ecr``: Update ecr client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``auditmanager``: Update auditmanager client to latest version +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``sagemaker-edge``: Update sagemaker-edge client to latest version +* api-change:``forecast``: Update forecast client to latest version +* api-change:``healthlake``: Update healthlake client to latest version +* api-change:``emr-containers``: Update emr-containers client to latest version + + +1.19.31 +======= + +* api-change:``dms``: Update dms client to latest version +* api-change:``servicecatalog-appregistry``: Update servicecatalog-appregistry client to latest version + + +1.19.30 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``license-manager``: Update license-manager client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``ds``: Update ds client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.19.29 +======= + +* api-change:``license-manager``: Update license-manager client to latest version +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version +* api-change:``amplifybackend``: Update amplifybackend client to latest version +* api-change:``batch``: Update batch client to latest version + + +1.19.28 +======= + +* api-change:``customer-profiles``: Update customer-profiles client to latest version + + +1.19.27 +======= + +* api-change:``sagemaker-featurestore-runtime``: Update sagemaker-featurestore-runtime client to latest version +* api-change:``ecr-public``: Update ecr-public client to latest version +* api-change:``honeycode``: Update honeycode client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``amplifybackend``: Update amplifybackend client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``lookoutvision``: Update lookoutvision client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``connect``: Update connect client to latest version +* api-change:``connect-contact-lens``: Update connect-contact-lens client to latest version +* api-change:``profile``: Update profile client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``appintegrations``: Update appintegrations client to latest version +* api-change:``ds``: Update ds client to latest version +* api-change:``devops-guru``: Update devops-guru client to latest version + + +1.19.26 +======= + +* api-change:``ec2``: Update ec2 client to latest version + + +1.19.25 +======= + +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``appflow``: Update appflow client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``timestream-write``: Update timestream-write client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``cloudtrail``: Update cloudtrail client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``mwaa``: Update mwaa client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``gamelift``: Update gamelift client to latest version + + +1.19.24 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``translate``: Update translate client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``application-insights``: Update application-insights client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``signer``: Update signer client to latest version +* api-change:``codestar-connections``: Update codestar-connections client to latest version +* api-change:``codeartifact``: Update codeartifact client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``forecast``: Update forecast client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``timestream-query``: Update timestream-query client to latest version +* api-change:``sso-admin``: Update sso-admin client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``outposts``: Update outposts client to latest version +* api-change:``license-manager``: Update license-manager client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version + + +1.19.23 +======= + +* api-change:``servicecatalog-appregistry``: Update servicecatalog-appregistry client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version +* api-change:``codeguru-reviewer``: Update codeguru-reviewer client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``cognito-identity``: Update cognito-identity client to latest version +* api-change:``connect``: Update connect client to latest version + + +1.19.22 +======= + +* api-change:``ce``: Update ce client to latest version +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``ds``: Update ds client to latest version +* api-change:``kinesisanalyticsv2``: Update kinesisanalyticsv2 client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``lambda``: Update lambda client to latest version + + +1.19.21 +======= + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* bugfix:Retry: Fix bug where retries were attempted on any response with an "Error" key. +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``backup``: Update backup client to latest version +* api-change:``outposts``: Update outposts client to latest version + + +1.19.20 +======= + +* api-change:``connect``: Update connect client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``fms``: Update fms client to latest version +* api-change:``network-firewall``: Update network-firewall client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``macie2``: Update macie2 client to latest version + + +1.19.19 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``iotsecuretunneling``: Update iotsecuretunneling client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``synthetics``: Update synthetics client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``quicksight``: Update quicksight client to latest version + + +1.19.18 +======= + +* api-change:``textract``: Update textract client to latest version +* api-change:``shield``: Update shield client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.19.17 +======= + +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``servicecatalog-appregistry``: Update servicecatalog-appregistry client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``polly``: Update polly client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``lightsail``: Update lightsail client to latest version + + +1.19.16 +======= + +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``databrew``: Update databrew client to latest version +* api-change:``forecast``: Update forecast client to latest version +* api-change:``amplify``: Update amplify client to latest version +* api-change:``quicksight``: Update quicksight client to latest version + + +1.19.15 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.19.14 +======= + +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``datasync``: Update datasync client to latest version + + +1.19.13 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``dlm``: Update dlm client to latest version + + +1.19.12 +======= + +* api-change:``frauddetector``: Update frauddetector client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``appmesh``: Update appmesh client to latest version + + +1.19.11 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``mq``: Update mq client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.19.10 +======= + +* api-change:``ec2``: Update ec2 client to latest version + + +1.19.9 +====== + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``braket``: Update braket client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``elasticache``: Update elasticache client to latest version + + +1.19.8 +====== + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``codeartifact``: Update codeartifact client to latest version +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``sesv2``: Update sesv2 client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version + + +1.19.7 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``workmail``: Update workmail client to latest version + + +1.19.6 +====== + +* api-change:``glue``: Update glue client to latest version + + +1.19.5 +====== + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``neptune``: Update neptune client to latest version +* api-change:``kendra``: Update kendra client to latest version + + +1.19.4 +====== + +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``macie2``: Update macie2 client to latest version + + +1.19.3 +====== + +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version +* api-change:``appflow``: Update appflow client to latest version + + +1.19.2 +====== + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.19.1 +====== + +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``batch``: Update batch client to latest version + + +1.19.0 +====== + +* api-change:``backup``: Update backup client to latest version +* api-change:``docdb``: Update docdb client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* feature:imds: Updated InstanceMetadataFetcher to use custom ipv6 uri as endpoint if envvar or config set +* api-change:``ssm``: Update ssm client to latest version + + +1.18.18 +======= + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.18.17 +======= + +* api-change:``transfer``: Update transfer client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``groundstation``: Update groundstation client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``budgets``: Update budgets client to latest version +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``workmail``: Update workmail client to latest version +* api-change:``iot``: Update iot client to latest version + + +1.18.16 +======= + +* api-change:``snowball``: Update snowball client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``amplify``: Update amplify client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.18.15 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.18.14 +======= + +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version +* api-change:``elasticache``: Update elasticache client to latest version + + +1.18.13 +======= + +* api-change:``dms``: Update dms client to latest version +* api-change:``kinesisanalyticsv2``: Update kinesisanalyticsv2 client to latest version +* api-change:``marketplace-catalog``: Update marketplace-catalog client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.18.12 +======= + +* api-change:``dynamodbstreams``: Update dynamodbstreams client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.18.11 +======= + +* api-change:``batch``: Update batch client to latest version +* api-change:``personalize-events``: Update personalize-events client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``servicediscovery``: Update servicediscovery client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.18.10 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``quicksight``: Update quicksight client to latest version + + +1.18.9 +====== + +* api-change:``datasync``: Update datasync client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``s3outposts``: Update s3outposts client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.18.8 +====== + +* api-change:``timestream-write``: Update timestream-write client to latest version +* api-change:``connect``: Update connect client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``schemas``: Update schemas client to latest version +* api-change:``timestream-query``: Update timestream-query client to latest version + + +1.18.7 +====== + +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.18.6 +====== + +* api-change:``frauddetector``: Update frauddetector client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``docdb``: Update docdb client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``sts``: Update sts client to latest version + + +1.18.5 +====== + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``textract``: Update textract client to latest version +* api-change:``amplify``: Update amplify client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``savingsplans``: Update savingsplans client to latest version +* api-change:``synthetics``: Update synthetics client to latest version + + +1.18.4 +====== + +* api-change:``translate``: Update translate client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``backup``: Update backup client to latest version + + +1.18.3 +====== + +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``dynamodbstreams``: Update dynamodbstreams client to latest version +* api-change:``workmail``: Update workmail client to latest version +* api-change:``lex-models``: Update lex-models client to latest version + + +1.18.2 +====== + +* api-change:``glue``: Update glue client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.18.1 +====== + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``sso-admin``: Update sso-admin client to latest version +* api-change:``codestar-connections``: Update codestar-connections client to latest version + + +1.18.0 +====== + +* api-change:``kendra``: Update kendra client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* feature:dependency: botocore has removed docutils as a required dependency + + +1.17.63 +======= + +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``connect``: Update connect client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.17.62 +======= + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``budgets``: Update budgets client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.17.61 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``managedblockchain``: Update managedblockchain client to latest version +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``docdb``: Update docdb client to latest version + + +1.17.60 +======= + +* api-change:``workspaces``: Update workspaces client to latest version + + +1.17.59 +======= + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``ebs``: Update ebs client to latest version +* api-change:``sso-admin``: Update sso-admin client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.17.58 +======= + +* api-change:``kinesisanalyticsv2``: Update kinesisanalyticsv2 client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``redshift-data``: Update redshift-data client to latest version + + +1.17.57 +======= + +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.17.56 +======= + +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.17.55 +======= + +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``kendra``: Update kendra client to latest version + + +1.17.54 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``macie2``: Update macie2 client to latest version + + +1.17.53 +======= + +* api-change:``codeguru-reviewer``: Update codeguru-reviewer client to latest version +* api-change:``securityhub``: Update securityhub client to latest version + + +1.17.52 +======= + +* api-change:``sqs``: Update sqs client to latest version +* api-change:``backup``: Update backup client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.17.51 +======= + +* api-change:``cur``: Update cur client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``emr``: Update emr client to latest version + + +1.17.50 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.17.49 +======= + +* api-change:``appflow``: Update appflow client to latest version +* api-change:``route53resolver``: Update route53resolver client to latest version + + +1.17.48 +======= + +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``logs``: Update logs client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``kafka``: Update kafka client to latest version + + +1.17.47 +======= + +* api-change:``chime``: Update chime client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version + + +1.17.46 +======= + +* api-change:``lakeformation``: Update lakeformation client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``ivs``: Update ivs client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.17.45 +======= + +* api-change:``identitystore``: Update identitystore client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``datasync``: Update datasync client to latest version +* api-change:``sesv2``: Update sesv2 client to latest version +* api-change:``securityhub``: Update securityhub client to latest version + + +1.17.44 +======= + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``kinesis``: Update kinesis client to latest version +* api-change:``ecr``: Update ecr client to latest version +* api-change:``acm``: Update acm client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``elb``: Update elb client to latest version +* api-change:``acm-pca``: Update acm-pca client to latest version + + +1.17.43 +======= + +* api-change:``braket``: Update braket client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``license-manager``: Update license-manager client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``appstream``: Update appstream client to latest version + + +1.17.42 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``braket``: Update braket client to latest version + + +1.17.41 +======= + +* api-change:``transfer``: Update transfer client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``cloud9``: Update cloud9 client to latest version + + +1.17.40 +======= + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.17.39 +======= + +* api-change:``savingsplans``: Update savingsplans client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.17.38 +======= + +* api-change:``sms``: Update sms client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.17.37 +======= + +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``personalize``: Update personalize client to latest version +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``personalize-events``: Update personalize-events client to latest version + + +1.17.36 +======= + +* api-change:``fsx``: Update fsx client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``transcribe``: Update transcribe client to latest version + + +1.17.35 +======= + +* api-change:``health``: Update health client to latest version + + +1.17.34 +======= + +* api-change:``ssm``: Update ssm client to latest version + + +1.17.33 +======= + +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version + + +1.17.32 +======= + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``sesv2``: Update sesv2 client to latest version + + +1.17.31 +======= + +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``firehose``: Update firehose client to latest version +* api-change:``servicediscovery``: Update servicediscovery client to latest version +* api-change:``ecr``: Update ecr client to latest version +* api-change:``guardduty``: Update guardduty client to latest version + + +1.17.30 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``ivs``: Update ivs client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version + + +1.17.29 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``datasync``: Update datasync client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``frauddetector``: Update frauddetector client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``dms``: Update dms client to latest version + + +1.17.28 +======= + +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``frauddetector``: Update frauddetector client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``mq``: Update mq client to latest version + + +1.17.27 +======= + +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``lightsail``: Update lightsail client to latest version + + +1.17.26 +======= + +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.17.25 +======= + +* api-change:``codeguruprofiler``: Update codeguruprofiler client to latest version + + +1.17.24 +======= + +* api-change:``frauddetector``: Update frauddetector client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``groundstation``: Update groundstation client to latest version +* api-change:``fms``: Update fms client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version + + +1.17.23 +======= + +* api-change:``connect``: Update connect client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.17.22 +======= + +* enhancement:examples: Pull in latest examples from EFS. + + +1.17.21 +======= + +* api-change:``ivs``: Update ivs client to latest version + + +1.17.20 +======= + +* api-change:``amplify``: Update amplify client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``ebs``: Update ebs client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``comprehend``: Update comprehend client to latest version + + +1.17.19 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``forecast``: Update forecast client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.17.18 +======= + +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``lakeformation``: Update lakeformation client to latest version +* api-change:``efs``: Update efs client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version + + +1.17.17 +======= + +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version + + +1.17.16 +======= + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``connect``: Update connect client to latest version + + +1.17.15 +======= + +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.17.14 +======= + +* api-change:``ecr``: Update ecr client to latest version +* api-change:``codeguru-reviewer``: Update codeguru-reviewer client to latest version +* api-change:``comprehendmedical``: Update comprehendmedical client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.17.13 +======= + +* api-change:``codestar-connections``: Update codestar-connections client to latest version +* api-change:``codeguruprofiler``: Update codeguruprofiler client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version + + +1.17.12 +======= + +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``dms``: Update dms client to latest version + + +1.17.11 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.17.10 +======= + +* api-change:``iam``: Update iam client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``backup``: Update backup client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``amplify``: Update amplify client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``honeycode``: Update honeycode client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version + + +1.17.9 +====== + +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.17.8 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``sqs``: Update sqs client to latest version + + +1.17.7 +====== + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.17.6 +====== + +* api-change:``support``: Update support client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``sesv2``: Update sesv2 client to latest version + + +1.17.5 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``snowball``: Update snowball client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``macie2``: Update macie2 client to latest version + + +1.17.4 +====== + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``dataexchange``: Update dataexchange client to latest version +* api-change:``qldb``: Update qldb client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``polly``: Update polly client to latest version + + +1.17.3 +====== + +* api-change:``chime``: Update chime client to latest version +* api-change:``appconfig``: Update appconfig client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``iot``: Update iot client to latest version + + +1.17.2 +====== + +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version + + +1.17.1 +====== + +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``iot-data``: Update iot-data client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.17.0 +====== + +* api-change:``macie2``: Update macie2 client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``codeartifact``: Update codeartifact client to latest version +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version +* api-change:``shield``: Update shield client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``appconfig``: Update appconfig client to latest version +* feature:SSO: Added support for the SSO credential provider. This allows the SDK to retrieve temporary AWS credentials from a profile configured to use SSO credentials. +* api-change:``dlm``: Update dlm client to latest version + + +1.16.26 +======= + +* api-change:``transfer``: Update transfer client to latest version + + +1.16.25 +======= + +* api-change:``shield``: Update shield client to latest version +* api-change:``servicediscovery``: Update servicediscovery client to latest version + + +1.16.24 +======= + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``personalize``: Update personalize client to latest version + + +1.16.23 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.16.22 +======= + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.16.21 +======= + +* api-change:``guardduty``: Update guardduty client to latest version + + +1.16.20 +======= + +* api-change:``fsx``: Update fsx client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``athena``: Update athena client to latest version +* api-change:``worklink``: Update worklink client to latest version +* api-change:``emr``: Update emr client to latest version + + +1.16.19 +======= + +* api-change:``marketplace-catalog``: Update marketplace-catalog client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``qldb-session``: Update qldb-session client to latest version +* api-change:``workmail``: Update workmail client to latest version + + +1.16.18 +======= + +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.16.17 +======= + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``macie``: Update macie client to latest version + + +1.16.16 +======= + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version + + +1.16.15 +======= + +* api-change:``synthetics``: Update synthetics client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.16.14 +======= + +* api-change:``backup``: Update backup client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``appmesh``: Update appmesh client to latest version + + +1.16.13 +======= + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``health``: Update health client to latest version +* api-change:``chime``: Update chime client to latest version + + +1.16.12 +======= + +* api-change:``chime``: Update chime client to latest version +* api-change:``qldb``: Update qldb client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``macie2``: Update macie2 client to latest version + + +1.16.11 +======= + +* api-change:``sts``: Update sts client to latest version +* api-change:``ecr``: Update ecr client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version + + +1.16.10 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version + + +1.16.9 +====== + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``macie2``: Update macie2 client to latest version + + +1.16.8 +====== + +* api-change:``workmail``: Update workmail client to latest version +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* enchancement:Endpoints: Improved endpoint resolution for clients with unknown regions + + +1.16.7 +====== + +* api-change:``kendra``: Update kendra client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codeguru-reviewer``: Update codeguru-reviewer client to latest version + + +1.16.6 +====== + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version + + +1.16.5 +====== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``appconfig``: Update appconfig client to latest version +* api-change:``logs``: Update logs client to latest version + + +1.16.4 +====== + +* api-change:``codestar-connections``: Update codestar-connections client to latest version +* api-change:``comprehendmedical``: Update comprehendmedical client to latest version + + +1.16.3 +====== + +* api-change:``support``: Update support client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.16.2 +====== + +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``s3control``: Update s3control client to latest version + + +1.16.1 +====== + +* api-change:``efs``: Update efs client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.16.0 +====== + +* api-change:``schemas``: Update schemas client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``iotevents``: Update iotevents client to latest version +* feature:Exceptions: Added support for parsing modeled exception fields. +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.15.49 +======= + +* api-change:``iotsitewise``: Update iotsitewise client to latest version +* api-change:``waf``: Update waf client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``servicediscovery``: Update servicediscovery client to latest version + + +1.15.48 +======= + +* api-change:``kinesisvideo``: Update kinesisvideo client to latest version +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``ecr``: Update ecr client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.15.47 +======= + +* api-change:``dms``: Update dms client to latest version +* api-change:``dataexchange``: Update dataexchange client to latest version +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.15.46 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``elastic-inference``: Update elastic-inference client to latest version + + +1.15.45 +======= + +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ram``: Update ram client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``transfer``: Update transfer client to latest version +* api-change:``firehose``: Update firehose client to latest version + + +1.15.44 +======= + +* api-change:``codeguru-reviewer``: Update codeguru-reviewer client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``fms``: Update fms client to latest version + + +1.15.43 +======= + +* api-change:``route53domains``: Update route53domains client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``emr``: Update emr client to latest version + + +1.15.42 +======= + +* api-change:``ce``: Update ce client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``synthetics``: Update synthetics client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* api-change:``iotevents``: Update iotevents client to latest version + + +1.15.41 +======= + +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``frauddetector``: Update frauddetector client to latest version + + +1.15.40 +======= + +* api-change:``iotevents``: Update iotevents client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``sagemaker-a2i-runtime``: Update sagemaker-a2i-runtime client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``snowball``: Update snowball client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``mgh``: Update mgh client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.15.39 +======= + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codeguruprofiler``: Update codeguruprofiler client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``migrationhub-config``: Update migrationhub-config client to latest version + + +1.15.38 +======= + +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``codeguru-reviewer``: Update codeguru-reviewer client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version + + +1.15.37 +======= + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version + + +1.15.36 +======= + +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``robomaker``: Update robomaker client to latest version + + +1.15.35 +======= + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.15.34 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version + + +1.15.33 +======= + +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``elastic-inference``: Update elastic-inference client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``mediastore``: Update mediastore client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``fms``: Update fms client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``detective``: Update detective client to latest version +* api-change:``appconfig``: Update appconfig client to latest version + + +1.15.32 +======= + +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version + + +1.15.31 +======= + +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.15.30 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``securityhub``: Update securityhub client to latest version + + +1.15.29 +======= + +* api-change:``managedblockchain``: Update managedblockchain client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``application-insights``: Update application-insights client to latest version +* api-change:``detective``: Update detective client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``xray``: Update xray client to latest version + + +1.15.28 +======= + +* api-change:``athena``: Update athena client to latest version +* api-change:``rds-data``: Update rds-data client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.15.27 +======= + +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.15.26 +======= + +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.15.25 +======= + +* api-change:``outposts``: Update outposts client to latest version +* api-change:``acm``: Update acm client to latest version + + +1.15.24 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``personalize``: Update personalize client to latest version + + +1.15.23 +======= + +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.15.22 +======= + +* api-change:``s3control``: Update s3control client to latest version +* bugfix:Stubber: fixes `#1884 `__ +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``elasticache``: Update elasticache client to latest version + + +1.15.21 +======= + +* api-change:``appconfig``: Update appconfig client to latest version + + +1.15.20 +======= + +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* api-change:``iot``: Update iot client to latest version + + +1.15.19 +======= + +* api-change:``efs``: Update efs client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.15.18 +======= + +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version +* api-change:``iotevents``: Update iotevents client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* enhancement:timezones: Improved timezone parsing for Windows with new fallback method (#1939) +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version + + +1.15.17 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``dms``: Update dms client to latest version + + +1.15.16 +======= + +* api-change:``signer``: Update signer client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``robomaker``: Update robomaker client to latest version + + +1.15.15 +======= + +* api-change:``eks``: Update eks client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``guardduty``: Update guardduty client to latest version + + +1.15.14 +======= + +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.15.13 +======= + +* api-change:``ec2``: Update ec2 client to latest version + + +1.15.12 +======= + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``comprehendmedical``: Update comprehendmedical client to latest version + + +1.15.11 +======= + +* api-change:``config``: Update config client to latest version + + +1.15.10 +======= + +* api-change:``config``: Update config client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``sagemaker-a2i-runtime``: Update sagemaker-a2i-runtime client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``workdocs``: Update workdocs client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version +* api-change:``codeguruprofiler``: Update codeguruprofiler client to latest version + + +1.15.9 +====== + +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version + + +1.15.8 +====== + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``securityhub``: Update securityhub client to latest version + + +1.15.7 +====== + +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``outposts``: Update outposts client to latest version + + +1.15.6 +====== + +* api-change:``iotevents``: Update iotevents client to latest version +* api-change:``docdb``: Update docdb client to latest version +* api-change:``snowball``: Update snowball client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``events``: Update events client to latest version + + +1.15.5 +====== + +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.15.4 +====== + +* api-change:``savingsplans``: Update savingsplans client to latest version +* api-change:``appconfig``: Update appconfig client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.15.3 +====== + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``lambda``: Update lambda client to latest version + + +1.15.2 +====== + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.15.1 +====== + +* api-change:``cloud9``: Update cloud9 client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.15.0 +====== + +* feature:retries: Add support for retry modes, including ``standard`` and ``adaptive`` modes (`#1972 `__) +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``shield``: Update shield client to latest version + + +1.14.17 +======= + +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version + + +1.14.16 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``workmail``: Update workmail client to latest version +* api-change:``ds``: Update ds client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``neptune``: Update neptune client to latest version + + +1.14.15 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version + + +1.14.14 +======= + +* api-change:``docdb``: Update docdb client to latest version +* api-change:``kms``: Update kms client to latest version + + +1.14.13 +======= + +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.14.12 +======= + +* api-change:``ebs``: Update ebs client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``ecr``: Update ecr client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.14.11 +======= + +* api-change:``groundstation``: Update groundstation client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``forecastquery``: Update forecastquery client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version + + +1.14.10 +======= + +* api-change:``workmail``: Update workmail client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.14.9 +====== + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``datasync``: Update datasync client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.14.8 +====== + +* api-change:``rds``: Update rds client to latest version +* api-change:``iam``: Update iam client to latest version + + +1.14.7 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``discovery``: Update discovery client to latest version +* api-change:``iotevents``: Update iotevents client to latest version +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version + + +1.14.6 +====== + +* api-change:``lambda``: Update lambda client to latest version +* api-change:``application-insights``: Update application-insights client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.14.5 +====== + +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``neptune``: Update neptune client to latest version +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.14.4 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``ds``: Update ds client to latest version + + +1.14.3 +====== + +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.14.2 +====== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.14.1 +====== + +* api-change:``efs``: Update efs client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``backup``: Update backup client to latest version + + +1.14.0 +====== + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``transfer``: Update transfer client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* feature:Python: Dropped support for Python 2.6 and 3.3. +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.13.50 +======= + +* api-change:``logs``: Update logs client to latest version + + +1.13.49 +======= + +* api-change:``fms``: Update fms client to latest version +* api-change:``translate``: Update translate client to latest version +* api-change:``ce``: Update ce client to latest version + + +1.13.48 +======= + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``mgh``: Update mgh client to latest version +* api-change:``xray``: Update xray client to latest version + + +1.13.47 +======= + +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.13.46 +======= + +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``ecr``: Update ecr client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``ce``: Update ce client to latest version + + +1.13.45 +======= + +* api-change:``fsx``: Update fsx client to latest version +* api-change:``health``: Update health client to latest version +* api-change:``detective``: Update detective client to latest version + + +1.13.44 +======= + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.13.43 +======= + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``codestar-connections``: Update codestar-connections client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.13.42 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* enhancement:``s3``: Add support for opting into using the us-east-1 regional endpoint. +* api-change:``opsworkscm``: Update opsworkscm client to latest version + + +1.13.41 +======= + +* api-change:``kinesisanalyticsv2``: Update kinesisanalyticsv2 client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.13.40 +======= + +* api-change:``mq``: Update mq client to latest version +* api-change:``comprehendmedical``: Update comprehendmedical client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.13.39 +======= + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``detective``: Update detective client to latest version +* api-change:``sesv2``: Update sesv2 client to latest version + + +1.13.38 +======= + +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version + + +1.13.37 +======= + +* api-change:``ec2``: Update ec2 client to latest version + + +1.13.36 +======= + +* api-change:``kendra``: Update kendra client to latest version + + +1.13.35 +======= + +* bugfix:s3: Add stricter validation to s3 control account id parameter. +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``kafka``: Update kafka client to latest version + + +1.13.34 +======= + +* bugfix:s3: Fixed an issue where the request path was set incorrectly if access point name was present in key path. + + +1.13.33 +======= + +* api-change:``kinesisvideo``: Update kinesisvideo client to latest version +* api-change:``kinesis-video-signaling``: Update kinesis-video-signaling client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version + + +1.13.32 +======= + +* api-change:``ebs``: Update ebs client to latest version +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.13.31 +======= + +* api-change:``textract``: Update textract client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``outposts``: Update outposts client to latest version +* api-change:``kendra``: Update kendra client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``networkmanager``: Update networkmanager client to latest version +* api-change:``compute-optimizer``: Update compute-optimizer client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``frauddetector``: Update frauddetector client to latest version +* api-change:``sagemaker-a2i-runtime``: Update sagemaker-a2i-runtime client to latest version +* api-change:``codeguru-reviewer``: Update codeguru-reviewer client to latest version +* api-change:``codeguruprofiler``: Update codeguruprofiler client to latest version +* api-change:``es``: Update es client to latest version + + +1.13.30 +======= + +* api-change:``accessanalyzer``: Update accessanalyzer client to latest version + + +1.13.29 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``license-manager``: Update license-manager client to latest version +* api-change:``imagebuilder``: Update imagebuilder client to latest version +* api-change:``schemas``: Update schemas client to latest version + + +1.13.28 +======= + +* api-change:``rds-data``: Update rds-data client to latest version +* api-change:``ds``: Update ds client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``elastic-inference``: Update elastic-inference client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version + + +1.13.27 +======= + +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``wafv2``: Update wafv2 client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``athena``: Update athena client to latest version +* api-change:``iotsecuretunneling``: Update iotsecuretunneling client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``application-insights``: Update application-insights client to latest version +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version +* api-change:``appconfig``: Update appconfig client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``kinesisanalyticsv2``: Update kinesisanalyticsv2 client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``sesv2``: Update sesv2 client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``ram``: Update ram client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``kms``: Update kms client to latest version + + +1.13.26 +======= + +* api-change:``acm``: Update acm client to latest version +* api-change:``autoscaling-plans``: Update autoscaling-plans client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``sts``: Update sts client to latest version +* api-change:``forecast``: Update forecast client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.13.25 +======= + +* bugfix:IMDS metadata: Add 405 case to metadata fetching logic. + + +1.13.24 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``connectparticipant``: Update connectparticipant client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``connect``: Update connect client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``amplify``: Update amplify client to latest version +* api-change:``appsync``: Update appsync client to latest version + + +1.13.23 +======= + +* api-change:``datasync``: Update datasync client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``mediastore``: Update mediastore client to latest version +* api-change:``cloudtrail``: Update cloudtrail client to latest version +* api-change:``mgh``: Update mgh client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``migrationhub-config``: Update migrationhub-config client to latest version +* api-change:``firehose``: Update firehose client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``discovery``: Update discovery client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``quicksight``: Update quicksight client to latest version + + +1.13.22 +======= + +* bugfix:IMDS: Fix regression in IMDS credential resolution. Fixes `#1892 `__. + + +1.13.21 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version + + +1.13.20 +======= + +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.13.19 +======= + +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``logs``: Update logs client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``chime``: Update chime client to latest version + + +1.13.18 +======= + +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``connect``: Update connect client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``personalize``: Update personalize client to latest version + + +1.13.17 +======= + +* api-change:``sesv2``: Update sesv2 client to latest version +* api-change:``dataexchange``: Update dataexchange client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``cloudsearch``: Update cloudsearch client to latest version +* api-change:``dlm``: Update dlm client to latest version + + +1.13.16 +======= + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``marketplace-catalog``: Update marketplace-catalog client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.13.15 +======= + +* api-change:``ce``: Update ce client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version + + +1.13.14 +======= + +* api-change:``cognito-identity``: Update cognito-identity client to latest version +* api-change:``ecr``: Update ecr client to latest version + + +1.13.13 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``sso``: Update sso client to latest version +* api-change:``sso-oidc``: Update sso-oidc client to latest version +* api-change:``comprehend``: Update comprehend client to latest version + + +1.13.12 +======= + +* api-change:``savingsplans``: Update savingsplans client to latest version + + +1.13.11 +======= + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``budgets``: Update budgets client to latest version +* api-change:``efs``: Update efs client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``savingsplans``: Update savingsplans client to latest version +* api-change:``signer``: Update signer client to latest version + + +1.13.10 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``codestar-notifications``: Update codestar-notifications client to latest version + + +1.13.9 +====== + +* api-change:``dax``: Update dax client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``robomaker``: Update robomaker client to latest version + + +1.13.8 +====== + +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``cloudtrail``: Update cloudtrail client to latest version +* api-change:``dms``: Update dms client to latest version + + +1.13.7 +====== + +* api-change:``support``: Update support client to latest version +* api-change:``amplify``: Update amplify client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.13.6 +====== + +* api-change:``elasticache``: Update elasticache client to latest version + + +1.13.5 +====== + +* api-change:``cloud9``: Update cloud9 client to latest version +* api-change:``appstream``: Update appstream client to latest version + + +1.13.4 +====== + +* api-change:``s3``: Update s3 client to latest version + + +1.13.3 +====== + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``transfer``: Update transfer client to latest version +* api-change:``ecr``: Update ecr client to latest version + + +1.13.2 +====== + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* enhancement:``sts``: Add support for configuring the use of regional STS endpoints. +* api-change:``chime``: Update chime client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.13.1 +====== + +* api-change:``polly``: Update polly client to latest version +* api-change:``connect``: Update connect client to latest version + + +1.13.0 +====== + +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``iotevents``: Update iotevents client to latest version +* feature:``botocore.vendored.requests``: Removed vendored version of ``requests`` (`#1829 `__) + + +1.12.253 +======== + +* api-change:``cloudwatch``: Update cloudwatch client to latest version + + +1.12.252 +======== + +* api-change:``batch``: Update batch client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.251 +======== + +* api-change:``kafka``: Update kafka client to latest version +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version +* api-change:``robomaker``: Update robomaker client to latest version + + +1.12.250 +======== + +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version + + +1.12.249 +======== + +* api-change:``personalize``: Update personalize client to latest version +* api-change:``workspaces``: Update workspaces client to latest version + + +1.12.248 +======== + +* api-change:``greengrass``: Update greengrass client to latest version + + +1.12.247 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``fms``: Update fms client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version + + +1.12.246 +======== + +* api-change:``kafka``: Update kafka client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.245 +======== + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``firehose``: Update firehose client to latest version +* api-change:``datasync``: Update datasync client to latest version + + +1.12.244 +======== + +* api-change:``snowball``: Update snowball client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``firehose``: Update firehose client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``pinpoint-email``: Update pinpoint-email client to latest version + + +1.12.243 +======== + +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.12.242 +======== + +* api-change:``es``: Update es client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.12.241 +======== + +* api-change:``lightsail``: Update lightsail client to latest version + + +1.12.240 +======== + +* api-change:``docdb``: Update docdb client to latest version + + +1.12.239 +======== + +* api-change:``waf``: Update waf client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``mq``: Update mq client to latest version + + +1.12.238 +======== + +* api-change:``amplify``: Update amplify client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.237 +======== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version + + +1.12.236 +======== + +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.12.235 +======== + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``comprehendmedical``: Update comprehendmedical client to latest version +* api-change:``datasync``: Update datasync client to latest version + + +1.12.234 +======== + +* api-change:``rds-data``: Update rds-data client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.12.233 +======== + +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.232 +======== + +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.231 +======== + +* api-change:``ram``: Update ram client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``apigateway``: Update apigateway client to latest version + + +1.12.230 +======== + +* api-change:``iam``: Update iam client to latest version +* api-change:``athena``: Update athena client to latest version +* api-change:``personalize``: Update personalize client to latest version + + +1.12.229 +======== + +* api-change:``eks``: Update eks client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.228 +======== + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``workmailmessageflow``: Update workmailmessageflow client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.12.227 +======== + +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``ses``: Update ses client to latest version +* api-change:``config``: Update config client to latest version + + +1.12.226 +======== + +* api-change:``storagegateway``: Update storagegateway client to latest version + + +1.12.225 +======== + +* api-change:``qldb``: Update qldb client to latest version +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``qldb-session``: Update qldb-session client to latest version + + +1.12.224 +======== + +* api-change:``kinesisanalytics``: Update kinesisanalytics client to latest version + + +1.12.223 +======== + +* api-change:``config``: Update config client to latest version + + +1.12.222 +======== + +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.12.221 +======== + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``gamelift``: Update gamelift client to latest version + + +1.12.220 +======== + +* api-change:``mq``: Update mq client to latest version +* api-change:``apigatewaymanagementapi``: Update apigatewaymanagementapi client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.219 +======== + +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.218 +======== + +* api-change:``sqs``: Update sqs client to latest version +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.217 +======== + +* api-change:``organizations``: Update organizations client to latest version + + +1.12.216 +======== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``securityhub``: Update securityhub client to latest version + + +1.12.215 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version +* api-change:``transcribe``: Update transcribe client to latest version + + +1.12.214 +======== + +* api-change:``datasync``: Update datasync client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.213 +======== + +* api-change:``forecast``: Update forecast client to latest version +* api-change:``forecastquery``: Update forecastquery client to latest version +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``sqs``: Update sqs client to latest version + + +1.12.212 +======== + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``transfer``: Update transfer client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.12.211 +======== + +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``cur``: Update cur client to latest version + + +1.12.210 +======== + +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.209 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``athena``: Update athena client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version + + +1.12.208 +======== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.207 +======== + +* api-change:``appsync``: Update appsync client to latest version + + +1.12.206 +======== + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.12.205 +======== + +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.204 +======== + +* api-change:``lakeformation``: Update lakeformation client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.12.203 +======== + +* api-change:``application-insights``: Update application-insights client to latest version + + +1.12.202 +======== + +* api-change:``batch``: Update batch client to latest version + + +1.12.201 +======== + +* api-change:``datasync``: Update datasync client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.200 +======== + +* api-change:``sts``: Update sts client to latest version +* enhancement:Credentials: Add support for a credential provider that handles resolving credentials via STS AssumeRoleWithWebIdentity + + +1.12.199 +======== + +* api-change:``polly``: Update polly client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.12.198 +======== + +* bugfix:S3: Fix an issue that would cause S3 list_object_versions to sometimes fail parsing responses with certain key values. +* api-change:``codecommit``: Update codecommit client to latest version + + +1.12.197 +======== + +* api-change:``ce``: Update ce client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``logs``: Update logs client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.196 +======== + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``ecr``: Update ecr client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.195 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``sts``: Update sts client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.12.194 +======== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version + + +1.12.193 +======== + +* api-change:``mq``: Update mq client to latest version +* api-change:``shield``: Update shield client to latest version + + +1.12.192 +======== + +* bugfix:Dependency: Fixed dependency issue with broken docutils aws/aws-cli`#4332 `__ + + +1.12.191 +======== + +* api-change:``sqs``: Update sqs client to latest version +* api-change:``iotevents``: Update iotevents client to latest version + + +1.12.190 +======== + +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.189 +======== + +* api-change:``config``: Update config client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version + + +1.12.188 +======== + +* api-change:``iam``: Update iam client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``es``: Update es client to latest version + + +1.12.187 +======== + +* api-change:``events``: Update events client to latest version + + +1.12.186 +======== + +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``glacier``: Update glacier client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.12.185 +======== + +* api-change:``efs``: Update efs client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``amplify``: Update amplify client to latest version +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``kinesisvideo``: Update kinesisvideo client to latest version +* api-change:``waf``: Update waf client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version + + +1.12.184 +======== + +* api-change:``ce``: Update ce client to latest version + + +1.12.183 +======== + +* api-change:``swf``: Update swf client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.182 +======== + +* enhancement:CSM: Support configuration of the host used in client side metrics via AWS_CSM_HOST +* api-change:``appstream``: Update appstream client to latest version +* api-change:``mediastore``: Update mediastore client to latest version + + +1.12.181 +======== + +* api-change:``docdb``: Update docdb client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.180 +======== + +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``workspaces``: Update workspaces client to latest version + + +1.12.179 +======== + +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``ec2-instance-connect``: Update ec2-instance-connect client to latest version + + +1.12.178 +======== + +* api-change:``dynamodb``: Update dynamodb client to latest version + + +1.12.177 +======== + +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version + + +1.12.176 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.12.175 +======== + +* api-change:``application-insights``: Update application-insights client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``service-quotas``: Update service-quotas client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version + + +1.12.174 +======== + +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``kinesis-video-media``: Update kinesis-video-media client to latest version + + +1.12.173 +======== + +* api-change:``health``: Update health client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``iotevents-data``: Update iotevents-data client to latest version +* api-change:``opsworks``: Update opsworks client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``acm-pca``: Update acm-pca client to latest version + + +1.12.172 +======== + +* api-change:``eks``: Update eks client to latest version + + +1.12.171 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version + + +1.12.170 +======== + +* api-change:``neptune``: Update neptune client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* bugfix:Paginator: Fixes a bug where pagination tokens with three consecutive underscores would result in a parsing failure. Resolves boto/boto3`#1984 `__. + + +1.12.169 +======== + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``personalize``: Update personalize client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``appstream``: Update appstream client to latest version + + +1.12.168 +======== + +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``guardduty``: Update guardduty client to latest version + + +1.12.167 +======== + +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.12.166 +======== + +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.12.165 +======== + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``personalize-runtime``: Update personalize-runtime client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``personalize-events``: Update personalize-events client to latest version +* api-change:``personalize``: Update personalize client to latest version + + +1.12.164 +======== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.163 +======== + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``logs``: Update logs client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ses``: Update ses client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version + + +1.12.162 +======== + +* api-change:``glue``: Update glue client to latest version + + +1.12.161 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``iam``: Update iam client to latest version + + +1.12.160 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.159 +======== + +* api-change:``iotevents-data``: Update iotevents-data client to latest version +* api-change:``iotevents``: Update iotevents client to latest version +* api-change:``pinpoint-email``: Update pinpoint-email client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``rds-data``: Update rds-data client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``kafka``: Update kafka client to latest version + + +1.12.158 +======== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``iotthingsgraph``: Update iotthingsgraph client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.157 +======== + +* api-change:``groundstation``: Update groundstation client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``waf``: Update waf client to latest version +* api-change:``pinpoint-email``: Update pinpoint-email client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``sts``: Update sts client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version + + +1.12.156 +======== + +* api-change:``mediastore-data``: Update mediastore-data client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version + + +1.12.155 +======== + +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.154 +======== + +* api-change:``efs``: Update efs client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``worklink``: Update worklink client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``budgets``: Update budgets client to latest version + + +1.12.153 +======== + +* api-change:``datasync``: Update datasync client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.12.152 +======== + +* api-change:``kafka``: Update kafka client to latest version +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version +* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version + + +1.12.151 +======== + +* api-change:``appstream``: Update appstream client to latest version + + +1.12.150 +======== + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.12.149 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* enhancement:Environment Variables: Ignore env var credentials is values are empty (`#1680 `__) +* api-change:``rds``: Update rds client to latest version + + +1.12.148 +======== + +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``chime``: Update chime client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.147 +======== + +* api-change:``datasync``: Update datasync client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``lambda``: Update lambda client to latest version + + +1.12.146 +======== + +* api-change:``glue``: Update glue client to latest version +* api-change:``sts``: Update sts client to latest version + + +1.12.145 +======== + +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``eks``: Update eks client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``kinesisanalytics``: Update kinesisanalytics client to latest version +* api-change:``kinesisanalyticsv2``: Update kinesisanalyticsv2 client to latest version + + +1.12.144 +======== + +* api-change:``appsync``: Update appsync client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.12.143 +======== + +* api-change:``config``: Update config client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``sts``: Update sts client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version + + +1.12.142 +======== + +* api-change:``workmail``: Update workmail client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.141 +======== + +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``kms``: Update kms client to latest version + + +1.12.140 +======== + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.139 +======== + +* api-change:``neptune``: Update neptune client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``managedblockchain``: Update managedblockchain client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version + + +1.12.138 +======== + +* api-change:``transfer``: Update transfer client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.137 +======== + +* api-change:``iam``: Update iam client to latest version +* api-change:``sns``: Update sns client to latest version + + +1.12.136 +======== + +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``inspector``: Update inspector client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``batch``: Update batch client to latest version + + +1.12.135 +======== + +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``textract``: Update textract client to latest version + + +1.12.134 +======== + +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``workspaces``: Update workspaces client to latest version + + +1.12.133 +======== + +* api-change:``kafka``: Update kafka client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``worklink``: Update worklink client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``discovery``: Update discovery client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.12.132 +======== + +* api-change:``polly``: Update polly client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.131 +======== + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``mq``: Update mq client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version + + +1.12.130 +======== + +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``iot1click-devices``: Update iot1click-devices client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.12.129 +======== + +* api-change:``eks``: Update eks client to latest version +* api-change:``iam``: Update iam client to latest version + + +1.12.128 +======== + +* api-change:``batch``: Update batch client to latest version +* api-change:``comprehend``: Update comprehend client to latest version + + +1.12.127 +======== + +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``acm``: Update acm client to latest version + + +1.12.126 +======== + +* api-change:``emr``: Update emr client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.12.125 +======== + +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``greengrass``: Update greengrass client to latest version + + +1.12.124 +======== + +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``pinpoint-email``: Update pinpoint-email client to latest version +* api-change:``workspaces``: Update workspaces client to latest version + + +1.12.123 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``transfer``: Update transfer client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.12.122 +======== + +* api-change:``workmail``: Update workmail client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.12.121 +======== + +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``fms``: Update fms client to latest version +* api-change:``iot1click-devices``: Update iot1click-devices client to latest version + + +1.12.120 +======== + +* api-change:``iot1click-projects``: Update iot1click-projects client to latest version +* api-change:``transcribe``: Update transcribe client to latest version + + +1.12.119 +======== + +* api-change:``iot``: Update iot client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version + + +1.12.118 +======== + +* api-change:``cognito-identity``: Update cognito-identity client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version + + +1.12.117 +======== + +* api-change:``config``: Update config client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.12.116 +======== + +* api-change:``dms``: Update dms client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``chime``: Update chime client to latest version + + +1.12.115 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``acm``: Update acm client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``acm-pca``: Update acm-pca client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.12.114 +======== + +* api-change:``config``: Update config client to latest version +* api-change:``logs``: Update logs client to latest version + + +1.12.113 +======== + +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version + + +1.12.112 +======== + +* api-change:``iot``: Update iot client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.12.111 +======== + +* api-change:``s3``: Update s3 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.12.110 +======== + +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.109 +======== + +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.108 +======== + +* api-change:``textract``: Update textract client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version + + +1.12.107 +======== + +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.12.106 +======== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``autoscaling-plans``: Update autoscaling-plans client to latest version + + +1.12.105 +======== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.12.104 +======== + +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``waf``: Update waf client to latest version + + +1.12.103 +======== + +* api-change:``discovery``: Update discovery client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``cur``: Update cur client to latest version + + +1.12.102 +======== + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``mediastore``: Update mediastore client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version + + +1.12.101 +======== + +* api-change:``athena``: Update athena client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``cloud9``: Update cloud9 client to latest version + + +1.12.100 +======== + +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version +* api-change:``workdocs``: Update workdocs client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``kinesisvideo``: Update kinesisvideo client to latest version +* api-change:``kinesis-video-media``: Update kinesis-video-media client to latest version +* api-change:``transfer``: Update transfer client to latest version + + +1.12.99 +======= + +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.12.98 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ds``: Update ds client to latest version +* enhancement:Paginator: Add additional paginators for CloudFormation +* api-change:``efs``: Update efs client to latest version + + +1.12.97 +======= + +* api-change:``athena``: Update athena client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version + + +1.12.96 +======= + +* api-change:``chime``: Update chime client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``iot``: Update iot client to latest version + + +1.12.95 +======= + +* api-change:``kinesisvideo``: Update kinesisvideo client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.94 +======= + +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``efs``: Update efs client to latest version + + +1.12.93 +======= + +* api-change:``lambda``: Update lambda client to latest version + + +1.12.92 +======= + +* api-change:``appstream``: Update appstream client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version + + +1.12.91 +======= + +* api-change:``discovery``: Update discovery client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``dlm``: Update dlm client to latest version + + +1.12.90 +======= + +* api-change:``es``: Update es client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``robomaker``: Update robomaker client to latest version + + +1.12.89 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``fsx``: Update fsx client to latest version + + +1.12.88 +======= + +* api-change:``shield``: Update shield client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.87 +======= + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``codecommit``: Update codecommit client to latest version + + +1.12.86 +======= + +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version + + +1.12.85 +======= + +* api-change:``logs``: Update logs client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``sms-voice``: Update sms-voice client to latest version +* api-change:``ecr``: Update ecr client to latest version + + +1.12.84 +======= + +* api-change:``worklink``: Update worklink client to latest version +* api-change:``apigatewaymanagementapi``: Update apigatewaymanagementapi client to latest version +* api-change:``acm-pca``: Update acm-pca client to latest version + + +1.12.83 +======= + +* api-change:``appstream``: Update appstream client to latest version +* api-change:``discovery``: Update discovery client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``fms``: Update fms client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.12.82 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.81 +======= + +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.12.80 +======= + +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``backup``: Update backup client to latest version + + +1.12.79 +======= + +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.78 +======= + +* api-change:``rds-data``: Update rds-data client to latest version +* api-change:``emr``: Update emr client to latest version + + +1.12.77 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.12.76 +======= + +* api-change:``docdb``: Update docdb client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.12.75 +======= + +* api-change:``appmesh``: Update appmesh client to latest version + + +1.12.74 +======= + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.12.73 +======= + +* api-change:``iotanalytics``: Update iotanalytics client to latest version + + +1.12.72 +======= + +* enhancement:Paginator: Added over 400 new paginators. +* api-change:``opsworkscm``: Update opsworkscm client to latest version + + +1.12.71 +======= + +* api-change:``acm-pca``: Update acm-pca client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``sms-voice``: Update sms-voice client to latest version +* api-change:``stepfunctions``: Update stepfunctions client to latest version + + +1.12.70 +======= + +* api-change:``medialive``: Update medialive client to latest version +* enhancement:EndpointDiscovery: Add a config option, ``endpoint_discovery_enabled``, for automatically discovering endpoints +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``firehose``: Update firehose client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version + + +1.12.69 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``waf``: Update waf client to latest version + + +1.12.68 +======= + +* api-change:``apigatewayv2``: Update apigatewayv2 client to latest version +* bugfix:Credentials: Fixes an issue where credentials would be checked when creating an anonymous client. Fixes `#1472 `__ +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version +* enhancement:StreamingBody: Support iterating lines from a streaming response body with CRLF line endings +* api-change:``apigatewaymanagementapi``: Update apigatewaymanagementapi client to latest version + + +1.12.67 +======= + +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``ecr``: Update ecr client to latest version + + +1.12.66 +======= + +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version + + +1.12.65 +======= + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``pinpoint-email``: Update pinpoint-email client to latest version + + +1.12.64 +======= + +* api-change:``route53``: Update route53 client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.12.63 +======= + +* api-change:``mediastore``: Update mediastore client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``connect``: Update connect client to latest version + + +1.12.62 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* enhancement:AssumeRole: Add support for duration_seconds when assuming a role in the config file (`#1600 `__). +* api-change:``iam``: Update iam client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.12.61 +======= + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.60 +======= + +* api-change:``mq``: Update mq client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version + + +1.12.59 +======= + +* api-change:``health``: Update health client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.12.58 +======= + +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.12.57 +======= + +* bugfix:s3: Add md5 header injection to new operations that require it +* api-change:``s3``: Update s3 client to latest version + + +1.12.56 +======= + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version +* api-change:``kafka``: Update kafka client to latest version +* api-change:``s3``: Update s3 client to latest version + + +1.12.55 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``appmesh``: Update appmesh client to latest version +* api-change:``license-manager``: Update license-manager client to latest version +* api-change:``servicediscovery``: Update servicediscovery client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``lightsail``: Update lightsail client to latest version + + +1.12.54 +======= + +* api-change:``securityhub``: Update securityhub client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``fsx``: Update fsx client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version + + +1.12.53 +======= + +* api-change:``meteringmarketplace``: Update meteringmarketplace client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``translate``: Update translate client to latest version +* api-change:``logs``: Update logs client to latest version +* api-change:``kinesisanalytics``: Update kinesisanalytics client to latest version +* api-change:``comprehendmedical``: Update comprehendmedical client to latest version +* api-change:``mediaconnect``: Update mediaconnect client to latest version +* api-change:``kinesisanalyticsv2``: Update kinesisanalyticsv2 client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.52 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``sms``: Update sms client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``globalaccelerator``: Update globalaccelerator client to latest version + + +1.12.51 +======= + +* api-change:``amplify``: Update amplify client to latest version +* api-change:``transfer``: Update transfer client to latest version +* api-change:``snowball``: Update snowball client to latest version +* api-change:``robomaker``: Update robomaker client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``datasync``: Update datasync client to latest version + + +1.12.50 +======= + +* api-change:``rekognition``: Update rekognition client to latest version + + +1.12.49 +======= + +* api-change:``autoscaling-plans``: Update autoscaling-plans client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``rds-data``: Update rds-data client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``quicksight``: Update quicksight client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version + + +1.12.48 +======= + +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``workdocs``: Update workdocs client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``cloudtrail``: Update cloudtrail client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``iot``: Update iot client to latest version + + +1.12.47 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.12.46 +======= + +* api-change:``s3``: Update s3 client to latest version +* api-change:``sms-voice``: Update sms-voice client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``s3control``: Update s3control client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``ram``: Update ram client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``route53resolver``: Update route53resolver client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``iam``: Update iam client to latest version + + +1.12.45 +======= + +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.44 +======= + +* api-change:``chime``: Update chime client to latest version +* api-change:``budgets``: Update budgets client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.12.43 +======= + +* api-change:``polly``: Update polly client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``firehose``: Update firehose client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``budgets``: Update budgets client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.42 +======= + +* api-change:``mediapackage``: Update mediapackage client to latest version + + +1.12.41 +======= + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``events``: Update events client to latest version + + +1.12.40 +======= + +* api-change:``dms``: Update dms client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.39 +======= + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``pinpoint-email``: Update pinpoint-email client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* bugfix:session config: Added the default session configuration tuples back to session.session_vars_map. + + +1.12.38 +======= + +* api-change:``eks``: Update eks client to latest version +* enhancement:Configuration: Added new configuration provider methods allowing for more flexibility in how a botocore session loads a particular configuration value. +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version + + +1.12.37 +======= + +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``clouddirectory``: Update clouddirectory client to latest version + + +1.12.36 +======= + +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* enhancement:Exceptions: Add the ability to pickle botocore exceptions (`834 `__) + + +1.12.35 +======= + +* api-change:``mediastore-data``: Update mediastore-data client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``config``: Update config client to latest version + + +1.12.34 +======= + +* api-change:``chime``: Update chime client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``dms``: Update dms client to latest version + + +1.12.33 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.12.32 +======= + +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.31 +======= + +* api-change:``codestar``: Update codestar client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.12.30 +======= + +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.29 +======= + +* api-change:``inspector``: Update inspector client to latest version +* api-change:``shield``: Update shield client to latest version + + +1.12.28 +======= + +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.12.27 +======= + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``appstream``: Update appstream client to latest version + + +1.12.26 +======= + +* api-change:``events``: Update events client to latest version +* api-change:``apigateway``: Update apigateway client to latest version + + +1.12.25 +======= + +* api-change:``glue``: Update glue client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``resource-groups``: Update resource-groups client to latest version + + +1.12.24 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.12.23 +======= + +* api-change:``cloudtrail``: Update cloudtrail client to latest version + + +1.12.22 +======= + +* api-change:``athena``: Update athena client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``directconnect``: Update directconnect client to latest version + + +1.12.21 +======= + +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``es``: Update es client to latest version + + +1.12.20 +======= + +* enhancement:TLS: Added support for configuring a client certificate and key when establishing TLS connections. +* api-change:``ssm``: Update ssm client to latest version +* bugfix:InstanceMetadataFetcher: Fix failure to retry on empty credentials and invalid JSON returned from IMDS `1049 `__ `1403 `__ + + +1.12.19 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``iot-jobs-data``: Update iot-jobs-data client to latest version + + +1.12.18 +======= + +* api-change:``ds``: Update ds client to latest version + + +1.12.17 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* enhancement:HTTP Session: Added the ability to enable TCP Keepalive via the shared config file's ``tcp_keepalive`` option. +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version + + +1.12.16 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version + + +1.12.15 +======= + +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``guardduty``: Update guardduty client to latest version + + +1.12.14 +======= + +* api-change:``codestar``: Update codestar client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.13 +======= + +* api-change:``mq``: Update mq client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* enhancement:Event: Add the `before-send` event which allows finalized requests to be inspected before being sent across the wire and allows for custom responses to be returned. +* api-change:``codecommit``: Update codecommit client to latest version + + +1.12.12 +======= + +* api-change:``sqs``: Update sqs client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.11 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``ds``: Update ds client to latest version + + +1.12.10 +======= + +* api-change:``connect``: Update connect client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.12.9 +====== + +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.12.8 +====== + +* api-change:``rds``: Update rds client to latest version +* api-change:``ds``: Update ds client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.12.7 +====== + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.12.6 +====== + +* bugfix:Serialization: Fixes `#1557 `__. Fixed a regression in serialization where request bodies would be improperly encoded. +* api-change:``es``: Update es client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.12.5 +====== + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``elastictranscoder``: Update elastictranscoder client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``elasticache``: Update elasticache client to latest version + + +1.12.4 +====== + +* enhancement:s3: Adds encoding and decoding handlers for ListObjectsV2 `#1552 `__ +* api-change:``polly``: Update polly client to latest version + + +1.12.3 +====== + +* api-change:``ses``: Update ses client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``fms``: Update fms client to latest version +* api-change:``connect``: Update connect client to latest version + + +1.12.2 +====== + +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.12.1 +====== + +* api-change:``redshift``: Update redshift client to latest version +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version + + +1.12.0 +====== + +* api-change:``logs``: Update logs client to latest version +* api-change:``config``: Update config client to latest version +* feature:Events: This migrates the event system to using sevice ids instead of either client name or endpoint prefix. This prevents issues that might arise when a service changes their endpoint prefix, also fixes a long-standing bug where you could not register an event to a particular service if it happened to share its endpoint prefix with another service (e.g. ``autoscaling`` and ``application-autoscaling`` both use the endpoint prefix ``autoscaling``). Please see the `upgrade notes `_ to determine if you are impacted and how to proceed if you are. + + +1.11.9 +====== + +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.11.8 +====== + +* api-change:``rds``: Update rds client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``elb``: Update elb client to latest version + + +1.11.7 +====== + +* api-change:``rds``: Update rds client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.11.6 +====== + +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``waf``: Update waf client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.11.5 +====== + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* bugfix:signing: Fix an issue where mixed endpoint casing could cause a SigV4 signature mismatch. + + +1.11.4 +====== + +* api-change:``glue``: Update glue client to latest version +* api-change:``sagemaker-runtime``: Update sagemaker-runtime client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version + + +1.11.3 +====== + +* api-change:``glue``: Update glue client to latest version +* api-change:``xray``: Update xray client to latest version + + +1.11.2 +====== + +* api-change:``iot``: Update iot client to latest version +* api-change:``signer``: Update signer client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version + + +1.11.1 +====== + +* api-change:``glue``: Update glue client to latest version + + +1.11.0 +====== + +* api-change:``events``: Update events client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* feature:urllib3: The vendored version of requests and urllib3 are no longer being used and botocore now has a direct dependency on newer versions of upstream urllib3. + + +1.10.84 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.10.83 +======= + +* api-change:``snowball``: Update snowball client to latest version + + +1.10.82 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version + + +1.10.81 +======= + +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version + + +1.10.80 +======= + +* api-change:``dax``: Update dax client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.10.79 +======= + +* api-change:``discovery``: Update discovery client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.10.78 +======= + +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.10.77 +======= + +* api-change:``es``: Update es client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version + + +1.10.76 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.10.75 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.10.74 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``dax``: Update dax client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.10.73 +======= + +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.10.72 +======= + +* api-change:``logs``: Update logs client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.10.71 +======= + +* api-change:``health``: Update health client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version + + +1.10.70 +======= + +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.10.69 +======= + +* api-change:``polly``: Update polly client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``kinesis``: Update kinesis client to latest version +* api-change:``resource-groups``: Update resource-groups client to latest version + + +1.10.68 +======= + +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``transcribe``: Update transcribe client to latest version + + +1.10.67 +======= + +* api-change:``kms``: Update kms client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``connect``: Update connect client to latest version + + +1.10.66 +======= + +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``mq``: Update mq client to latest version +* enhancment:Timestamp Serialization: Support explicit timestamp serialization per timestamp shape. +* api-change:``glacier``: Update glacier client to latest version + + +1.10.65 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``inspector``: Update inspector client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.10.64 +======= + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.10.63 +======= + +* api-change:``dynamodb``: Update dynamodb client to latest version + + +1.10.62 +======= + +* api-change:``config``: Update config client to latest version +* api-change:``dlm``: Update dlm client to latest version + + +1.10.61 +======= + +* api-change:``mediapackage``: Update mediapackage client to latest version + + +1.10.60 +======= + +* api-change:``iotanalytics``: Update iotanalytics client to latest version + + +1.10.59 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``polly``: Update polly client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``snowball``: Update snowball client to latest version + + +1.10.58 +======= + +* api-change:``kinesisvideo``: Update kinesisvideo client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version + + +1.10.57 +======= + +* api-change:``iam``: Update iam client to latest version +* api-change:``dlm``: Update dlm client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``efs``: Update efs client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``emr``: Update emr client to latest version + + +1.10.56 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``ce``: Update ce client to latest version + + +1.10.55 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``opsworks``: Update opsworks client to latest version +* api-change:``appstream``: Update appstream client to latest version + + +1.10.54 +======= + +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.10.53 +======= + +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``transcribe``: Update transcribe client to latest version + + +1.10.52 +======= + +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version + + +1.10.51 +======= + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.10.50 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``acm``: Update acm client to latest version + + +1.10.49 +======= + +* api-change:``ssm``: Update ssm client to latest version + + +1.10.48 +======= + +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``lambda``: Update lambda client to latest version + + +1.10.47 +======= + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* enhancement:StreamingResponses: Add ``iter_lines()`` and ``iter_chunks()`` to streaming responses (`#1195 `__) + + +1.10.46 +======= + +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``inspector``: Update inspector client to latest version + + +1.10.45 +======= + +* api-change:``appstream``: Update appstream client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.10.44 +======= + +* api-change:``clouddirectory``: Update clouddirectory client to latest version + + +1.10.43 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``macie``: Update macie client to latest version +* api-change:``neptune``: Update neptune client to latest version + + +1.10.42 +======= + +* api-change:``acm-pca``: Update acm-pca client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``medialive``: Update medialive client to latest version + + +1.10.41 +======= + +* api-change:``rekognition``: Update rekognition client to latest version + + +1.10.40 +======= + +* api-change:``mediaconvert``: Update mediaconvert client to latest version + + +1.10.39 +======= + +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``apigateway``: Update apigateway client to latest version + + +1.10.38 +======= + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.10.37 +======= + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.10.36 +======= + +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``clouddirectory``: Update clouddirectory client to latest version + + +1.10.35 +======= + +* api-change:``mediatailor``: Update mediatailor client to latest version + + +1.10.34 +======= + +* api-change:``medialive``: Update medialive client to latest version + + +1.10.33 +======= + +* api-change:``polly``: Update polly client to latest version +* api-change:``ce``: Update ce client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``shield``: Update shield client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.10.32 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``mgh``: Update mgh client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``eks``: Update eks client to latest version + + +1.10.31 +======= + +* api-change:``ds``: Update ds client to latest version +* api-change:``mediatailor``: Update mediatailor client to latest version +* api-change:``sns``: Update sns client to latest version +* api-change:``redshift``: Update redshift client to latest version +* api-change:``iot``: Update iot client to latest version + + +1.10.30 +======= + +* api-change:``neptune``: Update neptune client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.10.29 +======= + +* api-change:``pi``: Update pi client to latest version + + +1.10.28 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.10.27 +======= + +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.10.26 +======= + +* api-change:``inspector``: Update inspector client to latest version +* enhancement:Credentials: Disable proxy configuration when fetching container credentials +* api-change:``ecs``: Update ecs client to latest version + + +1.10.25 +======= + +* api-change:``cloudformation``: Update cloudformation client to latest version + + +1.10.24 +======= + +* api-change:``iot``: Update iot client to latest version +* api-change:``ses``: Update ses client to latest version + + +1.10.23 +======= + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version + + +1.10.22 +======= + +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version + + +1.10.21 +======= + +* api-change:``config``: Update config client to latest version + + +1.10.20 +======= + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``iot1click-devices``: Update iot1click-devices client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``iot1click-projects``: Update iot1click-projects client to latest version + + +1.10.19 +======= + +* api-change:``firehose``: Update firehose client to latest version + + +1.10.18 +======= + +* api-change:``gamelift``: Update gamelift client to latest version + + +1.10.17 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``budgets``: Update budgets client to latest version + + +1.10.16 +======= + +* api-change:``rds``: Update rds client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.10.15 +======= + +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``budgets``: Update budgets client to latest version +* api-change:``es``: Update es client to latest version + + +1.10.14 +======= + +* api-change:``guardduty``: Update guardduty client to latest version + + +1.10.13 +======= + +* api-change:``config``: Update config client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``appsync``: Update appsync client to latest version + + +1.10.12 +======= + +* api-change:``acm``: Update acm client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.10.11 +======= + +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``route53domains``: Update route53domains client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version + + +1.10.10 +======= + +* api-change:``glacier``: Update glacier client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version + + +1.10.9 +====== + +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``xray``: Update xray client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version + + +1.10.8 +====== + +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version + + +1.10.7 +====== + +* api-change:``iotanalytics``: Update iotanalytics client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``autoscaling-plans``: Update autoscaling-plans client to latest version + + +1.10.6 +====== + +* api-change:``medialive``: Update medialive client to latest version +* api-change:``firehose``: Update firehose client to latest version + + +1.10.5 +====== + +* api-change:``ce``: Update ce client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.10.4 +====== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``workmail``: Update workmail client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.10.3 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version + + +1.10.2 +====== + +* api-change:``batch``: Update batch client to latest version + + +1.10.1 +====== + +* enhancement:shield: Added paginator for list_protections operation. +* api-change:``ssm``: Update ssm client to latest version + + +1.10.0 +====== + +* api-change:``s3``: Update s3 client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``acm``: Update acm client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``transcribe``: Update transcribe client to latest version +* api-change:``secretsmanager``: Update secretsmanager client to latest version +* api-change:``acm-pca``: Update acm-pca client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* feature:s3: Add support for S3 Select. Amazon S3 Select is an Amazon S3 feature that makes it easy to retrieve specific data from the contents of an object using simple SQL expressions without having to retrieve the entire object. With this release of the Amazon S3 SDK, S3 Select API (SelectObjectContent) is now generally available in all public regions. This release supports retrieval of a subset of data using SQL clauses, like SELECT and WHERE, from delimited text files and JSON objects in Amazon S3 through the SelectObjectContent API available in AWS S3 SDK. +* api-change:``fms``: Update fms client to latest version + + +1.9.23 +====== + +* api-change:``lambda``: Update lambda client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``translate``: Update translate client to latest version + + +1.9.22 +====== + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``es``: Update es client to latest version + + +1.9.21 +====== + +* api-change:``connect``: Update connect client to latest version +* api-change:``acm``: Update acm client to latest version + + +1.9.20 +====== + +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version + + +1.9.19 +====== + +* api-change:``mturk``: Update mturk client to latest version +* api-change:``sts``: Update sts client to latest version +* api-change:``iam``: Update iam client to latest version + + +1.9.18 +====== + +* api-change:``acm``: Update acm client to latest version + + +1.9.17 +====== + +* api-change:``dynamodb``: Update dynamodb client to latest version +* bugfix:``s3``: Fix bug where invalid head_object requests would cause an infinite loop (alternate fix to `#1400 `__) + + +1.9.16 +====== + +* api-change:``rds``: Update rds client to latest version + + +1.9.15 +====== + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.9.14 +====== + +* bugfix:``s3``: Fix regression in redirects in using wrong region + + +1.9.13 +====== + +* bugfix:s3: Fixed a bug where head object and bucket calls would attempt redirects incorrectly. +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version + + +1.9.12 +====== + +* api-change:``ce``: Update ce client to latest version +* enhancement:Credentials: Add the ability to disable fetching credentials from EC2 metadata by setting the environment variable AWS_EC2_METADATA_DISABLED to 'true'. +* api-change:``config``: Update config client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``medialive``: Update medialive client to latest version +* bugfix:Credentials: Fix a race condition related to assuming a role for the first time (`#1405 `__) +* api-change:``events``: Update events client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.9.11 +====== + +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version + + +1.9.10 +====== + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.9.9 +===== + +* api-change:``lightsail``: Update lightsail client to latest version + + +1.9.8 +===== + +* api-change:``servicediscovery``: Update servicediscovery client to latest version + + +1.9.7 +===== + +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version +* api-change:``discovery``: Update discovery client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``redshift``: Update redshift client to latest version + + +1.9.6 +===== + +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``mgh``: Update mgh client to latest version + + +1.9.5 +===== + +* api-change:``medialive``: Update medialive client to latest version + + +1.9.4 +===== + +* api-change:``ecs``: Update ecs client to latest version + + +1.9.3 +===== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.9.2 +===== + +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.9.1 +===== + +* api-change:``ecr``: Update ecr client to latest version + + +1.9.0 +===== + +* enhancement:Stubber: Added the ability to add items to response metadata with the stubber. +* api-change:``sts``: Update sts client to latest version +* api-change:``route53``: Update route53 client to latest version +* feature:``s3``: Default to virtual hosted addressing regardless of signature version (boto/botocore`#1387 `__) + + +1.8.50 +====== + +* api-change:``appstream``: Update appstream client to latest version + + +1.8.49 +====== + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``ce``: Update ce client to latest version + + +1.8.48 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version +* api-change:``codecommit``: Update codecommit client to latest version + + +1.8.47 +====== + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``waf``: Update waf client to latest version + + +1.8.46 +====== + +* api-change:``config``: Update config client to latest version + + +1.8.45 +====== + +* api-change:``rds``: Update rds client to latest version + + +1.8.44 +====== + +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``gamelift``: Update gamelift client to latest version + + +1.8.43 +====== + +* api-change:``appsync``: Update appsync client to latest version +* api-change:``lex-models``: Update lex-models client to latest version + + +1.8.42 +====== + +* api-change:``glacier``: Update glacier client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.8.41 +====== + +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``kms``: Update kms client to latest version + + +1.8.40 +====== + +* api-change:``lex-runtime``: Update lex-runtime client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``lex-models``: Update lex-models client to latest version + + +1.8.39 +====== + +* api-change:``ds``: Update ds client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``budgets``: Update budgets client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``mediastore``: Update mediastore client to latest version + + +1.8.38 +====== + +* api-change:``servicediscovery``: Update servicediscovery client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.8.37 +====== + +* api-change:``cloud9``: Update cloud9 client to latest version +* api-change:``acm``: Update acm client to latest version +* api-change:``kinesis``: Update kinesis client to latest version +* api-change:``opsworks``: Update opsworks client to latest version + + +1.8.36 +====== + +* api-change:``mturk``: Update mturk client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.8.35 +====== + +* api-change:``lambda``: Update lambda client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* bugfix:Presign: Fix issue where some events were not fired during the presigning of a request thus not including a variety of customizations (`#1340 `__) +* enhancement:Credentials: Improved error message when the source profile for an assume role is misconfigured. Fixes aws/aws-cli`#2763 `__ +* api-change:``guardduty``: Update guardduty client to latest version +* enhancment:Paginator: Added paginators for a number of services where the result key is unambiguous. + + +1.8.34 +====== + +* api-change:``budgets``: Update budgets client to latest version + + +1.8.33 +====== + +* api-change:``glue``: Update glue client to latest version +* api-change:``transcribe``: Update transcribe client to latest version + + +1.8.32 +====== + +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.8.31 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``autoscaling-plans``: Update autoscaling-plans client to latest version + + +1.8.30 +====== + +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``autoscaling-plans``: Update autoscaling-plans client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.8.29 +====== + +* api-change:``lambda``: Update lambda client to latest version +* enhancement:cloudformation get_template template body ordering: fixes boto/boto3`#1378 `__ + + +1.8.28 +====== + +* api-change:``glue``: Update glue client to latest version + + +1.8.27 +====== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``elb``: Update elb client to latest version + + +1.8.26 +====== + +* api-change:``kms``: Update kms client to latest version + + +1.8.25 +====== + +* api-change:``ds``: Update ds client to latest version + + +1.8.24 +====== + +* api-change:``route53``: Update route53 client to latest version +* api-change:``discovery``: Update discovery client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version + + +1.8.23 +====== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``inspector``: Update inspector client to latest version +* api-change:``snowball``: Update snowball client to latest version + + +1.8.22 +====== + +* api-change:``rds``: Update rds client to latest version + + +1.8.21 +====== + +* api-change:``workspaces``: Update workspaces client to latest version + + +1.8.20 +====== + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``inspector``: Update inspector client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version + + +1.8.19 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* enhancement:Paginator: Added paginator support for lambda list aliases operation. +* api-change:``kinesisanalytics``: Update kinesisanalytics client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.8.18 +====== + +* api-change:``iot``: Update iot client to latest version +* api-change:``config``: Update config client to latest version + + +1.8.17 +====== + +* api-change:``route53``: Update route53 client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``mediastore-data``: Update mediastore-data client to latest version + + +1.8.16 +====== + +* bugfix:presigned-url: Fixes a bug where content-type would be set on presigned requests for query services. +* api-change:``cloudwatch``: Update cloudwatch client to latest version + + +1.8.15 +====== + +* api-change:``appstream``: Update appstream client to latest version + + +1.8.14 +====== + +* api-change:``ses``: Update ses client to latest version +* enhancement:credentials: Moved the JSONFileCache from the CLI into botocore so that it can be used without importing from the cli. +* api-change:``apigateway``: Update apigateway client to latest version + + +1.8.13 +====== + +* api-change:``codedeploy``: Update codedeploy client to latest version +* bugfix:sagemaker-runtime: Renamed the runtime.sagemaker service to sagemaker-runtime to be more consistent with existing services. The old service name is now aliased to sagemaker-runtime to maintain backwards compatibility. +* bugfix:Stubber: This change makes the error handling more verbose in the case where a stubbed method has been called, but the Stubber is not expecting a call. +* api-change:``workmail``: Update workmail client to latest version + + +1.8.12 +====== + +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``lex-models``: Update lex-models client to latest version + + +1.8.11 +====== + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``appstream``: Update appstream client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.8.10 +====== + +* api-change:``ses``: Update ses client to latest version +* api-change:``es``: Update es client to latest version + + +1.8.9 +===== + +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``clouddirectory``: Update clouddirectory client to latest version + + +1.8.8 +===== + +* api-change:``iot``: Update iot client to latest version +* api-change:``servicediscovery``: Update servicediscovery client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.8.7 +===== + +* api-change:``budgets``: Update budgets client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.8.6 +===== + +* api-change:``cloud9``: Update cloud9 client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version +* api-change:``serverlessrepo``: Update serverlessrepo client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.8.5 +===== + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``waf``: Update waf client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``resource-groups``: Update resource-groups client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.8.4 +===== + +* api-change:``kinesis-video-media``: Update kinesis-video-media client to latest version +* api-change:``translate``: Update translate client to latest version +* api-change:``sagemaker``: Update sagemaker client to latest version +* api-change:``iot-jobs-data``: Update iot-jobs-data client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``runtime.sagemaker``: Update runtime.sagemaker client to latest version +* api-change:``kinesisvideo``: Update kinesisvideo client to latest version +* api-change:``comprehend``: Update comprehend client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``glacier``: Update glacier client to latest version +* api-change:``kinesis-video-archived-media``: Update kinesis-video-archived-media client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* bugfix:Credentials: Fixed a bug causing issues in configuring the process provider on windows when paths were used. +* api-change:``iot``: Update iot client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.8.3 +===== + +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``appsync``: Update appsync client to latest version +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``guardduty``: Update guardduty client to latest version +* api-change:``batch``: Update batch client to latest version +* bugfix:rekognition: Fixed a bug causing the rekognition paginator to not return FaceModelVersions. +* api-change:``lambda``: Update lambda client to latest version +* api-change:``mq``: Update mq client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* bugfix:Credentials: Fixes an issue where cache keys would be too long to use as file names. +* api-change:``ec2``: Update ec2 client to latest version + + +1.8.2 +===== + +* api-change:``mediapackage``: Update mediapackage client to latest version +* api-change:``medialive``: Update medialive client to latest version +* api-change:``mediastore``: Update mediastore client to latest version +* api-change:``mediaconvert``: Update mediaconvert client to latest version +* api-change:``mediastore-data``: Update mediastore-data client to latest version + + +1.8.1 +===== + +* bugfix:Credentials: Fixes a bug causing cached credentials to break in the CLI on Windows. Fixes aws/aws-cli`#2978 `__ +* api-change:``acm``: Update acm client to latest version + + +1.8.0 +===== + +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``emr``: Update emr client to latest version +* api-change:``xray``: Update xray client to latest version +* feature:Credentials: When creating an assume role profile, you can now specify a credential source outside of the config file using the `credential_source` key. +* api-change:``shield``: Update shield client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* feature:Credentials: When creating an assume role profile, you can now specify another assume role profile as the source. This allows for chaining assume role calls. +* api-change:``codebuild``: Update codebuild client to latest version +* feature:credentials: Adds support for the process credential provider, allowing users to specify a process to call to get credentials. +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* enhancement:Response: Allow reads of zero on streaming bodies, fixes `#1309 `__. + + +1.7.48 +====== + +* api-change:``workdocs``: Update workdocs client to latest version +* api-change:``kinesis``: Update kinesis client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``firehose``: Update firehose client to latest version +* api-change:``ce``: Update ce client to latest version + + +1.7.47 +====== + +* api-change:``s3``: Update s3 client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.7.46 +====== + +* api-change:``opsworkscm``: Update opsworkscm client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.7.45 +====== + +* api-change:``ses``: Update ses client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``polly``: Update polly client to latest version + + +1.7.44 +====== + +* api-change:``ecs``: Update ecs client to latest version +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.7.43 +====== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.7.42 +====== + +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.7.41 +====== + +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``s3``: Update s3 client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.7.40 +====== + +* api-change:``stepfunctions``: Update stepfunctions client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``pricing``: Update pricing client to latest version + + +1.7.39 +====== + +* api-change:``ecs``: Update ecs client to latest version + + +1.7.38 +====== + +* api-change:``apigateway``: Update apigateway client to latest version + + +1.7.37 +====== + +* api-change:``acm``: Update acm client to latest version +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version +* api-change:``directconnect``: Update directconnect client to latest version + + +1.7.36 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudfront``: Update cloudfront client to latest version + + +1.7.35 +====== + +* api-change:``elasticache``: Update elasticache client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``config``: Update config client to latest version +* api-change:``glue``: Update glue client to latest version + + +1.7.34 +====== + +* api-change:``organizations``: Update organizations client to latest version + + +1.7.33 +====== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.7.32 +====== + +* api-change:``ssm``: Update ssm client to latest version +* bugfix:sigv4: Strip out the default port and http auth info when computing the host header for sigv4 signing. +* api-change:``sqs``: Update sqs client to latest version + + +1.7.31 +====== + +* api-change:``lightsail``: Update lightsail client to latest version + + +1.7.30 +====== + +* api-change:``es``: Update es client to latest version + + +1.7.29 +====== + +* api-change:``waf``: Update waf client to latest version +* api-change:``cloudhsm``: Update cloudhsm client to latest version +* api-change:``es``: Update es client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.7.28 +====== + +* api-change:``polly``: Update polly client to latest version +* api-change:``dms``: Update dms client to latest version +* api-change:``codecommit``: Update codecommit client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* bugfix:Paginator: Fixes an issue when `build_full_result` is used repeatedly that results in the same token being returned multiple times. +* api-change:``rds``: Update rds client to latest version + + +1.7.27 +====== + +* api-change:``ecr``: Update ecr client to latest version +* api-change:``ses``: Update ses client to latest version + + +1.7.26 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version + + +1.7.25 +====== + +* api-change:``sqs``: Update sqs client to latest version +* bugfix:serializer: Update query serializer to automatically include the application/x-www-form-urlencoded; charset=utf-8 Content-Type header. + + +1.7.24 +====== + +* api-change:``redshift``: Update redshift client to latest version + + +1.7.23 +====== + +* api-change:``route53domains``: Update route53domains client to latest version +* api-change:``kinesisanalytics``: Update kinesisanalytics client to latest version + + +1.7.22 +====== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.7.21 +====== + +* api-change:``cloudhsm``: Update cloudhsm client to latest version + + +1.7.20 +====== + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``mturk``: Update mturk client to latest version +* api-change:``appstream``: Update appstream client to latest version + + +1.7.19 +====== + +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.7.18 +====== + +* api-change:``cloudformation``: Update cloudformation client to latest version + + +1.7.17 +====== + +* api-change:``config``: Update config client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.7.16 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``logs``: Update logs client to latest version +* api-change:``budgets``: Update budgets client to latest version + + +1.7.15 +====== + +* api-change:``appstream``: Update appstream client to latest version +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``rds``: Update rds client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``lex-runtime``: Update lex-runtime client to latest version + + +1.7.14 +====== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.7.13 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``ses``: Update ses client to latest version + + +1.7.12 +====== + +* api-change:``apigateway``: Update apigateway client to latest version + + +1.7.11 +====== + +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.7.10 +====== + +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``events``: Update events client to latest version + + +1.7.9 +===== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.7.8 +===== + +* api-change:``devicefarm``: Update devicefarm client to latest version + + +1.7.7 +===== + +* api-change:``logs``: Update logs client to latest version + + +1.7.6 +===== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.7.5 +===== + +* api-change:``budgets``: Update budgets client to latest version + + +1.7.4 +===== + +* api-change:``codestar``: Update codestar client to latest version + + +1.7.3 +===== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``mobile``: Update mobile client to latest version +* api-change:``gamelift``: Update gamelift client to latest version + + +1.7.2 +===== + +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version +* api-change:``lex-models``: Update lex-models client to latest version + + +1.7.1 +===== + +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version +* api-change:``organizations``: Update organizations client to latest version + + +1.7.0 +===== + +* api-change:``ec2``: Update ec2 client to latest version +* feature:Waiter: Expose configurable waiter interface +* api-change:``config``: Update config client to latest version + + +1.6.8 +===== + +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.6.7 +===== + +* api-change:``rekognition``: Update rekognition client to latest version + + +1.6.6 +===== + +* api-change:``appstream``: Update appstream client to latest version + + +1.6.5 +===== + +* bugfix:Paginator: Fix Athena GetQueryResults paginator +* api-change:``ssm``: Update ssm client to latest version + + +1.6.4 +===== + +* api-change:``route53``: Update route53 client to latest version +* api-change:``firehose``: Update firehose client to latest version + + +1.6.3 +===== + +* api-change:``gamelift``: Update gamelift client to latest version + + +1.6.2 +===== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.6.1 +===== + +* api-change:``cloudhsmv2``: Update cloudhsmv2 client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``glue``: Update glue client to latest version +* api-change:``mgh``: Update mgh client to latest version +* api-change:``efs``: Update efs client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``batch``: Update batch client to latest version + + +1.6.0 +===== + +* api-change:``ec2``: Update ec2 client to latest version +* feature:retries: Add ability to configure the maximum amount of retry attempts a client call can make. (`#1260 `__) +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version + + +1.5.95 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.5.94 +====== + +* api-change:``rds``: Update rds client to latest version + + +1.5.93 +====== + +* bugfix:Paginator: Ensure that the page size type matches the type expected by the service. Fixes `#1063 `__. +* bugfix:Exceptions: Default to 'Unknown' when error response is missing 'Error' key +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version + + +1.5.92 +====== + +* api-change:``ses``: Update ses client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``config``: Update config client to latest version + + +1.5.91 +====== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``inspector``: Update inspector client to latest version + + +1.5.90 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``kinesisanalytics``: Update kinesisanalytics client to latest version + + +1.5.89 +====== + +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``cloudwatch``: Update cloudwatch client to latest version + + +1.5.88 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version + + +1.5.87 +====== + +* api-change:``appstream``: Update appstream client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.5.86 +====== + +* api-change:``emr``: Update emr client to latest version + + +1.5.85 +====== + +* api-change:``budgets``: Update budgets client to latest version + + +1.5.84 +====== + +* api-change:``lambda``: Update lambda client to latest version +* bugfix:Paginator: Fixed a bug causing running `build_full_results` multiple times to incorrectly generate the `NextToken` value. +* api-change:``cognito-idp``: Update cognito-idp client to latest version + + +1.5.83 +====== + +* api-change:``discovery``: Update discovery client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version + + +1.5.82 +====== + +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``lex-models``: Update lex-models client to latest version + + +1.5.81 +====== + +* enhancement:SSM: Added a paginator for describe_parameters. +* enchancement:Organizations: Added paginators for Organizations. +* enhancement:IoT: Add paginators for IoT. +* api-change:``swf``: Update swf client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* enhancement:Athena: Added paginators for Athena. + + +1.5.80 +====== + +* api-change:``kinesis``: Update kinesis client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``ds``: Update ds client to latest version +* api-change:``ssm``: Update ssm client to latest version + + +1.5.79 +====== + +* api-change:``cloudwatch``: Update cloudwatch client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.5.78 +====== + +* api-change:``s3``: Update s3 client to latest version +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version + + +1.5.77 +====== + +* api-change:``ssm``: Update ssm client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``events``: Update events client to latest version + + +1.5.76 +====== + +* bugfix:Config: Fixes a bug resulting from copy/deepcopy not returning the same object for botocore.UNSIGNED. Fixes boto/boto3`#1144 `__ +* api-change:``servicecatalog``: Update servicecatalog client to latest version + + +1.5.75 +====== + +* api-change:``lambda``: Update lambda client to latest version + + +1.5.74 +====== + +* api-change:``lightsail``: Update lightsail client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``codepipeline``: Update codepipeline client to latest version +* api-change:``dms``: Update dms client to latest version + + +1.5.73 +====== + +* api-change:``dax``: Update dax client to latest version +* api-change:``waf``: Update waf client to latest version +* api-change:``ssm``: Update ssm client to latest version +* api-change:``route53``: Update route53 client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version + + +1.5.72 +====== + +* api-change:``workdocs``: Update workdocs client to latest version + + +1.5.71 +====== + +* enhancement:s3: All S3 requests will now use SigV4 by default so that we can take advantage of stronger security algorithms and improved access key isolation. +* api-change:``organizations``: Update organizations client to latest version + + +1.5.70 +====== + +* api-change:``xray``: Update xray client to latest version + + +1.5.69 +====== + +* api-change:``iot``: Update iot client to latest version +* api-change:``servicecatalog``: Update servicecatalog client to latest version +* api-change:``ecs``: Update ecs client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.5.68 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.5.67 +====== + +* api-change:``config``: Update config client to latest version + + +1.5.66 +====== + +* api-change:``rds``: Update rds client to latest version + + +1.5.65 +====== + +* api-change:``opsworks``: Update opsworks client to latest version + + +1.5.64 +====== + +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``pinpoint``: Update pinpoint client to latest version + + +1.5.63 +====== + +* api-change:``greengrass``: Update greengrass client to latest version +* api-change:``codebuild``: Update codebuild client to latest version + + +1.5.62 +====== + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``iot``: Update iot client to latest version +* api-change:``acm``: Update acm client to latest version + + +1.5.61 +====== + +* api-change:``iot``: Update iot client to latest version +* api-change:``appstream``: Update appstream client to latest version + + +1.5.60 +====== + +* api-change:``workdocs``: Update workdocs client to latest version +* api-change:``kinesisanalytics``: Update kinesisanalytics client to latest version + + +1.5.59 +====== + +* api-change:``cognito-idp``: Update cognito-idp client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.5.58 +====== + +* api-change:``rds``: Update rds client to latest version + + +1.5.57 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version + + +1.5.56 +====== + +* api-change:``appstream``: Update appstream client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.5.55 +====== + +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``sts``: Update sts client to latest version + + +1.5.54 +====== + +* api-change:``dms``: Update dms client to latest version + + +1.5.53 +====== + +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version + + +1.5.52 +====== + +* api-change:``athena``: Update athena client to latest version +* api-change:``lightsail``: Update lightsail client to latest version + + +1.5.51 +====== + +* api-change:``polly``: Update polly client to latest version +* api-change:``autoscaling``: Update autoscaling client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``logs``: Update logs client to latest version + + +1.5.50 +====== + +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``inspector``: Update inspector client to latest version +* api-change:``kms``: Update kms client to latest version + + +1.5.49 +====== + +* api-change:``ssm``: Update ssm client to latest version + + +1.5.48 +====== + +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``elb``: Update elb client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.5.47 +====== + +* api-change:``codestar``: Update codestar client to latest version +* api-change:``workspaces``: Update workspaces client to latest version +* enhancement:Credentials: Add support for environment variable credential expiration. + + +1.5.46 +====== + +* api-change:``marketplace-entitlement``: Update marketplace-entitlement client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``ecs``: Update ecs client to latest version + + +1.5.45 +====== + +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``snowball``: Update snowball client to latest version +* api-change:``sqs``: Update sqs client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* bugfix:Paginator: Fixes bug where pagination would fail if the pagination token contained bytes. +* api-change:``rds``: Update rds client to latest version + + +1.5.44 +====== + +* enhancement:rds: Add rds database presigner. +* api-change:``rds``: Update rds client to latest version + + +1.5.43 +====== + +* api-change:``appstream``: Update appstream client to latest version +* bugfix:Auth: Fix bug in Signature Version 4 signer when a header value has consecutive spaces +* api-change:``kinesis``: Update kinesis client to latest version + + +1.5.42 +====== + +* api-change:``route53``: Update route53 client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``kms``: Update kms client to latest version +* api-change:``route53domains``: Update route53domains client to latest version + + +1.5.41 +====== + +* api-change:``codestar``: Update codestar client to latest version +* api-change:``lambda``: Update lambda client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``lex-models``: Update lex-models client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``rekognition``: Update rekognition client to latest version +* api-change:``polly``: Update polly client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.5.40 +====== + +* bugfix:mturk: Fix naming on list_hits_for_qualification_type for mturk. The old method name will still be supported. +* api-change:``lambda``: Update lambda client to latest version + + +1.5.39 +====== + +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``batch``: Update batch client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``opsworks``: Update opsworks client to latest version + + +1.5.38 +====== + +* api-change:``redshift``: Update redshift client to latest version + + +1.5.37 +====== + +* api-change:``elbv2``: Update elbv2 client to latest version + + +1.5.36 +====== + +* api-change:``elasticache``: Update elasticache client to latest version + + +1.5.35 +====== + +* api-change:``cloudwatch``: Update cloudwatch client to latest version + + +1.5.34 +====== + +* api-change:``lex-runtime``: Update lex-runtime client to latest version + + +1.5.33 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version + + +1.5.32 +====== + +* api-change:``cloudfront``: Update cloudfront client to latest version +* api-change:``storagegateway``: Update storagegateway client to latest version +* api-change:``resourcegroupstaggingapi``: Update resourcegroupstaggingapi client to latest version +* api-change:``cloudformation``: Update cloudformation client to latest version +* api-change:``config``: Update config client to latest version + + +1.5.31 +====== + +* api-change:``batch``: Update batch client to latest version +* api-change:``ec2``: Update ec2 client to latest version + + +1.5.30 +====== + +* api-change:``ssm``: Update ssm client to latest version +* bugfix:config: Fix a bug in loading config files from paths that contain non-ascii characters. Fixes aws/aws-cli`#2395 `__ + + +1.5.29 +====== + +* api-change:``cloudtrail``: Update cloudtrail client to latest version +* api-change:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.5.28 +====== + +* api-change:``discovery``: Update discovery client to latest version +* api-change:``lambda``: Update lambda client to latest version + + +1.5.27 +====== + +* api-change:``pinpoint``: Update pinpoint client to latest version +* api-change:``directconnect``: Update directconnect client to latest version +* enhancement:Credentials: Add support for localhost when using container credential provider (`#1160 `__) +* api-change:``codebuild``: Update codebuild client to latest version +* api-change:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version +* api-change:``rekognition``: Update rekognition client to latest version + + +1.5.26 +====== + +* api-change:``budgets``: Update budgets client to latest version +* api-change:``apigateway``: Update apigateway client to latest version +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``events``: Update events client to latest version +* api-change:``rds``: Update rds client to latest version + + +1.5.25 +====== + +* api-change:``devicefarm``: Update devicefarm client to latest version +* api-change:``events``: Update events client to latest version + + +1.5.24 +====== + +* api-change:``codedeploy``: Update codedeploy client to latest version +* api-change:``emr``: Update emr client to latest version + + +1.5.23 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version +* api-change:``apigateway``: Update apigateway client to latest version + + +1.5.22 +====== + +* api-change:``organizations``: Update organizations client to latest version +* api-change:``workdocs``: Update workdocs client to latest version + + +1.5.21 +====== + +* api-change:``rds``: Update rds client to latest version + + +1.5.20 +====== + +* api-change:``budgets``: Update budgets client to latest version +* api-change:``cloudtrail``: Update cloudtrail client to latest version +* api-change:``opsworkscm``: Update opsworkscm client to latest version + + +1.5.19 +====== + +* api-change:``waf``: Update waf client to latest version +* api-change:``mturk``: Update mturk client to latest version +* api-change:``iam``: Update iam client to latest version +* api-change:``organizations``: Update organizations client to latest version +* api-change:``waf-regional``: Update waf-regional client to latest version +* api-change:``dynamodb``: Update dynamodb client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``ec2``: Update ec2 client to latest version +* api-change:``dynamodbstreams``: Update dynamodbstreams client to latest version + + +1.5.18 +====== + +* api-change:``es``: Update es client to latest version + + +1.5.17 +====== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.5.16 +====== + +* api-change:``clouddirectory``: Update clouddirectory client to latest version +* api-change:``gamelift``: Update gamelift client to latest version +* api-change:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* api-change:``route53``: Update route53 client to latest version + + +1.5.15 +====== + +* api-change:``ec2``: Update ec2 client to latest version + + +1.5.14 +====== + +* api-change:``directconnect``: Update directconnect client to latest version + + +1.5.13 +====== + +* api-change:``config``: Update config client to latest version +* api-change:``cognito-identity``: Update cognito-identity client to latest version + + +1.5.12 +====== + +* feature:``kms``: Update kms client to latest version + + +1.5.11 +====== + +* feature:``ec2``: Update ec2 client to latest version + + +1.5.10 +====== + +* feature:``storagegateway``: Update storagegateway client to latest version +* feature:Waiter: Adds several new waiters. +* feature:``clouddirectory``: Update clouddirectory client to latest version +* feature:``lex-runtime``: Update lex-runtime client to latest version + + +1.5.9 +===== + +* feature:``rekognition``: Update rekognition client to latest version +* feature:``ec2``: Update ec2 client to latest version + + +1.5.8 +===== + +* feature:``lex-runtime``: Update lex-runtime client to latest version +* feature:Paginator: Added paginators for multiple services + + +1.5.7 +===== + +* feature:``ec2``: Update ec2 client to latest version +* feature:``clouddirectory``: Update clouddirectory client to latest version +* feature:``codedeploy``: Update codedeploy client to latest version +* feature:``rds``: Update rds client to latest version + + +1.5.6 +===== + +* feature:``elbv2``: Update elbv2 client to latest version +* feature:``rds``: Update rds client to latest version + + +1.5.5 +===== + +* feature:``codebuild``: Update codebuild client to latest version +* feature:``ecs``: Update ecs client to latest version +* feature:``codecommit``: Update codecommit client to latest version + + +1.5.4 +===== + +* feature:``health``: Update health client to latest version +* feature:``acm``: Update acm client to latest version + + +1.5.3 +===== + +* feature:``ec2``: Update ec2 client to latest version + + +1.5.2 +===== + +* feature:``rds``: Update rds client to latest version + + +1.5.1 +===== + +* feature:``glacier``: Update glacier client to latest version +* feature:``dynamodb``: Update dynamodb client to latest version +* feature:``route53``: Update route53 client to latest version +* feature:``polly``: Update polly client to latest version +* feature:``rekognition``: Update rekognition client to latest version + + +1.5.0 +===== + +* feature:Exceptions: Add modeled exceptions on client via ``Client.exceptions`` property +* feature:``dynamodb``: Update dynamodb client to latest version +* feature:``config``: Update config client to latest version +* feature:``cur``: Update cur client to latest version +* feature:``elasticache``: Update elasticache client to latest version + + +1.4.93 +====== + +* feature:``rds``: Update rds client to latest version +* feature:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version +* feature:``config``: Update config client to latest version +* feature:``iam``: Update iam client to latest version +* feature:``lambda``: Update lambda client to latest version +* feature:``dynamodbstreams``: Update dynamodbstreams client to latest version +* feature:``efs``: Update efs client to latest version +* feature:``rekognition``: Update rekognition client to latest version + + +1.4.92 +====== + +* feature:``codedeploy``: Update codedeploy client to latest version +* bugfix:Paginator: Fix a paginator bug involving optional tokens (`#1057 `__) +* feature:``ecs``: Update ecs client to latest version + + +1.4.91 +====== + +* feature:``iam``: Update iam client to latest version +* feature:``apigateway``: Update apigateway client to latest version +* feature:``ds``: Update ds client to latest version +* feature:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* feature:``kms``: Update kms client to latest version + + +1.4.90 +====== + +* feature:``rds``: Update rds client to latest version +* feature:``ecr``: Update ecr client to latest version + + +1.4.89 +====== + +* feature:``storagegateway``: Update storagegateway client to latest version +* feature:``firehose``: Update firehose client to latest version +* feature:``route53``: Update route53 client to latest version + + +1.4.88 +====== + +* feature:``discovery``: Update discovery client to latest version +* feature:``cognito-identity``: Update cognito-identity client to latest version +* feature:``inspector``: Update inspector client to latest version +* feature:``sqs``: Update sqs client to latest version +* feature:``cloudformation``: Update cloudformation client to latest version + + +1.4.87 +====== + +* feature:``ssm``: Update ssm client to latest version +* feature:user-agent: Default user agent now includes the environment variable $AWS_EXECUTION_ENVIRONMENT +* bugfix:Python 3.6: Adds compatibility with the new Python 3.6 HTTPConnection. +* bugfix:sigv4: Do not sign x-amzn-trace-id as it can be mutated along the way. +* feature:``cognito-idp``: Update cognito-idp client to latest version + + +1.4.86 +====== + +* feature:``dms``: Update dms client to latest version +* feature:``rds``: Update rds client to latest version +* feature:``logs``: Update logs client to latest version +* feature:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version +* feature:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* feature:``sts``: Update sts client to latest version +* feature:``batch``: Update batch client to latest version + + +1.4.85 +====== + +* feature:cloudfront: Add lambda function associations to cache behaviors. +* feature:rds: Add cluster create data to DBCluster APIs. +* feature:waf-regional: With this new feature, customers can use AWS WAF directly on Application Load Balancers in a VPC within available regions to protect their websites and web services from malicious attacks such as SQL injection, Cross Site Scripting, bad bots, etc. + + +1.4.84 +====== + +* feature:``config``: Update config client to latest version +* feature:health: Add paginators for Health. +* feature:``sqs``: Update sqs client to latest version +* feature:``s3``: Update s3 client to latest version + + +1.4.83 +====== + +* feature:``pinpoint``: Update pinpoint client to latest version +* feature:``ec2``: Update ec2 client to latest version +* feature:``sts``: Update sts client to latest version +* feature:``config``: Update config client to latest version + + +1.4.82 +====== + +* bugfix:Exceptions: Allow parsing of json error responses with non-json bodies. +* feature:opsworks-cm: Added waiter for Opsworks CM + + +1.4.81 +====== + +* feature:parameter: Automatically inject an idempotency token into parameters marked with the idempotencyToken trait +* feature:``appstream``: Update appstream client to latest version +* feature:``directconnect``: Update directconnect client to latest version +* feature:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* feature:``shield``: Update shield client to latest version +* feature:``opsworkscm``: Update opsworkscm client to latest version +* feature:``lambda``: Update lambda client to latest version +* feature:``codebuild``: Update codebuild client to latest version +* feature:``xray``: Update xray client to latest version +* feature:``stepfunctions``: Update stepfunctions client to latest version +* feature:``ssm``: Update ssm client to latest version +* feature:``health``: Update health client to latest version +* feature:``ec2``: Update ec2 client to latest version +* feature:``apigateway``: Update apigateway client to latest version +* feature:``pinpoint``: Update pinpoint client to latest version + + +1.4.80 +====== + +* feature:``lightsail``: Update lightsail client to latest version +* feature:``polly``: Update polly client to latest version +* feature:``snowball``: Update snowball client to latest version +* feature:``rekognition``: Update rekognition client to latest version + + +1.4.79 +====== + +* bugfix:s3: fixes `#1059 `__ (presigned s3v4 URL bug related to blank query parameters being filtered incorrectly) +* feature:``s3``: Update s3 client to latest version +* bugfix:Presigner: Support presigning rest-json services. + + +1.4.78 +====== + +* feature:``s3``: Update s3 client to latest version +* feature:``glacier``: Update glacier client to latest version +* feature:``cloudformation``: Update cloudformation client to latest version +* feature:``route53``: Update route53 client to latest version + + +1.4.77 +====== + +* feature:``cloudtrail``: Update cloudtrail client to latest version +* feature:``ecs``: Update ecs client to latest version + + +1.4.76 +====== + +* feature:``application-autoscaling``: Update application-autoscaling client to latest version +* feature:``elastictranscoder``: Update elastictranscoder client to latest version +* feature:``lambda``: Update lambda client to latest version +* feature:``emr``: Update emr client to latest version +* feature:``gamelift``: Update gamelift client to latest version + + +1.4.75 +====== + +* feature:Loader: Support loading json extra files. +* feature:``meteringmarketplace``: Update meteringmarketplace client to latest version +* feature:``cloudwatch``: Update cloudwatch client to latest version +* feature:``apigateway``: Update apigateway client to latest version +* feature:``sqs``: Update sqs client to latest version + + +1.4.74 +====== + +* feature:``route53``: Update route53 client to latest version +* feature:``servicecatalog``: Update servicecatalog client to latest version + + +1.4.73 +====== + +* feature:``kinesis``: Update kinesis client to latest version +* feature:``ds``: Update ds client to latest version +* feature:``elasticache``: Update elasticache client to latest version + + +1.4.72 +====== + +* feature:``cognito-idp``: Update cognito-idp client to latest version +* feature:Paginator: Add paginators for AWS WAF + + +1.4.71 +====== + +* bugfix:Parsers: ResponseMetadata will now always be populated, provided the response was able to be parsed into a dict. +* feature:``cloudformation``: Update cloudformation client to latest version +* feature:``logs``: Update logs client to latest version + + +1.4.70 +====== + +* feature:``directconnect``: Update directconnect client to latest version + + +1.4.69 +====== + +* feature:``ses``: Update ses client to latest version + + +1.4.68 +====== + +* feature:``cloudformation``: Update cloudformation client to latest version +* feature:Stub: Made ANY usable for nested parameters + + +1.4.67 +====== + +* feature:``elbv2``: Update elbv2 client to latest version +* feature:``autoscaling``: Update autoscaling client to latest version + + +1.4.66 +====== + +* feature:``sms``: Update sms client to latest version +* feature:``ecs``: Update ecs client to latest version + + +1.4.65 +====== + +* bugfix:Waiters: Add back missing fail fail states to cloudformation waiters (`#1056 `__) +* feature:``waf``: Update waf client to latest version +* feature:``budgets``: Update budgets client to latest version + + +1.4.64 +====== + +* feature:``cloudfront``: Update cloudfront client to latest version +* feature:``iot``: Update iot client to latest version +* feature:``config``: Update config client to latest version +* feature:``rds``: Update rds client to latest version +* feature:``kinesisanalytics``: Update kinesisanalytics client to latest version + + +1.4.63 +====== + +* feature:``route53``: Update route53 client to latest version +* feature:regions: Add support us-east-2 + + +1.4.62 +====== + +* feature:``elasticbeanstalk``: Update elasticbeanstalk client to latest version +* feature:``acm``: Update acm client to latest version +* feature:``gamelift``: Update gamelift client to latest version + + +1.4.61 +====== + +* feature:``ecr``: Update ecr client to latest version +* feature:``cloudfront``: Update cloudfront client to latest version +* feature:``codedeploy``: Update codedeploy client to latest version +* feature:``sns``: Update sns client to latest version +* feature:``apigateway``: Update apigateway client to latest version +* feature:Client Meta: Add partition to client meta object (`#1027 `__) +* feature:``elasticache``: Update elasticache client to latest version +* feature:``kms``: Update kms client to latest version +* feature:``rds``: Update rds client to latest version +* feature:``gamelift``: Update gamelift client to latest version + + +1.4.60 +====== + +* feature:``opsworks``: Update opsworks client to latest version +* feature:``devicefarm``: Update devicefarm client to latest version +* feature:``kms``: Update kms client to latest version +* feature:``s3``: Update s3 client to latest version +* feature:``waf``: Update waf client to latest version +* feature:``cognito-idp``: Update cognito-idp client to latest version + + +1.4.58 +====== + +* feature:``snowball``: Update snowball client to latest version +* feature:``s3``: Update s3 client to latest version +* feature:``ec2``: Update ec2 client to latest version + + +1.4.57 +====== + +* feature:``cloudformation``: Update cloudformation client to latest version +* feature:``codepipeline``: Update codepipeline client to latest version +* feature:``kms``: Update kms client to latest version +* feature:``efs``: Update efs client to latest version + + +1.4.56 +====== + +* feature:``redshift``: Update redshift client to latest version +* feature:Stubber: Add ability to specify expected params when using `add_client_error` (`#1025 `__) +* feature:``emr``: Update emr client to latest version +* feature:``codedeploy``: Update codedeploy client to latest version +* feature:``rds``: Update rds client to latest version + + +1.4.55 +====== + +* feature:``iot``: Update iot client to latest version +* feature:``rds``: Update rds client to latest version + + +1.4.54 +====== + +* feature:EC2: Add `NetworkAclExists` waiter (`#1019 `__) +* feature:Paginator: Add paginators for Application Auto Scaling service (`#1029 `__) +* feature:Config: Add `max_pool_connections` to client config (`#773 `__, `#766 `__, `#1026 `__) +* feature:``ec2``: Update ec2 client to latest version +* feature:``servicecatalog``: Update servicecatalog client to latest version + + +1.4.53 +====== + +* feature:``support``: Update support client to latest version +* feature:``cloudfront``: Update cloudfront client to latest version +* feature:``sns``: Update sns client to latest version + + +1.4.52 +====== + +* feature:``codepipeline``: Update codepipeline client to latest version +* feature:``ec2``: Update ec2 client to latest version +* feature:``rds``: Update rds client to latest version +* feature:``sns``: Update sns client to latest version +* feature:``ecr``: Update ecr client to latest version + + +1.4.51 +====== + +* feature:``rds``: Update rds client to latest version +* feature:ResponseMetadata: Add MaxAttemptsReached and RetryAttempts keys to the returned ResonseMetadata dictionary (`#1024 `__, `#965 `__, `#926 `__) +* feature:``application-autoscaling``: Update application-autoscaling client to latest version +* feature:``cognito-idp``: Update cognito-idp client to latest version +* feature:Waiters: Add last_response attribute to WaiterError (`#1023 `__, `#957 `__) +* feature:``config``: Update config client to latest version +* feature:``gamelift``: Update gamelift client to latest version + + +1.4.50 +====== + +* feature:``autoscaling``: Update autoscaling client to latest version +* feature:``codepipeline``: Update codepipeline client to latest version +* feature:``ssm``: Update ssm client to latest version +* feature:``cloudfront``: Update cloudfront client to latest version +* feature:``route53``: Update route53 client to latest version + + +1.4.49 +====== + +* feature:``rds``: Update rds client to latest version +* feature:``opsworks``: Update opsworks client to latest version + + +1.4.48 +====== + +* feature:``ec2``: Update ec2 client to latest version +* feature:``iam``: Update iam client to latest version +* feature:``workspaces``: Update workspaces client to latest version + + +1.4.47 +====== + +* feature:``elbv2``: Update elbv2 client to latest version +* feature:``apigateway``: Update apigateway client to latest version +* feature:``ecs``: Update ecs client to latest version +* feature:``acm``: Update acm client to latest version +* feature:``kms``: Update kms client to latest version + + +1.4.45 +====== + +* feature:``kms``: Update kms client to latest version +* feature:``kinesisanalytics``: Update kinesisanalytics client to latest version +* feature:``autoscaling``: Update autoscaling client to latest version +* feature:``elb``: Update elb client to latest version +* feature:``ecs``: Update ecs client to latest version +* feature:s3: Add support for s3 dualstack configuration +* feature:``snowball``: Update snowball client to latest version +* feature:``elbv2``: Update elbv2 client to latest version + + +1.4.44 +====== + +* feature:``marketplacecommerceanalytics``: Update marketplacecommerceanalytics client to latest version +* feature:``ecr``: Update ecr client to latest version +* feature:``cloudfront``: Update cloudfront client to latest version + + +1.4.43 +====== + +* feature:``lambda``: Update lambda client to latest version +* feature:``gamelift``: Update gamelift client to latest version +* feature:``rds``: Update rds client to latest version + + +1.4.42 +====== + +* bugfix:Serialization: Account for boolean in query string serialization +* feature:``rds``: Update rds client to latest version +* feature:``iot``: Update iot client to latest version +* feature:``ds``: Update ds client to latest version +* feature:``meteringmarketplace``: Update meteringmarketplace client to latest version +* feature:``route53domains``: Update route53domains client to latest version +* feature:``application-autoscaling``: Update application-autoscaling client to latest version +* feature:``emr``: Update emr client to latest version +* feature:``cloudwatch``: Update cloudwatch client to latest version +* feature:``logs``: Update logs client to latest version +* feature:``machinelearning``: Update machinelearning client to latest version + + +1.4.41 +====== + +* feature:``ds``: Update ds client to latest version +* feature:``ses``: Update ses client to latest version +* bugfix:s3: S3 region redirector will now honor the orginial url scheme. +* feature:``sts``: Update sts client to latest version +* feature:``cognito-idp``: Update cognito-idp client to latest version +* feature:``ec2``: Update ec2 client to latest version +* feature:``es``: Update es client to latest version +* feature:``apigateway``: Update apigateway client to latest version +* bugfix:Credentials: Raise error when partial hard coded creds are provided when creating a client. + + +1.4.40 +====== + +* feature:``s3``: Update s3 client to latest version +* feature:codedeploy: Add a waiter to wait on successful deployments. +* feature:``iot``: Update iot client to latest version + + +1.4.39 +====== + +* feature:``acm``: Update acm client to latest version +* feature:``elastictranscoder``: Update elastictranscoder client to latest version +* feature:``cloudformation``: Update cloudformation client to latest version +* feature:``config``: Update config client to latest version +* feature:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.4.38 +====== + +* feature:``ssm``: Update ssm client to latest version +* feature:``devicefarm``: Update devicefarm client to latest version + + +1.4.37 +====== + +* feature:``dms``: Update dms client to latest version +* feature:``ecs``: Update ecs client to latest version +* Feature:Credential Provider: Add support for ECS metadata credential provider. +* feature:``rds``: Update rds client to latest version + + +1.4.36 +====== + +* feature:``servicecatalog``: Update servicecatalog client to latest version +* feature:``opsworks``: Update opsworks client to latest version +* feature:``ds``: Update ds client to latest version +* feature:``config``: Update config client to latest version + + +1.4.35 +====== + +* feature:``iam``: Update iam client to latest version +* feature:``codepipeline``: Update codepipeline client to latest version +* feature:``efs``: Update efs client to latest version + + +1.4.34 +====== + +* feature:``dms``: Update dms client to latest version +* feature:``ssm``: Update ssm client to latest version + + +1.4.33 +====== + +* feature:``sns``: Update sns client to latest version +* feature:``route53``: Update route53 client to latest version +* feature:``ec2``: Update ec2 client to latest version +* feature:``gamelift``: Update gamelift client to latest version +* feature:``efs``: Update efs client to latest version +* feature:``iot``: Update iot client to latest version + + +1.4.32 +====== + +* bugfix:S3: Fixed a bug where the S3 region redirector was potentially causing a memory leak on python 2.6. +* feature:``s3``: Update s3 client to latest version + + +1.4.31 +====== + +* bugfix:RequestSigner: `RequestSigner.generate_presigned_url` now requires the operation name to be passed in. This does not affect using `generate_presigned_url` through a client. +* feature:``rds``: Update rds client to latest version +* feature:``directconnect``: Update directconnect client to latest version +* feature:RequestSigner: Allow `botocore.UNSIGNED` to be used with `generate_presigned_url` and `generate_presigned_post`. +* feature:``ec2``: Update ec2 client to latest version +* feature:``cognito-identity``: Update cognito-identity client to latest version +* feature:``iam``: Update iam client to latest version + + +1.4.30 +====== + +* bugfix:AssumeRole: Fix regression introduced in `#920 `__ where assume role responses error out when attempting to cache a response. (`#961 `__) + + +1.4.29 +====== + +* feature:ResponseMetadata: Add http response headers to the response metadata. +* feature:``codepipeline``: Update codepipeline client to latest version +* feature:s3: Automatically redirect S3 sigv4 requests sent to the wrong region. +* feature:``opsworks``: Update opsworks client to latest version +* feature:s3: Use MD5 to sign S3 bodies by default. +* bugfix:EC2: Replace chars in the EC2 console output we can't decode with replacement chars. We were previously returning either the decoded content or the original base64 encoded content. We now will consistently return decoded output, any any chars we can't decode are substituted with a replacement char. (`#953 `__) + + +1.4.28 +====== + +* feature:``cloudtrail``: Update cloudtrail client to latest version +* feature:``acm``: Update acm client to latest version +* bugfix:Stubber: Fix regression in comparing multiple expected parameters +* feature:``rds``: Update rds client to latest version +* feature:``ses``: Update ses client to latest version + + +1.4.27 +====== + +* feature:Stubber: Allow certain paramters to be ignored by specifying stub.ANY. Resolves `#931 `__ +* feature:``s3``: Update s3 client to latest version + + +1.4.26 +====== + +* feature:Config: Add ``parameter_validation`` option in config file to disable parameter validation when making API calls (`#905 `__) +* feature:``dynamodbstreams``: Update dynamodbstreams client to latest version +* bugfix:s3: Make the stubber work with get_bucket_location +* feature:``iot``: Update iot client to latest version +* feature:``machinelearning``: Update machinelearning client to latest version + + +1.4.25 +====== + +* feature:Stubber: Allow adding additional keys to the service error response. +* feature:``ec2``: Update ec2 client to latest version +* feature:``application-autoscaling``: Update application-autoscaling client to latest version + + +1.4.24 +====== + +* feature:``elasticache``: Update elasticache client to latest version + + +1.4.23 +====== + +* feature:``rds``: Update rds client to latest version +* feature:``ec2``: Update ec2 client to latest version + + +1.4.22 +====== + +* feature:``firehose``: Update firehose client to latest version +* feature:``ec2``: Update ec2 client to latest version +* feature:``ecs``: Update ecs client to latest version + + +1.4.21 +====== + +* feature:``application-autoscaling``: Adds support for Application Auto Scaling. Application Auto Scaling is a general purpose Auto Scaling service for supported elastic AWS resources. With Application Auto Scaling, you can automatically scale your AWS resources, with an experience similar to that of Auto Scaling. +* feature:endpoints: Updated endpoints.json to latest. + + +1.4.20 +====== + +* feature:``dynamodb``: Update dynamodb client to latest version +* bugfix:Waiters: Fix ``JMESPathTypeError`` exception being raised (`#906 `__, `#907 `__) +* feature:``workspaces``: Update workspaces client to latest version +* feature:s3: Add paginator for ListObjectsV2 +* feature:``discovery``: Update discovery client to latest version +* feature:iam: Add missing paginators. Fixes `#919 `__. + + +1.4.19 +====== + +* feature:``ec2``: Update ec2 client to latest version +* feature:``ssm``: Update ssm client to latest version +* feature:``discovery``: Update discovery client to latest version +* feature:``cloudformation``: Update cloudformation client to latest version + + +1.4.18 +====== + +* feature:``storagegateway``: Update storagegateway client to latest version +* feature:``directconnect``: Update directconnect client to latest version +* feature:``emr``: Update emr client to latest version +* feature:``sqs``: Update sqs client to latest version +* feature:``iam``: Update iam client to latest version + + +1.4.17 +====== + +* feature:``kms``: Update kms client to latest version +* feature:``sts``: Update sts client to latest version +* feature:``apigateway``: Update apigateway client to latest version +* feature:``ecs``: Update ecs client to latest version +* feature:``s3``: Update s3 client to latest version +* feature:``cloudtrail``: Update cloudtrail client to latest version + + +1.4.16 +====== + +* feature:``inspector``: Update inspector client to latest version +* feature:``codepipeline``: Update codepipeline client to latest version +* feature:``opsworks``: Add InstanceRegistered waiter +* feature:``elasticbeanstalk``: Update elasticbeanstalk client to latest version + + +1.4.15 +====== + +* feature:``route53domains``: Update route53domains client to latest version +* feature:``opsworks``: Update opsworks client to latest version + + +1.4.14 +====== + +* feature:``ecr``: Update ecr client to latest version +* bugfix:``aws kinesis``: Fix issue where "EnhancedMonitoring" was not displayed when running ``aws kinesis describe-stream`` (`#1929 `__) +* feature:``acm``: Update acm client to latest version +* feature:``ec2``: Update ec2 client to latest version +* feature:``sts``: Update sts client to latest version +* bugfix:Serializer: In the rest xml parser, we were converting the input we recieve into a `str`, which was causing failures on python 2 when multibyte unicode strings were passed in. The fix is to simply use `six.text_type`, which is `unicode` on 2 and `str` on 3. The string will be encoded into the default encoding later on in the serializer. Fixes `#868 `__ +* feature:``cognito-idp``: Update cognito-idp client to latest version + + +1.4.13 +====== + +* feature:EMR: Add support for smart targeted resize feature +* feature:IOT: Add SQL RulesEngine version support +* feature:ACM: Add tagging support for ACM + + +1.4.12 +====== + +* bugfix:Credentials: Include timezone information when storing refresh time (`#869 `__) +* feature:EC2: Add support for two new EBS volume types +* feature:``S3``: Add support for s3 accelerate configuration +* feature:CognitoIdentityProvider: Add support for new service, CognitoIdedentityProvider +* feature:S3: Add support for Amazon S3 Transfer Acceleration +* feature:CodeCommit: Add paginators for CodeCommit (`#881 `__) +* feature:Kinesis: Update Kinesis client to latest version +* feature:ElasticBeanstalk: Add support for automatic platform version upgrades with managed updates +* feature:DeviceFarm: Update DeviceFarm client to latest version +* feature:FireHose: Update FireHose client to latest version + + +1.4.11 +====== + +* feature:``IoT``: Add methods for managing CA certificates. +* bugfix:``EC2``: Fix issues with checking an incorrect error code in waiters. +* bugfix:Accept Header: Fix issue in overriding Accept header for API Gateway. + + +1.4.10 +====== + +* feature:``DS``: Added support for Directory Service Conditional Forwarder APIs. +* feature:``Elasticbeanstalk``: Adds support for three additional elements in AWS Elasticbeanstalk's DescribeInstancesHealthResponse: Deployment, AvailabilityZone, and InstanceType. Additionally adds support for increased EnvironmentName length from 23 to 40. +* bugfix:Paginator: Allow non-specified input tokens in old starting token format. + + +1.4.9 +===== + +* feature:``Route53``: Added support for metric-based health checks and regional health checks. +* feature:``STS``: Added support for GetCallerIdentity, which returns details about the credentials used to make the API call. The details include name and account, as well as the type of entity making the call, such as an IAM user vs. federated user. +* feature:``S3``: Added support for VersionId in PutObjectAcl (`issue 856 `__) +* bugfix:``S3``: Add validation to enforce S3 metadata only contains ASCII. (`issue 861 `__) +* bugfix:Exceptions: Consistently parse errors with no body (`issue 859 `__) +* bugfix:Config: Handle case where S3 config key is not a dict (`issue 858 `__) +* bugfix:Examples: Account for empty input shape in examples (`issue 855 `__) + + +1.4.8 +===== + +* feature:``CloudFormation``: Update client to latest version +* feature:``CodeDeploy``: Update client to latest version +* feature:``DMS``: Update client to latest version +* feature:``ElastiCache``: Update client to latest version +* feature:``Elastic Beanstalk``: Update client to latest version +* feature:``Redshift``: Update client to latest version +* feature:``WAF``: Update client to latest version +* bugfix:Pagintor: Fix regression when providing a starting token for a paginator (`issue 849 `__) +* bugfix:Response Parsing: Handle case when generic HTML error response is received (`issue 850 `__) +* bugfix:Request serialization: Handle case when non str values are provided for header values when using signature version 4 (`issue 852 `__) +* bugfix:Retry: Retry HTTP responses with status code 502 (`issue 853 `__) + + +1.4.7 +===== + +* feature:``RDS``: Update client to latest version +* feature:``StorageGateway``: Update client to latest version +* bugfix:Proxy: Handle case where error response from proxy is received (`issue 850 `__) + + +1.4.5 +===== + +* feature:``S3``: Added support for delete marker and abort multipart upload lifecycle configuration. +* feature:``IOT``: Added support for Amazon Elasticsearch Service and Amazon Cloudwatch actions for the AWS IoT rules engine. +* feature:``CloudHSM``: Added support for tagging resources. + + +1.4.4 +===== + +* feature:``SES``: Added support for white-labeling +* feature:``CodeDeploy``: Added support for BatchGetDeploymentGroups +* feature:``endpoints``: Updated endpoints.json to latest version + + +1.4.3 +===== + +* feature:``IAM``: Update model to latest version +* feature:``Redshift``: Update model to latest version + + +1.4.2 +===== + +* feature:``CodeCommit``: Update model to latest version +* feature:``Config``: Update model to latest version +* feature:``DeviceFarm``: Update model to latest version +* feature:``DirectConnect``: Update model to latest version +* feature:``Events``: Update model to latest version +* bugfix:``DynamoDB Local``: Fix issue when using the ``local`` region with ``dynamodb`` (`issue 819 `__) +* bugfix:``CloudSearchDomain``: Fix issue when signing requests for ``cloudsearchdomain`` (`boto3 issue 538 `__) + + +1.4.1 +===== + +* feature:``EC2``: Add support for VPC peering with security groups. +* feature:``DirectoryService``: Add SNS event notification support + + +1.4.0 +===== + +* feature:``DynamoDB``: Add support for DescribeLimits. +* feature:``APIGateway``: Add support for TestInvokeAuthorizer and FlushStageAuthorizersCache operations. +* feature:``CloudSearchDomain``: Add support for stats. + + +1.3.28 +====== + +* feature:``CodeDeploy``: Added support for setting up triggers for a deployment group. +* bugfix:SSL: Fixed issue where AWS_CA_BUNDLE was not being used. + + +1.3.27 +====== + +* feature:``EMR``: Added support for adding EBS storage to EMR instances. +* bugfix:pagination: Refactored pagination to handle non-string service tokens. +* bugfix:credentials: Fix race condition in credential provider. + diff --git a/testbed/boto__botocore/CODE_OF_CONDUCT.md b/testbed/boto__botocore/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..5b627cfa60b5313da2c7df81aab2340225c2329f --- /dev/null +++ b/testbed/boto__botocore/CODE_OF_CONDUCT.md @@ -0,0 +1,4 @@ +## Code of Conduct +This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). +For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact +opensource-codeofconduct@amazon.com with any additional questions or comments. diff --git a/testbed/boto__botocore/CONTRIBUTING.rst b/testbed/boto__botocore/CONTRIBUTING.rst new file mode 100644 index 0000000000000000000000000000000000000000..718b29489a7cf074894e3039d191212378113107 --- /dev/null +++ b/testbed/boto__botocore/CONTRIBUTING.rst @@ -0,0 +1,95 @@ +Contributing +============ + +We work hard to provide a high-quality and useful SDK, and we greatly value +feedback and contributions from our community. Whether it's a new feature, +correction, or additional documentation, we welcome your pull requests. Please +submit any `issues `__ +or `pull requests `__ through GitHub. + +This document contains guidelines for contributing code and filing issues. + +Contributing Code +----------------- + +The list below are guidelines to use when submitting pull requests. +These are the same set of guidelines that the core contributors use +when submitting changes, and we ask the same of all community +contributions as well: + +* The SDK is released under the + `Apache license `__. + Any code you submit will be released under that license. +* We maintain a high percentage of code coverage in our unit tests. As + a general rule of thumb, code changes should not lower the overall + code coverage percentage for the project. To help with this, + we use `coveralls `__, which will + comment on changes in code coverage for every pull request. + In practice, this means that every bug fix and feature addition should + include unit tests. +* If you identify an issue with the JSON service descriptions, + such as ``botocore/data/aws/s3/2006-03-01/service-2.json``, please submit an + `issue `__ so we can get it + fixed upstream. +* Changes to paginators, waiters, and endpoints are also generated upstream based on our internal knowledge of the AWS services. + These include any of the following files in ``botocore/data/``: + + * ``_endpoints.json`` + * ``*.paginators-1.json`` + * ``*.waiters-2.json`` + + If you identify an issue with these files, such as a missing paginator or waiter, please submit an + `issue `__ so we can get it fixed upstream. +* We do accept, and encourage, changes to the ``botocore/data/_retry.json`` file. +* Code should follow the guidelines listed in the Codestyle section below. +* Code must work on all versions of Python supported by Botocore. +* Botocore is cross platform and code must work on at least linux, Windows, + and Mac OS X. +* If you would like to implement support for a significant feature that is not + yet available in botocore, please talk to us beforehand to avoid any duplication + of effort. You can file an + `issue `__ + to discuss the feature request further. + +Reporting An Issue/Feature +-------------------------- + +* Check to see if there's an existing issue/pull request for the + bug/feature. All issues are at + https://github.com/boto/botocore/issues and pull reqs are at + https://github.com/boto/botocore/pulls. +* If there isn't an existing issue there, please file an issue. The + ideal report includes: + + * A description of the problem/suggestion. + * A code sample that demonstrates the issue. + * Including the versions of your: + + * python interpreter + * OS + * botocore (accessible via ``botocore.__version__``) + * optionally any other python dependencies involved + +Codestyle +--------- +This project uses `ruff `__ to enforce +codstyle requirements. We've codified this process using a tool called +`pre-commit `__. pre-commit allows us to specify a +config file with all tools required for code linting, and surfaces either a +git commit hook, or single command, for enforcing these. + +To validate your PR prior to publishing, you can use the following +`installation guide `__ to setup pre-commit. + +If you don't want to use the git commit hook, you can run the below command +to automatically perform the codestyle validation: + +.. code-block:: bash + + $ pre-commit run + +This will automatically perform simple updates (such as white space clean up) +and provide a list of any failing checks. After these are addressed, +you can commit the changes prior to publishing the PR. +These checks are also included in our CI setup under the "Lint" workflow which +will provide output on Github for anything missed locally. diff --git a/testbed/boto__botocore/LICENSE.txt b/testbed/boto__botocore/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..f433b1a53f5b830a205fd2df78e2b34974656c7b --- /dev/null +++ b/testbed/boto__botocore/LICENSE.txt @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/testbed/boto__botocore/MANIFEST.in b/testbed/boto__botocore/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..c5d2e1eadad0addec69dcbd1b217584c09d88659 --- /dev/null +++ b/testbed/boto__botocore/MANIFEST.in @@ -0,0 +1,11 @@ +include README.rst +include LICENSE.txt +include requirements.txt +include requirements-dev.txt +include botocore/cacert.pem +include botocore/vendored/requests/cacert.pem +recursive-include botocore/data *.json +recursive-include botocore/data *.json.gz +graft docs +prune docs/build +graft tests diff --git a/testbed/boto__botocore/NOTICE b/testbed/boto__botocore/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..edcc3cd78ef78effb3203d4e21f572a92e31f8eb --- /dev/null +++ b/testbed/boto__botocore/NOTICE @@ -0,0 +1,60 @@ +Botocore +Copyright 2012-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +---- + +Botocore includes vendorized parts of the requests python library for backwards compatibility. + +Requests License +================ + +Copyright 2013 Kenneth Reitz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Botocore includes vendorized parts of the urllib3 library for backwards compatibility. + +Urllib3 License +=============== + +This is the MIT license: http://www.opensource.org/licenses/mit-license.php + +Copyright 2008-2011 Andrey Petrov and contributors (see CONTRIBUTORS.txt), +Modifications copyright 2012 Kenneth Reitz. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +Bundle of CA Root Certificates +============================== + +***** BEGIN LICENSE BLOCK ***** +This Source Code Form is subject to the terms of the +Mozilla Public License, v. 2.0. If a copy of the MPL +was not distributed with this file, You can obtain +one at http://mozilla.org/MPL/2.0/. + +***** END LICENSE BLOCK ***** diff --git a/testbed/boto__botocore/README.rst b/testbed/boto__botocore/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..29649333219489580dd03534f0861f229a640479 --- /dev/null +++ b/testbed/boto__botocore/README.rst @@ -0,0 +1,116 @@ +botocore +======== + +|Version| |Python| |License| + +A low-level interface to a growing number of Amazon Web Services. The +botocore package is the foundation for the +`AWS CLI `__ as well as +`boto3 `__. + +Botocore is maintained and published by `Amazon Web Services`_. + +Notices +------- + +On 2023-12-13, support was dropped for Python 3.7. This follows the +Python Software Foundation `end of support `__ +for the runtime which occurred on 2023-06-27. +For more information, see this `blog post `__. + +.. _`Amazon Web Services`: https://aws.amazon.com/what-is-aws/ +.. |Python| image:: https://img.shields.io/pypi/pyversions/botocore.svg?style=flat + :target: https://pypi.python.org/pypi/botocore/ + :alt: Python Versions +.. |Version| image:: http://img.shields.io/pypi/v/botocore.svg?style=flat + :target: https://pypi.python.org/pypi/botocore/ + :alt: Package Version +.. |License| image:: http://img.shields.io/pypi/l/botocore.svg?style=flat + :target: https://github.com/boto/botocore/blob/develop/LICENSE.txt + :alt: License + +Getting Started +--------------- +Assuming that you have Python and ``virtualenv`` installed, set up your environment and install the required dependencies like this or you can install the library using ``pip``: + +.. code-block:: sh + + $ git clone https://github.com/boto/botocore.git + $ cd botocore + $ virtualenv venv + ... + $ . venv/bin/activate + $ pip install -r requirements.txt + $ pip install -e . + +.. code-block:: sh + + $ pip install botocore + +Using Botocore +~~~~~~~~~~~~~~ +After installing botocore + +Next, set up credentials (in e.g. ``~/.aws/credentials``): + +.. code-block:: ini + + [default] + aws_access_key_id = YOUR_KEY + aws_secret_access_key = YOUR_SECRET + +Then, set up a default region (in e.g. ``~/.aws/config``): + +.. code-block:: ini + + [default] + region=us-east-1 + +Other credentials configuration method can be found `here `__ + +Then, from a Python interpreter: + +.. code-block:: python + + >>> import botocore.session + >>> session = botocore.session.get_session() + >>> client = session.create_client('ec2') + >>> print(client.describe_instances()) + + +Getting Help +------------ + +We use GitHub issues for tracking bugs and feature requests and have limited +bandwidth to address them. Please use these community resources for getting +help. Please note many of the same resources available for ``boto3`` are +applicable for ``botocore``: + +* Ask a question on `Stack Overflow `__ and tag it with `boto3 `__ +* Open a support ticket with `AWS Support `__ +* If it turns out that you may have found a bug, please `open an issue `__ + + +Contributing +------------ + +We value feedback and contributions from our community. Whether it's a bug report, new feature, correction, or additional documentation, we welcome your issues and pull requests. Please read through this `CONTRIBUTING `__ document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your contribution. + + +Maintenance and Support for SDK Major Versions +---------------------------------------------- + +Botocore was made generally available on 06/22/2015 and is currently in the full support phase of the availability life cycle. + +For information about maintenance and support for SDK major versions and their underlying dependencies, see the following in the AWS SDKs and Tools Reference Guide: + +* `AWS SDKs and Tools Maintenance Policy `__ +* `AWS SDKs and Tools Version Support Matrix `__ + + +More Resources +-------------- + +* `NOTICE `__ +* `Changelog `__ +* `License `__ diff --git a/testbed/boto__botocore/pyproject.toml b/testbed/boto__botocore/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..456a8489679578b6b7169f1ba2e405e0168c0344 --- /dev/null +++ b/testbed/boto__botocore/pyproject.toml @@ -0,0 +1,72 @@ +[tool.pytest.ini_options] +markers = [ + "slow: marks tests as slow", + "validates_models: marks tests as one which validates service models", +] + +[tool.isort] +profile = "black" +line_length = 79 +honor_noqa = true +src_paths = ["botocore", "tests"] + +[tool.ruff] +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Format same as Black. +line-length = 79 +indent-width = 4 + +target-version = "py38" + +[tool.ruff.lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F", "UP"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings, spaces for indents +# and trailing commas. +quote-style = "preserve" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" + +docstring-code-format = false +docstring-code-line-length = "dynamic" diff --git a/testbed/boto__botocore/requirements-dev-lock.txt b/testbed/boto__botocore/requirements-dev-lock.txt new file mode 100644 index 0000000000000000000000000000000000000000..1f69686a458606d7e1ff2bed133328c252d6d934 --- /dev/null +++ b/testbed/boto__botocore/requirements-dev-lock.txt @@ -0,0 +1,285 @@ +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# pip-compile --allow-unsafe --generate-hashes --output-file=requirements-dev-lock.txt requirements-dev.txt +# +atomicwrites==1.4.1 \ + --hash=sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11 + # via -r requirements-dev.txt +attrs==23.2.0 \ + --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ + --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 + # via + # jsonschema + # referencing +behave==1.2.5 \ + --hash=sha256:07c741f30497b6f9361a9bc74c68418507cd17e70d6f586faa3bff57684a2ec8 \ + --hash=sha256:81b731ac5187e31e4aad2594944fa914943683a9818320846d037c5ebd6d5d0b \ + --hash=sha256:89238a5e4b11ff607e8ebc6b4b1fb1a0b1f3d794fba80e1fb4b6b3652979c927 \ + --hash=sha256:8c182feece4a519c5ffc11e1ab3682d25d5a390dd5f4573bb1296443beb9d7c7 + # via -r requirements-dev.txt +colorama==0.4.6 \ + --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ + --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 + # via -r requirements-dev.txt +coverage[toml]==7.2.7 \ + --hash=sha256:06a9a2be0b5b576c3f18f1a241f0473575c4a26021b52b2a85263a00f034d51f \ + --hash=sha256:06fb182e69f33f6cd1d39a6c597294cff3143554b64b9825d1dc69d18cc2fff2 \ + --hash=sha256:0a5f9e1dbd7fbe30196578ca36f3fba75376fb99888c395c5880b355e2875f8a \ + --hash=sha256:0e1f928eaf5469c11e886fe0885ad2bf1ec606434e79842a879277895a50942a \ + --hash=sha256:171717c7cb6b453aebac9a2ef603699da237f341b38eebfee9be75d27dc38e01 \ + --hash=sha256:1e9d683426464e4a252bf70c3498756055016f99ddaec3774bf368e76bbe02b6 \ + --hash=sha256:201e7389591af40950a6480bd9edfa8ed04346ff80002cec1a66cac4549c1ad7 \ + --hash=sha256:245167dd26180ab4c91d5e1496a30be4cd721a5cf2abf52974f965f10f11419f \ + --hash=sha256:2aee274c46590717f38ae5e4650988d1af340fe06167546cc32fe2f58ed05b02 \ + --hash=sha256:2e07b54284e381531c87f785f613b833569c14ecacdcb85d56b25c4622c16c3c \ + --hash=sha256:31563e97dae5598556600466ad9beea39fb04e0229e61c12eaa206e0aa202063 \ + --hash=sha256:33d6d3ea29d5b3a1a632b3c4e4f4ecae24ef170b0b9ee493883f2df10039959a \ + --hash=sha256:3d376df58cc111dc8e21e3b6e24606b5bb5dee6024f46a5abca99124b2229ef5 \ + --hash=sha256:419bfd2caae268623dd469eff96d510a920c90928b60f2073d79f8fe2bbc5959 \ + --hash=sha256:48c19d2159d433ccc99e729ceae7d5293fbffa0bdb94952d3579983d1c8c9d97 \ + --hash=sha256:49969a9f7ffa086d973d91cec8d2e31080436ef0fb4a359cae927e742abfaaa6 \ + --hash=sha256:52edc1a60c0d34afa421c9c37078817b2e67a392cab17d97283b64c5833f427f \ + --hash=sha256:537891ae8ce59ef63d0123f7ac9e2ae0fc8b72c7ccbe5296fec45fd68967b6c9 \ + --hash=sha256:54b896376ab563bd38453cecb813c295cf347cf5906e8b41d340b0321a5433e5 \ + --hash=sha256:58c2ccc2f00ecb51253cbe5d8d7122a34590fac9646a960d1430d5b15321d95f \ + --hash=sha256:5b7540161790b2f28143191f5f8ec02fb132660ff175b7747b95dcb77ac26562 \ + --hash=sha256:5baa06420f837184130752b7c5ea0808762083bf3487b5038d68b012e5937dbe \ + --hash=sha256:5e330fc79bd7207e46c7d7fd2bb4af2963f5f635703925543a70b99574b0fea9 \ + --hash=sha256:61b9a528fb348373c433e8966535074b802c7a5d7f23c4f421e6c6e2f1697a6f \ + --hash=sha256:63426706118b7f5cf6bb6c895dc215d8a418d5952544042c8a2d9fe87fcf09cb \ + --hash=sha256:6d040ef7c9859bb11dfeb056ff5b3872436e3b5e401817d87a31e1750b9ae2fb \ + --hash=sha256:6f48351d66575f535669306aa7d6d6f71bc43372473b54a832222803eb956fd1 \ + --hash=sha256:7ee7d9d4822c8acc74a5e26c50604dff824710bc8de424904c0982e25c39c6cb \ + --hash=sha256:81c13a1fc7468c40f13420732805a4c38a105d89848b7c10af65a90beff25250 \ + --hash=sha256:8d13c64ee2d33eccf7437961b6ea7ad8673e2be040b4f7fd4fd4d4d28d9ccb1e \ + --hash=sha256:8de8bb0e5ad103888d65abef8bca41ab93721647590a3f740100cd65c3b00511 \ + --hash=sha256:8fa03bce9bfbeeef9f3b160a8bed39a221d82308b4152b27d82d8daa7041fee5 \ + --hash=sha256:924d94291ca674905fe9481f12294eb11f2d3d3fd1adb20314ba89e94f44ed59 \ + --hash=sha256:975d70ab7e3c80a3fe86001d8751f6778905ec723f5b110aed1e450da9d4b7f2 \ + --hash=sha256:976b9c42fb2a43ebf304fa7d4a310e5f16cc99992f33eced91ef6f908bd8f33d \ + --hash=sha256:9e31cb64d7de6b6f09702bb27c02d1904b3aebfca610c12772452c4e6c21a0d3 \ + --hash=sha256:a342242fe22407f3c17f4b499276a02b01e80f861f1682ad1d95b04018e0c0d4 \ + --hash=sha256:a3d33a6b3eae87ceaefa91ffdc130b5e8536182cd6dfdbfc1aa56b46ff8c86de \ + --hash=sha256:a895fcc7b15c3fc72beb43cdcbdf0ddb7d2ebc959edac9cef390b0d14f39f8a9 \ + --hash=sha256:afb17f84d56068a7c29f5fa37bfd38d5aba69e3304af08ee94da8ed5b0865833 \ + --hash=sha256:b1c546aca0ca4d028901d825015dc8e4d56aac4b541877690eb76490f1dc8ed0 \ + --hash=sha256:b29019c76039dc3c0fd815c41392a044ce555d9bcdd38b0fb60fb4cd8e475ba9 \ + --hash=sha256:b46517c02ccd08092f4fa99f24c3b83d8f92f739b4657b0f146246a0ca6a831d \ + --hash=sha256:b7aa5f8a41217360e600da646004f878250a0d6738bcdc11a0a39928d7dc2050 \ + --hash=sha256:b7b4c971f05e6ae490fef852c218b0e79d4e52f79ef0c8475566584a8fb3e01d \ + --hash=sha256:ba90a9563ba44a72fda2e85302c3abc71c5589cea608ca16c22b9804262aaeb6 \ + --hash=sha256:cb017fd1b2603ef59e374ba2063f593abe0fc45f2ad9abdde5b4d83bd922a353 \ + --hash=sha256:d22656368f0e6189e24722214ed8d66b8022db19d182927b9a248a2a8a2f67eb \ + --hash=sha256:d2c2db7fd82e9b72937969bceac4d6ca89660db0a0967614ce2481e81a0b771e \ + --hash=sha256:d39b5b4f2a66ccae8b7263ac3c8170994b65266797fb96cbbfd3fb5b23921db8 \ + --hash=sha256:d62a5c7dad11015c66fbb9d881bc4caa5b12f16292f857842d9d1871595f4495 \ + --hash=sha256:e7d9405291c6928619403db1d10bd07888888ec1abcbd9748fdaa971d7d661b2 \ + --hash=sha256:e84606b74eb7de6ff581a7915e2dab7a28a0517fbe1c9239eb227e1354064dcd \ + --hash=sha256:eb393e5ebc85245347950143969b241d08b52b88a3dc39479822e073a1a8eb27 \ + --hash=sha256:ebba1cd308ef115925421d3e6a586e655ca5a77b5bf41e02eb0e4562a111f2d1 \ + --hash=sha256:ee57190f24fba796e36bb6d3aa8a8783c643d8fa9760c89f7a98ab5455fbf818 \ + --hash=sha256:f2f67fe12b22cd130d34d0ef79206061bfb5eda52feb6ce0dba0644e20a03cf4 \ + --hash=sha256:f6951407391b639504e3b3be51b7ba5f3528adbf1a8ac3302b687ecababf929e \ + --hash=sha256:f75f7168ab25dd93110c8a8117a22450c19976afbc44234cbf71481094c1b850 \ + --hash=sha256:fdec9e8cbf13a5bf63290fc6013d216a4c7232efb51548594ca3631a7f13c3a3 + # via + # -r requirements-dev.txt + # pytest-cov +exceptiongroup==1.2.2 \ + --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b \ + --hash=sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc + # via pytest +execnet==2.1.1 \ + --hash=sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc \ + --hash=sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3 + # via pytest-xdist +importlib-resources==6.4.0 \ + --hash=sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c \ + --hash=sha256:cdb2b453b8046ca4e3798eb1d84f3cce1446a0e8e7b5ef4efb600f19fc398145 + # via + # jsonschema + # jsonschema-specifications +iniconfig==2.0.0 \ + --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ + --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 + # via pytest +jsonschema==4.21.1 \ + --hash=sha256:7996507afae316306f9e2290407761157c6f78002dcf7419acb99822143d1c6f \ + --hash=sha256:85727c00279f5fa6bedbe6238d2aa6403bedd8b4864ab11207d07df3cc1b2ee5 + # via -r requirements-dev.txt +jsonschema-specifications==2023.12.1 \ + --hash=sha256:48a76787b3e70f5ed53f1160d2b81f586e4ca6d1548c5de7085d1682674764cc \ + --hash=sha256:87e4fdf3a94858b8a2ba2778d9ba57d8a9cafca7c7489c46ba0d30a8bc6a9c3c + # via jsonschema +packaging==24.1 \ + --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ + --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 + # via pytest +parse==1.20.2 \ + --hash=sha256:967095588cb802add9177d0c0b6133b5ba33b1ea9007ca800e526f42a85af558 \ + --hash=sha256:b41d604d16503c79d81af5165155c0b20f6c8d6c559efa66b4b695c3e5a0a0ce + # via + # behave + # parse-type +parse-type==0.6.2 \ + --hash=sha256:06d39a8b70fde873eb2a131141a0e79bb34a432941fb3d66fad247abafc9766c \ + --hash=sha256:79b1f2497060d0928bc46016793f1fca1057c4aacdf15ef876aa48d75a73a355 + # via behave +pkgutil-resolve-name==1.3.10 \ + --hash=sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174 \ + --hash=sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e + # via jsonschema +pluggy==1.5.0 \ + --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ + --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 + # via pytest +pytest==8.1.1 \ + --hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \ + --hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044 + # via + # -r requirements-dev.txt + # pytest-cov + # pytest-xdist +pytest-cov==5.0.0 \ + --hash=sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652 \ + --hash=sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857 + # via -r requirements-dev.txt +pytest-xdist==3.5.0 \ + --hash=sha256:cbb36f3d67e0c478baa57fa4edc8843887e0f6cfc42d677530a36d7472b32d8a \ + --hash=sha256:d075629c7e00b611df89f490a5063944bee7a4362a5ff11c7cc7824a03dfce24 + # via -r requirements-dev.txt +referencing==0.35.1 \ + --hash=sha256:25b42124a6c8b632a425174f24087783efb348a6f1e0008e63cd4466fedf703c \ + --hash=sha256:eda6d3234d62814d1c64e305c1331c9a3a6132da475ab6382eaa997b21ee75de + # via + # jsonschema + # jsonschema-specifications +rpds-py==0.19.1 \ + --hash=sha256:01227f8b3e6c8961490d869aa65c99653df80d2f0a7fde8c64ebddab2b9b02fd \ + --hash=sha256:08ce9c95a0b093b7aec75676b356a27879901488abc27e9d029273d280438505 \ + --hash=sha256:0b02dd77a2de6e49078c8937aadabe933ceac04b41c5dde5eca13a69f3cf144e \ + --hash=sha256:0d4b52811dcbc1aba08fd88d475f75b4f6db0984ba12275d9bed1a04b2cae9b5 \ + --hash=sha256:13e6d4840897d4e4e6b2aa1443e3a8eca92b0402182aafc5f4ca1f5e24f9270a \ + --hash=sha256:1a129c02b42d46758c87faeea21a9f574e1c858b9f358b6dd0bbd71d17713175 \ + --hash=sha256:1a8dfa125b60ec00c7c9baef945bb04abf8ac772d8ebefd79dae2a5f316d7850 \ + --hash=sha256:1c32e41de995f39b6b315d66c27dea3ef7f7c937c06caab4c6a79a5e09e2c415 \ + --hash=sha256:1d494887d40dc4dd0d5a71e9d07324e5c09c4383d93942d391727e7a40ff810b \ + --hash=sha256:1d4af2eb520d759f48f1073ad3caef997d1bfd910dc34e41261a595d3f038a94 \ + --hash=sha256:1fb93d3486f793d54a094e2bfd9cd97031f63fcb5bc18faeb3dd4b49a1c06523 \ + --hash=sha256:24f8ae92c7fae7c28d0fae9b52829235df83f34847aa8160a47eb229d9666c7b \ + --hash=sha256:24fc5a84777cb61692d17988989690d6f34f7f95968ac81398d67c0d0994a897 \ + --hash=sha256:26ab43b6d65d25b1a333c8d1b1c2f8399385ff683a35ab5e274ba7b8bb7dc61c \ + --hash=sha256:271accf41b02687cef26367c775ab220372ee0f4925591c6796e7c148c50cab5 \ + --hash=sha256:2ddd50f18ebc05ec29a0d9271e9dbe93997536da3546677f8ca00b76d477680c \ + --hash=sha256:31dd5794837f00b46f4096aa8ccaa5972f73a938982e32ed817bb520c465e520 \ + --hash=sha256:31e450840f2f27699d014cfc8865cc747184286b26d945bcea6042bb6aa4d26e \ + --hash=sha256:32e0db3d6e4f45601b58e4ac75c6f24afbf99818c647cc2066f3e4b192dabb1f \ + --hash=sha256:346557f5b1d8fd9966059b7a748fd79ac59f5752cd0e9498d6a40e3ac1c1875f \ + --hash=sha256:34bca66e2e3eabc8a19e9afe0d3e77789733c702c7c43cd008e953d5d1463fde \ + --hash=sha256:3511f6baf8438326e351097cecd137eb45c5f019944fe0fd0ae2fea2fd26be39 \ + --hash=sha256:35af5e4d5448fa179fd7fff0bba0fba51f876cd55212f96c8bbcecc5c684ae5c \ + --hash=sha256:3837c63dd6918a24de6c526277910e3766d8c2b1627c500b155f3eecad8fad65 \ + --hash=sha256:39d67896f7235b2c886fb1ee77b1491b77049dcef6fbf0f401e7b4cbed86bbd4 \ + --hash=sha256:3b823be829407393d84ee56dc849dbe3b31b6a326f388e171555b262e8456cc1 \ + --hash=sha256:3c73254c256081704dba0a333457e2fb815364018788f9b501efe7c5e0ada401 \ + --hash=sha256:3ddab996807c6b4227967fe1587febade4e48ac47bb0e2d3e7858bc621b1cace \ + --hash=sha256:3e1dc59a5e7bc7f44bd0c048681f5e05356e479c50be4f2c1a7089103f1621d5 \ + --hash=sha256:4383beb4a29935b8fa28aca8fa84c956bf545cb0c46307b091b8d312a9150e6a \ + --hash=sha256:4cc4bc73e53af8e7a42c8fd7923bbe35babacfa7394ae9240b3430b5dcf16b2a \ + --hash=sha256:4dd02e29c8cbed21a1875330b07246b71121a1c08e29f0ee3db5b4cfe16980c4 \ + --hash=sha256:4f580ae79d0b861dfd912494ab9d477bea535bfb4756a2269130b6607a21802e \ + --hash=sha256:53dbc35808c6faa2ce3e48571f8f74ef70802218554884787b86a30947842a14 \ + --hash=sha256:56313be667a837ff1ea3508cebb1ef6681d418fa2913a0635386cf29cff35165 \ + --hash=sha256:57863d16187995c10fe9cf911b897ed443ac68189179541734502353af33e693 \ + --hash=sha256:5953391af1405f968eb5701ebbb577ebc5ced8d0041406f9052638bafe52209d \ + --hash=sha256:5beffdbe766cfe4fb04f30644d822a1080b5359df7db3a63d30fa928375b2720 \ + --hash=sha256:5e360188b72f8080fefa3adfdcf3618604cc8173651c9754f189fece068d2a45 \ + --hash=sha256:5e58b61dcbb483a442c6239c3836696b79f2cd8e7eec11e12155d3f6f2d886d1 \ + --hash=sha256:69084fd29bfeff14816666c93a466e85414fe6b7d236cfc108a9c11afa6f7301 \ + --hash=sha256:6d1d7539043b2b31307f2c6c72957a97c839a88b2629a348ebabe5aa8b626d6b \ + --hash=sha256:6d8b735c4d162dc7d86a9cf3d717f14b6c73637a1f9cd57fe7e61002d9cb1972 \ + --hash=sha256:6ea961a674172ed2235d990d7edf85d15d8dfa23ab8575e48306371c070cda67 \ + --hash=sha256:71157f9db7f6bc6599a852852f3389343bea34315b4e6f109e5cbc97c1fb2963 \ + --hash=sha256:720f3108fb1bfa32e51db58b832898372eb5891e8472a8093008010911e324c5 \ + --hash=sha256:74129d5ffc4cde992d89d345f7f7d6758320e5d44a369d74d83493429dad2de5 \ + --hash=sha256:747251e428406b05fc86fee3904ee19550c4d2d19258cef274e2151f31ae9d38 \ + --hash=sha256:75130df05aae7a7ac171b3b5b24714cffeabd054ad2ebc18870b3aa4526eba23 \ + --hash=sha256:7b3661e6d4ba63a094138032c1356d557de5b3ea6fd3cca62a195f623e381c76 \ + --hash=sha256:7d5c7e32f3ee42f77d8ff1a10384b5cdcc2d37035e2e3320ded909aa192d32c3 \ + --hash=sha256:8124101e92c56827bebef084ff106e8ea11c743256149a95b9fd860d3a4f331f \ + --hash=sha256:81db2e7282cc0487f500d4db203edc57da81acde9e35f061d69ed983228ffe3b \ + --hash=sha256:840e18c38098221ea6201f091fc5d4de6128961d2930fbbc96806fb43f69aec1 \ + --hash=sha256:89cc8921a4a5028d6dd388c399fcd2eef232e7040345af3d5b16c04b91cf3c7e \ + --hash=sha256:8b32cd4ab6db50c875001ba4f5a6b30c0f42151aa1fbf9c2e7e3674893fb1dc4 \ + --hash=sha256:8df1c283e57c9cb4d271fdc1875f4a58a143a2d1698eb0d6b7c0d7d5f49c53a1 \ + --hash=sha256:902cf4739458852fe917104365ec0efbea7d29a15e4276c96a8d33e6ed8ec137 \ + --hash=sha256:97fbb77eaeb97591efdc654b8b5f3ccc066406ccfb3175b41382f221ecc216e8 \ + --hash=sha256:9c7042488165f7251dc7894cd533a875d2875af6d3b0e09eda9c4b334627ad1c \ + --hash=sha256:9e318e6786b1e750a62f90c6f7fa8b542102bdcf97c7c4de2a48b50b61bd36ec \ + --hash=sha256:a9421b23c85f361a133aa7c5e8ec757668f70343f4ed8fdb5a4a14abd5437244 \ + --hash=sha256:aaf71f95b21f9dc708123335df22e5a2fef6307e3e6f9ed773b2e0938cc4d491 \ + --hash=sha256:afedc35fe4b9e30ab240b208bb9dc8938cb4afe9187589e8d8d085e1aacb8309 \ + --hash=sha256:b5e28e56143750808c1c79c70a16519e9bc0a68b623197b96292b21b62d6055c \ + --hash=sha256:b82c9514c6d74b89a370c4060bdb80d2299bc6857e462e4a215b4ef7aa7b090e \ + --hash=sha256:b8f78398e67a7227aefa95f876481485403eb974b29e9dc38b307bb6eb2315ea \ + --hash=sha256:bbda75f245caecff8faa7e32ee94dfaa8312a3367397975527f29654cd17a6ed \ + --hash=sha256:bca34e913d27401bda2a6f390d0614049f5a95b3b11cd8eff80fe4ec340a1208 \ + --hash=sha256:bd04d8cab16cab5b0a9ffc7d10f0779cf1120ab16c3925404428f74a0a43205a \ + --hash=sha256:c149a652aeac4902ecff2dd93c3b2681c608bd5208c793c4a99404b3e1afc87c \ + --hash=sha256:c2087dbb76a87ec2c619253e021e4fb20d1a72580feeaa6892b0b3d955175a71 \ + --hash=sha256:c34f751bf67cab69638564eee34023909380ba3e0d8ee7f6fe473079bf93f09b \ + --hash=sha256:c6d20c8896c00775e6f62d8373aba32956aa0b850d02b5ec493f486c88e12859 \ + --hash=sha256:c7af6f7b80f687b33a4cdb0a785a5d4de1fb027a44c9a049d8eb67d5bfe8a687 \ + --hash=sha256:c7b07959866a6afb019abb9564d8a55046feb7a84506c74a6f197cbcdf8a208e \ + --hash=sha256:ca0dda0c5715efe2ab35bb83f813f681ebcd2840d8b1b92bfc6fe3ab382fae4a \ + --hash=sha256:cdb7eb3cf3deb3dd9e7b8749323b5d970052711f9e1e9f36364163627f96da58 \ + --hash=sha256:ce757c7c90d35719b38fa3d4ca55654a76a40716ee299b0865f2de21c146801c \ + --hash=sha256:d1fa67ef839bad3815124f5f57e48cd50ff392f4911a9f3cf449d66fa3df62a5 \ + --hash=sha256:d2dbd8f4990d4788cb122f63bf000357533f34860d269c1a8e90ae362090ff3a \ + --hash=sha256:d4ec0046facab83012d821b33cead742a35b54575c4edfb7ed7445f63441835f \ + --hash=sha256:dbceedcf4a9329cc665452db1aaf0845b85c666e4885b92ee0cddb1dbf7e052a \ + --hash=sha256:dc733d35f861f8d78abfaf54035461e10423422999b360966bf1c443cbc42705 \ + --hash=sha256:dd635c2c4043222d80d80ca1ac4530a633102a9f2ad12252183bcf338c1b9474 \ + --hash=sha256:de1f7cd5b6b351e1afd7568bdab94934d656abe273d66cda0ceea43bbc02a0c2 \ + --hash=sha256:df7c841813f6265e636fe548a49664c77af31ddfa0085515326342a751a6ba51 \ + --hash=sha256:e0f9d268b19e8f61bf42a1da48276bcd05f7ab5560311f541d22557f8227b866 \ + --hash=sha256:e2d66eb41ffca6cc3c91d8387509d27ba73ad28371ef90255c50cb51f8953301 \ + --hash=sha256:e429fc517a1c5e2a70d576077231538a98d59a45dfc552d1ac45a132844e6dfb \ + --hash=sha256:e4d2b88efe65544a7d5121b0c3b003ebba92bfede2ea3577ce548b69c5235185 \ + --hash=sha256:e76c902d229a3aa9d5ceb813e1cbcc69bf5bda44c80d574ff1ac1fa3136dea71 \ + --hash=sha256:ef07a0a1d254eeb16455d839cef6e8c2ed127f47f014bbda64a58b5482b6c836 \ + --hash=sha256:f09529d2332264a902688031a83c19de8fda5eb5881e44233286b9c9ec91856d \ + --hash=sha256:f0a6d4a93d2a05daec7cb885157c97bbb0be4da739d6f9dfb02e101eb40921cd \ + --hash=sha256:f0cf2a0dbb5987da4bd92a7ca727eadb225581dd9681365beba9accbe5308f7d \ + --hash=sha256:f2671cb47e50a97f419a02cd1e0c339b31de017b033186358db92f4d8e2e17d8 \ + --hash=sha256:f35b34a5184d5e0cc360b61664c1c06e866aab077b5a7c538a3e20c8fcdbf90b \ + --hash=sha256:f3d73022990ab0c8b172cce57c69fd9a89c24fd473a5e79cbce92df87e3d9c48 \ + --hash=sha256:f5b8353ea1a4d7dfb59a7f45c04df66ecfd363bb5b35f33b11ea579111d4655f \ + --hash=sha256:f809a17cc78bd331e137caa25262b507225854073fd319e987bd216bed911b7c \ + --hash=sha256:f9bc4161bd3b970cd6a6fcda70583ad4afd10f2750609fb1f3ca9505050d4ef3 \ + --hash=sha256:fdf4890cda3b59170009d012fca3294c00140e7f2abe1910e6a730809d0f3f9b + # via + # jsonschema + # referencing +six==1.16.0 \ + --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ + --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 + # via + # behave + # parse-type +tomli==2.0.1 \ + --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ + --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f + # via + # coverage + # pytest +wheel==0.43.0 \ + --hash=sha256:465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85 \ + --hash=sha256:55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81 + # via -r requirements-dev.txt +zipp==3.19.2 \ + --hash=sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19 \ + --hash=sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c + # via importlib-resources diff --git a/testbed/boto__botocore/requirements-dev.txt b/testbed/boto__botocore/requirements-dev.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0732858cf958eaae19f2afcfe5cb12399847494 --- /dev/null +++ b/testbed/boto__botocore/requirements-dev.txt @@ -0,0 +1,13 @@ +wheel==0.43.0 +behave==1.2.5 +jsonschema==4.21.1 +coverage==7.2.7 +setuptools==71.1.0;python_version>="3.12" +packaging==24.1;python_version>="3.12" # Requirement for setuptools>=71 + +# Pytest specific deps +pytest==8.1.1 +pytest-cov==5.0.0 +pytest-xdist==3.5.0 +atomicwrites>=1.0 # Windows requirement +colorama>0.3.0 # Windows requirement diff --git a/testbed/boto__botocore/requirements-docs-lock.txt b/testbed/boto__botocore/requirements-docs-lock.txt new file mode 100644 index 0000000000000000000000000000000000000000..26ae627b4d01e70b1ab0c2055f9d381f738176df --- /dev/null +++ b/testbed/boto__botocore/requirements-docs-lock.txt @@ -0,0 +1,281 @@ +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# pip-compile --allow-unsafe --generate-hashes --output-file=requirements-docs-lock.txt requirements-docs.txt +# +alabaster==0.7.13 \ + --hash=sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3 \ + --hash=sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2 + # via sphinx +babel==2.15.0 \ + --hash=sha256:08706bdad8d0a3413266ab61bd6c34d0c28d6e1e7badf40a2cebe67644e2e1fb \ + --hash=sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413 + # via sphinx +beautifulsoup4==4.12.3 \ + --hash=sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051 \ + --hash=sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed + # via furo +certifi==2024.7.4 \ + --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ + --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 + # via requests +charset-normalizer==3.3.2 \ + --hash=sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027 \ + --hash=sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087 \ + --hash=sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786 \ + --hash=sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8 \ + --hash=sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09 \ + --hash=sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185 \ + --hash=sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574 \ + --hash=sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e \ + --hash=sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519 \ + --hash=sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898 \ + --hash=sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269 \ + --hash=sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3 \ + --hash=sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f \ + --hash=sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6 \ + --hash=sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8 \ + --hash=sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a \ + --hash=sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73 \ + --hash=sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc \ + --hash=sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714 \ + --hash=sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2 \ + --hash=sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc \ + --hash=sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce \ + --hash=sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d \ + --hash=sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e \ + --hash=sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6 \ + --hash=sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269 \ + --hash=sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96 \ + --hash=sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d \ + --hash=sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a \ + --hash=sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4 \ + --hash=sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77 \ + --hash=sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d \ + --hash=sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0 \ + --hash=sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed \ + --hash=sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068 \ + --hash=sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac \ + --hash=sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25 \ + --hash=sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8 \ + --hash=sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab \ + --hash=sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26 \ + --hash=sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2 \ + --hash=sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db \ + --hash=sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f \ + --hash=sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5 \ + --hash=sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99 \ + --hash=sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c \ + --hash=sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d \ + --hash=sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811 \ + --hash=sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa \ + --hash=sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a \ + --hash=sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03 \ + --hash=sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b \ + --hash=sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04 \ + --hash=sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c \ + --hash=sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001 \ + --hash=sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458 \ + --hash=sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389 \ + --hash=sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99 \ + --hash=sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985 \ + --hash=sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537 \ + --hash=sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238 \ + --hash=sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f \ + --hash=sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d \ + --hash=sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796 \ + --hash=sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a \ + --hash=sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143 \ + --hash=sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8 \ + --hash=sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c \ + --hash=sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5 \ + --hash=sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5 \ + --hash=sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711 \ + --hash=sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4 \ + --hash=sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6 \ + --hash=sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c \ + --hash=sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7 \ + --hash=sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4 \ + --hash=sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b \ + --hash=sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae \ + --hash=sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12 \ + --hash=sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c \ + --hash=sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae \ + --hash=sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8 \ + --hash=sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887 \ + --hash=sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b \ + --hash=sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4 \ + --hash=sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f \ + --hash=sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5 \ + --hash=sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33 \ + --hash=sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519 \ + --hash=sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561 + # via requests +docutils==0.19 \ + --hash=sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6 \ + --hash=sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc + # via sphinx +furo==2022.12.7 \ + --hash=sha256:7cb76c12a25ef65db85ab0743df907573d03027a33631f17d267e598ebb191f7 \ + --hash=sha256:d8008f8efbe7587a97ba533c8b2df1f9c21ee9b3e5cad0d27f61193d38b1a986 + # via -r requirements-docs.txt +idna==3.7 \ + --hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \ + --hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 + # via requests +imagesize==1.4.1 \ + --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \ + --hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a + # via sphinx +importlib-metadata==8.0.0 \ + --hash=sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f \ + --hash=sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812 + # via sphinx +jinja2==3.1.4 \ + --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ + --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d + # via sphinx +markupsafe==2.1.5 \ + --hash=sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf \ + --hash=sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff \ + --hash=sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f \ + --hash=sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3 \ + --hash=sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532 \ + --hash=sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f \ + --hash=sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617 \ + --hash=sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df \ + --hash=sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4 \ + --hash=sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906 \ + --hash=sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f \ + --hash=sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4 \ + --hash=sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8 \ + --hash=sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371 \ + --hash=sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2 \ + --hash=sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465 \ + --hash=sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52 \ + --hash=sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6 \ + --hash=sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169 \ + --hash=sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad \ + --hash=sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2 \ + --hash=sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0 \ + --hash=sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029 \ + --hash=sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f \ + --hash=sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a \ + --hash=sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced \ + --hash=sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5 \ + --hash=sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c \ + --hash=sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf \ + --hash=sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9 \ + --hash=sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb \ + --hash=sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad \ + --hash=sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3 \ + --hash=sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1 \ + --hash=sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46 \ + --hash=sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc \ + --hash=sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a \ + --hash=sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee \ + --hash=sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900 \ + --hash=sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5 \ + --hash=sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea \ + --hash=sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f \ + --hash=sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5 \ + --hash=sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e \ + --hash=sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a \ + --hash=sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f \ + --hash=sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50 \ + --hash=sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a \ + --hash=sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b \ + --hash=sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4 \ + --hash=sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff \ + --hash=sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2 \ + --hash=sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46 \ + --hash=sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b \ + --hash=sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf \ + --hash=sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5 \ + --hash=sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5 \ + --hash=sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab \ + --hash=sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd \ + --hash=sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68 + # via jinja2 +packaging==24.1 \ + --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ + --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 + # via sphinx +pygments==2.18.0 \ + --hash=sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199 \ + --hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a + # via + # furo + # sphinx +pytz==2024.1 \ + --hash=sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812 \ + --hash=sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319 + # via babel +requests==2.32.3 \ + --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ + --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 + # via sphinx +snowballstemmer==2.2.0 \ + --hash=sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1 \ + --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a + # via sphinx +soupsieve==2.5 \ + --hash=sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690 \ + --hash=sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7 + # via beautifulsoup4 +sphinx==5.3.0 \ + --hash=sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d \ + --hash=sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5 + # via + # -r requirements-docs.txt + # furo + # sphinx-basic-ng + # sphinx-copybutton + # sphinx-remove-toctrees +sphinx-basic-ng==1.0.0b2 \ + --hash=sha256:9ec55a47c90c8c002b5960c57492ec3021f5193cb26cebc2dc4ea226848651c9 \ + --hash=sha256:eb09aedbabfb650607e9b4b68c9d240b90b1e1be221d6ad71d61c52e29f7932b + # via furo +sphinx-copybutton==0.5.1 \ + --hash=sha256:0842851b5955087a7ec7fc870b622cb168618ad408dee42692e9a5c97d071da8 \ + --hash=sha256:366251e28a6f6041514bfb5439425210418d6c750e98d3a695b73e56866a677a + # via -r requirements-docs.txt +sphinx-remove-toctrees==0.0.3 \ + --hash=sha256:1077ebc00652f8a896ce27404d31cb5bdde9eeaefc80ada72d95a7a0a7b99a9d \ + --hash=sha256:e4792cc4e5d25ceb1a44dd1490c45d578e6b36f1b1e385ede659e4c324b98cba + # via -r requirements-docs.txt +sphinxcontrib-applehelp==1.0.4 \ + --hash=sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228 \ + --hash=sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e + # via sphinx +sphinxcontrib-devhelp==1.0.2 \ + --hash=sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e \ + --hash=sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4 + # via sphinx +sphinxcontrib-htmlhelp==2.0.1 \ + --hash=sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff \ + --hash=sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903 + # via sphinx +sphinxcontrib-jsmath==1.0.1 \ + --hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \ + --hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8 + # via sphinx +sphinxcontrib-qthelp==1.0.3 \ + --hash=sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72 \ + --hash=sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6 + # via sphinx +sphinxcontrib-serializinghtml==1.1.5 \ + --hash=sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd \ + --hash=sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952 + # via sphinx +urllib3==1.26.19 ; python_version < "3.10" \ + --hash=sha256:37a0344459b199fce0e80b0d3569837ec6b6937435c5244e7fd73fa6006830f3 \ + --hash=sha256:3e3d753a8618b86d7de333b4223005f68720bcd6a7d2bcb9fbd2229ec7c1e429 + # via + # -r requirements-docs.txt + # requests +zipp==3.19.2 \ + --hash=sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19 \ + --hash=sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c + # via importlib-metadata diff --git a/testbed/boto__botocore/requirements-docs.txt b/testbed/boto__botocore/requirements-docs.txt new file mode 100644 index 0000000000000000000000000000000000000000..de99cd6ebdaa12f31280717f2ff9f7d789b28fea --- /dev/null +++ b/testbed/boto__botocore/requirements-docs.txt @@ -0,0 +1,6 @@ +sphinx==5.3.0 +furo==2022.12.7 +sphinx_copybutton==0.5.1 +sphinx-remove-toctrees==0.0.3 +# Avoid urllib3 2.x below Python 3.10 +urllib3<2.0 ; python_version < "3.10" diff --git a/testbed/boto__botocore/requirements.txt b/testbed/boto__botocore/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..60285a2d7faa45a09af3ae4f80f92d0c2a236db1 --- /dev/null +++ b/testbed/boto__botocore/requirements.txt @@ -0,0 +1 @@ +-r requirements-dev.txt diff --git a/testbed/boto__botocore/setup.cfg b/testbed/boto__botocore/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..d0d4c67561db5ffbce2fc2637389d1b60ca509be --- /dev/null +++ b/testbed/boto__botocore/setup.cfg @@ -0,0 +1,12 @@ +[bdist_wheel] +universal = 0 + +[metadata] +requires_dist = + jmespath>=0.7.1,<2.0.0 + python-dateutil>=2.1,<3.0.0 + urllib3>=1.25.4,<1.27; python_version<"3.10" + urllib3>=1.25.4,!=2.2.0,<3; python_version>="3.10" + +[options.extras_require] +crt = awscrt==0.21.5 diff --git a/testbed/boto__botocore/setup.py b/testbed/boto__botocore/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..781f1b6e146a432f8f62f2f169f4ec7f07fb2bfd --- /dev/null +++ b/testbed/boto__botocore/setup.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +import codecs +import os.path +import re + +from setuptools import find_packages, setup + +here = os.path.abspath(os.path.dirname(__file__)) + + +def read(*parts): + return codecs.open(os.path.join(here, *parts), 'r').read() + + +def find_version(*file_paths): + version_file = read(*file_paths) + version_match = re.search( + r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M + ) + if version_match: + return version_match.group(1) + raise RuntimeError("Unable to find version string.") + + +requires = [ + 'jmespath>=0.7.1,<2.0.0', + 'python-dateutil>=2.1,<3.0.0', + # Prior to Python 3.10, Python doesn't require openssl 1.1.1 + # but urllib3 2.0+ does. This means all botocore users will be + # broken by default on Amazon Linux 2 and AWS Lambda without this pin. + 'urllib3>=1.25.4,<1.27 ; python_version < "3.10"', + 'urllib3>=1.25.4,!=2.2.0,<3 ; python_version >= "3.10"', +] + +extras_require = { + 'crt': ['awscrt==0.21.5'], +} + +setup( + name='botocore', + version=find_version("botocore", "__init__.py"), + description='Low-level, data-driven core of boto 3.', + long_description=open('README.rst').read(), + author='Amazon Web Services', + url='https://github.com/boto/botocore', + scripts=[], + packages=find_packages(exclude=['tests*']), + package_data={ + 'botocore': ['cacert.pem', 'data/*.json', 'data/*/*.json'], + 'botocore.vendored.requests': ['*.pem'], + }, + include_package_data=True, + install_requires=requires, + extras_require=extras_require, + license="Apache License 2.0", + python_requires=">= 3.8", + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Natural Language :: English', + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + ], +) diff --git a/testbed/boto__botocore/tests/__init__.py b/testbed/boto__botocore/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0a647aef943f41ea0ca5279369371b793080917c --- /dev/null +++ b/testbed/boto__botocore/tests/__init__.py @@ -0,0 +1,599 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +import binascii +import contextlib +import datetime +import os +import platform +import random +import select +import shutil +import sys +import tempfile +import time +import unittest +from contextlib import ContextDecorator +from io import BytesIO +from subprocess import PIPE, Popen +from unittest import mock + +from dateutil.tz import tzlocal + +import botocore.loaders +import botocore.session +from botocore import credentials, utils +from botocore.awsrequest import AWSResponse +from botocore.compat import HAS_CRT, parse_qs, urlparse +from botocore.stub import Stubber + +_LOADER = botocore.loaders.Loader() + + +def _all_services(): + session = botocore.session.Session() + service_names = session.get_available_services() + return [session.get_service_model(name) for name in service_names] + + +# Only compute our service models once +ALL_SERVICES = _all_services() + + +def skip_unless_has_memory_collection(cls): + """Class decorator to skip tests that require memory collection. + + Any test that uses memory collection (such as the resource leak tests) + can decorate their class with skip_unless_has_memory_collection to + indicate that if the platform does not support memory collection + the tests should be skipped. + """ + if platform.system() not in ['Darwin', 'Linux']: + return unittest.skip('Memory tests only supported on mac/linux.')(cls) + return cls + + +def skip_if_windows(reason): + """Decorator to skip tests that should not be run on windows. + Example usage: + @skip_if_windows("Not valid") + def test_some_non_windows_stuff(self): + self.assertEqual(...) + """ + + def decorator(func): + return unittest.skipIf( + platform.system() not in ['Darwin', 'Linux'], reason + )(func) + + return decorator + + +def requires_crt(reason=None): + if reason is None: + reason = "Test requires awscrt to be installed" + + def decorator(func): + return unittest.skipIf(not HAS_CRT, reason)(func) + + return decorator + + +def random_chars(num_chars): + """Returns random hex characters. + + Useful for creating resources with random names. + + """ + return binascii.hexlify(os.urandom(int(num_chars / 2))).decode('ascii') + + +def create_session(**kwargs): + # Create a Session object. By default, + # the _LOADER object is used as the loader + # so that we reused the same models across tests. + session = botocore.session.Session(**kwargs) + session.register_component('data_loader', _LOADER) + session.set_config_variable('credentials_file', 'noexist/foo/botocore') + return session + + +@contextlib.contextmanager +def temporary_file(mode): + """This is a cross platform temporary file creation. + + tempfile.NamedTemporary file on windows creates a secure temp file + that can't be read by other processes and can't be opened a second time. + + For tests, we generally *want* them to be read multiple times. + The test fixture writes the temp file contents, the test reads the + temp file. + + """ + temporary_directory = tempfile.mkdtemp() + basename = f'tmpfile-{int(time.time())}-{random.randint(1, 1000)}' + full_filename = os.path.join(temporary_directory, basename) + open(full_filename, 'w').close() + try: + with open(full_filename, mode) as f: + yield f + finally: + shutil.rmtree(temporary_directory) + + +class BaseEnvVar(unittest.TestCase): + def setUp(self): + # Automatically patches out os.environ for you + # and gives you a self.environ attribute that simulates + # the environment. Also will automatically restore state + # for you in tearDown() + self.environ = {} + self.environ_patch = mock.patch('os.environ', self.environ) + self.environ_patch.start() + + def tearDown(self): + self.environ_patch.stop() + + +class BaseSessionTest(BaseEnvVar): + """Base class used to provide credentials. + + This class can be used as a base class that want to use a real + session class but want to be completely isolated from the + external environment (including environment variables). + + This class will also set credential vars so you can make fake + requests to services. + + """ + + def setUp(self, **environ): + super().setUp() + self.environ['AWS_ACCESS_KEY_ID'] = 'access_key' + self.environ['AWS_SECRET_ACCESS_KEY'] = 'secret_key' + self.environ['AWS_CONFIG_FILE'] = 'no-exist-foo' + self.environ.update(environ) + self.session = create_session() + self.session.config_filename = 'no-exist-foo' + + +@skip_unless_has_memory_collection +class BaseClientDriverTest(unittest.TestCase): + INJECT_DUMMY_CREDS = False + + def setUp(self): + self.driver = ClientDriver() + env = None + if self.INJECT_DUMMY_CREDS: + env = {'AWS_ACCESS_KEY_ID': 'foo', 'AWS_SECRET_ACCESS_KEY': 'bar'} + self.driver.start(env=env) + + def cmd(self, *args): + self.driver.cmd(*args) + + def send_cmd(self, *args): + self.driver.send_cmd(*args) + + def record_memory(self): + self.driver.record_memory() + + @property + def memory_samples(self): + return self.driver.memory_samples + + def tearDown(self): + self.driver.stop() + + +class ClientDriver: + CLIENT_SERVER = os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'cmd-runner' + ) + + def __init__(self): + self._popen = None + self.memory_samples = [] + + def _get_memory_with_ps(self, pid): + # It would be better to eventually switch to psutil, + # which should allow us to test on windows, but for now + # we'll just use ps and run on POSIX platforms. + command_list = ['ps', '-p', str(pid), '-o', 'rss'] + p = Popen(command_list, stdout=PIPE) + stdout = p.communicate()[0] + if not p.returncode == 0: + raise RuntimeError("Could not retrieve memory") + else: + # Get the RSS from output that looks like this: + # RSS + # 4496 + return int(stdout.splitlines()[1].split()[0]) * 1024 + + def record_memory(self): + mem = self._get_memory_with_ps(self._popen.pid) + self.memory_samples.append(mem) + + def start(self, env=None): + """Start up the command runner process.""" + self._popen = Popen( + [sys.executable, self.CLIENT_SERVER], + stdout=PIPE, + stdin=PIPE, + env=env, + ) + + def stop(self): + """Shutdown the command runner process.""" + self.cmd('exit') + self._popen.wait() + + def send_cmd(self, *cmd): + """Send a command and return immediately. + + This is a lower level method than cmd(). + This method will instruct the cmd-runner process + to execute a command, but this method will + immediately return. You will need to use + ``is_cmd_finished()`` to check that the command + is finished. + + This method is useful if you want to record attributes + about the process while an operation is occurring. For + example, if you want to instruct the cmd-runner process + to upload a 1GB file to S3 and you'd like to record + the memory during the upload process, you can use + send_cmd() instead of cmd(). + + """ + cmd_str = ' '.join(cmd) + '\n' + cmd_bytes = cmd_str.encode('utf-8') + self._popen.stdin.write(cmd_bytes) + self._popen.stdin.flush() + + def is_cmd_finished(self): + rlist = [self._popen.stdout.fileno()] + result = select.select(rlist, [], [], 0.01) + if result[0]: + return True + return False + + def cmd(self, *cmd): + """Send a command and block until it finishes. + + This method will send a command to the cmd-runner process + to run. It will block until the cmd-runner process is + finished executing the command and sends back a status + response. + + """ + self.send_cmd(*cmd) + result = self._popen.stdout.readline().strip() + if result != b'OK': + raise RuntimeError(f"Error from command '{cmd}': {result}") + + +# This is added to this file because it's used in both +# the functional and unit tests for cred refresh. +class IntegerRefresher(credentials.RefreshableCredentials): + """Refreshable credentials to help with testing. + + This class makes testing refreshable credentials easier. + It has the following functionality: + + * A counter, self.refresh_counter, to indicate how many + times refresh was called. + * A way to specify how many seconds to make credentials + valid. + * Configurable advisory/mandatory refresh. + * An easy way to check consistency. Each time creds are + refreshed, all the cred values are set to the next + incrementing integer. Frozen credentials should always + have this value. + """ + + _advisory_refresh_timeout = 2 + _mandatory_refresh_timeout = 1 + _credentials_expire = 3 + + def __init__( + self, + creds_last_for=_credentials_expire, + advisory_refresh=_advisory_refresh_timeout, + mandatory_refresh=_mandatory_refresh_timeout, + refresh_function=None, + ): + expires_in = self._current_datetime() + datetime.timedelta( + seconds=creds_last_for + ) + if refresh_function is None: + refresh_function = self._do_refresh + super().__init__( + '0', '0', '0', expires_in, refresh_function, 'INTREFRESH' + ) + self.creds_last_for = creds_last_for + self.refresh_counter = 0 + self._advisory_refresh_timeout = advisory_refresh + self._mandatory_refresh_timeout = mandatory_refresh + + def _do_refresh(self): + self.refresh_counter += 1 + current = int(self._access_key) + next_id = str(current + 1) + + return { + 'access_key': next_id, + 'secret_key': next_id, + 'token': next_id, + 'expiry_time': self._seconds_later(self.creds_last_for), + } + + def _seconds_later(self, num_seconds): + # We need to guarantee at *least* num_seconds. + # Because this doesn't handle subsecond precision + # we'll round up to the next second. + num_seconds += 1 + t = self._current_datetime() + datetime.timedelta(seconds=num_seconds) + return self._to_timestamp(t) + + def _to_timestamp(self, datetime_obj): + obj = utils.parse_to_aware_datetime(datetime_obj) + return obj.strftime('%Y-%m-%dT%H:%M:%SZ') + + def _current_timestamp(self): + return self._to_timestamp(self._current_datetime()) + + def _current_datetime(self): + return datetime.datetime.now(tzlocal()) + + +def _urlparse(url): + if isinstance(url, bytes): + # Not really necessary, but it helps to reduce noise on Python 2.x + url = url.decode('utf8') + return urlparse(url) + + +def assert_url_equal(url1, url2): + parts1 = _urlparse(url1) + parts2 = _urlparse(url2) + + # Because the query string ordering isn't relevant, we have to parse + # every single part manually and then handle the query string. + assert parts1.scheme == parts2.scheme + assert parts1.netloc == parts2.netloc + assert parts1.path == parts2.path + assert parts1.params == parts2.params + assert parts1.fragment == parts2.fragment + assert parts1.username == parts2.username + assert parts1.password == parts2.password + assert parts1.hostname == parts2.hostname + assert parts1.port == parts2.port + assert parse_qs(parts1.query) == parse_qs(parts2.query) + + +class HTTPStubberException(Exception): + pass + + +class RawResponse(BytesIO): + # TODO: There's a few objects similar to this in various tests, let's + # try and consolidate to this one in a future commit. + def stream(self, **kwargs): + contents = self.read() + while contents: + yield contents + contents = self.read() + + +class BaseHTTPStubber: + def __init__(self, obj_with_event_emitter, strict=True): + self.reset() + self._strict = strict + self._obj_with_event_emitter = obj_with_event_emitter + + def reset(self): + self.requests = [] + self.responses = [] + + def add_response( + self, url='https://example.com', status=200, headers=None, body=b'' + ): + if headers is None: + headers = {} + + raw = RawResponse(body) + response = AWSResponse(url, status, headers, raw) + self.responses.append(response) + + @property + def _events(self): + raise NotImplementedError('_events') + + def start(self): + self._events.register('before-send', self) + + def stop(self): + self._events.unregister('before-send', self) + + def __enter__(self): + self.start() + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.stop() + + def __call__(self, request, **kwargs): + self.requests.append(request) + if self.responses: + response = self.responses.pop(0) + if isinstance(response, Exception): + raise response + else: + return response + elif self._strict: + raise HTTPStubberException('Insufficient responses') + else: + return None + + +class ClientHTTPStubber(BaseHTTPStubber): + @property + def _events(self): + return self._obj_with_event_emitter.meta.events + + +class SessionHTTPStubber(BaseHTTPStubber): + @property + def _events(self): + return self._obj_with_event_emitter.get_component('event_emitter') + + +class ConsistencyWaiterException(Exception): + pass + + +class ConsistencyWaiter: + """ + A waiter class for some check to reach a consistent state. + + :type min_successes: int + :param min_successes: The minimum number of successful check calls to + treat the check as stable. Default of 1 success. + + :type max_attempts: int + :param min_successes: The maximum number of times to attempt calling + the check. Default of 20 attempts. + + :type delay: int + :param delay: The number of seconds to delay the next API call after a + failed check call. Default of 5 seconds. + """ + + def __init__( + self, + min_successes=1, + max_attempts=20, + delay=5, + delay_initial_poll=False, + ): + self.min_successes = min_successes + self.max_attempts = max_attempts + self.delay = delay + self.delay_initial_poll = delay_initial_poll + + def wait(self, check, *args, **kwargs): + """ + Wait until the check succeeds the configured number of times + + :type check: callable + :param check: A callable that returns True or False to indicate + if the check succeeded or failed. + + :type args: list + :param args: Any ordered arguments to be passed to the check. + + :type kwargs: dict + :param kwargs: Any keyword arguments to be passed to the check. + """ + attempts = 0 + successes = 0 + if self.delay_initial_poll: + time.sleep(self.delay) + while attempts < self.max_attempts: + attempts += 1 + if check(*args, **kwargs): + successes += 1 + if successes >= self.min_successes: + return + else: + time.sleep(self.delay) + fail_msg = self._fail_message(attempts, successes) + raise ConsistencyWaiterException(fail_msg) + + def _fail_message(self, attempts, successes): + return ( + f'Failed after {attempts} attempts, only had {successes} successes' + ) + + +class StubbedSession(botocore.session.Session): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._cached_clients = {} + self._client_stubs = {} + + def create_client(self, service_name, *args, **kwargs): + if service_name not in self._cached_clients: + client = self._create_stubbed_client(service_name, *args, **kwargs) + self._cached_clients[service_name] = client + return self._cached_clients[service_name] + + def _create_stubbed_client(self, service_name, *args, **kwargs): + client = super().create_client(service_name, *args, **kwargs) + stubber = Stubber(client) + self._client_stubs[service_name] = stubber + return client + + def stub(self, service_name, *args, **kwargs): + if service_name not in self._client_stubs: + self.create_client(service_name, *args, **kwargs) + return self._client_stubs[service_name] + + def activate_stubs(self): + for stub in self._client_stubs.values(): + stub.activate() + + def verify_stubs(self): + for stub in self._client_stubs.values(): + stub.assert_no_pending_responses() + + +class FreezeTime(ContextDecorator): + """ + Context manager for mocking out datetime in arbitrary modules when creating + performing actions like signing which require point in time specificity. + + :type module: module + :param module: reference to imported module to patch (e.g. botocore.auth.datetime) + + :type date: datetime.datetime + :param date: datetime object specifying the output for utcnow() + """ + + def __init__(self, module, date=None): + if date is None: + date = datetime.datetime.utcnow() + self.date = date + self.datetime_patcher = mock.patch.object( + module, 'datetime', mock.Mock(wraps=datetime.datetime) + ) + + def __enter__(self, *args, **kwargs): + mock = self.datetime_patcher.start() + mock.utcnow.return_value = self.date + + def __exit__(self, *args, **kwargs): + self.datetime_patcher.stop() + + +def patch_load_service_model( + session, monkeypatch, service_model_json, ruleset_json +): + def mock_load_service_model(service_name, type_name, api_version=None): + if type_name == 'service-2': + return service_model_json + if type_name == 'endpoint-rule-set-1': + return ruleset_json + + loader = session.get_component('data_loader') + monkeypatch.setattr(loader, 'load_service_model', mock_load_service_model) diff --git a/testbed/boto__botocore/tests/cmd-runner b/testbed/boto__botocore/tests/cmd-runner new file mode 100644 index 0000000000000000000000000000000000000000..c2d6ae9f314f5648ec6594a7b7eb146b478304ed --- /dev/null +++ b/testbed/boto__botocore/tests/cmd-runner @@ -0,0 +1,220 @@ +#!/usr/bin/env python +# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Driver for client scripts. + +How it Works +============ + +This script is part of the infrastructure used for resource leak tests. +At a high level, we're trying to verify that specific types of operations +don't leak memory. For example: + +* Creating 100 clients in a loop doesn't leak memory within reason +* Making 100 API calls doesn't leak memory +* Streaming uploads/downloads to/from S3 have O(1) memory usage. + +In order to do this, these tests are written to utilize two separate +processes: a driver and a runner. The driver sends commands to the +runner which performs the actual commands. While the runner is +running commands the driver can record various attributes about +the runner process. So far this is just memory usage. + +There's a BaseClientDriverTest test that implements the driver part +of the tests. These should read like normal functional/integration tests. + +This script (cmd-runner) implements the runner. It listens for commands +from the driver and runs the commands. + +The driver and runner communicate via a basic text protocol. Commands +are line separated with arguments separated by spaces. Commands +are sent to the runner via stdin. + +On success, the runner response through stdout with "OK". + +Here's an example:: + + +--------+ +-------+ + | Driver | |Runner | + +--------+ +-------+ + + create_client s3 + --------------------------------------------> + OK + <------------------------------------------- + + make_aws_request 100 ec2 describe_instances + --------------------------------------------> + OK + <------------------------------------------- + + stream_s3_upload bucket key /tmp/foo.txt + --------------------------------------------> + OK + <------------------------------------------- + + exit + --------------------------------------------> + OK + <------------------------------------------- + +""" +import botocore.session +import sys + + +class CommandRunner(object): + DEFAULT_REGION = 'us-west-2' + + def __init__(self): + self._session = botocore.session.get_session() + self._clients = [] + self._waiters = [] + self._paginators = [] + + def run(self): + while True: + line = sys.stdin.readline() + parts = line.strip().split() + if not parts: + break + elif parts[0] == 'exit': + sys.stdout.write('OK\n') + sys.stdout.flush() + break + else: + getattr(self, '_do_%s' % parts[0])(parts[1:]) + sys.stdout.write('OK\n') + sys.stdout.flush() + + def _do_create_client(self, args): + # The args provided by the user map directly to the args + # passed to create_client. At the least you need + # to provide the service name. + self._clients.append(self._session.create_client(*args)) + + def _do_create_multiple_clients(self, args): + # Args: + # * num_clients - Number of clients to create in a loop + # * client_args - Variable number of args to pass to create_client + num_clients = args[0] + client_args = args[1:] + for _ in range(int(num_clients)): + self._clients.append(self._session.create_client(*client_args)) + + def _do_free_clients(self, args): + # Frees the memory associated with all clients. + self._clients = [] + + def _do_create_waiter(self, args): + # Args: + # [0] client name used in its instantiation + # [1] waiter name used in its instantiation + client = self._create_client(args[0]) + self._waiters.append(client.get_waiter(args[1])) + + def _do_create_multiple_waiters(self, args): + # Args: + # [0] num_waiters - Number of clients to create in a loop + # [1] client name used in its instantiation + # [2] waiter name used in its instantiation + num_waiters = args[0] + client = self._create_client(args[1]) + for _ in range(int(num_waiters)): + self._waiters.append(client.get_waiter(args[2])) + + def _do_free_waiters(self, args): + # Frees the memory associated with all of the waiters. + self._waiters = [] + + def _do_create_paginator(self, args): + # Args: + # [0] client name used in its instantiation + # [1] paginator name used in its instantiation + client = self._create_client(args[0]) + self._paginators.append(client.get_paginator(args[1])) + + def _do_create_multiple_paginators(self, args): + # Args: + # [0] num_paginators - Number of paginators to create in a loop + # [1] client name used in its instantiation + # [2] paginator name used in its instantiation + num_paginators = args[0] + client = self._create_client(args[1]) + for _ in range(int(num_paginators)): + self._paginators.append(client.get_paginator(args[2])) + + def _do_free_paginators(self, args): + # Frees the memory associated with all of the waiters. + self._paginators = [] + + def _do_make_aws_request(self, args): + # Create a client and make a number of AWS requests. + # Args: + # * num_requests - The number of requests to create in a loop + # * service_name - The name of the AWS service + # * operation_name - The name of the service, snake_cased + # * oepration_args - Variable args, kwargs to pass to the API call, + # in the format Kwarg1:Val1 Kwarg2:Val2 + num_requests = int(args[0]) + service_name = args[1] + operation_name = args[2] + kwargs = dict([v.split(':', 1) for v in args[3:]]) + client = self._create_client(service_name) + method = getattr(client, operation_name) + for _ in range(num_requests): + method(**kwargs) + + def _do_stream_s3_upload(self, args): + # Stream an upload to S3 from a local file. + # This does *not* create an S3 bucket. You need to create this + # before running this command. You will also need to create + # the local file to upload before calling this command. + # Args: + # * bucket - The name of the S3 bucket + # * key - The name of the S3 key + # * filename - The name of the local filename to upload + bucket, key, local_filename = args + client = self._create_client('s3') + with open(local_filename, 'rb') as f: + client.put_object(Bucket=bucket, Key=key, Body=f) + + def _do_stream_s3_download(self, args): + # Stream a download to S3 from a local file. + # Before calling this command you'll need to create the S3 bucket + # as well as the S3 object. Also, the directory where the + # file will be downloaded must already exist. + # Args: + # * bucket - The name of the S3 bucket + # * key - The name of the S3 key + # * filename - The local filename where the object will be downloaded + bucket, key, local_filename = args + client = self._create_client('s3') + response = client.get_object(Bucket=bucket, Key=key) + body_stream = response['Body'] + with open(local_filename, 'wb') as f: + for chunk in iter(lambda: body_stream.read(64 * 1024), b''): + f.write(chunk) + + def _create_client(self, service_name): + # Create a client using the provided service name. + # It will also inject a region name of self.DEFAULT_REGION. + return self._session.create_client(service_name, + region_name=self.DEFAULT_REGION) + + +def run(): + CommandRunner().run() + + +run() diff --git a/testbed/boto__botocore/tests/unit/__init__.py b/testbed/boto__botocore/tests/unit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c03617edaaaea01b23cc39cc1507f526599337fa --- /dev/null +++ b/testbed/boto__botocore/tests/unit/__init__.py @@ -0,0 +1,46 @@ +# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import copy + +from tests import unittest + + +class BaseResponseTest(unittest.TestCase): + def assert_response_with_subset_metadata( + self, actual_response, expected_response + ): + """ + Compares two parsed service responses. For ResponseMetadata, it will + only assert that the expected is a proper subset of the actual. This + is useful so that when new keys are added to the metadata, tests don't + break. + """ + actual = copy.copy(actual_response) + expected = copy.copy(expected_response) + + actual_metadata = actual.pop('ResponseMetadata', {}) + expected_metadata = expected.pop('ResponseMetadata', {}) + + self.assertEqual(actual, expected) + self.assert_dict_is_proper_subset(actual_metadata, expected_metadata) + + def assert_dict_is_proper_subset(self, superset, subset): + """ + Asserts that a dictionary is a proper subset of another. + """ + self.assertTrue( + all( + (k in superset and superset[k] == v) for k, v in subset.items() + ) + ) diff --git a/testbed/boto__botocore/tests/unit/put_object_data b/testbed/boto__botocore/tests/unit/put_object_data new file mode 100644 index 0000000000000000000000000000000000000000..eaa3e40f1c546199f16b312d58dd9aef9cc93fff --- /dev/null +++ b/testbed/boto__botocore/tests/unit/put_object_data @@ -0,0 +1 @@ +This is a test of PutObject. diff --git a/testbed/boto__botocore/tests/unit/response_parsing/README.rst b/testbed/boto__botocore/tests/unit/response_parsing/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..9e00c1d11a87a0f0a81508f03f45393f03061b52 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/README.rst @@ -0,0 +1,34 @@ +====================== +Response Parsing Tests +====================== + +The purpose of this collection of tests it to determine whether the XML +responses from the services are being correctly parsed and transformed +into Python data structures. + +Within the ``data`` directory you will find pairs of files, an XML file +and a JSON file using a naming convention of:: + + -.[xml|json] + +Each pair of files represents one test. The XML file contains the +response sent from the server for that particular request and the JSON +file contains the expected Python data structure created from the XML +response. + +The main test is contained in ``test_response_parser.py`` and is +implemented as a nose generator. Each time through the loop an XML +file is read and passed to a ``botocore.response.XmlResponse`` +object. The corresponding JSON file is then parsed and compared to +the value created by the parser. If the are equal, the test passes. If +they are not equal, both the expected result and the actual result are +pretty-printed to stdout and the tests continue. + +----------------- +Adding More Tests +----------------- + +You can add more tests by simply placing appropriately named XML and JSON +files into the data directory. Make sure you follow the naming convention +shown above as that is how the generator determines which service and +operation to call. diff --git a/testbed/boto__botocore/tests/unit/response_parsing/test_response_parsing.py b/testbed/boto__botocore/tests/unit/response_parsing/test_response_parsing.py new file mode 100644 index 0000000000000000000000000000000000000000..3e3b9838cf69cb15bfdfc9c43debac2b0a09fd0c --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/test_response_parsing.py @@ -0,0 +1,195 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +import difflib +import glob +import json +import logging +import os +import pprint + +import pytest + +import botocore.session +from botocore import parsers, xform_name +from tests import create_session + +log = logging.getLogger(__name__) + + +SPECIAL_CASES = [ + 'iam-get-user-policy.xml', # Needs the JSON decode from handlers.py + 'iam-list-roles.xml', # Needs the JSON decode from handlers.py for the policy + 's3-get-bucket-location.xml', # Confirmed, this will need a special handler + # 's3-list-multipart-uploads.xml', # Bug in model, missing delimeter + 'cloudformation-get-template.xml', # Need to JSON decode the template body. +] + + +def _get_expected_parsed_result(filename): + dirname, filename = os.path.split(filename) + basename = os.path.splitext(filename)[0] + jsonfile = os.path.join(dirname, basename + '.json') + with open(jsonfile) as f: + return json.load(f) + + +def _get_raw_response_body(xmlfile): + with open(xmlfile, 'rb') as f: + return f.read() + + +def _get_operation_model(service_model, filename): + dirname, filename = os.path.split(filename) + basename = os.path.splitext(filename)[0] + sn, opname = basename.split('-', 1) + # In order to have multiple tests for the same + # operation a '#' char is used to separate + # operation names from some other suffix so that + # the tests have a different filename, e.g + # my-operation#1.xml, my-operation#2.xml. + opname = opname.split('#')[0] + operation_names = service_model.operation_names + for operation_name in operation_names: + if xform_name(operation_name) == opname.replace('-', '_'): + return service_model.operation_model(operation_name) + + +def _test_parsed_response(xmlfile, operation_model, expected): + response_body = _get_raw_response_body(xmlfile) + response = {'body': response_body, 'status_code': 200, 'headers': {}} + for case in SPECIAL_CASES: + if case in xmlfile: + print(f"SKIP: {xmlfile}") + return + if 'errors' in xmlfile: + response['status_code'] = 400 + # Handle the special cased __headers__ key if it exists. + if b'__headers__' in response_body: + loaded = json.loads(response_body.decode('utf-8')) + response['headers'] = loaded.pop('__headers__') + response['body'] = json.dumps(loaded).encode('utf-8') + + protocol = operation_model.service_model.protocol + parser_cls = parsers.PROTOCOL_PARSERS[protocol] + parser = parser_cls(timestamp_parser=lambda x: x) + parsed = parser.parse(response, operation_model.output_shape) + parsed = _convert_bytes_to_str(parsed) + expected['ResponseMetadata']['HTTPStatusCode'] = response['status_code'] + expected['ResponseMetadata']['HTTPHeaders'] = response['headers'] + + d2 = parsed + d1 = expected + + if d1 != d2: + log.debug('-' * 40) + log.debug("XML FILE:\n" + xmlfile) + log.debug('-' * 40) + log.debug("ACTUAL:\n" + pprint.pformat(parsed)) + log.debug('-' * 40) + log.debug("EXPECTED:\n" + pprint.pformat(expected)) + if not d1 == d2: + # Borrowed from assertDictEqual, though this doesn't + # handle the case when unicode literals are used in one + # dict but not in the other (and we want to consider them + # as being equal). + print(d1) + print() + print(d2) + pretty_d1 = pprint.pformat(d1, width=1).splitlines() + pretty_d2 = pprint.pformat(d2, width=1).splitlines() + diff = '\n' + '\n'.join(difflib.ndiff(pretty_d1, pretty_d2)) + raise AssertionError(f"Dicts are not equal:\n{diff}") + + +def _convert_bytes_to_str(parsed): + if isinstance(parsed, dict): + new_dict = {} + for key, value in parsed.items(): + new_dict[key] = _convert_bytes_to_str(value) + return new_dict + elif isinstance(parsed, bytes): + return parsed.decode('utf-8') + elif isinstance(parsed, list): + new_list = [] + for item in parsed: + new_list.append(_convert_bytes_to_str(item)) + return new_list + else: + return parsed + + +def _xml_test_cases(): + session = create_session() + test_cases = [] + for dp in ['responses', 'errors']: + data_path = os.path.join(os.path.dirname(__file__), 'xml') + data_path = os.path.join(data_path, dp) + xml_files = glob.glob(f'{data_path}/*.xml') + service_names = set() + for fn in xml_files: + service_names.add(os.path.split(fn)[1].split('-')[0]) + for service_name in service_names: + service_model = session.get_service_model(service_name) + service_xml_files = glob.glob(f'{data_path}/{service_name}-*.xml') + for xmlfile in service_xml_files: + expected = _get_expected_parsed_result(xmlfile) + operation_model = _get_operation_model(service_model, xmlfile) + test_cases.append((xmlfile, operation_model, expected)) + return sorted(test_cases) + + +@pytest.mark.parametrize( + "xmlfile, operation_model, expected", _xml_test_cases() +) +def test_xml_parsing(xmlfile, operation_model, expected): + _test_parsed_response(xmlfile, operation_model, expected) + + +def _json_test_cases(): + # The outputs/ directory has sample output responses + # For each file in outputs/ there's a corresponding file + # in expected/ that has the expected parsed response. + base_dir = os.path.join(os.path.dirname(__file__), 'json') + json_responses_dir = os.path.join(base_dir, 'errors') + expected_parsed_dir = os.path.join(base_dir, 'expected') + session = botocore.session.get_session() + json_test_cases = [] + for json_response_file in os.listdir(json_responses_dir): + # Files look like: 'datapipeline-create-pipeline.json' + service_name, operation_name = os.path.splitext(json_response_file)[ + 0 + ].split('-', 1) + expected_parsed_response = os.path.join( + expected_parsed_dir, json_response_file + ) + raw_response_file = os.path.join( + json_responses_dir, json_response_file + ) + with open(expected_parsed_response) as f: + expected = json.load(f) + service_model = session.get_service_model(service_name) + operation_names = service_model.operation_names + operation_model = None + for op_name in operation_names: + if xform_name(op_name) == operation_name.replace('-', '_'): + operation_model = service_model.operation_model(op_name) + json_test_cases.append((raw_response_file, operation_model, expected)) + return sorted(json_test_cases) + + +@pytest.mark.parametrize( + "raw_response_file, operation_model, expected", _json_test_cases() +) +def test_json_errors_parsing(raw_response_file, operation_model, expected): + _test_parsed_response(raw_response_file, operation_model, expected) diff --git a/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-describe-alarm-history.json b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-describe-alarm-history.json new file mode 100644 index 0000000000000000000000000000000000000000..39e4bb8dde56fe69d9a171a4c9192146ccf79da8 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-describe-alarm-history.json @@ -0,0 +1,6 @@ +{ + "AlarmHistoryItems": [], + "ResponseMetadata": { + "RequestId": "ac265b36-9167-11e2-bf7e-91c14e278742" + } +} \ No newline at end of file diff --git a/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-describe-alarm-history.xml b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-describe-alarm-history.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a9630eb260f85b390e0c64b8b5a3aeaf553086 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-describe-alarm-history.xml @@ -0,0 +1,8 @@ + + + + + + ac265b36-9167-11e2-bf7e-91c14e278742 + + diff --git a/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-list-metrics.xml b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-list-metrics.xml new file mode 100644 index 0000000000000000000000000000000000000000..b95c8276f3cf10d76074e17a207d24e9f20b1b76 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/cloudwatch-list-metrics.xml @@ -0,0 +1,819 @@ + + + + + + + VolumeId + vol-267b761f + + + VolumeIdleTime + AWS/EBS + + + + + VolumeId + vol-04c7c53d + + + VolumeReadBytes + AWS/EBS + + + + + InstanceId + i-d63c6ce4 + + + DiskReadBytes + AWS/EC2 + + + + + QueueName + foobar + + + NumberOfEmptyReceives + AWS/SQS + + + + + InstanceId + i-78f1b94a + + + NetworkOut + AWS/EC2 + + + + + QueueName + foobar + + + ApproximateNumberOfMessagesNotVisible + AWS/SQS + + + + + VolumeId + vol-04c7c53d + + + VolumeTotalReadTime + AWS/EBS + + + + + VolumeId + vol-203b3919 + + + VolumeWriteOps + AWS/EBS + + + + + VolumeId + vol-267b761f + + + VolumeWriteOps + AWS/EBS + + + + + VolumeId + vol-a8d2e991 + + + VolumeWriteBytes + AWS/EBS + + + + + InstanceId + i-70d08042 + + + StatusCheckFailed_Instance + AWS/EC2 + + + + + QueueName + foobar + + + ApproximateNumberOfMessagesDelayed + AWS/SQS + + + + + VolumeId + vol-04c7c53d + + + VolumeReadOps + AWS/EBS + + + + + InstanceId + i-d63c6ce4 + + + CPUUtilization + AWS/EC2 + + + + + VolumeId + vol-267b761f + + + VolumeTotalWriteTime + AWS/EBS + + + + + VolumeId + vol-a8d2e991 + + + VolumeWriteOps + AWS/EBS + + + + + InstanceId + i-78f1b94a + + + CPUUtilization + AWS/EC2 + + + + + VolumeId + vol-267b761f + + + VolumeQueueLength + AWS/EBS + + + + + InstanceId + i-20277712 + + + DiskWriteBytes + AWS/EC2 + + + + + VolumeId + vol-267b761f + + + VolumeTotalReadTime + AWS/EBS + + + + + VolumeId + vol-04c7c53d + + + VolumeWriteOps + AWS/EBS + + + + + InstanceId + i-70d08042 + + + CPUUtilization + AWS/EC2 + + + + + InstanceId + i-20277712 + + + StatusCheckFailed_Instance + AWS/EC2 + + + + + InstanceId + i-20277712 + + + CPUUtilization + AWS/EC2 + + + + + InstanceId + i-20277712 + + + DiskReadBytes + AWS/EC2 + + + + + VolumeId + vol-04c7c53d + + + VolumeIdleTime + AWS/EBS + + + + + VolumeId + vol-203b3919 + + + VolumeQueueLength + AWS/EBS + + + + + InstanceId + i-d63c6ce4 + + + DiskReadOps + AWS/EC2 + + + + + VolumeId + vol-a8d2e991 + + + VolumeIdleTime + AWS/EBS + + + + + VolumeId + vol-267b761f + + + VolumeWriteBytes + AWS/EBS + + + + + QueueName + foobar + + + ApproximateNumberOfMessagesVisible + AWS/SQS + + + + + InstanceId + i-70d08042 + + + DiskReadBytes + AWS/EC2 + + + + + InstanceId + i-78f1b94a + + + StatusCheckFailed_Instance + AWS/EC2 + + + + + VolumeId + vol-267b761f + + + VolumeReadOps + AWS/EBS + + + + + InstanceId + i-78f1b94a + + + DiskReadOps + AWS/EC2 + + + + + VolumeId + vol-a8d2e991 + + + VolumeTotalWriteTime + AWS/EBS + + + + + InstanceId + i-d63c6ce4 + + + StatusCheckFailed_System + AWS/EC2 + + + + + InstanceId + i-70d08042 + + + NetworkOut + AWS/EC2 + + + + + InstanceId + i-d63c6ce4 + + + StatusCheckFailed + AWS/EC2 + + + + + VolumeId + vol-a8d2e991 + + + VolumeReadOps + AWS/EBS + + + + + VolumeId + vol-203b3919 + + + VolumeTotalWriteTime + AWS/EBS + + + + + VolumeId + vol-203b3919 + + + VolumeReadBytes + AWS/EBS + + + + + InstanceId + i-d63c6ce4 + + + DiskWriteOps + AWS/EC2 + + + + + InstanceId + i-78f1b94a + + + DiskWriteOps + AWS/EC2 + + + + + VolumeId + vol-a8d2e991 + + + VolumeQueueLength + AWS/EBS + + + + + VolumeId + vol-203b3919 + + + VolumeIdleTime + AWS/EBS + + + + + InstanceId + i-78f1b94a + + + StatusCheckFailed + AWS/EC2 + + + + + InstanceId + i-70d08042 + + + StatusCheckFailed + AWS/EC2 + + + + + QueueName + foobar + + + NumberOfMessagesSent + AWS/SQS + + + + + VolumeId + vol-04c7c53d + + + VolumeQueueLength + AWS/EBS + + + + + VolumeId + vol-267b761f + + + VolumeReadBytes + AWS/EBS + + + + + TableName + fromcli + + + ProvisionedReadCapacityUnits + AWS/DynamoDB + + + + + InstanceId + i-70d08042 + + + StatusCheckFailed_System + AWS/EC2 + + + + + QueueName + foobar + + + NumberOfMessagesDeleted + AWS/SQS + + + + + VolumeId + vol-a8d2e991 + + + VolumeReadBytes + AWS/EBS + + + + + InstanceId + i-20277712 + + + DiskWriteOps + AWS/EC2 + + + + + InstanceId + i-20277712 + + + NetworkOut + AWS/EC2 + + + + + InstanceId + i-20277712 + + + DiskReadOps + AWS/EC2 + + + + + InstanceId + i-20277712 + + + StatusCheckFailed_System + AWS/EC2 + + + + + InstanceId + i-d63c6ce4 + + + NetworkOut + AWS/EC2 + + + + + InstanceId + i-20277712 + + + NetworkIn + AWS/EC2 + + + + + VolumeId + vol-203b3919 + + + VolumeWriteBytes + AWS/EBS + + + + + InstanceId + i-70d08042 + + + DiskWriteBytes + AWS/EC2 + + + + + QueueName + foobar + + + NumberOfMessagesReceived + AWS/SQS + + + + + VolumeId + vol-203b3919 + + + VolumeReadOps + AWS/EBS + + + + + VolumeId + vol-203b3919 + + + VolumeTotalReadTime + AWS/EBS + + + + + InstanceId + i-70d08042 + + + DiskWriteOps + AWS/EC2 + + + + + TableName + fromcli + + + ProvisionedWriteCapacityUnits + AWS/DynamoDB + + + + + VolumeId + vol-04c7c53d + + + VolumeTotalWriteTime + AWS/EBS + + + + + VolumeId + vol-a8d2e991 + + + VolumeTotalReadTime + AWS/EBS + + + + + VolumeId + vol-04c7c53d + + + VolumeWriteBytes + AWS/EBS + + + + + InstanceId + i-78f1b94a + + + DiskReadBytes + AWS/EC2 + + + + + InstanceId + i-d63c6ce4 + + + DiskWriteBytes + AWS/EC2 + + + + + InstanceId + i-20277712 + + + StatusCheckFailed + AWS/EC2 + + + + + InstanceId + i-d63c6ce4 + + + StatusCheckFailed_Instance + AWS/EC2 + + + + + InstanceId + i-70d08042 + + + NetworkIn + AWS/EC2 + + + + + InstanceId + i-78f1b94a + + + NetworkIn + AWS/EC2 + + + + + InstanceId + i-70d08042 + + + DiskReadOps + AWS/EC2 + + + + + InstanceId + i-d63c6ce4 + + + NetworkIn + AWS/EC2 + + + + + InstanceId + i-78f1b94a + + + StatusCheckFailed_System + AWS/EC2 + + + + + InstanceId + i-78f1b94a + + + DiskWriteBytes + AWS/EC2 + + + + + abea8add-9167-11e2-91d1-9b4c7751b290 + + diff --git a/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sqs-change-message-visibility-batch.json b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sqs-change-message-visibility-batch.json new file mode 100644 index 0000000000000000000000000000000000000000..0419a71a177bde58fb633c0d2c9290e4e10d41ba --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sqs-change-message-visibility-batch.json @@ -0,0 +1,13 @@ +{ + "Successful": [ + { + "Id": "change_visibility_msg_2" + }, + { + "Id": "change_visibility_msg_3" + } + ], + "ResponseMetadata": { + "RequestId": "ca9668f7-ab1b-4f7a-8859-f15747ab17a7" + } +} diff --git a/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sqs-list-queues.json b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sqs-list-queues.json new file mode 100644 index 0000000000000000000000000000000000000000..7d04603fe01d8ee3280b74f02fb9bd7dca24d87c --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sqs-list-queues.json @@ -0,0 +1,9 @@ +{ + "QueueUrls": [ + "https://us-west-2.queue.amazonaws.com/123456789012/foobar", + "https://us-west-2.queue.amazonaws.com/123456789012/fiebaz" + ], + "ResponseMetadata": { + "RequestId": "517c6371-751f-5711-9ebc-2ab2b1a92268" + } +} diff --git a/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sts-get-session-token.xml b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sts-get-session-token.xml new file mode 100644 index 0000000000000000000000000000000000000000..053c8e598067b03d078096901f85d90055dc17ac --- /dev/null +++ b/testbed/boto__botocore/tests/unit/response_parsing/xml/responses/sts-get-session-token.xml @@ -0,0 +1,16 @@ + + + + AQoEXAMPLEH4aoAH0gNCAPyJxz4BlCFFxWNE1OPTgk5TthT+FvwqnKwRcOIfrRh3c/L + To6UDdyJwOOvEVPvLXCrrrUtdnniCEXAMPLE/IvU1dYUg2RVAJBanLiHb4IgRmpRV3z + rkuWJOgQs8IZZaIv2BXIa2R4OlgkBN9bkUDNCJiBeb/AXlzBBko7b15fjrBs2+cTQtp + Z3CYWFXG8C5zqx37wnOE49mRl/+OtkIKGO7fAE + wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY + 2011-07-11T19:55:29.611Z + AKIAIOSFODNN7EXAMPLE + + + + 58c5dbae-abef-11e0-8cfe-09039844ac7d + + diff --git a/testbed/boto__botocore/tests/unit/retries/__init__.py b/testbed/boto__botocore/tests/unit/retries/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/boto__botocore/tests/unit/retries/test_adaptive.py b/testbed/boto__botocore/tests/unit/retries/test_adaptive.py new file mode 100644 index 0000000000000000000000000000000000000000..72be1bd405b2b35dfa213383c536b85562738a8e --- /dev/null +++ b/testbed/boto__botocore/tests/unit/retries/test_adaptive.py @@ -0,0 +1,167 @@ +from botocore.retries import adaptive, bucket, standard, throttling +from tests import mock, unittest + + +class FakeClock(bucket.Clock): + def __init__(self, timestamp_sequences): + self.timestamp_sequences = timestamp_sequences + self.sleep_call_amounts = [] + + def sleep(self, amount): + self.sleep_call_amounts.append(amount) + + def current_time(self): + return self.timestamp_sequences.pop(0) + + +class TestCanCreateRetryHandler(unittest.TestCase): + def test_can_register_retry_handler(self): + client = mock.Mock() + limiter = adaptive.register_retry_handler(client) + self.assertEqual( + client.meta.events.register.call_args_list, + [ + mock.call('before-send', limiter.on_sending_request), + mock.call('needs-retry', limiter.on_receiving_response), + ], + ) + + +class TestClientRateLimiter(unittest.TestCase): + def setUp(self): + self.timestamp_sequences = [0] + self.clock = FakeClock(self.timestamp_sequences) + self.token_bucket = mock.Mock(spec=bucket.TokenBucket) + self.rate_adjustor = mock.Mock(spec=throttling.CubicCalculator) + self.rate_clocker = mock.Mock(spec=adaptive.RateClocker) + self.throttling_detector = mock.Mock( + spec=standard.ThrottlingErrorDetector + ) + + def create_client_limiter(self): + rate_limiter = adaptive.ClientRateLimiter( + rate_adjustor=self.rate_adjustor, + rate_clocker=self.rate_clocker, + token_bucket=self.token_bucket, + throttling_detector=self.throttling_detector, + clock=self.clock, + ) + return rate_limiter + + def test_bucket_bucket_acquisition_only_if_enabled(self): + rate_limiter = self.create_client_limiter() + rate_limiter.on_sending_request(request=mock.sentinel.request) + self.assertFalse(self.token_bucket.acquire.called) + + def test_token_bucket_enabled_on_throttling_error(self): + rate_limiter = self.create_client_limiter() + self.throttling_detector.is_throttling_error.return_value = True + self.rate_clocker.record.return_value = 21 + self.rate_adjustor.error_received.return_value = 17 + rate_limiter.on_receiving_response() + # Now if we call on_receiving_response we should try to acquire + # token. + self.timestamp_sequences.append(1) + rate_limiter.on_sending_request(request=mock.sentinel.request) + self.assertTrue(self.token_bucket.acquire.called) + + def test_max_rate_updated_on_success_response(self): + rate_limiter = self.create_client_limiter() + self.throttling_detector.is_throttling_error.return_value = False + self.rate_adjustor.success_received.return_value = 20 + self.rate_clocker.record.return_value = 21 + rate_limiter.on_receiving_response() + self.assertEqual(self.token_bucket.max_rate, 20) + + def test_max_rate_cant_exceed_20_percent_max(self): + rate_limiter = self.create_client_limiter() + self.throttling_detector.is_throttling_error.return_value = False + # So if our actual measured sending rate is 20 TPS + self.rate_clocker.record.return_value = 20 + # But the rate adjustor is telling us to go up to 100 TPS + self.rate_adjustor.success_received.return_value = 100 + + # The most we should go up is 2.0 * 20 + rate_limiter.on_receiving_response() + self.assertEqual(self.token_bucket.max_rate, 2.0 * 20) + + +class TestRateClocker(unittest.TestCase): + def setUp(self): + self.timestamp_sequences = [0] + self.clock = FakeClock(self.timestamp_sequences) + self.rate_measure = adaptive.RateClocker(self.clock) + self.smoothing = 0.8 + + def test_initial_rate_is_0(self): + self.assertEqual(self.rate_measure.measured_rate, 0) + + def test_time_updates_if_after_bucket_range(self): + self.timestamp_sequences.append(1) + # This should be 1 * 0.8 + 0 * 0.2, or just 0.8 + self.assertEqual(self.rate_measure.record(), 0.8) + + def test_can_measure_constant_rate(self): + # Timestamps of 1 every second indicate a rate of 1 TPS. + self.timestamp_sequences.extend(range(1, 21)) + for _ in range(20): + self.rate_measure.record() + self.assertAlmostEqual(self.rate_measure.measured_rate, 1) + + def test_uses_smoothing_to_favor_recent_weights(self): + self.timestamp_sequences.extend( + [ + 1, + 1.5, + 2, + 2.5, + 3, + 3.5, + 4, + # If we now wait 10 seconds (.1 TPS), + # our rate is somewhere between 2 TPS and .1 TPS. + 14, + ] + ) + for _ in range(7): + self.rate_measure.record() + # We should almost be at 2.0 but not quite. + self.assertGreaterEqual(self.rate_measure.measured_rate, 1.99) + self.assertLessEqual(self.rate_measure.measured_rate, 2.0) + # With our last recording we now drop down between 0.1 and 2 + # depending on our smoothing factor. + self.rate_measure.record() + self.assertGreaterEqual(self.rate_measure.measured_rate, 0.1) + self.assertLessEqual(self.rate_measure.measured_rate, 2.0) + + def test_noop_when_delta_t_is_0(self): + self.timestamp_sequences.extend([1, 1, 1, 2, 3]) + for _ in range(5): + self.rate_measure.record() + self.assertGreaterEqual(self.rate_measure.measured_rate, 1.0) + + def test_times_are_grouped_per_time_bucket(self): + # Using our default of 0.5 time buckets, we have: + self.timestamp_sequences.extend( + [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.49, + ] + ) + for _ in range(len(self.timestamp_sequences)): + self.rate_measure.record() + # This is showing the tradeoff we're making with measuring rates. + # we're currently in the window from 0 <= x < 0.5, which means + # we use the rate from the previous bucket, which is 0: + self.assertEqual(self.rate_measure.measured_rate, 0) + # However if we now add a new measurement that's in the next + # time bucket 0.5 <= x < 1.0 + # we'll use the range from the previous bucket: + self.timestamp_sequences.append(0.5) + self.rate_measure.record() + # And our previous bucket will be: + # 12 * 0.8 + 0.2 * 0 + self.assertEqual(self.rate_measure.measured_rate, 12 * 0.8) diff --git a/testbed/boto__botocore/tests/unit/retries/test_special.py b/testbed/boto__botocore/tests/unit/retries/test_special.py new file mode 100644 index 0000000000000000000000000000000000000000..daf8d6b40db1e2c3bbf0d3f3cbeaa4d3fb26b33a --- /dev/null +++ b/testbed/boto__botocore/tests/unit/retries/test_special.py @@ -0,0 +1,143 @@ +from botocore.awsrequest import AWSResponse +from botocore.retries import special, standard +from tests import mock, unittest + + +def create_fake_op_model(service_name): + model = mock.Mock() + model.service_model.service_name = service_name + return model + + +class TestRetryIDPCommunicationError(unittest.TestCase): + def setUp(self): + self.checker = special.RetryIDPCommunicationError() + + def test_only_retries_error_for_sts(self): + context = standard.RetryContext( + attempt_number=1, + operation_model=create_fake_op_model('s3'), + parsed_response={ + 'Error': { + 'Code': 'IDPCommunicationError', + 'Message': 'message', + } + }, + http_response=AWSResponse( + status_code=400, raw=None, headers={}, url='https://foo' + ), + caught_exception=None, + ) + self.assertFalse(self.checker.is_retryable(context)) + + def test_can_retry_idp_communication_error(self): + context = standard.RetryContext( + attempt_number=1, + operation_model=create_fake_op_model('sts'), + parsed_response={ + 'Error': { + 'Code': 'IDPCommunicationError', + 'Message': 'message', + } + }, + http_response=AWSResponse( + status_code=400, raw=None, headers={}, url='https://foo' + ), + caught_exception=None, + ) + self.assertTrue(self.checker.is_retryable(context)) + + def test_not_idp_communication_error(self): + context = standard.RetryContext( + attempt_number=1, + operation_model=create_fake_op_model('sts'), + parsed_response={ + 'Error': { + 'Code': 'NotIDPCommunicationError', + 'Message': 'message', + } + }, + http_response=AWSResponse( + status_code=400, raw=None, headers={}, url='https://foo' + ), + caught_exception=None, + ) + self.assertFalse(self.checker.is_retryable(context)) + + +class TestRetryDDBChecksumError(unittest.TestCase): + def setUp(self): + self.checker = special.RetryDDBChecksumError() + + def raw_stream(self, contents): + raw = mock.Mock() + raw.stream.return_value = [contents] + return raw + + def test_checksum_not_in_header(self): + context = standard.RetryContext( + attempt_number=1, + operation_model=create_fake_op_model('dynamodb'), + parsed_response={ + 'Anything': ["foo"], + }, + http_response=AWSResponse( + status_code=200, + raw=self.raw_stream(b'foo'), + headers={}, + url='https://foo', + ), + caught_exception=None, + ) + self.assertFalse(self.checker.is_retryable(context)) + + def test_checksum_matches(self): + context = standard.RetryContext( + attempt_number=1, + operation_model=create_fake_op_model('dynamodb'), + parsed_response={ + 'Anything': ["foo"], + }, + http_response=AWSResponse( + status_code=200, + raw=self.raw_stream(b'foo'), + headers={'x-amz-crc32': '2356372769'}, + url='https://foo', + ), + caught_exception=None, + ) + self.assertFalse(self.checker.is_retryable(context)) + + def test_checksum_not_matches(self): + context = standard.RetryContext( + attempt_number=1, + operation_model=create_fake_op_model('dynamodb'), + parsed_response={ + 'Anything': ["foo"], + }, + http_response=AWSResponse( + status_code=200, + raw=self.raw_stream(b'foo'), + headers={'x-amz-crc32': '2356372768'}, + url='https://foo', + ), + caught_exception=None, + ) + self.assertTrue(self.checker.is_retryable(context)) + + def test_checksum_check_only_for_dynamodb(self): + context = standard.RetryContext( + attempt_number=1, + operation_model=create_fake_op_model('s3'), + parsed_response={ + 'Anything': ["foo"], + }, + http_response=AWSResponse( + status_code=200, + raw=self.raw_stream(b'foo'), + headers={'x-amz-crc32': '2356372768'}, + url='https://foo', + ), + caught_exception=None, + ) + self.assertFalse(self.checker.is_retryable(context)) diff --git a/testbed/boto__botocore/tests/unit/test_args.py b/testbed/boto__botocore/tests/unit/test_args.py new file mode 100644 index 0000000000000000000000000000000000000000..9338b053718ec46ee45e4e328d6f603719e96996 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_args.py @@ -0,0 +1,844 @@ +#!/usr/bin/env +# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import socket + +from botocore import args, exceptions +from botocore.client import ClientEndpointBridge +from botocore.config import Config +from botocore.configprovider import ConfigValueStore +from botocore.hooks import HierarchicalEmitter +from botocore.model import ServiceModel +from botocore.useragent import UserAgentString +from tests import mock, unittest + + +class TestCreateClientArgs(unittest.TestCase): + def setUp(self): + self.event_emitter = mock.Mock(HierarchicalEmitter) + self.config_store = ConfigValueStore() + user_agent_creator = UserAgentString( + platform_name=None, + platform_version=None, + platform_machine=None, + python_version=None, + python_implementation=None, + execution_env=None, + crt_version=None, + ) + self.args_create = args.ClientArgsCreator( + event_emitter=self.event_emitter, + user_agent=None, + response_parser_factory=None, + loader=None, + exceptions_factory=None, + config_store=self.config_store, + user_agent_creator=user_agent_creator, + ) + self.service_name = 'ec2' + self.region = 'us-west-2' + self.endpoint_url = 'https://ec2/' + self.service_model = self._get_service_model() + self.bridge = mock.Mock(ClientEndpointBridge) + self._set_endpoint_bridge_resolve() + self._set_resolver_uses_builtin() + self.default_socket_options = [ + (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + ] + + def _get_service_model(self, service_name=None): + if service_name is None: + service_name = self.service_name + service_model = mock.Mock(ServiceModel) + service_model.service_name = service_name + service_model.endpoint_prefix = service_name + service_model.metadata = { + 'serviceFullName': 'MyService', + 'protocol': 'query', + } + service_model.operation_names = [] + return service_model + + def _set_endpoint_bridge_resolve(self, **override_kwargs): + ret_val = { + 'region_name': self.region, + 'signature_version': 'v4', + 'endpoint_url': self.endpoint_url, + 'signing_name': self.service_name, + 'signing_region': self.region, + 'metadata': {}, + } + ret_val.update(**override_kwargs) + self.bridge.resolve.return_value = ret_val + + def _set_resolver_uses_builtin(self, uses_builtin=True): + self.bridge.resolver_uses_builtin_data.return_value = uses_builtin + + def call_get_client_args(self, **override_kwargs): + call_kwargs = { + 'service_model': self.service_model, + 'region_name': self.region, + 'is_secure': True, + 'endpoint_url': self.endpoint_url, + 'verify': True, + 'credentials': None, + 'scoped_config': {}, + 'client_config': None, + 'endpoint_bridge': self.bridge, + 'endpoints_ruleset_data': { + 'version': '1.0', + 'parameters': {}, + 'rules': [], + }, + 'partition_data': {}, + } + call_kwargs.update(**override_kwargs) + return self.args_create.get_client_args(**call_kwargs) + + def assert_create_endpoint_call(self, mock_endpoint, **override_kwargs): + call_kwargs = { + 'endpoint_url': self.endpoint_url, + 'region_name': self.region, + 'response_parser_factory': None, + 'timeout': (60, 60), + 'verify': True, + 'max_pool_connections': 10, + 'proxies': None, + 'proxies_config': None, + 'socket_options': self.default_socket_options, + 'client_cert': None, + } + call_kwargs.update(**override_kwargs) + mock_endpoint.return_value.create_endpoint.assert_called_with( + self.service_model, **call_kwargs + ) + + def test_compute_s3_configuration(self): + self.assertIsNone(self.args_create.compute_s3_config(None)) + + def test_compute_s3_config_only_config_store(self): + self.config_store.set_config_variable( + 's3', {'use_accelerate_endpoint': True} + ) + self.assertEqual( + self.args_create.compute_s3_config(None), + {'use_accelerate_endpoint': True}, + ) + + def test_client_s3_accelerate_from_client_config(self): + self.assertEqual( + self.args_create.compute_s3_config( + client_config=Config(s3={'use_accelerate_endpoint': True}) + ), + {'use_accelerate_endpoint': True}, + ) + + def test_client_s3_accelerate_client_config_overrides_config_store(self): + self.config_store.set_config_variable( + 's3', {'use_accelerate_endpoint': False} + ) + self.assertEqual( + self.args_create.compute_s3_config( + client_config=Config(s3={'use_accelerate_endpoint': True}) + ), + # client_config beats scoped_config + {'use_accelerate_endpoint': True}, + ) + + def test_max_pool_from_client_config_forwarded_to_endpoint_creator(self): + config = Config(max_pool_connections=20) + with mock.patch('botocore.args.EndpointCreator') as m: + self.call_get_client_args(client_config=config) + self.assert_create_endpoint_call(m, max_pool_connections=20) + + def test_proxies_from_client_config_forwarded_to_endpoint_creator(self): + proxies = { + 'http': 'http://foo.bar:1234', + 'https': 'https://foo.bar:4321', + } + config = Config(proxies=proxies) + with mock.patch('botocore.args.EndpointCreator') as m: + self.call_get_client_args(client_config=config) + self.assert_create_endpoint_call(m, proxies=proxies) + + def test_s3_with_endpoint_url_still_resolves_region(self): + self.service_model.endpoint_prefix = 's3' + self.service_model.metadata = {'protocol': 'rest-xml'} + self.bridge.resolve.side_effect = [ + { + 'region_name': None, + 'signature_version': 's3v4', + 'endpoint_url': 'http://other.com/', + 'signing_name': 's3', + 'signing_region': None, + 'metadata': {}, + }, + { + 'region_name': 'us-west-2', + 'signature_version': 's3v4', + 'endpoint_url': 'https://s3-us-west-2.amazonaws.com', + 'signing_name': 's3', + 'signing_region': 'us-west-2', + 'metadata': {}, + }, + ] + client_args = self.call_get_client_args( + endpoint_url='http://other.com/' + ) + self.assertEqual(client_args['client_config'].region_name, 'us-west-2') + + def test_region_does_not_resolve_if_not_s3_and_endpoint_url_provided(self): + self.service_model.endpoint_prefix = 'ec2' + self.service_model.metadata = {'protocol': 'query'} + self.bridge.resolve.side_effect = [ + { + 'region_name': None, + 'signature_version': 'v4', + 'endpoint_url': 'http://other.com/', + 'signing_name': 'ec2', + 'signing_region': None, + 'metadata': {}, + } + ] + client_args = self.call_get_client_args( + endpoint_url='http://other.com/' + ) + self.assertEqual(client_args['client_config'].region_name, None) + + def test_tcp_keepalive_enabled_scoped_config(self): + scoped_config = {'tcp_keepalive': 'true'} + with mock.patch('botocore.args.EndpointCreator') as m: + self.call_get_client_args(scoped_config=scoped_config) + self.assert_create_endpoint_call( + m, + socket_options=self.default_socket_options + + [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)], + ) + + def test_tcp_keepalive_not_specified(self): + with mock.patch('botocore.args.EndpointCreator') as m: + self.call_get_client_args(scoped_config={}, client_config=None) + self.assert_create_endpoint_call( + m, socket_options=self.default_socket_options + ) + self.call_get_client_args( + scoped_config=None, client_config=Config() + ) + self.assert_create_endpoint_call( + m, socket_options=self.default_socket_options + ) + + def test_tcp_keepalive_enabled_if_set_anywhere(self): + with mock.patch('botocore.args.EndpointCreator') as m: + self.call_get_client_args( + scoped_config={'tcp_keepalive': 'true'}, + client_config=Config(tcp_keepalive=False), + ) + self.assert_create_endpoint_call( + m, + socket_options=self.default_socket_options + + [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)], + ) + self.call_get_client_args( + scoped_config={'tcp_keepalive': 'false'}, + client_config=Config(tcp_keepalive=True), + ) + self.assert_create_endpoint_call( + m, + socket_options=self.default_socket_options + + [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)], + ) + + def test_tcp_keepalive_explicitly_disabled(self): + scoped_config = {'tcp_keepalive': 'false'} + with mock.patch('botocore.args.EndpointCreator') as m: + self.call_get_client_args(scoped_config=scoped_config) + self.assert_create_endpoint_call( + m, socket_options=self.default_socket_options + ) + + def test_tcp_keepalive_enabled_case_insensitive(self): + scoped_config = {'tcp_keepalive': 'True'} + with mock.patch('botocore.args.EndpointCreator') as m: + self.call_get_client_args(scoped_config=scoped_config) + self.assert_create_endpoint_call( + m, + socket_options=self.default_socket_options + + [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)], + ) + + def test_client_config_has_use_dualstack_endpoint_flag(self): + self._set_endpoint_bridge_resolve(metadata={'tags': ['dualstack']}) + client_args = self.call_get_client_args( + service_model=self._get_service_model('ec2'), + ) + self.assertTrue(client_args['client_config'].use_dualstack_endpoint) + + def test_client_config_has_use_fips_endpoint_flag(self): + self._set_endpoint_bridge_resolve(metadata={'tags': ['fips']}) + client_args = self.call_get_client_args( + service_model=self._get_service_model('ec2'), + ) + self.assertTrue(client_args['client_config'].use_fips_endpoint) + + def test_client_config_has_both_use_fips_and_use_dualstack__endpoint_flags( + self, + ): + self._set_endpoint_bridge_resolve( + metadata={'tags': ['fips', 'dualstack']} + ) + client_args = self.call_get_client_args( + service_model=self._get_service_model('ec2'), + ) + self.assertTrue(client_args['client_config'].use_fips_endpoint) + self.assertTrue(client_args['client_config'].use_dualstack_endpoint) + + def test_s3_override_use_dualstack_endpoint_flag(self): + self._set_endpoint_bridge_resolve(metadata={'tags': ['dualstack']}) + client_args = self.call_get_client_args( + service_model=self._get_service_model('s3'), + ) + self.assertTrue( + client_args['client_config'].s3['use_dualstack_endpoint'] + ) + + def test_sts_override_resolved_endpoint_for_legacy_region(self): + self.config_store.set_config_variable( + 'sts_regional_endpoints', 'legacy' + ) + client_args = self.call_get_client_args( + service_model=self._get_service_model('sts'), + region_name='us-west-2', + endpoint_url=None, + ) + self.assertEqual( + client_args['endpoint'].host, 'https://sts.amazonaws.com' + ) + self.assertEqual( + client_args['request_signer'].region_name, 'us-east-1' + ) + + def test_sts_use_resolved_endpoint_for_nonlegacy_region(self): + resolved_endpoint = 'https://resolved-endpoint' + resolved_region = 'resolved-region' + self._set_endpoint_bridge_resolve( + endpoint_url=resolved_endpoint, signing_region=resolved_region + ) + self.config_store.set_config_variable( + 'sts_regional_endpoints', 'legacy' + ) + client_args = self.call_get_client_args( + service_model=self._get_service_model('sts'), + region_name='ap-east-1', + endpoint_url=None, + ) + self.assertEqual(client_args['endpoint'].host, resolved_endpoint) + self.assertEqual( + client_args['request_signer'].region_name, resolved_region + ) + + def test_sts_use_resolved_endpoint_for_regional_configuration(self): + resolved_endpoint = 'https://resolved-endpoint' + resolved_region = 'resolved-region' + self._set_endpoint_bridge_resolve( + endpoint_url=resolved_endpoint, signing_region=resolved_region + ) + self.config_store.set_config_variable( + 'sts_regional_endpoints', 'regional' + ) + client_args = self.call_get_client_args( + service_model=self._get_service_model('sts'), + region_name='us-west-2', + endpoint_url=None, + ) + self.assertEqual(client_args['endpoint'].host, resolved_endpoint) + self.assertEqual( + client_args['request_signer'].region_name, resolved_region + ) + + def test_sts_with_endpoint_override_and_legacy_configured(self): + override_endpoint = 'https://override-endpoint' + self._set_endpoint_bridge_resolve(endpoint_url=override_endpoint) + self.config_store.set_config_variable( + 'sts_regional_endpoints', 'legacy' + ) + client_args = self.call_get_client_args( + service_model=self._get_service_model('sts'), + region_name='us-west-2', + endpoint_url=override_endpoint, + ) + self.assertEqual(client_args['endpoint'].host, override_endpoint) + + def test_sts_http_scheme_for_override_endpoint(self): + self.config_store.set_config_variable( + 'sts_regional_endpoints', 'legacy' + ) + client_args = self.call_get_client_args( + service_model=self._get_service_model('sts'), + region_name='us-west-2', + endpoint_url=None, + is_secure=False, + ) + self.assertEqual( + client_args['endpoint'].host, 'http://sts.amazonaws.com' + ) + + def test_sts_regional_endpoints_defaults_to_legacy_if_not_set(self): + self.config_store.set_config_variable('sts_regional_endpoints', None) + client_args = self.call_get_client_args( + service_model=self._get_service_model('sts'), + region_name='us-west-2', + endpoint_url=None, + ) + self.assertEqual( + client_args['endpoint'].host, 'https://sts.amazonaws.com' + ) + self.assertEqual( + client_args['request_signer'].region_name, 'us-east-1' + ) + + def test_invalid_sts_regional_endpoints(self): + self.config_store.set_config_variable( + 'sts_regional_endpoints', 'invalid' + ) + with self.assertRaises( + exceptions.InvalidSTSRegionalEndpointsConfigError + ): + self.call_get_client_args( + service_model=self._get_service_model('sts'), + region_name='us-west-2', + endpoint_url=None, + ) + + def test_provides_total_max_attempts(self): + config = Config(retries={'total_max_attempts': 10}) + client_args = self.call_get_client_args(client_config=config) + self.assertEqual( + client_args['client_config'].retries['total_max_attempts'], 10 + ) + + def test_provides_total_max_attempts_has_precedence(self): + config = Config(retries={'total_max_attempts': 10, 'max_attempts': 5}) + client_args = self.call_get_client_args(client_config=config) + self.assertEqual( + client_args['client_config'].retries['total_max_attempts'], 10 + ) + self.assertNotIn('max_attempts', client_args['client_config'].retries) + + def test_provide_retry_config_maps_total_max_attempts(self): + config = Config(retries={'max_attempts': 10}) + client_args = self.call_get_client_args(client_config=config) + self.assertEqual( + client_args['client_config'].retries['total_max_attempts'], 11 + ) + self.assertNotIn('max_attempts', client_args['client_config'].retries) + + def test_can_merge_max_attempts(self): + self.config_store.set_config_variable('max_attempts', 4) + config = self.call_get_client_args()['client_config'] + self.assertEqual(config.retries['total_max_attempts'], 4) + + def test_uses_config_value_if_present_for_max_attempts(self): + config = self.call_get_client_args( + client_config=Config(retries={'max_attempts': 2}) + )['client_config'] + self.assertEqual(config.retries['total_max_attempts'], 3) + + def test_uses_client_config_over_config_store_max_attempts(self): + self.config_store.set_config_variable('max_attempts', 4) + config = self.call_get_client_args( + client_config=Config(retries={'max_attempts': 2}) + )['client_config'] + self.assertEqual(config.retries['total_max_attempts'], 3) + + def test_uses_client_config_total_over_config_store_max_attempts(self): + self.config_store.set_config_variable('max_attempts', 4) + config = self.call_get_client_args( + client_config=Config(retries={'total_max_attempts': 2}) + )['client_config'] + self.assertEqual(config.retries['total_max_attempts'], 2) + + def test_max_attempts_unset_if_retries_is_none(self): + config = self.call_get_client_args(client_config=Config(retries=None))[ + 'client_config' + ] + self.assertEqual(config.retries, {'mode': 'legacy'}) + + def test_retry_mode_set_on_config_store(self): + self.config_store.set_config_variable('retry_mode', 'standard') + config = self.call_get_client_args()['client_config'] + self.assertEqual(config.retries['mode'], 'standard') + + def test_retry_mode_set_on_client_config(self): + config = self.call_get_client_args( + client_config=Config(retries={'mode': 'standard'}) + )['client_config'] + self.assertEqual(config.retries['mode'], 'standard') + + def test_connect_timeout_set_on_config_store(self): + self.config_store.set_config_variable('connect_timeout', 10) + config = self.call_get_client_args( + client_config=Config(defaults_mode='standard') + )['client_config'] + self.assertEqual(config.connect_timeout, 10) + + def test_connnect_timeout_set_on_client_config(self): + config = self.call_get_client_args( + client_config=Config(connect_timeout=10) + )['client_config'] + self.assertEqual(config.connect_timeout, 10) + + def test_connnect_timeout_set_to_client_config_default(self): + config = self.call_get_client_args()['client_config'] + self.assertEqual(config.connect_timeout, 60) + + def test_client_config_beats_config_store(self): + self.config_store.set_config_variable('retry_mode', 'adaptive') + config = self.call_get_client_args( + client_config=Config(retries={'mode': 'standard'}) + )['client_config'] + self.assertEqual(config.retries['mode'], 'standard') + + def test_creates_ruleset_resolver_if_given_data(self): + with mock.patch('botocore.args.EndpointRulesetResolver') as m: + self.call_get_client_args( + service_model=self._get_service_model('s3'), + endpoints_ruleset_data={ + 'version': '1.0', + 'parameters': {}, + 'rules': [], + }, + ) + m.assert_called_once() + + def test_doesnt_create_ruleset_resolver_if_not_given_data(self): + with mock.patch('botocore.args.EndpointRulesetResolver') as m: + self.call_get_client_args( + service_model=self._get_service_model('s3'), + endpoints_ruleset_data=None, + ) + m.assert_not_called() + + def test_request_compression_client_config(self): + input_config = Config( + disable_request_compression=True, + request_min_compression_size_bytes=100, + ) + client_args = self.call_get_client_args(client_config=input_config) + config = client_args['client_config'] + self.assertEqual(config.request_min_compression_size_bytes, 100) + self.assertTrue(config.disable_request_compression) + + def test_request_compression_config_store(self): + self.config_store.set_config_variable( + 'request_min_compression_size_bytes', 100 + ) + self.config_store.set_config_variable( + 'disable_request_compression', True + ) + config = self.call_get_client_args()['client_config'] + self.assertEqual(config.request_min_compression_size_bytes, 100) + self.assertTrue(config.disable_request_compression) + + def test_request_compression_client_config_overrides_config_store(self): + self.config_store.set_config_variable( + 'request_min_compression_size_bytes', 100 + ) + self.config_store.set_config_variable( + 'disable_request_compression', True + ) + input_config = Config( + disable_request_compression=False, + request_min_compression_size_bytes=1, + ) + client_args = self.call_get_client_args(client_config=input_config) + config = client_args['client_config'] + self.assertEqual(config.request_min_compression_size_bytes, 1) + self.assertFalse(config.disable_request_compression) + + def test_coercible_value_request_min_compression_size_bytes(self): + config = Config(request_min_compression_size_bytes='100') + client_args = self.call_get_client_args(client_config=config) + config = client_args['client_config'] + self.assertEqual(config.request_min_compression_size_bytes, 100) + + def test_coercible_value_disable_request_compression(self): + config = Config(disable_request_compression='true') + client_args = self.call_get_client_args(client_config=config) + config = client_args['client_config'] + self.assertTrue(config.disable_request_compression) + + def test_bad_type_request_min_compression_size_bytes(self): + with self.assertRaises(exceptions.InvalidConfigError): + config = Config(request_min_compression_size_bytes='foo') + self.call_get_client_args(client_config=config) + self.config_store.set_config_variable( + 'request_min_compression_size_bytes', 'foo' + ) + with self.assertRaises(exceptions.InvalidConfigError): + self.call_get_client_args() + + def test_low_min_request_min_compression_size_bytes(self): + with self.assertRaises(exceptions.InvalidConfigError): + config = Config(request_min_compression_size_bytes=0) + self.call_get_client_args(client_config=config) + self.config_store.set_config_variable( + 'request_min_compression_size_bytes', 0 + ) + with self.assertRaises(exceptions.InvalidConfigError): + self.call_get_client_args() + + def test_high_max_request_min_compression_size_bytes(self): + with self.assertRaises(exceptions.InvalidConfigError): + config = Config(request_min_compression_size_bytes=9999999) + self.call_get_client_args(client_config=config) + self.config_store.set_config_variable( + 'request_min_compression_size_bytes', 9999999 + ) + with self.assertRaises(exceptions.InvalidConfigError): + self.call_get_client_args() + + def test_bad_value_disable_request_compression(self): + input_config = Config(disable_request_compression='foo') + client_args = self.call_get_client_args(client_config=input_config) + config = client_args['client_config'] + self.assertFalse(config.disable_request_compression) + + +class TestEndpointResolverBuiltins(unittest.TestCase): + def setUp(self): + event_emitter = mock.Mock(HierarchicalEmitter) + self.config_store = ConfigValueStore() + user_agent_creator = UserAgentString( + platform_name=None, + platform_version=None, + platform_machine=None, + python_version=None, + python_implementation=None, + execution_env=None, + crt_version=None, + ) + self.args_create = args.ClientArgsCreator( + event_emitter=event_emitter, + user_agent=None, + response_parser_factory=None, + loader=None, + exceptions_factory=None, + config_store=self.config_store, + user_agent_creator=user_agent_creator, + ) + self.bridge = ClientEndpointBridge( + endpoint_resolver=mock.Mock(), + scoped_config=None, + client_config=Config(), + default_endpoint=None, + service_signing_name=None, + config_store=self.config_store, + ) + # assume a legacy endpoint resolver that uses the builtin + # endpoints.json file + self.bridge.endpoint_resolver.uses_builtin_data = True + + def call_compute_endpoint_resolver_builtin_defaults(self, **overrides): + defaults = { + 'region_name': 'ca-central-1', + 'service_name': 'fooservice', + 's3_config': {}, + 'endpoint_bridge': self.bridge, + 'client_endpoint_url': None, + 'legacy_endpoint_url': 'https://my.legacy.endpoint.com', + } + kwargs = {**defaults, **overrides} + return self.args_create.compute_endpoint_resolver_builtin_defaults( + **kwargs + ) + + def test_builtins_defaults(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults() + + self.assertEqual(bins['AWS::Region'], 'ca-central-1') + self.assertEqual(bins['AWS::UseFIPS'], False) + self.assertEqual(bins['AWS::UseDualStack'], False) + self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], True) + self.assertEqual(bins['AWS::S3::UseGlobalEndpoint'], False) + self.assertEqual(bins['AWS::S3::Accelerate'], False) + self.assertEqual(bins['AWS::S3::ForcePathStyle'], False) + self.assertEqual(bins['AWS::S3::UseArnRegion'], True) + self.assertEqual(bins['AWS::S3Control::UseArnRegion'], False) + self.assertEqual( + bins['AWS::S3::DisableMultiRegionAccessPoints'], False + ) + self.assertEqual(bins['SDK::Endpoint'], None) + + def test_aws_region(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + region_name='my-region-1', + ) + self.assertEqual(bins['AWS::Region'], 'my-region-1') + + def test_aws_use_fips_when_config_is_set_true(self): + self.config_store.set_config_variable('use_fips_endpoint', True) + bins = self.call_compute_endpoint_resolver_builtin_defaults() + self.assertEqual(bins['AWS::UseFIPS'], True) + + def test_aws_use_fips_when_config_is_set_false(self): + self.config_store.set_config_variable('use_fips_endpoint', False) + bins = self.call_compute_endpoint_resolver_builtin_defaults() + self.assertEqual(bins['AWS::UseFIPS'], False) + + def test_aws_use_dualstack_when_config_is_set_true(self): + self.bridge.client_config = Config(s3={'use_dualstack_endpoint': True}) + bins = self.call_compute_endpoint_resolver_builtin_defaults( + service_name='s3-control' + ) + self.assertEqual(bins['AWS::UseDualStack'], True) + + def test_aws_use_dualstack_when_config_is_set_false(self): + self.bridge.client_config = Config( + s3={'use_dualstack_endpoint': False} + ) + bins = self.call_compute_endpoint_resolver_builtin_defaults( + service_name='s3-control' + ) + self.assertEqual(bins['AWS::UseDualStack'], False) + + def test_aws_use_dualstack_when_non_dualstack_service(self): + self.bridge.client_config = Config(s3={'use_dualstack_endpoint': True}) + bins = self.call_compute_endpoint_resolver_builtin_defaults( + service_name='other-service' + ) + self.assertEqual(bins['AWS::UseDualStack'], False) + + def test_aws_sts_global_endpoint_with_default_and_legacy_region(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + region_name='us-west-2', + ) + self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], True) + + def test_aws_sts_global_endpoint_with_default_and_nonlegacy_region(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + region_name='eu-south-1', + ) + self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], False) + + def test_aws_sts_global_endpoint_with_nondefault_config(self): + self.config_store.set_config_variable( + 'sts_regional_endpoints', 'regional' + ) + bins = self.call_compute_endpoint_resolver_builtin_defaults( + region_name='us-west-2', + ) + self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], False) + + def test_s3_global_endpoint(self): + # The only reason for this builtin to not have the default value + # (False) is that the ``_should_force_s3_global`` method + # returns True. + self.args_create._should_force_s3_global = mock.Mock(return_value=True) + bins = self.call_compute_endpoint_resolver_builtin_defaults() + self.assertTrue(bins['AWS::S3::UseGlobalEndpoint']) + self.args_create._should_force_s3_global.assert_called_once() + + def test_s3_accelerate_with_config_set_true(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'use_accelerate_endpoint': True}, + ) + self.assertEqual(bins['AWS::S3::Accelerate'], True) + + def test_s3_accelerate_with_config_set_false(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'use_accelerate_endpoint': False}, + ) + self.assertEqual(bins['AWS::S3::Accelerate'], False) + + def test_force_path_style_with_config_set_to_path(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'addressing_style': 'path'}, + ) + self.assertEqual(bins['AWS::S3::ForcePathStyle'], True) + + def test_force_path_style_with_config_set_to_auto(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'addressing_style': 'auto'}, + ) + self.assertEqual(bins['AWS::S3::ForcePathStyle'], False) + + def test_force_path_style_with_config_set_to_virtual(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'addressing_style': 'virtual'}, + ) + self.assertEqual(bins['AWS::S3::ForcePathStyle'], False) + + def test_use_arn_region_with_config_set_false(self): + # These two builtins both take their value from the ``use_arn_region`` + # in the S3 configuration, but have different default values. + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'use_arn_region': False}, + ) + self.assertEqual(bins['AWS::S3::UseArnRegion'], False) + self.assertEqual(bins['AWS::S3Control::UseArnRegion'], False) + + def test_use_arn_region_with_config_set_true(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'use_arn_region': True}, + ) + self.assertEqual(bins['AWS::S3::UseArnRegion'], True) + self.assertEqual(bins['AWS::S3Control::UseArnRegion'], True) + + def test_disable_mrap_with_config_set_true(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'s3_disable_multiregion_access_points': True}, + ) + self.assertEqual(bins['AWS::S3::DisableMultiRegionAccessPoints'], True) + + def test_disable_mrap_with_config_set_false(self): + bins = self.call_compute_endpoint_resolver_builtin_defaults( + s3_config={'s3_disable_multiregion_access_points': False}, + ) + self.assertEqual( + bins['AWS::S3::DisableMultiRegionAccessPoints'], False + ) + + def test_sdk_endpoint_both_inputs_set(self): + # assume a legacy endpoint resolver that uses a customized + # endpoints.json file + self.bridge.endpoint_resolver.uses_builtin_data = False + bins = self.call_compute_endpoint_resolver_builtin_defaults( + client_endpoint_url='https://my.client.endpoint.com', + legacy_endpoint_url='https://my.legacy.endpoint.com', + ) + self.assertEqual( + bins['SDK::Endpoint'], 'https://my.client.endpoint.com' + ) + + def test_sdk_endpoint_legacy_set_with_builtin_data(self): + # assume a legacy endpoint resolver that uses a customized + # endpoints.json file + self.bridge.endpoint_resolver.uses_builtin_data = False + bins = self.call_compute_endpoint_resolver_builtin_defaults( + client_endpoint_url=None, + legacy_endpoint_url='https://my.legacy.endpoint.com', + ) + self.assertEqual( + bins['SDK::Endpoint'], 'https://my.legacy.endpoint.com' + ) + + def test_sdk_endpoint_legacy_set_without_builtin_data(self): + # assume a legacy endpoint resolver that uses the builtin + # endpoints.json file + self.bridge.endpoint_resolver.uses_builtin_data = True + bins = self.call_compute_endpoint_resolver_builtin_defaults( + client_endpoint_url=None, + legacy_endpoint_url='https://my.legacy.endpoint.com', + ) + self.assertEqual(bins['SDK::Endpoint'], None) diff --git a/testbed/boto__botocore/tests/unit/test_auth_bearer.py b/testbed/boto__botocore/tests/unit/test_auth_bearer.py new file mode 100644 index 0000000000000000000000000000000000000000..898da57960d55c933758656aefacb7e20ad04476 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_auth_bearer.py @@ -0,0 +1,72 @@ +# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import pytest + +from botocore.auth import BearerAuth +from botocore.awsrequest import AWSRequest +from botocore.exceptions import NoAuthTokenError +from botocore.tokens import FrozenAuthToken + +cases = [ + { + "documentation": "Minimal bearer auth case", + "headers": {}, + "token": "mF_9.B5f-4.1JqM", + "expectedHeaders": {"Authorization": "Bearer mF_9.B5f-4.1JqM"}, + }, + { + "documentation": "Longer token case", + "headers": {}, + "token": "eW91J3JlIG5vdCBzdXBwb3NlZCB0byBkZWNvZGUgdGhpcyE=", + "expectedHeaders": { + "Authorization": "Bearer eW91J3JlIG5vdCBzdXBwb3NlZCB0byBkZWNvZGUgdGhpcyE=" + }, + }, + { + "documentation": "Signer should override existing header", + "headers": {"Authorization": "Bearer foo"}, + "token": "mF_9.B5f-4.1JqM", + "expectedHeaders": {"Authorization": "Bearer mF_9.B5f-4.1JqM"}, + }, + { + "documentation": "Signer requires a token", + "headers": {}, + "token": None, + "expectedException": NoAuthTokenError, + }, +] + + +@pytest.mark.parametrize("test_case", cases) +def test_bearer_auth(test_case): + url = "https://example.com" + headers = test_case.get("headers", {}) + request = AWSRequest(method="GET", url=url, headers=headers) + + auth_token = None + raw_token = test_case["token"] + if raw_token: + auth_token = FrozenAuthToken(test_case["token"], expiration=None) + + bearer_auth = BearerAuth(auth_token) + expected_headers = test_case.get("expectedHeaders") + expected_exception = test_case.get("expectedException") + if expected_headers: + bearer_auth.add_auth(request) + for name in expected_headers: + actual_header = request.headers[name] + expected_header = expected_headers[name] + assert actual_header == expected_header + elif expected_exception: + with pytest.raises(expected_exception): + bearer_auth.add_auth(request) diff --git a/testbed/boto__botocore/tests/unit/test_auth_sigv4.py b/testbed/boto__botocore/tests/unit/test_auth_sigv4.py new file mode 100644 index 0000000000000000000000000000000000000000..5509d50813bb32a8af9f8089d199d121a5c10ecb --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_auth_sigv4.py @@ -0,0 +1,53 @@ +# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +from botocore.auth import SigV4Auth +from botocore.awsrequest import AWSRequest +from botocore.credentials import Credentials +from tests import unittest + +SECRET_KEY = "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY" +ACCESS_KEY = 'AKIDEXAMPLE' + + +class TestSigV4Auth(unittest.TestCase): + def setUp(self): + self.credentials = Credentials(ACCESS_KEY, SECRET_KEY) + self.sigv4 = SigV4Auth(self.credentials, 'host', 'us-weast-1') + + def test_signed_host_is_lowercase(self): + endpoint = 'https://S5.Us-WeAsT-2.AmAZonAwS.com' + expected_host = 's5.us-weast-2.amazonaws.com' + request = AWSRequest(method='GET', url=endpoint) + headers_to_sign = self.sigv4.headers_to_sign(request) + self.assertEqual(expected_host, headers_to_sign.get('host')) + + def test_signed_host_is_ipv6_without_port(self): + endpoint = 'http://[::1]' + expected_host = '[::1]' + request = AWSRequest(method='GET', url=endpoint) + headers_to_sign = self.sigv4.headers_to_sign(request) + self.assertEqual(expected_host, headers_to_sign.get('host')) + + def test_signed_host_is_ipv6_with_default_port(self): + endpoint = 'http://[::1]:80' + expected_host = '[::1]' + request = AWSRequest(method='GET', url=endpoint) + headers_to_sign = self.sigv4.headers_to_sign(request) + self.assertEqual(expected_host, headers_to_sign.get('host')) + + def test_signed_host_is_ipv6_with_explicit_port(self): + endpoint = 'http://[::1]:6789' + expected_host = '[::1]:6789' + request = AWSRequest(method='GET', url=endpoint) + headers_to_sign = self.sigv4.headers_to_sign(request) + self.assertEqual(expected_host, headers_to_sign.get('host')) diff --git a/testbed/boto__botocore/tests/unit/test_awsrequest.py b/testbed/boto__botocore/tests/unit/test_awsrequest.py new file mode 100644 index 0000000000000000000000000000000000000000..a29a846116c984932121ba97bc7ee8a962cb25f3 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_awsrequest.py @@ -0,0 +1,802 @@ +#!/usr/bin/env +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +import io +import os +import shutil +import socket +import tempfile + +import pytest +from urllib3.connectionpool import HTTPConnectionPool, HTTPSConnectionPool + +from botocore.awsrequest import ( + AWSHTTPConnection, + AWSHTTPSConnection, + AWSRequest, + AWSResponse, + HeadersDict, + create_request_object, + prepare_request_dict, +) +from botocore.compat import file_type +from botocore.exceptions import UnseekableStreamError +from tests import mock, unittest + + +class IgnoreCloseBytesIO(io.BytesIO): + def close(self): + pass + + +class FakeSocket: + def __init__(self, read_data, fileclass=IgnoreCloseBytesIO): + self.sent_data = b'' + self.read_data = read_data + self.fileclass = fileclass + self._fp_object = None + + def sendall(self, data): + self.sent_data += data + + def makefile(self, mode, bufsize=None): + if self._fp_object is None: + self._fp_object = self.fileclass(self.read_data) + return self._fp_object + + def close(self): + pass + + def settimeout(self, value): + pass + + +class BytesIOWithLen(io.BytesIO): + def __len__(self): + return len(self.getvalue()) + + +class Unseekable(file_type): + def __init__(self, stream): + self._stream = stream + + def read(self): + return self._stream.read() + + def seek(self, offset, whence): + # This is a case where seek() exists as part of the object's interface, + # but it doesn't actually work (for example socket.makefile(), which + # will raise an io.* error on python3). + raise ValueError("Underlying stream does not support seeking.") + + +class Seekable: + """This class represents a bare-bones,seekable file-like object + + Note it does not include some of the other attributes of other + file-like objects such as StringIO's getvalue() and file object's fileno + property. If the file-like object does not have either of these attributes + requests will not calculate the content length even though it is still + possible to calculate it. + """ + + def __init__(self, stream): + self._stream = stream + + def __iter__(self): + return iter(self._stream) + + def read(self): + return self._stream.read() + + def seek(self, offset, whence=0): + self._stream.seek(offset, whence) + + def tell(self): + return self._stream.tell() + + +class TestAWSRequest(unittest.TestCase): + def setUp(self): + self.tempdir = tempfile.mkdtemp() + self.filename = os.path.join(self.tempdir, 'foo') + self.request = AWSRequest(method='GET', url='http://example.com') + self.prepared_request = self.request.prepare() + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def test_prepared_request_repr(self): + expected_repr = ( + '' + ) + request_repr = repr(self.prepared_request) + self.assertEqual(request_repr, expected_repr) + + def test_can_prepare_url_params(self): + request = AWSRequest(url='http://example.com/', params={'foo': 'bar'}) + prepared_request = request.prepare() + self.assertEqual(prepared_request.url, 'http://example.com/?foo=bar') + + def test_can_prepare_url_params_with_existing_query(self): + request = AWSRequest( + url='http://example.com/?bar=foo', params={'foo': 'bar'} + ) + prepared_request = request.prepare() + self.assertEqual( + prepared_request.url, 'http://example.com/?bar=foo&foo=bar' + ) + + def test_can_prepare_dict_body(self): + body = {'dead': 'beef'} + request = AWSRequest(url='http://example.com/', data=body) + prepared_request = request.prepare() + self.assertEqual(prepared_request.body, 'dead=beef') + + def test_can_prepare_dict_body_unicode_values(self): + body = {'Text': '\u30c6\u30b9\u30c8 string'} + expected_body = 'Text=%E3%83%86%E3%82%B9%E3%83%88+string' + request = AWSRequest(url='http://example.com/', data=body) + prepared_request = request.prepare() + self.assertEqual(prepared_request.body, expected_body) + + def test_can_prepare_dict_body_unicode_keys(self): + body = {'\u30c6\u30b9\u30c8': 'string'} + expected_body = '%E3%83%86%E3%82%B9%E3%83%88=string' + request = AWSRequest(url='http://example.com/', data=body) + prepared_request = request.prepare() + self.assertEqual(prepared_request.body, expected_body) + + def test_can_prepare_empty_body(self): + request = AWSRequest(url='http://example.com/', data=b'') + prepared_request = request.prepare() + self.assertEqual(prepared_request.body, None) + content_length = prepared_request.headers.get('content-length') + self.assertEqual(content_length, '0') + + def test_request_body_is_prepared(self): + request = AWSRequest(url='http://example.com/', data='body') + self.assertEqual(request.body, b'body') + + def test_prepare_body_content_adds_content_length(self): + content = b'foobarbaz' + expected_len = str(len(content)) + with open(self.filename, 'wb') as f: + f.write(content) + with open(self.filename, 'rb') as f: + data = Seekable(f) + self.request.data = data + self.request.method = 'POST' + prepared_request = self.request.prepare() + calculated_len = prepared_request.headers['Content-Length'] + self.assertEqual(calculated_len, expected_len) + + def test_prepare_body_doesnt_override_content_length(self): + self.request.method = 'PUT' + self.request.headers['Content-Length'] = '20' + self.request.data = b'asdf' + prepared_request = self.request.prepare() + self.assertEqual(prepared_request.headers['Content-Length'], '20') + + def test_prepare_body_doesnt_set_content_length_head(self): + self.request.method = 'HEAD' + self.request.data = b'thisshouldntbehere' + prepared_request = self.request.prepare() + self.assertEqual(prepared_request.headers.get('Content-Length'), None) + + def test_prepare_body_doesnt_set_content_length_get(self): + self.request.method = 'GET' + self.request.data = b'thisshouldntbehere' + prepared_request = self.request.prepare() + self.assertEqual(prepared_request.headers.get('Content-Length'), None) + + def test_prepare_body_doesnt_set_content_length_options(self): + self.request.method = 'OPTIONS' + self.request.data = b'thisshouldntbehere' + prepared_request = self.request.prepare() + self.assertEqual(prepared_request.headers.get('Content-Length'), None) + + def test_can_reset_stream_handles_binary(self): + contents = b'notastream' + self.prepared_request.body = contents + self.prepared_request.reset_stream() + # assert the request body doesn't change after reset_stream is called + self.assertEqual(self.prepared_request.body, contents) + + def test_can_reset_stream_handles_bytearray(self): + contents = bytearray(b'notastream') + self.prepared_request.body = contents + self.prepared_request.reset_stream() + # assert the request body doesn't change after reset_stream is called + self.assertEqual(self.prepared_request.body, contents) + + def test_can_reset_stream(self): + contents = b'foobarbaz' + with open(self.filename, 'wb') as f: + f.write(contents) + with open(self.filename, 'rb') as body: + self.prepared_request.body = body + # pretend the request body was partially sent + body.read() + self.assertNotEqual(body.tell(), 0) + # have the prepared request reset its stream + self.prepared_request.reset_stream() + # the stream should be reset + self.assertEqual(body.tell(), 0) + + def test_cannot_reset_stream_raises_error(self): + contents = b'foobarbaz' + with open(self.filename, 'wb') as f: + f.write(contents) + with open(self.filename, 'rb') as body: + self.prepared_request.body = Unseekable(body) + # pretend the request body was partially sent + body.read() + self.assertNotEqual(body.tell(), 0) + # reset stream should fail + with self.assertRaises(UnseekableStreamError): + self.prepared_request.reset_stream() + + def test_duck_type_for_file_check(self): + # As part of determining whether or not we can rewind a stream + # we first need to determine if the thing is a file like object. + # We should not be using an isinstance check. Instead, we should + # be using duck type checks. + + class LooksLikeFile: + def __init__(self): + self.seek_called = False + + def read(self, amount=None): + pass + + def seek(self, where): + self.seek_called = True + + looks_like_file = LooksLikeFile() + self.prepared_request.body = looks_like_file + self.prepared_request.reset_stream() + # The stream should now be reset. + self.assertTrue(looks_like_file.seek_called) + + +@pytest.mark.parametrize( + "test_input,expected_output", + [ + ([('foo', None)], 'http://example.com/?foo=None'), + ([(None, None)], 'http://example.com/?None=None'), + ( + [('foo', 'bar'), ('foo', 'baz'), ('fizz', 'buzz')], + 'http://example.com/?foo=bar&foo=baz&fizz=buzz', + ), + ( + [('foo', 'bar'), ('foo', None)], + 'http://example.com/?foo=bar&foo=None', + ), + ([('foo', 'bar')], 'http://example.com/?foo=bar'), + ( + [('foo', 'bar'), ('foo', 'bar'), ('fizz', 'buzz')], + 'http://example.com/?foo=bar&foo=bar&fizz=buzz', + ), + ([('', 'bar')], 'http://example.com/?=bar'), + ([(1, 'bar')], 'http://example.com/?1=bar'), + ], +) +def test_can_use_list_tuples_for_params(test_input, expected_output): + request = AWSRequest(url='http://example.com/', params=test_input) + prepared_request = request.prepare() + assert prepared_request.url == expected_output + + +def test_empty_list_tuples_value_error_for_params(): + request = AWSRequest(url='http://example.com/', params=[()]) + with pytest.raises(ValueError): + request.prepare() + + +class TestAWSResponse(unittest.TestCase): + def setUp(self): + self.response = AWSResponse('http://url.com', 200, HeadersDict(), None) + self.response.raw = mock.Mock() + + def set_raw_stream(self, blobs): + def stream(*args, **kwargs): + yield from blobs + + self.response.raw.stream.return_value = stream() + + def test_content_property(self): + self.set_raw_stream([b'some', b'data']) + self.assertEqual(self.response.content, b'somedata') + self.assertEqual(self.response.content, b'somedata') + # assert that stream was not called more than once + self.assertEqual(self.response.raw.stream.call_count, 1) + + def test_text_property(self): + self.set_raw_stream([b'\xe3\x82\xb8\xe3\x83\xa7\xe3\x82\xb0']) + self.response.headers['content-type'] = 'text/plain; charset=utf-8' + self.assertEqual(self.response.text, '\u30b8\u30e7\u30b0') + + def test_text_property_defaults_utf8(self): + self.set_raw_stream([b'\xe3\x82\xb8\xe3\x83\xa7\xe3\x82\xb0']) + self.assertEqual(self.response.text, '\u30b8\u30e7\u30b0') + + +class TestAWSHTTPConnection(unittest.TestCase): + def create_tunneled_connection(self, url, port, response): + s = FakeSocket(response) + conn = AWSHTTPConnection(url, port) + conn.sock = s + conn._tunnel_host = url + conn._tunnel_port = port + conn._tunnel_headers = {'key': 'value'} + + # Create a mock response. + self.mock_response = mock.Mock() + self.mock_response.fp = mock.Mock() + + # Imitate readline function by creating a list to be sent as + # a side effect of the mocked readline to be able to track how the + # response is processed in ``_tunnel()``. + delimeter = b'\r\n' + side_effect = [] + response_components = response.split(delimeter) + for i in range(len(response_components)): + new_component = response_components[i] + # Only add the delimeter on if it is not the last component + # which should be an empty string. + if i != len(response_components) - 1: + new_component += delimeter + side_effect.append(new_component) + + self.mock_response.fp.readline.side_effect = side_effect + + response_components = response.split(b' ') + self.mock_response._read_status.return_value = ( + response_components[0], + int(response_components[1]), + response_components[2], + ) + conn.response_class = mock.Mock() + conn.response_class.return_value = self.mock_response + return conn + + def test_expect_100_continue_returned(self): + with mock.patch('urllib3.util.wait_for_read') as wait_mock: + # Shows the server first sending a 100 continue response + # then a 200 ok response. + s = FakeSocket(b'HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\n') + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + wait_mock.return_value = True + conn.request( + 'GET', '/bucket/foo', b'body', {'Expect': b'100-continue'} + ) + response = conn.getresponse() + # Assert that we waited for the 100-continue response + self.assertEqual(wait_mock.call_count, 1) + # Now we should verify that our final response is the 200 OK + self.assertEqual(response.status, 200) + + def test_handles_expect_100_with_different_reason_phrase(self): + with mock.patch('urllib3.util.wait_for_read') as wait_mock: + # Shows the server first sending a 100 continue response + # then a 200 ok response. + s = FakeSocket( + b'HTTP/1.1 100 (Continue)\r\n\r\nHTTP/1.1 200 OK\r\n' + ) + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + wait_mock.return_value = True + conn.request( + 'GET', + '/bucket/foo', + io.BytesIO(b'body'), + {'Expect': b'100-continue', 'Content-Length': b'4'}, + ) + response = conn.getresponse() + # Now we should verify that our final response is the 200 OK. + self.assertEqual(response.status, 200) + # Assert that we waited for the 100-continue response + self.assertEqual(wait_mock.call_count, 1) + # Verify that we went the request body because we got a 100 + # continue. + self.assertIn(b'body', s.sent_data) + + def test_expect_100_sends_connection_header(self): + # When using squid as an HTTP proxy, it will also send + # a Connection: keep-alive header back with the 100 continue + # response. We need to ensure we handle this case. + with mock.patch('urllib3.util.wait_for_read') as wait_mock: + # Shows the server first sending a 100 continue response + # then a 500 response. We're picking 500 to confirm we + # actually parse the response instead of getting the + # default status of 200 which happens when we can't parse + # the response. + s = FakeSocket( + b'HTTP/1.1 100 Continue\r\n' + b'Connection: keep-alive\r\n' + b'\r\n' + b'HTTP/1.1 500 Internal Service Error\r\n' + ) + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + wait_mock.return_value = True + conn.request( + 'GET', '/bucket/foo', b'body', {'Expect': b'100-continue'} + ) + # Assert that we waited for the 100-continue response + self.assertEqual(wait_mock.call_count, 1) + response = conn.getresponse() + self.assertEqual(response.status, 500) + + def test_expect_100_continue_sends_307(self): + # This is the case where we send a 100 continue and the server + # immediately sends a 307 + with mock.patch('urllib3.util.wait_for_read') as wait_mock: + # Shows the server first sending a 100 continue response + # then a 200 ok response. + s = FakeSocket( + b'HTTP/1.1 307 Temporary Redirect\r\n' + b'Location: http://example.org\r\n' + ) + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + wait_mock.return_value = True + conn.request( + 'GET', '/bucket/foo', b'body', {'Expect': b'100-continue'} + ) + # Assert that we waited for the 100-continue response + self.assertEqual(wait_mock.call_count, 1) + response = conn.getresponse() + # Now we should verify that our final response is the 307. + self.assertEqual(response.status, 307) + + def test_expect_100_continue_no_response_from_server(self): + with mock.patch('urllib3.util.wait_for_read') as wait_mock: + # Shows the server first sending a 100 continue response + # then a 200 ok response. + s = FakeSocket( + b'HTTP/1.1 307 Temporary Redirect\r\n' + b'Location: http://example.org\r\n' + ) + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + # By settings wait_mock to return False, this indicates + # that the server did not send any response. In this situation + # we should just send the request anyways. + wait_mock.return_value = False + conn.request( + 'GET', '/bucket/foo', b'body', {'Expect': b'100-continue'} + ) + # Assert that we waited for the 100-continue response + self.assertEqual(wait_mock.call_count, 1) + response = conn.getresponse() + self.assertEqual(response.status, 307) + + def test_message_body_is_file_like_object(self): + # Shows the server first sending a 100 continue response + # then a 200 ok response. + body = BytesIOWithLen(b'body contents') + s = FakeSocket(b'HTTP/1.1 200 OK\r\n') + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + conn.request('GET', '/bucket/foo', body) + response = conn.getresponse() + self.assertEqual(response.status, 200) + + def test_no_expect_header_set(self): + # Shows the server first sending a 100 continue response + # then a 200 ok response. + s = FakeSocket(b'HTTP/1.1 200 OK\r\n') + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + conn.request('GET', '/bucket/foo', b'body') + response = conn.getresponse() + self.assertEqual(response.status, 200) + + def test_tunnel_readline_none_bugfix(self): + # Tests whether ``_tunnel`` function is able to work around the + # py26 bug of avoiding infinite while loop if nothing is returned. + conn = self.create_tunneled_connection( + url='s3.amazonaws.com', + port=443, + response=b'HTTP/1.1 200 OK\r\n', + ) + conn._tunnel() + # Ensure proper amount of readline calls were made. + self.assertEqual(self.mock_response.fp.readline.call_count, 2) + + def test_tunnel_readline_normal(self): + # Tests that ``_tunnel`` function behaves normally when it comes + # across the usual http ending. + conn = self.create_tunneled_connection( + url='s3.amazonaws.com', + port=443, + response=b'HTTP/1.1 200 OK\r\n\r\n', + ) + conn._tunnel() + # Ensure proper amount of readline calls were made. + self.assertEqual(self.mock_response.fp.readline.call_count, 2) + + def test_tunnel_raises_socket_error(self): + # Tests that ``_tunnel`` function throws appropriate error when + # not 200 status. + conn = self.create_tunneled_connection( + url='s3.amazonaws.com', + port=443, + response=b'HTTP/1.1 404 Not Found\r\n\r\n', + ) + with self.assertRaises(socket.error): + conn._tunnel() + + def test_tunnel_uses_std_lib(self): + s = FakeSocket(b'HTTP/1.1 200 OK\r\n') + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + # Test that the standard library method was used by patching out + # the ``_tunnel`` method and seeing if the std lib method was called. + with mock.patch( + 'urllib3.connection.HTTPConnection._tunnel' + ) as mock_tunnel: + conn._tunnel() + self.assertTrue(mock_tunnel.called) + + def test_encodes_unicode_method_line(self): + s = FakeSocket(b'HTTP/1.1 200 OK\r\n') + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + # Note the combination of unicode 'GET' and + # bytes 'Utf8-Header' value. + conn.request( + 'GET', + '/bucket/foo', + b'body', + headers={"Utf8-Header": b"\xe5\xb0\x8f"}, + ) + response = conn.getresponse() + self.assertEqual(response.status, 200) + + def test_state_reset_on_connection_close(self): + # This simulates what urllib3 does with connections + # in its connection pool logic. + with mock.patch('urllib3.util.wait_for_read') as wait_mock: + # First fast fail with a 500 response when we first + # send the expect header. + s = FakeSocket(b'HTTP/1.1 500 Internal Server Error\r\n') + conn = AWSHTTPConnection('s3.amazonaws.com', 443) + conn.sock = s + wait_mock.return_value = True + + conn.request( + 'GET', '/bucket/foo', b'body', {'Expect': b'100-continue'} + ) + self.assertEqual(wait_mock.call_count, 1) + response = conn.getresponse() + self.assertEqual(response.status, 500) + + # Now what happens in urllib3 is that when the next + # request comes along and this conection gets checked + # out. We see that the connection needs to be + # reset. So first the connection is closed. + conn.close() + + # And then a new connection is established. + new_conn = FakeSocket( + b'HTTP/1.1 100 (Continue)\r\n\r\nHTTP/1.1 200 OK\r\n' + ) + conn.sock = new_conn + + # And we make a request, we should see the 200 response + # that was sent back. + wait_mock.return_value = True + + conn.request( + 'GET', '/bucket/foo', b'body', {'Expect': b'100-continue'} + ) + # Assert that we waited for the 100-continue response + self.assertEqual(wait_mock.call_count, 2) + response = conn.getresponse() + # This should be 200. If it's a 500 then + # the prior response was leaking into our + # current response., + self.assertEqual(response.status, 200) + + +class TestAWSHTTPConnectionPool(unittest.TestCase): + def test_global_urllib3_pool_is_unchanged(self): + http_connection_class = HTTPConnectionPool.ConnectionCls + self.assertIsNot(http_connection_class, AWSHTTPConnection) + https_connection_class = HTTPSConnectionPool.ConnectionCls + self.assertIsNot(https_connection_class, AWSHTTPSConnection) + + +class TestPrepareRequestDict(unittest.TestCase): + def setUp(self): + self.user_agent = 'botocore/1.0' + self.endpoint_url = 'https://s3.amazonaws.com' + self.base_request_dict = { + 'body': '', + 'headers': {}, + 'method': 'GET', + 'query_string': '', + 'url_path': '/', + 'context': {}, + } + + def prepare_base_request_dict( + self, request_dict, endpoint_url=None, user_agent=None, context=None + ): + self.base_request_dict.update(request_dict) + context = context or {} + if user_agent is None: + user_agent = self.user_agent + if endpoint_url is None: + endpoint_url = self.endpoint_url + prepare_request_dict( + self.base_request_dict, + endpoint_url=endpoint_url, + user_agent=user_agent, + context=context, + ) + + def test_prepare_request_dict_for_get(self): + request_dict = {'method': 'GET', 'url_path': '/'} + self.prepare_base_request_dict( + request_dict, endpoint_url='https://s3.amazonaws.com' + ) + self.assertEqual(self.base_request_dict['method'], 'GET') + self.assertEqual( + self.base_request_dict['url'], 'https://s3.amazonaws.com/' + ) + self.assertEqual( + self.base_request_dict['headers']['User-Agent'], self.user_agent + ) + + def test_prepare_request_dict_for_get_no_user_agent(self): + self.user_agent = None + request_dict = {'method': 'GET', 'url_path': '/'} + self.prepare_base_request_dict( + request_dict, endpoint_url='https://s3.amazonaws.com' + ) + self.assertNotIn('User-Agent', self.base_request_dict['headers']) + + def test_prepare_request_dict_with_context(self): + context = {'foo': 'bar'} + self.prepare_base_request_dict({}, context=context) + self.assertEqual(self.base_request_dict['context'], context) + + def test_query_string_serialized_to_url(self): + request_dict = { + 'method': 'GET', + 'query_string': {'prefix': 'foo'}, + 'url_path': '/mybucket', + } + self.prepare_base_request_dict(request_dict) + self.assertEqual( + self.base_request_dict['url'], + 'https://s3.amazonaws.com/mybucket?prefix=foo', + ) + + def test_url_path_combined_with_endpoint_url(self): + # This checks the case where a user specifies and + # endpoint_url that has a path component, and the + # serializer gives us a request_dict that has a url + # component as well (say from a rest-* service). + request_dict = { + 'query_string': {'prefix': 'foo'}, + 'url_path': '/mybucket', + } + endpoint_url = 'https://custom.endpoint/foo/bar' + self.prepare_base_request_dict(request_dict, endpoint_url) + self.assertEqual( + self.base_request_dict['url'], + 'https://custom.endpoint/foo/bar/mybucket?prefix=foo', + ) + + def test_url_path_with_trailing_slash(self): + self.prepare_base_request_dict( + {'url_path': '/mybucket'}, + endpoint_url='https://custom.endpoint/foo/bar/', + ) + + self.assertEqual( + self.base_request_dict['url'], + 'https://custom.endpoint/foo/bar/mybucket', + ) + + def test_url_path_is_slash(self): + self.prepare_base_request_dict( + {'url_path': '/'}, endpoint_url='https://custom.endpoint/foo/bar/' + ) + + self.assertEqual( + self.base_request_dict['url'], 'https://custom.endpoint/foo/bar/' + ) + + def test_url_path_is_slash_with_endpoint_url_no_slash(self): + self.prepare_base_request_dict( + {'url_path': '/'}, endpoint_url='https://custom.endpoint/foo/bar' + ) + + self.assertEqual( + self.base_request_dict['url'], 'https://custom.endpoint/foo/bar' + ) + + def test_custom_endpoint_with_query_string(self): + self.prepare_base_request_dict( + {'url_path': '/baz', 'query_string': {'x': 'y'}}, + endpoint_url='https://custom.endpoint/foo/bar?foo=bar', + ) + + self.assertEqual( + self.base_request_dict['url'], + 'https://custom.endpoint/foo/bar/baz?foo=bar&x=y', + ) + + +class TestCreateRequestObject(unittest.TestCase): + def setUp(self): + self.request_dict = { + 'method': 'GET', + 'query_string': {'prefix': 'foo'}, + 'url_path': '/mybucket', + 'headers': {'User-Agent': 'my-agent'}, + 'body': 'my body', + 'url': 'https://s3.amazonaws.com/mybucket?prefix=foo', + 'context': {'signing': {'region': 'us-west-2'}}, + } + + def test_create_request_object(self): + request = create_request_object(self.request_dict) + self.assertEqual(request.method, self.request_dict['method']) + self.assertEqual(request.url, self.request_dict['url']) + self.assertEqual(request.data, self.request_dict['body']) + self.assertEqual(request.context, self.request_dict['context']) + self.assertIn('User-Agent', request.headers) + + +class TestHeadersDict(unittest.TestCase): + def setUp(self): + self.headers = HeadersDict() + + def test_get_insensitive(self): + self.headers['foo'] = 'bar' + self.assertEqual(self.headers['FOO'], 'bar') + + def test_set_insensitive(self): + self.headers['foo'] = 'bar' + self.headers['FOO'] = 'baz' + self.assertEqual(self.headers['foo'], 'baz') + + def test_del_insensitive(self): + self.headers['foo'] = 'bar' + self.assertEqual(self.headers['FOO'], 'bar') + del self.headers['FoO'] + with self.assertRaises(KeyError): + self.headers['foo'] + + def test_iteration(self): + self.headers['FOO'] = 'bar' + self.headers['dead'] = 'beef' + self.assertIn('FOO', list(self.headers)) + self.assertIn('dead', list(self.headers)) + headers_items = list(self.headers.items()) + self.assertIn(('FOO', 'bar'), headers_items) + self.assertIn(('dead', 'beef'), headers_items) + + +if __name__ == "__main__": + unittest.main() diff --git a/testbed/boto__botocore/tests/unit/test_client.py b/testbed/boto__botocore/tests/unit/test_client.py new file mode 100644 index 0000000000000000000000000000000000000000..86974fd553d9a674bc92a727c5deba114335dbe6 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_client.py @@ -0,0 +1,2368 @@ +# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import io +from contextlib import closing + +import botocore +import botocore.config +from botocore import client, exceptions, hooks +from botocore.auth import AUTH_TYPE_MAPS, BaseSigner +from botocore.client import ClientEndpointBridge +from botocore.configprovider import ( + ChainProvider, + ConfigValueStore, + EnvironmentProvider, +) +from botocore.credentials import Credentials +from botocore.endpoint import DEFAULT_TIMEOUT +from botocore.errorfactory import ClientExceptionsFactory +from botocore.exceptions import ( + InvalidMaxRetryAttemptsError, + InvalidRetryConfigurationError, + InvalidRetryModeError, + InvalidS3AddressingStyleError, + ParamValidationError, + UnknownSignatureVersionError, +) +from botocore.stub import Stubber +from botocore.useragent import UserAgentString +from tests import mock, unittest + + +class TestAutoGeneratedClient(unittest.TestCase): + def setUp(self): + self.service_description = { + 'metadata': { + 'serviceFullName': 'AWS MyService', + 'apiVersion': '2014-01-01', + 'endpointPrefix': 'myservice', + 'signatureVersion': 'v4', + 'protocol': 'query', + 'serviceId': 'MyService', + }, + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'TestOperationRequest'}, + 'errors': [{'shape': 'TestOperationException'}], + 'documentation': 'Documents TestOperation', + } + }, + 'shapes': { + 'TestOperationRequest': { + 'type': 'structure', + 'required': ['Foo'], + 'members': { + 'Foo': { + 'shape': 'StringType', + 'documentation': 'Documents Foo', + }, + 'Bar': { + 'shape': 'StringType', + 'documentation': 'Documents Bar', + }, + }, + }, + "TestOperationException": { + 'type': 'structure', + 'exception': True, + 'error': {'code': 'TestOperationErrorCode'}, + }, + 'StringType': {'type': 'string'}, + }, + } + self.endpoint_ruleset = { + "version": "1.0", + "parameters": {}, + "rules": [ + { + "conditions": [], + "type": "endpoint", + "endpoint": { + "url": "https://foo.bar", + "properties": {}, + "headers": {}, + }, + } + ], + } + self.retry_config = { + "retry": { + "__default__": { + "max_attempts": 5, + "delay": { + "type": "exponential", + "base": "rand", + "growth_factor": 2, + }, + "policies": {}, + } + } + } + + def load_service_mock(*args, **kwargs): + if args[1] == "service-2": + return self.service_description + + self.loader = mock.Mock() + self.loader.load_service_model.side_effect = load_service_mock + self.loader.load_data.return_value = self.retry_config + + self.credentials = Credentials('access-key', 'secret-key') + + self.endpoint_creator_patch = mock.patch( + 'botocore.args.EndpointCreator' + ) + self.endpoint_creator_cls = self.endpoint_creator_patch.start() + self.endpoint_creator = self.endpoint_creator_cls.return_value + + self.endpoint = mock.Mock() + self.endpoint.host = 'https://myservice.amazonaws.com' + self.endpoint.make_request.return_value = ( + mock.Mock(status_code=200), + {}, + ) + self.endpoint_creator.create_endpoint.return_value = self.endpoint + + self.resolver = mock.Mock() + self.endpoint_data = { + 'partition': 'aws', + 'hostname': 'foo', + 'endpointName': 'us-west-2', + 'signatureVersions': ['v4'], + } + self.resolver.construct_endpoint.return_value = self.endpoint_data + self.resolver.get_available_endpoints.return_value = ['us-west-2'] + self.config_store = ConfigValueStore() + + def tearDown(self): + self.endpoint_creator_patch.stop() + + def create_mock_emitter(self, responses=None): + if responses is None: + responses = [] + + emitter = mock.Mock() + emitter.emit.return_value = responses + return emitter + + def create_client_creator( + self, + endpoint_creator=None, + event_emitter=None, + retry_handler_factory=None, + retry_config_translator=None, + response_parser_factory=None, + endpoint_prefix=None, + exceptions_factory=None, + config_store=None, + user_agent_creator=None, + ): + if event_emitter is None: + event_emitter = hooks.HierarchicalEmitter() + if retry_handler_factory is None: + retry_handler_factory = botocore.retryhandler + if retry_config_translator is None: + retry_config_translator = botocore.translate + if endpoint_prefix is not None: + self.service_description['metadata']['endpointPrefix'] = ( + endpoint_prefix + ) + + if endpoint_creator is not None: + self.endpoint_creator_cls.return_value = endpoint_creator + if exceptions_factory is None: + exceptions_factory = ClientExceptionsFactory() + if config_store is None: + config_store = self.config_store + if user_agent_creator is None: + user_agent_creator = ( + UserAgentString.from_environment().set_session_config( + session_user_agent_name='MyUserAgent', + session_user_agent_version='1.2.3-rc5', + session_user_agent_extra=None, + ) + ) + creator = client.ClientCreator( + self.loader, + self.resolver, + 'user-agent', + event_emitter, + retry_handler_factory, + retry_config_translator, + response_parser_factory, + exceptions_factory, + config_store, + user_agent_creator, + ) + return creator + + def assert_no_param_error_raised(self, client): + try: + self.make_api_call_with_missing_param(client) + except ParamValidationError: + self.fail( + "ParamValidationError shouldn't be raised " + "with validation disabled" + ) + + def make_api_call_with_missing_param(self, service_client): + # Missing required 'Foo' param. + service_client.test_operation(Bar='two') + + def test_client_name(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(service_client.__class__.__name__, 'MyService') + + def test_client_name_with_amazon(self): + self.service_description['metadata']['serviceFullName'] = ( + 'Amazon MyService' + ) + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(service_client.__class__.__name__, 'MyService') + + def test_client_name_using_abreviation(self): + self.service_description['metadata']['serviceAbbreviation'] = ( + 'Abbreviation' + ) + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(service_client.__class__.__name__, 'Abbreviation') + + def test_client_name_with_non_alphabet_characters(self): + self.service_description['metadata']['serviceFullName'] = ( + 'Amazon My-Service' + ) + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(service_client.__class__.__name__, 'MyService') + + def test_client_name_with_no_full_name_or_abbreviation(self): + del self.service_description['metadata']['serviceFullName'] + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(service_client.__class__.__name__, 'myservice') + + def test_client_generated_from_model(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(hasattr(service_client, 'test_operation')) + + def test_client_with_nonstandard_signature_version(self): + self.service_description['metadata']['signatureVersion'] = 'foo' + creator = self.create_client_creator() + foo_signer = mock.Mock(spec=BaseSigner) + + auth_types = AUTH_TYPE_MAPS.copy() + auth_types['foo'] = foo_signer + + with mock.patch('botocore.client.AUTH_TYPE_MAPS', auth_types): + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + assert service_client.meta.config.signature_version == 'foo' + + def test_client_method_docstring(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + method_docstring = str(service_client.test_operation.__doc__) + ref_docstring_lines = [ + 'Documents TestOperation', + '**Request Syntax**', + ' response = client.test_operation(', + ' Bar=\'string\'', + ' Foo=\'string\'', + ' )', + ':type Bar: string', + ':param Bar: Documents Bar', + ':type Foo: string', + ':param Foo: **[REQUIRED]** Documents Foo', + ] + for line in ref_docstring_lines: + self.assertIn(line, method_docstring) + + def test_client_method_help(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + with mock.patch('sys.stdout', io.StringIO()) as mock_stdout: + help(service_client.test_operation) + method_docstring = mock_stdout.getvalue() + ref_docstring_lines = [ + 'Documents TestOperation', + '**Request Syntax**', + ' response = client.test_operation(', + ' Bar=\'string\'', + ' Foo=\'string\'', + ' )', + ':type Bar: string', + ':param Bar: Documents Bar', + ':type Foo: string', + ':param Foo: **[REQUIRED]** Documents Foo', + ] + for line in ref_docstring_lines: + self.assertIn(line, method_docstring) + + def test_client_create_unicode(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(hasattr(service_client, 'test_operation')) + + def test_client_has_region_name_on_meta(self): + creator = self.create_client_creator() + region_name = 'us-west-2' + self.endpoint.region_name = region_name + service_client = creator.create_client( + 'myservice', region_name, credentials=self.credentials + ) + self.assertEqual(service_client.meta.region_name, region_name) + + def test_client_has_endpoint_url_on_meta(self): + creator = self.create_client_creator() + self.endpoint.host = 'https://foo.bar' + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertEqual(service_client.meta.endpoint_url, 'https://foo.bar') + + def test_client_has_standard_partition_on_meta(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertEqual(service_client.meta.partition, 'aws') + + def test_client_has_non_standard_partition_on_meta(self): + creator = self.create_client_creator() + self.resolver.construct_endpoint.return_value = { + 'partition': 'aws-cn', + 'hostname': 'foo', + 'endpointName': 'cn-north-1', + 'signatureVersions': ['v4'], + } + service_client = creator.create_client( + 'myservice', 'cn-north-1', credentials=self.credentials + ) + self.assertEqual(service_client.meta.partition, 'aws-cn') + + def test_client_has_exceptions_attribute(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue(hasattr(service_client, 'exceptions')) + + def test_client_has_modeled_exceptions(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertTrue( + issubclass( + service_client.exceptions.TestOperationException, + client.ClientError, + ) + ) + + def test_client_fips_region_transformation(self): + creator = self.create_client_creator() + with self.assertLogs('botocore.client', level='WARNING') as log: + creator.create_client( + 'myservice', 'fips-us-west-2', credentials=self.credentials + ) + self.assertIn('fips-us-west-2 to us-west-2', log.output[0]) + + def test_api_version_is_passed_to_loader_if_provided(self): + creator = self.create_client_creator() + self.endpoint.host = 'https://foo.bar' + specific_api_version = '2014-03-01' + creator.create_client( + 'myservice', + 'us-west-2', + credentials=self.credentials, + api_version=specific_api_version, + ) + calls = [ + mock.call( + 'myservice', 'service-2', api_version=specific_api_version + ), + mock.call( + 'myservice', + 'endpoint-rule-set-1', + api_version=specific_api_version, + ), + ] + self.loader.load_service_model.assert_has_calls(calls) + + def test_create_client_class_creates_class(self): + creator = self.create_client_creator() + client_class = creator.create_client_class('myservice') + self.assertTrue(hasattr(client_class, 'test_operation')) + + def test_create_client_class_forwards_api_version(self): + creator = self.create_client_creator() + specific_api_version = '2014-03-01' + creator.create_client_class( + 'myservice', api_version=specific_api_version + ) + self.loader.load_service_model.assert_called_with( + 'myservice', 'service-2', api_version=specific_api_version + ) + + def test_signing_region_does_not_change_client_region(self): + with mock.patch('botocore.args.RequestSigner') as mock_signer: + credential_scope_region = 'us-east-1' + self.resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'endpoint.url', + 'endpointName': 'us-west-2', + 'signatureVersions': ['v4'], + 'credentialScope': {'region': credential_scope_region}, + } + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertEqual(service_client.meta.region_name, 'us-west-2') + call_args = mock_signer.call_args + self.assertEqual(credential_scope_region, call_args[0][1]) + + def test_client_uses_signing_region_from_credential_scope(self): + with mock.patch('botocore.args.RequestSigner') as mock_signer: + credential_scope_region = 'us-east-1' + self.resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'endpointName': 'us-west-2', + 'hostname': 'endpoint.url', + 'signatureVersions': ['v4'], + 'credentialScope': {'region': credential_scope_region}, + } + creator = self.create_client_creator() + service_client = creator.create_client( + service_name='myservice', + region_name='us-west-2', + credentials=self.credentials, + ) + # Use the resolved region as the region value. + self.assertEqual(service_client.meta.region_name, 'us-west-2') + # Ensure that we use the credential scope region for signing, + # and not the resolved region name. + call_args = mock_signer.call_args + self.assertEqual(credential_scope_region, call_args[0][1]) + + def test_client_uses_signing_name_from_credential_scope(self): + with mock.patch('botocore.args.RequestSigner') as mock_signer: + self.resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'endpointName': 'us-west-2', + 'hostname': 'endpoint.url', + 'signatureVersions': ['v4'], + 'credentialScope': {'service': 'override'}, + } + creator = self.create_client_creator() + creator.create_client( + service_name='myservice', + region_name='us-west-2', + credentials=self.credentials, + ) + call_args = mock_signer.call_args + self.assertEqual('MyService', call_args[0][0]) + self.assertEqual('override', call_args[0][2]) + + def test_client_uses_given_region_name_and_endpoint_url_when_present(self): + with mock.patch('botocore.args.RequestSigner') as mock_signer: + credential_scope_region = 'us-east-1' + self.resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'endpointName': 'us-west-2', + 'hostname': 'endpoint.url', + 'signatureVersions': ['v4'], + 'credentialScope': {'region': credential_scope_region}, + } + creator = self.create_client_creator() + service_client = creator.create_client( + service_name='myservice', + region_name='us-west-2', + credentials=self.credentials, + endpoint_url='https://foo', + ) + self.assertEqual(service_client.meta.region_name, 'us-west-2') + call_args = mock_signer.call_args + self.assertEqual('us-west-2', call_args[0][1]) + + def test_client_uses_signing_name_from_model_if_present_if_resolved(self): + self.service_description['metadata']['signingName'] = 'otherName' + with mock.patch('botocore.args.RequestSigner') as mock_signer: + self.resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'endpointName': 'us-west-2', + 'hostname': 'endpoint.url', + 'signatureVersions': ['v4'], + } + creator = self.create_client_creator() + service_client = creator.create_client( + service_name='myservice', + region_name='us-west-2', + credentials=self.credentials, + endpoint_url='https://foo', + ) + self.assertEqual(service_client.meta.region_name, 'us-west-2') + call_args = mock_signer.call_args[0] + self.assertEqual('otherName', call_args[2]) + + def test_client_uses_signing_name_even_with_no_resolve(self): + self.service_description['metadata']['signingName'] = 'otherName' + with mock.patch('botocore.args.RequestSigner') as mock_signer: + self.resolver.construct_endpoint.return_value = {} + creator = self.create_client_creator() + service_client = creator.create_client( + service_name='myservice', + region_name='us-west-2', + credentials=self.credentials, + endpoint_url='https://foo', + ) + self.assertEqual(service_client.meta.region_name, 'us-west-2') + call_args = mock_signer.call_args[0] + self.assertEqual('otherName', call_args[2]) + + @mock.patch('botocore.args.RequestSigner') + def test_client_signature_no_override(self, request_signer): + creator = self.create_client_creator() + creator.create_client( + 'myservice', + 'us-west-2', + credentials=self.credentials, + scoped_config={}, + ) + request_signer.assert_called_with( + mock.ANY, + mock.ANY, + mock.ANY, + 'v4', + mock.ANY, + mock.ANY, + mock.ANY, + ) + + @mock.patch('botocore.args.RequestSigner') + def test_client_signature_override_config_file(self, request_signer): + creator = self.create_client_creator() + config = {'myservice': {'signature_version': 'foo'}} + creator.create_client( + 'myservice', + 'us-west-2', + credentials=self.credentials, + scoped_config=config, + ) + request_signer.assert_called_with( + mock.ANY, + mock.ANY, + mock.ANY, + 'foo', + mock.ANY, + mock.ANY, + mock.ANY, + ) + + @mock.patch('botocore.args.RequestSigner') + def test_client_signature_override_arg(self, request_signer): + creator = self.create_client_creator() + config = botocore.config.Config(signature_version='foo') + creator.create_client( + 'myservice', + 'us-west-2', + credentials=self.credentials, + client_config=config, + ) + request_signer.assert_called_with( + mock.ANY, + mock.ANY, + mock.ANY, + 'foo', + mock.ANY, + mock.ANY, + mock.ANY, + ) + + def test_client_method_to_api_mapping(self): + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + self.assertEqual( + service_client.meta.method_to_api_mapping, + {'test_operation': 'TestOperation'}, + ) + + def test_anonymous_client_request(self): + creator = self.create_client_creator() + config = botocore.config.Config(signature_version=botocore.UNSIGNED) + service_client = creator.create_client( + 'myservice', 'us-west-2', client_config=config + ) + + service_client.test_operation(Foo='one') + + # Make sure a request has been attempted + self.assertTrue(self.endpoint.make_request.called) + + # Make sure the request parameters do NOT include auth + # information. The service defined above for these tests + # uses sigv4 by default (which we disable). + params = { + k.lower(): v + for k, v in self.endpoint.make_request.call_args[0][1].items() + } + self.assertNotIn('authorization', params) + self.assertNotIn('x-amz-signature', params) + + def test_client_user_agent_in_request(self): + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + + service_client.test_operation(Foo='one') + + self.assertTrue(self.endpoint.make_request.called) + params = { + k.lower(): v + for k, v in self.endpoint.make_request.call_args[0][1].items() + } + self.assertIn('MyUserAgent/1.2.3', params['headers']['User-Agent']) + + def test_client_custom_user_agent_in_request(self): + creator = self.create_client_creator() + config = botocore.config.Config(user_agent='baz') + service_client = creator.create_client( + 'myservice', 'us-west-2', client_config=config + ) + + service_client.test_operation(Foo='one') + + self.assertTrue(self.endpoint.make_request.called) + params = { + k.lower(): v + for k, v in self.endpoint.make_request.call_args[0][1].items() + } + self.assertEqual(params['headers']['User-Agent'], 'baz') + + def test_client_custom_user_agent_extra_in_request(self): + creator = self.create_client_creator() + config = botocore.config.Config(user_agent_extra='extrastuff') + service_client = creator.create_client( + 'myservice', 'us-west-2', client_config=config + ) + service_client.test_operation(Foo='one') + headers = self.endpoint.make_request.call_args[0][1]['headers'] + self.assertTrue(headers['User-Agent'].endswith('extrastuff')) + + def test_client_registers_request_created_handler(self): + event_emitter = self.create_mock_emitter() + creator = self.create_client_creator(event_emitter=event_emitter) + creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertIn( + mock.call('request-created.myservice', mock.ANY), + event_emitter.register.call_args_list, + ) + + def test_client_makes_call(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + self.assertTrue(self.endpoint_creator.create_endpoint.called) + + response = service_client.test_operation(Foo='one', Bar='two') + self.assertEqual(response, {}) + + def test_client_error_message_for_positional_args(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + with self.assertRaisesRegex( + TypeError, 'only accepts keyword arguments' + ): + service_client.test_operation('foo') + + @mock.patch('botocore.args.RequestSigner.sign') + def test_client_signs_call(self, signer_mock): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + request = mock.Mock() + + # Emit the request created event to see if it would be signed. + # We tested above to ensure this event is registered when + # a client is created. This prevents testing the entire client + # call logic. + service_client.meta.events.emit( + 'request-created.myservice.test_operation', + request=request, + operation_name='test_operation', + ) + + signer_mock.assert_called_with('test_operation', request) + + def test_client_validates_params_by_default(self): + creator = self.create_client_creator() + + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + with self.assertRaises(ParamValidationError): + self.make_api_call_with_missing_param(service_client) + + def test_client_doesnt_validate_params_when_validation_disabled(self): + creator = self.create_client_creator() + + client_config = botocore.config.Config() + client_config.parameter_validation = False + service_client = creator.create_client( + 'myservice', + 'us-west-2', + credentials=self.credentials, + client_config=client_config, + ) + + self.assert_no_param_error_raised(service_client) + + def test_can_disable_param_validation_from_scoped_config(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', + 'us-west-2', + credentials=self.credentials, + scoped_config={'parameter_validation': False}, + ) + self.assert_no_param_error_raised(service_client) + + def test_client_config_trumps_scoped_config(self): + creator = self.create_client_creator() + scoped_config = {'parameter_validation': True} + client_config = botocore.config.Config(parameter_validation=False) + # Client config should win and param validation is disabled. + service_client = creator.create_client( + 'myservice', + 'us-west-2', + credentials=self.credentials, + scoped_config=scoped_config, + client_config=client_config, + ) + self.assert_no_param_error_raised(service_client) + + def test_client_with_custom_both_timeout(self): + self.create_client_creator().create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config( + connect_timeout=123, read_timeout=234 + ), + ) + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertEqual(call_kwargs['timeout'], (123, 234)) + + def test_client_with_custom_connect_timeout(self): + self.create_client_creator().create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config(connect_timeout=123), + ) + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertEqual(call_kwargs['timeout'], (123, DEFAULT_TIMEOUT)) + + def test_client_with_custom_read_timeout(self): + self.create_client_creator().create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config(read_timeout=234), + ) + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertEqual(call_kwargs['timeout'], (DEFAULT_TIMEOUT, 234)) + + def test_client_with_custom_neither_timeout(self): + self.create_client_creator().create_client('myservice', 'us-west-2') + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertEqual( + call_kwargs['timeout'], (DEFAULT_TIMEOUT, DEFAULT_TIMEOUT) + ) + + def test_client_with_custom_params(self): + creator = self.create_client_creator() + creator.create_client( + 'myservice', 'us-west-2', is_secure=False, verify=False + ) + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertFalse(call_kwargs['verify']) + self.assertNotIn('is_secure', call_kwargs) + + def test_client_with_custom_proxy_config(self): + proxies_config = { + 'proxy_ca_bundle': 'foo_ca_bundle', + 'proxy_client_cert': 'foo_cert', + 'proxy_use_forwarding_for_https': False, + } + self.create_client_creator().create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config( + proxies_config=proxies_config + ), + ) + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertEqual(call_kwargs['proxies_config'], proxies_config) + + def test_client_with_endpoint_url(self): + creator = self.create_client_creator() + creator.create_client( + 'myservice', 'us-west-2', endpoint_url='http://custom.foo' + ) + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertEqual(call_kwargs['endpoint_url'], 'http://custom.foo') + + def test_client_can_use_guessed_endpoints(self): + # Ensure the resolver returns None (meaning a guess is made) + self.resolver.construct_endpoint.return_value = None + creator = self.create_client_creator() + client = creator.create_client('myservice', region_name='invalid') + self.assertEqual('invalid', client.meta.region_name) + + def test_client_with_response_parser_factory(self): + factory = mock.Mock() + creator = self.create_client_creator(response_parser_factory=factory) + creator.create_client('myservice', 'us-west-2') + call_kwargs = self.endpoint_creator.create_endpoint.call_args[1] + self.assertEqual(call_kwargs['response_parser_factory'], factory) + + def test_operation_cannot_paginate(self): + pagination_config = { + 'pagination': { + # Note that there's no pagination config for + # 'TestOperation', indicating that TestOperation + # is not pageable. + 'SomeOtherOperation': { + "input_token": "Marker", + "output_token": "Marker", + "more_results": "IsTruncated", + "limit_key": "MaxItems", + "result_key": "Users", + } + } + } + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + pagination_config, + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + self.assertFalse(service_client.can_paginate('test_operation')) + + def test_operation_can_paginate(self): + pagination_config = { + 'pagination': { + 'TestOperation': { + "input_token": "Marker", + "output_token": "Marker", + "more_results": "IsTruncated", + "limit_key": "MaxItems", + "result_key": "Users", + } + } + } + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + pagination_config, + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + self.assertTrue(service_client.can_paginate('test_operation')) + # Also, the config is cached, but we want to make sure we get + # the same answer when we ask again. + self.assertTrue(service_client.can_paginate('test_operation')) + + def test_service_has_no_pagination_configs(self): + # This is the case where there is an actual *.paginator.json, file, + # but the specific operation itself is not actually pageable. + # If the loader cannot load pagination configs, it communicates + # this by raising a DataNotFoundError. + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + exceptions.DataNotFoundError(data_path='/foo'), + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + self.assertFalse(service_client.can_paginate('test_operation')) + + def test_waiter_config_uses_service_name_not_endpoint_prefix(self): + waiter_config = {'version': 2, 'waiters': {}} + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + waiter_config, + ] + creator = self.create_client_creator() + # We're going to verify that the loader loads a service called + # 'other-service-name', and even though the endpointPrefix is + # 'myservice', we use 'other-service-name' for waiters/paginators, etc. + service_client = creator.create_client( + 'other-service-name', 'us-west-2' + ) + self.assertEqual(service_client.waiter_names, []) + # Note we're using other-service-name, not + # 'myservice', which is the endpointPrefix. + self.loader.load_service_model.assert_called_with( + 'other-service-name', 'waiters-2', '2014-01-01' + ) + + def test_service_has_waiter_configs(self): + waiter_config = { + 'version': 2, + 'waiters': { + "Waiter1": { + 'operation': 'TestOperation', + 'delay': 5, + 'maxAttempts': 20, + 'acceptors': [], + }, + "Waiter2": { + 'operation': 'TestOperation', + 'delay': 5, + 'maxAttempts': 20, + 'acceptors': [], + }, + }, + } + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + waiter_config, + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + self.assertEqual( + sorted(service_client.waiter_names), sorted(['waiter1', 'waiter2']) + ) + self.assertTrue(hasattr(service_client.get_waiter('waiter1'), 'wait')) + + def test_service_has_no_waiter_configs(self): + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + exceptions.DataNotFoundError(data_path='/foo'), + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + self.assertEqual(service_client.waiter_names, []) + with self.assertRaises(ValueError): + service_client.get_waiter("unknown_waiter") + + def test_service_has_retry_event(self): + # A retry event should be registered for the service. + event_emitter = self.create_mock_emitter() + creator = self.create_client_creator(event_emitter=event_emitter) + creator.create_client('myservice', 'us-west-2') + + event_emitter.register.assert_any_call( + 'needs-retry.myservice', + mock.ANY, + unique_id='retry-config-myservice', + ) + + def test_service_creates_retryhandler(self): + # A retry handler with the expected configuration should be + # created when instantiating a client. + retry_handler_factory = mock.Mock() + creator = self.create_client_creator( + retry_handler_factory=retry_handler_factory + ) + creator.create_client('myservice', 'us-west-2') + + retry_handler_factory.create_retry_handler.assert_called_with( + { + '__default__': { + 'delay': { + 'growth_factor': 2, + 'base': 'rand', + 'type': 'exponential', + }, + 'policies': {}, + 'max_attempts': 5, + } + }, + 'myservice', + ) + + def test_service_registers_retry_handler(self): + # The retry handler returned from ``create_retry_handler`` + # that was tested above needs to be set as the handler for + # the event emitter. + retry_handler_factory = mock.Mock() + handler = mock.Mock() + event_emitter = self.create_mock_emitter() + retry_handler_factory.create_retry_handler.return_value = handler + + creator = self.create_client_creator( + event_emitter=event_emitter, + retry_handler_factory=retry_handler_factory, + ) + creator.create_client('myservice', 'us-west-2') + + event_emitter.register.assert_any_call( + mock.ANY, handler, unique_id=mock.ANY + ) + + def test_service_retry_missing_config(self): + # No config means we should never see any retry events registered. + self.loader.load_data.return_value = {} + + event_emitter = self.create_mock_emitter() + creator = self.create_client_creator(event_emitter=event_emitter) + creator.create_client('myservice', 'us-west-2') + + for call in event_emitter.register.call_args_list: + self.assertNotIn('needs-retry', call[0][0]) + + def test_emits_after_call_error(self): + event_emitter = hooks.HierarchicalEmitter() + + recorded_kwargs = [] + + def record(event_name, **kwargs): + recorded_kwargs.append(kwargs) + + event_emitter.register( + 'after-call-error.myservice.TestOperation', record + ) + + raised_error = RuntimeError('Unexpected error') + self.endpoint.make_request.side_effect = raised_error + creator = self.create_client_creator(event_emitter=event_emitter) + client = creator.create_client('myservice', 'us-west-2') + with self.assertRaises(RuntimeError): + client.test_operation(Foo='one', Bar='two') + self.assertEqual( + recorded_kwargs, [{'exception': raised_error, 'context': mock.ANY}] + ) + + def test_can_override_max_attempts(self): + retry_handler_factory = mock.Mock(botocore.retryhandler) + creator = self.create_client_creator( + retry_handler_factory=retry_handler_factory + ) + creator.create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config( + retries={'max_attempts': 9, 'mode': 'legacy'} + ), + ) + + retry_handler_factory.create_retry_handler.assert_called_with( + { + '__default__': { + 'delay': { + 'growth_factor': 2, + 'base': 'rand', + 'type': 'exponential', + }, + 'policies': {}, + 'max_attempts': 10, + } + }, + 'myservice', + ) + + def test_can_register_standard_retry_mode(self): + with mock.patch('botocore.client.standard') as standard: + creator = self.create_client_creator() + creator.create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config( + retries={'mode': 'standard'} + ), + ) + self.assertTrue(standard.register_retry_handler.called) + + def test_can_register_standard_retry_mode_from_config_store(self): + fake_env = {'AWS_RETRY_MODE': 'standard'} + config_store = ConfigValueStore( + mapping={ + 'retry_mode': ChainProvider( + [ + EnvironmentProvider('AWS_RETRY_MODE', fake_env), + ] + ) + } + ) + creator = self.create_client_creator(config_store=config_store) + with mock.patch('botocore.client.standard') as standard: + creator.create_client('myservice', 'us-west-2') + self.assertTrue(standard.register_retry_handler.called) + + def test_try_to_paginate_non_paginated(self): + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + exceptions.DataNotFoundError(data_path='/foo'), + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + with self.assertRaises(exceptions.OperationNotPageableError): + service_client.get_paginator('test_operation') + + def test_successful_pagination_object_created(self): + pagination_config = { + 'pagination': { + 'TestOperation': { + "input_token": "Marker", + "output_token": "Marker", + "more_results": "IsTruncated", + "limit_key": "MaxItems", + "result_key": "Users", + } + } + } + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + pagination_config, + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + paginator = service_client.get_paginator('test_operation') + # The pagination logic itself is tested elsewhere (test_paginate.py), + # but we can at least make sure it looks like a paginator. + self.assertTrue(hasattr(paginator, 'paginate')) + + def test_paginator_class_name_from_client(self): + pagination_config = { + 'pagination': { + 'TestOperation': { + "input_token": "Marker", + "output_token": "Marker", + "more_results": "IsTruncated", + "limit_key": "MaxItems", + "result_key": "Users", + } + } + } + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + pagination_config, + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + paginator = service_client.get_paginator('test_operation') + self.assertEqual( + paginator.__class__.__name__, 'MyService.Paginator.TestOperation' + ) + + def test_paginator_help_from_client(self): + pagination_config = { + 'pagination': { + 'TestOperation': { + "input_token": "Marker", + "output_token": "Marker", + "more_results": "IsTruncated", + "limit_key": "MaxItems", + "result_key": "Users", + } + } + } + self.loader.load_service_model.side_effect = [ + self.service_description, + self.endpoint_ruleset, + pagination_config, + ] + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + paginator = service_client.get_paginator('test_operation') + with mock.patch('sys.stdout', io.StringIO()) as mock_stdout: + help(paginator.paginate) + contents = mock_stdout.getvalue() + lines = [ + ( + ' Creates an iterator that will paginate through responses ' + 'from :py:meth:`MyService.Client.test_operation`.' + ), + ' **Request Syntax**', + ' ::', + ' response_iterator = paginator.paginate(', + " Foo='string',", + " Bar='string',", + ' PaginationConfig={', + " 'MaxItems': 123,", + " 'PageSize': 123,", + " 'StartingToken': 'string'", + ' }', + ' )', + ' :type Foo: string', + ' :param Foo: **[REQUIRED]** Documents Foo', + ' :type Bar: string', + ' :param Bar: Documents Bar', + ' :type PaginationConfig: dict', + ' :param PaginationConfig:', + ( + ' A dictionary that provides parameters to control ' + 'pagination.' + ), + ' - **MaxItems** *(integer) --*', + ( + ' The total number of items to return. If the total ' + 'number of items available is more than the value specified ' + 'in max-items then a ``NextToken`` will be provided in the ' + 'output that you can use to resume pagination.' + ), + ' - **PageSize** *(integer) --*', + ' The size of each page.', + ' - **StartingToken** *(string) --*', + ( + ' A token to specify where to start paginating. This is ' + 'the ``NextToken`` from a previous response.' + ), + ' :returns: None', + ] + for line in lines: + self.assertIn(line, contents) + + def test_can_set_credentials_in_client_init(self): + creator = self.create_client_creator() + credentials = Credentials( + access_key='access_key', + secret_key='secret_key', + token='session_token', + ) + client = creator.create_client( + 'myservice', 'us-west-2', credentials=credentials + ) + + # Verify that we create an endpoint with a credentials object + # matching our creds arguments. + self.assertEqual(client._request_signer._credentials, credentials) + + def test_event_emitted_when_invoked(self): + event_emitter = hooks.HierarchicalEmitter() + creator = self.create_client_creator(event_emitter=event_emitter) + + calls = [] + + def handler(**kwargs): + return calls.append(kwargs) + + event_emitter.register('before-call', handler) + + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + service_client.test_operation(Foo='one', Bar='two') + self.assertEqual(len(calls), 1) + + def test_events_are_per_client(self): + event_emitter = hooks.HierarchicalEmitter() + creator = self.create_client_creator(event_emitter=event_emitter) + + first_calls = [] + + def first_handler(**kwargs): + return first_calls.append(kwargs) + + second_calls = [] + + def second_handler(**kwargs): + return second_calls.append(kwargs) + + first_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + second_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + first_client.meta.events.register('before-call', first_handler) + second_client.meta.events.register('before-call', second_handler) + + # Now, if we invoke an operation from either client, only + # the handlers registered with the specific client will be invoked. + # So if we invoke the first client. + first_client.test_operation(Foo='one', Bar='two') + # Only first_calls is populated, not second_calls. + self.assertEqual(len(first_calls), 1) + self.assertEqual(len(second_calls), 0) + + # If we invoke an operation from the second client, + # only second_calls will be populated, not first_calls. + second_client.test_operation(Foo='one', Bar='two') + # first_calls == 1 from the previous first_client.test_operation() + # call. + self.assertEqual(len(first_calls), 1) + self.assertEqual(len(second_calls), 1) + + def test_clients_inherit_handlers_from_session(self): + # Even though clients get their own event emitters, they still + # inherit any handlers that were registered on the event emitter + # at the time the client was created. + event_emitter = hooks.HierarchicalEmitter() + creator = self.create_client_creator(event_emitter=event_emitter) + + # So if an event handler is registered before any clients are created: + + base_calls = [] + + def base_handler(**kwargs): + return base_calls.append(kwargs) + + event_emitter.register('before-call', base_handler) + + # Then any client created from this point forward from the + # event_emitter passed into the ClientCreator will have this + # handler. + first_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + first_client.test_operation(Foo='one', Bar='two') + self.assertEqual(len(base_calls), 1) + + # Same thing if we create another client. + second_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + second_client.test_operation(Foo='one', Bar='two') + self.assertEqual(len(base_calls), 2) + + def test_clients_inherit_only_at_create_time(self): + # If event handlers are added to the copied event emitter + # _after_ a client is created, we don't pick those up. + event_emitter = hooks.HierarchicalEmitter() + creator = self.create_client_creator(event_emitter=event_emitter) + + # 1. Create a client. + first_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + # 2. Now register an event handler from the originating event emitter. + base_calls = [] + + def base_handler(**kwargs): + return base_calls.append(kwargs) + + event_emitter.register('before-call', base_handler) + + # 3. The client will _not_ see this because it already has its + # own copy of the event handlers. + first_client.test_operation(Foo='one', Bar='two') + self.assertEqual(len(base_calls), 0) + + def test_clients_have_meta_object(self): + creator = self.create_client_creator() + service_client = creator.create_client('myservice', 'us-west-2') + self.assertTrue(hasattr(service_client, 'meta')) + self.assertTrue(hasattr(service_client.meta, 'events')) + # Sanity check the event emitter has an .emit() method. + self.assertTrue(hasattr(service_client.meta.events, 'emit')) + + def test_client_register_seperate_unique_id_event(self): + event_emitter = hooks.HierarchicalEmitter() + creator = self.create_client_creator(event_emitter=event_emitter) + + client1 = creator.create_client('myservice', 'us-west-2') + client2 = creator.create_client('myservice', 'us-west-2') + + def ping(**kwargs): + return 'foo' + + client1.meta.events.register('some-event', ping, 'my-unique-id') + client2.meta.events.register('some-event', ping, 'my-unique-id') + + # Ensure both clients can register a function with an unique id + client1_responses = client1.meta.events.emit('some-event') + self.assertEqual(len(client1_responses), 1) + self.assertEqual(client1_responses[0][1], 'foo') + + client2_responses = client2.meta.events.emit('some-event') + self.assertEqual(len(client2_responses), 1) + self.assertEqual(client2_responses[0][1], 'foo') + + # Ensure when a client is unregistered the other client has + # the unique-id event still registered. + client1.meta.events.unregister('some-event', ping, 'my-unique-id') + client1_responses = client1.meta.events.emit('some-event') + self.assertEqual(len(client1_responses), 0) + + client2_responses = client2.meta.events.emit('some-event') + self.assertEqual(len(client2_responses), 1) + self.assertEqual(client2_responses[0][1], 'foo') + + # Ensure that the other client can unregister the event + client2.meta.events.unregister('some-event', ping, 'my-unique-id') + client2_responses = client2.meta.events.emit('some-event') + self.assertEqual(len(client2_responses), 0) + + def test_client_created_emits_events(self): + called = [] + + def on_client_create(class_attributes, **kwargs): + called.append(class_attributes) + + event_emitter = hooks.HierarchicalEmitter() + event_emitter.register('creating-client-class', on_client_create) + + creator = self.create_client_creator(event_emitter=event_emitter) + creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + self.assertEqual(len(called), 1) + self.assertIn('test_operation', called[0]) + + def test_client_method_called_event(self): + event_emitter = hooks.HierarchicalEmitter() + + def inject_params(params, **kwargs): + new_params = params.copy() + new_params['Foo'] = 'zero' + return new_params + + event_emitter.register( + 'provide-client-params.myservice.TestOperation', inject_params + ) + + wrapped_emitter = mock.Mock(wraps=event_emitter) + creator = self.create_client_creator(event_emitter=wrapped_emitter) + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + params = {'Foo': 'one', 'Bar': 'two'} + service_client.test_operation(**params) + + # Ensure that the initial params were not modified in the handler + self.assertEqual(params, {'Foo': 'one', 'Bar': 'two'}) + + # Ensure the handler passed on the correct param values. + body = self.endpoint.make_request.call_args[0][1]['body'] + self.assertEqual(body['Foo'], 'zero') + + def test_client_default_for_s3_addressing_style(self): + creator = self.create_client_creator() + client = creator.create_client('myservice', 'us-west-2') + self.assertEqual(client.meta.config.s3, None) + + def test_client_s3_addressing_style_with_config(self): + creator = self.create_client_creator() + my_client = creator.create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config( + s3={'addressing_style': 'auto'} + ), + ) + self.assertEqual(my_client.meta.config.s3['addressing_style'], 'auto') + + def test_client_s3_addressing_style_with_bad_value(self): + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', + 'us-west-2', + scoped_config={'s3': ''}, + ) + self.assertIsNone(client.meta.config.s3) + + def test_client_s3_addressing_style_with_config_store(self): + self.config_store.set_config_variable( + 's3', {'addressing_style': 'virtual'} + ) + creator = self.create_client_creator() + client = creator.create_client('myservice', 'us-west-2') + self.assertEqual(client.meta.config.s3['addressing_style'], 'virtual') + + def test_client_s3_addressing_style_with_incorrect_style(self): + with self.assertRaises(InvalidS3AddressingStyleError): + botocore.config.Config(s3={'addressing_style': 'foo'}) + + def test_client_s3_addressing_style_config_overrides_config_store(self): + self.config_store.set_config_variable( + 's3', {'addressing_style': 'virtual'} + ) + creator = self.create_client_creator() + my_client = creator.create_client( + 'myservice', + 'us-west-2', + client_config=botocore.config.Config( + s3={'addressing_style': 'auto'} + ), + ) + self.assertEqual(my_client.meta.config.s3['addressing_style'], 'auto') + + def test_client_payload_signing_from_config_store(self): + self.config_store.set_config_variable( + 's3', {'payload_signing_enabled': True} + ) + creator = self.create_client_creator() + my_client = creator.create_client('myservice', 'us-west-2') + self.assertEqual( + my_client.meta.config.s3['payload_signing_enabled'], True + ) + + def test_client_payload_signing_from_client_config(self): + creator = self.create_client_creator() + my_client = creator.create_client( + 'myservice', + 'us-west-2', + client_config=client.Config(s3={'payload_signing_enabled': True}), + ) + self.assertEqual( + my_client.meta.config.s3['payload_signing_enabled'], True + ) + + def test_client_payload_signing_client_config_overrides_scoped(self): + creator = self.create_client_creator() + my_client = creator.create_client( + 'myservice', + 'us-west-2', + scoped_config={'s3': {'payload_signing_enabled': False}}, + client_config=client.Config(s3={'payload_signing_enabled': True}), + ) + self.assertEqual( + my_client.meta.config.s3['payload_signing_enabled'], True + ) + + def test_client_s3_accelerate_from_config_store(self): + self.config_store.set_config_variable( + 's3', {'use_accelerate_endpoint': True} + ) + creator = self.create_client_creator() + my_client = creator.create_client('myservice', 'us-west-2') + self.assertEqual( + my_client.meta.config.s3['use_accelerate_endpoint'], True + ) + + def test_client_s3_accelerate_from_client_config(self): + creator = self.create_client_creator() + my_client = creator.create_client( + 'myservice', + 'us-west-2', + client_config=client.Config(s3={'use_accelerate_endpoint': True}), + ) + self.assertEqual( + my_client.meta.config.s3['use_accelerate_endpoint'], True + ) + + def test_client_s3_accelerate_client_config_overrides_config_store(self): + self.config_store.set_config_variable( + 's3', {'use_accelerate_endpoint': False} + ) + creator = self.create_client_creator() + my_client = creator.create_client( + 'myservice', + 'us-west-2', + client_config=client.Config(s3={'use_accelerate_endpoint': True}), + ) + self.assertEqual( + my_client.meta.config.s3['use_accelerate_endpoint'], True + ) + + def test_before_call_short_circuits_request(self): + def return_mock_tuple(**kwargs): + http_mock = mock.Mock() + http_mock.status_code = 200 + return http_mock, mock.Mock() + + emitter = hooks.HierarchicalEmitter() + emitter.register_last('before-call.*.*', return_mock_tuple) + creator = self.create_client_creator(event_emitter=emitter) + service_client = creator.create_client('myservice', 'us-west-2') + + service_client.test_operation(Foo='one') + self.assertFalse(self.endpoint.make_request.called) + + def test_getattr_emits_event(self): + emitter = self.create_mock_emitter() + emitter.emit_until_response.return_value = (None, None) + + creator = self.create_client_creator(event_emitter=emitter) + service_client = creator.create_client('myservice', 'us-west-2') + + # Assert that the event hasn't fired yet + emitter.emit_until_response.assert_not_called() + + with self.assertRaises(AttributeError): + service_client.attribute_that_does_not_exist + + emitter.emit_until_response.assert_called_once_with( + 'getattr.myservice.attribute_that_does_not_exist', + client=service_client, + ) + + def test_getattr_event_returns_response(self): + emitter = self.create_mock_emitter() + emitter.emit_until_response.return_value = (None, 'success') + + creator = self.create_client_creator(event_emitter=emitter) + service_client = creator.create_client('myservice', 'us-west-2') + + value = service_client.attribute_that_does_not_exist + + self.assertEqual(value, 'success') + + def _create_hostname_binding_client(self, *args, **kwargs): + test_operation = self.service_description['operations'][ + 'TestOperation' + ] + test_operation['endpoint'] = {'hostPrefix': '{Foo}.'} + test_shape = self.service_description['shapes']['TestOperationRequest'] + test_shape['members']['Foo']['hostLabel'] = True + + creator = self.create_client_creator() + return creator.create_client('myservice', *args, **kwargs) + + def test_client_operation_hostname_binding(self): + client = self._create_hostname_binding_client('us-west-2') + client.test_operation(Foo='bound') + + expected_url = 'https://bound.myservice.amazonaws.com/' + self.assertTrue(self.endpoint.make_request.called) + request_dict = self.endpoint.make_request.call_args[0][1] + self.assertEqual(request_dict['url'], expected_url) + + def test_client_operation_hostname_binding_validation(self): + client = self._create_hostname_binding_client('us-west-2') + with self.assertRaises(ParamValidationError): + client.test_operation(Foo='') + + def test_client_operation_hostname_binding_configuration(self): + config = botocore.config.Config(inject_host_prefix=False) + client = self._create_hostname_binding_client( + 'us-west-2', + client_config=config, + ) + + client.test_operation(Foo='baz') + expected_url = 'https://myservice.amazonaws.com/' + self.assertTrue(self.endpoint.make_request.called) + request_dict = self.endpoint.make_request.call_args[0][1] + self.assertEqual(request_dict['url'], expected_url) + + def test_client_close(self): + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + service_client.close() + self.endpoint.close.assert_called_once_with() + + def test_client_close_context_manager(self): + creator = self.create_client_creator() + with closing( + creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + ) as service_client: + service_client.test_operation(Foo='baz') + + self.endpoint.close.assert_called_once_with() + + def test_client_internal_credential_shim(self): + """This test exercises the internal credential shim exposed on clients. + It's here to ensure we don't unintentionally regress behavior used with + our upload/download operations in s3transfer with the CRT. + """ + creator = self.create_client_creator() + service_client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + self.assertEqual(service_client._get_credentials(), self.credentials) + + +class TestClientErrors(TestAutoGeneratedClient): + def add_error_response(self, error_response): + self.endpoint.make_request.return_value = ( + mock.Mock(status_code=400), + error_response, + ) + + def test_client_makes_call_with_error(self): + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + with Stubber(client) as stub: + stub.add_client_error( + 'test_operation', 'TestOperationErrorCode', 'error occurred' + ) + with self.assertRaises(client.exceptions.TestOperationException): + client.test_operation(Foo='one', Bar='two') + + def test_error_with_no_wire_code(self): + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + with Stubber(client) as stub: + stub.add_client_error('test_operation', '404', 'Not Found') + try: + client.test_operation(Foo='one', Bar='two') + except client.exceptions.ClientError as e: + # This is needed becasue the error could be a subclass of + # ClientError. + # We explicitly want it to be a generic ClientError though + self.assertEqual(e.__class__, exceptions.ClientError) + + def test_error_with_dot_separated_code(self): + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + with Stubber(client) as stub: + stub.add_client_error( + 'test_operation', 'InvalidAddress.NotFound', 'Not Found' + ) + try: + client.test_operation(Foo='one', Bar='two') + except client.exceptions.ClientError as e: + # This is needed becasue the error could be a subclass of + # ClientError. + # We explicitly want it to be a generic ClientError though + self.assertEqual(e.__class__, exceptions.ClientError) + + def test_error_with_empty_message(self): + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + with Stubber(client) as stub: + stub.add_client_error('test_operation', 'TestOperationErrorCode') + with self.assertRaises(client.exceptions.TestOperationException): + client.test_operation(Foo='one', Bar='two') + + def test_error_with_empty_code(self): + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + with Stubber(client) as stub: + stub.add_client_error('test_operation') + try: + client.test_operation(Foo='one', Bar='two') + except client.exceptions.ClientError as e: + # This is needed becasue the error could be a subclass of + # ClientError. + # We explicitly want it to be a generic ClientError though + self.assertEqual(e.__class__, exceptions.ClientError) + + def test_error_with_missing_code(self): + error_response = {'Error': {'Message': 'error occurred'}} + # The stubber is not being used because it will always populate the + # the message and code. + self.endpoint.make_request.return_value = ( + mock.Mock(status_code=400), + error_response, + ) + + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + try: + client.test_operation(Foo='one', Bar='two') + except client.exceptions.ClientError as e: + # This is needed becasue the error could be a subclass of + # ClientError. + # We explicitly want it to be a generic ClientError though + self.assertEqual(e.__class__, exceptions.ClientError) + + def test_error_with_empty_contents(self): + error_response = {'Error': {}} + # The stubber is not being used because it will always populate the + # the message and code. + self.endpoint.make_request.return_value = ( + mock.Mock(status_code=400), + error_response, + ) + + creator = self.create_client_creator() + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + try: + client.test_operation(Foo='one', Bar='two') + except client.exceptions.ClientError as e: + # This is needed becasue the error could be a subclass of + # ClientError. + # We explicitly want it to be a generic ClientError though + self.assertEqual(e.__class__, exceptions.ClientError) + + def test_exception_classes_across_clients_are_the_same(self): + creator = self.create_client_creator( + exceptions_factory=ClientExceptionsFactory() + ) + client = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + client2 = creator.create_client( + 'myservice', 'us-west-2', credentials=self.credentials + ) + + with Stubber(client) as stub: + stub.add_client_error( + 'test_operation', 'TestOperationErrorCode', 'error occurred' + ) + try: + client.test_operation(Foo='one', Bar='two') + except client2.exceptions.TestOperationException as e: + # Caught exception should as well be an instance of the + # other client's TestOperationException + self.assertIsInstance( + e, client.exceptions.TestOperationException + ) + + +class TestConfig(unittest.TestCase): + def test_can_use_args_to_construct(self): + config = botocore.config.Config( + *botocore.config.Config.OPTION_DEFAULTS.values() + ) + for ( + option, + default_value, + ) in botocore.config.Config.OPTION_DEFAULTS.items(): + self.assertTrue(hasattr(config, option)) + self.assertEqual(getattr(config, option), default_value) + + def test_can_use_kwargs_to_construct(self): + config = botocore.config.Config( + **botocore.config.Config.OPTION_DEFAULTS + ) + for ( + option, + default_value, + ) in botocore.config.Config.OPTION_DEFAULTS.items(): + self.assertTrue(hasattr(config, option)) + self.assertEqual(getattr(config, option), default_value) + + def test_can_use_mix_of_args_and_kwargs(self): + config = botocore.config.Config('us-east-1', read_timeout=50) + self.assertEqual(config.region_name, 'us-east-1') + self.assertEqual(config.read_timeout, 50) + + def test_invalid_kwargs(self): + with self.assertRaisesRegex(TypeError, 'Got unexpected keyword'): + botocore.config.Config(foo='foo') + + def test_pass_invalid_length_of_args(self): + with self.assertRaisesRegex(TypeError, 'Takes at most'): + botocore.config.Config( + 'foo', *botocore.config.Config.OPTION_DEFAULTS.values() + ) + + def test_create_with_multiple_kwargs(self): + with self.assertRaisesRegex(TypeError, 'Got multiple values'): + botocore.config.Config('us-east-1', region_name='us-east-1') + + def test_merge_returns_new_config_object(self): + config = botocore.config.Config() + other_config = botocore.config.Config() + new_config = config.merge(other_config) + # Check the type is correct + self.assertIsInstance(new_config, botocore.config.Config) + # Make sure the new config is a brand new config object + self.assertIsNot(new_config, config) + self.assertIsNot(new_config, other_config) + + def test_general_merge_keeps_default_values(self): + config = botocore.config.Config() + other_config = botocore.config.Config() + config_properties = vars(config) + new_config = config.merge(other_config) + # Ensure that the values all stayed the same in the new config + self.assertEqual(config_properties, vars(new_config)) + + def test_merge_overrides_values(self): + config = botocore.config.Config(region_name='us-east-1') + other_config = botocore.config.Config(region_name='us-west-2') + new_config = config.merge(other_config) + self.assertEqual(new_config.region_name, 'us-west-2') + + def test_merge_overrides_values_even_when_using_default(self): + config = botocore.config.Config(region_name='us-east-1') + other_config = botocore.config.Config(region_name=None) + new_config = config.merge(other_config) + self.assertEqual(new_config.region_name, None) + + def test_merge_overrides_values_even_when_using_default_timeout(self): + config = botocore.config.Config(read_timeout=30) + other_config = botocore.config.Config(read_timeout=DEFAULT_TIMEOUT) + new_config = config.merge(other_config) + self.assertEqual(new_config.read_timeout, DEFAULT_TIMEOUT) + + def test_merge_overrides_only_when_user_provided_values(self): + config = botocore.config.Config( + region_name='us-east-1', signature_version='s3v4' + ) + other_config = botocore.config.Config(region_name='us-west-2') + new_config = config.merge(other_config) + self.assertEqual(new_config.region_name, 'us-west-2') + self.assertEqual(new_config.signature_version, 's3v4') + + def test_can_set_retry_max_attempts(self): + config = botocore.config.Config(retries={'max_attempts': 15}) + self.assertEqual(config.retries['max_attempts'], 15) + + def test_validates_retry_config(self): + with self.assertRaisesRegex( + InvalidRetryConfigurationError, + 'Cannot provide retry configuration for "not-allowed"', + ): + botocore.config.Config(retries={'not-allowed': True}) + + def test_validates_max_retry_attempts(self): + with self.assertRaises(InvalidMaxRetryAttemptsError): + botocore.config.Config(retries={'max_attempts': -1}) + + def test_validates_total_max_attempts(self): + with self.assertRaises(InvalidMaxRetryAttemptsError): + botocore.config.Config(retries={'total_max_attempts': 0}) + + def test_validaties_retry_mode(self): + with self.assertRaises(InvalidRetryModeError): + botocore.config.Config(retries={'mode': 'turbo-mode'}) + + +class TestClientEndpointBridge(unittest.TestCase): + def setUp(self): + self.resolver = mock.Mock() + self.boilerplate_response = { + 'endpointName': 'us-east-1', + 'hostname': 's3.amazonaws.com', + 'partition': 'aws', + 'protocols': ['http', 'https'], + 'dnsSuffix': 'amazonaws.com', + 'signatureVersions': ['s3', 's3v4'], + } + self.resolver.construct_endpoint.return_value = ( + self.boilerplate_response + ) + + def test_guesses_endpoint_as_last_resort(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = None + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('myservice', region_name='guess') + self.assertEqual('guess', resolved['region_name']) + self.assertEqual('guess', resolved['signing_region']) + self.assertEqual('myservice', resolved['signing_name']) + self.assertEqual('myservice', resolved['service_name']) + self.assertEqual('v4', resolved['signature_version']) + self.assertEqual( + 'https://myservice.guess.amazonaws.com', resolved['endpoint_url'] + ) + + def test_uses_us_east_1_by_default_for_s3(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 's3.amazonaws.com', + 'endpointName': 'us-east-1', + 'signatureVersions': ['s3', 's3v4'], + 'protocols': ['https'], + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('s3') + self.assertEqual('us-east-1', resolved['region_name']) + self.assertEqual('us-east-1', resolved['signing_region']) + self.assertEqual('https://s3.amazonaws.com', resolved['endpoint_url']) + + def test_uses_region_from_client_config_if_available(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = None + client_config = mock.Mock() + client_config.region_name = 'us-foo-bar' + bridge = ClientEndpointBridge(resolver, client_config=client_config) + resolved = bridge.resolve('test') + self.assertEqual('us-foo-bar', resolved['region_name']) + self.assertEqual('us-foo-bar', resolved['signing_region']) + self.assertEqual( + 'https://test.us-foo-bar.amazonaws.com', resolved['endpoint_url'] + ) + + def test_can_guess_endpoint_and_use_given_endpoint_url(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = None + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve( + 'test', 'guess', endpoint_url='http://test.com' + ) + self.assertEqual('guess', resolved['region_name']) + self.assertEqual('guess', resolved['signing_region']) + self.assertEqual('http://test.com', resolved['endpoint_url']) + + def test_can_use_endpoint_url_with_resolved_endpoint(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'do-not-use-this', + 'endpointName': 'us-west-2', + 'signatureVersions': ['v2'], + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve( + 'ec2', 'us-west-2', endpoint_url='https://foo' + ) + self.assertEqual('us-west-2', resolved['region_name']) + self.assertEqual('us-west-2', resolved['signing_region']) + self.assertEqual('https://foo', resolved['endpoint_url']) + self.assertEqual('v2', resolved['signature_version']) + + def test_can_create_http_urls(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'host.com', + 'signatureVersions': ['v4'], + 'endpointName': 'us-foo-baz', + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('myservice', 'us-foo-baz', is_secure=False) + self.assertEqual('http://host.com', resolved['endpoint_url']) + + def test_credential_scope_overrides_signing_region(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'host.com', + 'endpointName': 'us-foo-baz', + 'signatureVersions': ['v4'], + 'credentialScope': {'region': 'override'}, + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('myservice', 'us-foo-baz') + self.assertEqual('us-foo-baz', resolved['region_name']) + self.assertEqual('override', resolved['signing_region']) + + def test_cred_scope_does_not_override_signing_region_if_endpoint_url(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'will-not-use.com', + 'endpointName': 'us-foo-baz', + 'signatureVersions': ['v4'], + 'credentialScope': {'region': 'override'}, + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve( + 'myservice', 'us-foo-baz', endpoint_url='https://override.com' + ) + self.assertEqual('us-foo-baz', resolved['region_name']) + self.assertEqual('us-foo-baz', resolved['signing_region']) + self.assertEqual('https://override.com', resolved['endpoint_url']) + + def test_resolved_region_overrides_region_when_no_endpoint_url(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'host.com', + 'signatureVersions': ['v4'], + 'endpointName': 'override', + 'protocols': ['https'], + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('myservice', 'will-not-be-there') + self.assertEqual('override', resolved['region_name']) + self.assertEqual('override', resolved['signing_region']) + self.assertEqual('https://host.com', resolved['endpoint_url']) + + def test_does_not_use_https_if_not_available(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'host.com', + 'signatureVersions': ['v4'], + 'endpointName': 'foo', + # Note: http, not https + 'protocols': ['http'], + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('myservice') + # We should resolve to http://, not https:// + self.assertEqual('http://host.com', resolved['endpoint_url']) + + def test_uses_signature_version_from_client_config(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test.com', + 'endpointName': 'us-west-2', + 'signatureVersions': ['v2'], + } + client_config = mock.Mock() + client_config.signature_version = 's3' + bridge = ClientEndpointBridge(resolver, client_config=client_config) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('s3', resolved['signature_version']) + + def test_uses_signature_version_from_client_config_when_guessing(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = None + client_config = mock.Mock() + client_config.signature_version = 's3v4' + bridge = ClientEndpointBridge(resolver, client_config=client_config) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('s3v4', resolved['signature_version']) + + def test_uses_signature_version_from_scoped_config(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test.com', + 'endpointName': 'us-west-2', + 'signatureVersions': ['v2'], + } + scoped_config = mock.Mock() + scoped_config.get.return_value = {'signature_version': 's3'} + bridge = ClientEndpointBridge(resolver, scoped_config) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('s3', resolved['signature_version']) + + def test_uses_s3v4_over_s3_for_s3(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test.com', + 'endpointName': 'us-west-2', + 'signatureVersions': ['s3v4', 's3'], + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('s3', 'us-west-2') + self.assertEqual('s3v4', resolved['signature_version']) + + def test_uses_s3v4_over_others_for_s3(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test.com', + 'endpointName': 'us-west-2', + 'signatureVersions': ['s3v4', 'v4'], + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('s3', 'us-west-2') + self.assertEqual('s3v4', resolved['signature_version']) + + def test_uses_v4_over_other_signers(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'signatureVersions': ['v2', 'v4'], + 'endpointName': 'us-west-2', + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('v4', resolved['signature_version']) + + def test_uses_known_signers_from_list_of_signature_versions(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'signatureVersions': ['foo', 'baz', 'v3https'], + 'endpointName': 'us-west-2', + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('v3https', resolved['signature_version']) + + def test_raises_when_signature_version_is_unknown(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'endpointName': 'us-west-2', + 'signatureVersions': ['foo'], + } + bridge = ClientEndpointBridge(resolver) + with self.assertRaises(UnknownSignatureVersionError): + bridge.resolve('test', 'us-west-2') + + def test_uses_first_known_signature_version(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'endpointName': 'us-west-2', + 'signatureVersions': ['foo', 'bar', 'baz', 's3v4', 'v2'], + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('s3v4', resolved['signature_version']) + + def test_raises_when_signature_version_is_not_found(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'endpointName': 'us-west-2', + } + bridge = ClientEndpointBridge(resolver) + with self.assertRaises(UnknownSignatureVersionError): + bridge.resolve('test', 'us-west-2') + + def test_uses_service_name_as_signing_name(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'signatureVersions': ['v4'], + 'endpointName': 'us-west-2', + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('test', resolved['signing_name']) + + def test_uses_credential_scope_signing_name(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'endpointName': 'us-west-2', + 'signatureVersions': ['v4'], + 'credentialScope': {'service': 'override'}, + } + bridge = ClientEndpointBridge(resolver) + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('override', resolved['signing_name']) + + def test_uses_service_signing_name_when_present_and_no_cred_scope(self): + resolver = mock.Mock() + resolver.construct_endpoint.return_value = { + 'partition': 'aws', + 'hostname': 'test', + 'signatureVersions': ['v4'], + 'endpointName': 'us-west-2', + } + bridge = ClientEndpointBridge(resolver, service_signing_name='foo') + resolved = bridge.resolve('test', 'us-west-2') + self.assertEqual('foo', resolved['signing_name']) + + def test_disable_dualstack_explicitly(self): + scoped_config = {'s3': {'use_dualstack_endpoint': True}} + config = botocore.config.Config(s3={'use_dualstack_endpoint': False}) + bridge = ClientEndpointBridge( + self.resolver, scoped_config, client_config=config + ) + resolved = bridge.resolve('s3', 'us-east-1') + self.assertEqual(resolved['endpoint_url'], 'https://s3.amazonaws.com') + + def test_use_dualstack_endpoint(self): + config = botocore.config.Config(use_dualstack_endpoint=True) + bridge = ClientEndpointBridge(self.resolver, client_config=config) + bridge.resolve('ec2', 'us-west-2') + self.resolver.construct_endpoint.assert_called_with( + 'ec2', + 'us-west-2', + use_dualstack_endpoint=True, + use_fips_endpoint=False, + ) + + def test_use_fips_endpoint(self): + config = botocore.config.Config(use_fips_endpoint=True) + bridge = ClientEndpointBridge(self.resolver, client_config=config) + bridge.resolve('ec2', 'us-west-2') + self.resolver.construct_endpoint.assert_called_with( + 'ec2', + 'us-west-2', + use_dualstack_endpoint=False, + use_fips_endpoint=True, + ) + + def test_use_dualstack_endpoint_omits_s3(self): + config = botocore.config.Config( + use_dualstack_endpoint=True, s3={'use_dualstack_endpoint': False} + ) + bridge = ClientEndpointBridge(self.resolver, client_config=config) + bridge.resolve('s3', 'us-west-2') + self.resolver.construct_endpoint.assert_called_with( + 's3', + 'us-west-2', + use_dualstack_endpoint=False, + use_fips_endpoint=False, + ) + + def test_modeled_endpoint_variants_client_config_trumps_scoped_config( + self, + ): + scoped_config = { + 'use_dualstack_endpoint': True, + 'use_fips_endpoint': True, + } + config = botocore.config.Config( + use_dualstack_endpoint=False, use_fips_endpoint=False + ) + bridge = ClientEndpointBridge( + self.resolver, scoped_config, client_config=config + ) + bridge.resolve('ec2', 'us-west-2') + self.resolver.construct_endpoint.assert_called_with( + 'ec2', + 'us-west-2', + use_dualstack_endpoint=False, + use_fips_endpoint=False, + ) + + def test_modeled_endpoint_variants_tags_using_config_store(self): + config_store = mock.Mock() + config_store.get_config_variable.return_value = True + bridge = ClientEndpointBridge(self.resolver, config_store=config_store) + bridge.resolve('ec2', 'us-west-2') + self.resolver.construct_endpoint.assert_called_with( + 'ec2', + 'us-west-2', + use_dualstack_endpoint=True, + use_fips_endpoint=True, + ) diff --git a/testbed/boto__botocore/tests/unit/test_compress.py b/testbed/boto__botocore/tests/unit/test_compress.py new file mode 100644 index 0000000000000000000000000000000000000000..c149d7c6bc38bedc59a7998c9c35351014a60e43 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_compress.py @@ -0,0 +1,322 @@ +# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import gzip +import io +import sys + +import pytest + +import botocore +from botocore.compress import COMPRESSION_MAPPING, maybe_compress_request +from botocore.config import Config +from tests import mock + + +def _make_op( + request_compression=None, + has_streaming_input=False, + streaming_metadata=None, +): + op = mock.Mock() + op.request_compression = request_compression + op.has_streaming_input = has_streaming_input + if streaming_metadata is not None: + streaming_shape = mock.Mock() + streaming_shape.metadata = streaming_metadata + op.get_streaming_input.return_value = streaming_shape + return op + + +OP_NO_COMPRESSION = _make_op() +OP_WITH_COMPRESSION = _make_op({'encodings': ['gzip']}) +OP_UNKNOWN_COMPRESSION = _make_op({'encodings': ['foo']}) +OP_MULTIPLE_COMPRESSIONS = _make_op({'encodings': ['gzip', 'foo']}) +STREAMING_OP_WITH_COMPRESSION = _make_op( + {'encodings': ['gzip']}, + True, + {}, +) +STREAMING_OP_WITH_COMPRESSION_REQUIRES_LENGTH = _make_op( + {'encodings': ['gzip']}, + True, + {'requiresLength': True}, +) + + +REQUEST_BODY = ( + b'Action=PutMetricData&Version=2010-08-01&Namespace=Namespace' + b'&MetricData.member.1.MetricName=metric&MetricData.member.1.Unit=Bytes' + b'&MetricData.member.1.Value=128' +) +REQUEST_BODY_COMPRESSED = ( + b'\x1f\x8b\x08\x00\x01\x00\x00\x00\x02\xffsL.\xc9\xcc\xcf\xb3\r(-\xf1M-)' + b'\xcaLvI,IT\x0bK-*\x06\x89\x1a\x19\x18\x1a\xe8\x1aX\xe8\x1a\x18\xaa\xf9%' + b'\xe6\xa6\x16\x17$&\xa7\xda\xc2Yj\x08\x1dz\xb9\xa9\xb9I\xa9Ez\x86z\x101\x90' + b'\x1a\xdb\\0\x13\xab\xaa\xd0\xbc\xcc\x12[\xa7\xca\x92\xd4b\xac\xd2a\x899\xa5' + b'\xa9\xb6\x86F\x16\x00\x1e\xdd\t\xfd\x9e\x00\x00\x00' +) + + +COMPRESSION_CONFIG_128_BYTES = Config( + disable_request_compression=False, + request_min_compression_size_bytes=128, +) +COMPRESSION_CONFIG_1_BYTE = Config( + disable_request_compression=False, + request_min_compression_size_bytes=1, +) + + +class NonSeekableStream: + def __init__(self, buffer): + self._buffer = buffer + + def read(self, size=None): + return self._buffer.read(size) + + +def _request_dict(body=REQUEST_BODY, headers=None): + if headers is None: + headers = {} + + return { + 'body': body, + 'headers': headers, + } + + +def request_dict_non_seekable_text_stream(): + stream = NonSeekableStream(io.StringIO(REQUEST_BODY.decode('utf-8'))) + return _request_dict(stream) + + +def request_dict_non_seekable_bytes_stream(): + return _request_dict(NonSeekableStream(io.BytesIO(REQUEST_BODY))) + + +class StaticGzipFile(gzip.GzipFile): + def __init__(self, *args, **kwargs): + kwargs['mtime'] = 1 + super().__init__(*args, **kwargs) + + +def static_compress(*args, **kwargs): + kwargs['mtime'] = 1 + return gzip.compress(*args, **kwargs) + + +def _bad_compression(body): + raise ValueError('Reached unintended compression algorithm "foo"') + + +MOCK_COMPRESSION = {'foo': _bad_compression} +MOCK_COMPRESSION.update(COMPRESSION_MAPPING) + + +def _assert_compression_body(compressed_body, expected_body): + data = compressed_body + if hasattr(compressed_body, 'read'): + data = compressed_body.read() + assert data == expected_body + + +def _assert_compression_header(headers, encoding='gzip'): + assert 'Content-Encoding' in headers + assert encoding in headers['Content-Encoding'] + + +def assert_request_compressed(request_dict, expected_body): + _assert_compression_body(request_dict['body'], expected_body) + _assert_compression_header(request_dict['headers']) + + +@pytest.mark.parametrize( + 'request_dict, operation_model', + [ + ( + _request_dict(), + OP_WITH_COMPRESSION, + ), + ( + _request_dict(), + OP_MULTIPLE_COMPRESSIONS, + ), + ( + _request_dict(), + STREAMING_OP_WITH_COMPRESSION, + ), + ( + _request_dict(bytearray(REQUEST_BODY)), + OP_WITH_COMPRESSION, + ), + ( + _request_dict(headers={'Content-Encoding': 'identity'}), + OP_WITH_COMPRESSION, + ), + ( + _request_dict(REQUEST_BODY.decode('utf-8')), + OP_WITH_COMPRESSION, + ), + ( + _request_dict(io.BytesIO(REQUEST_BODY)), + OP_WITH_COMPRESSION, + ), + ( + _request_dict(io.StringIO(REQUEST_BODY.decode('utf-8'))), + OP_WITH_COMPRESSION, + ), + ( + request_dict_non_seekable_bytes_stream(), + STREAMING_OP_WITH_COMPRESSION, + ), + ( + request_dict_non_seekable_text_stream(), + STREAMING_OP_WITH_COMPRESSION, + ), + ], +) +@mock.patch.object(botocore.compress, 'GzipFile', StaticGzipFile) +@mock.patch.object(botocore.compress, 'gzip_compress', static_compress) +@pytest.mark.skipif( + sys.version_info < (3, 8), reason='requires python3.8 or higher' +) +def test_compression(request_dict, operation_model): + maybe_compress_request( + COMPRESSION_CONFIG_128_BYTES, request_dict, operation_model + ) + assert_request_compressed(request_dict, REQUEST_BODY_COMPRESSED) + + +@pytest.mark.parametrize( + 'config, request_dict, operation_model', + [ + ( + Config( + disable_request_compression=True, + request_min_compression_size_bytes=1, + ), + _request_dict(), + OP_WITH_COMPRESSION, + ), + ( + Config( + disable_request_compression=False, + request_min_compression_size_bytes=256, + ), + _request_dict(), + OP_WITH_COMPRESSION, + ), + ( + Config( + disable_request_compression=False, + request_min_compression_size_bytes=1, + signature_version='v2', + ), + _request_dict(), + OP_WITH_COMPRESSION, + ), + ( + COMPRESSION_CONFIG_128_BYTES, + _request_dict(), + STREAMING_OP_WITH_COMPRESSION_REQUIRES_LENGTH, + ), + ( + COMPRESSION_CONFIG_128_BYTES, + _request_dict(), + OP_NO_COMPRESSION, + ), + ( + COMPRESSION_CONFIG_128_BYTES, + _request_dict(), + OP_UNKNOWN_COMPRESSION, + ), + ( + COMPRESSION_CONFIG_128_BYTES, + _request_dict(headers={'Content-Encoding': 'identity'}), + OP_UNKNOWN_COMPRESSION, + ), + ( + COMPRESSION_CONFIG_128_BYTES, + request_dict_non_seekable_bytes_stream(), + OP_WITH_COMPRESSION, + ), + ], +) +def test_no_compression(config, request_dict, operation_model): + ce_header = request_dict['headers'].get('Content-Encoding') + original_body = request_dict['body'] + maybe_compress_request(config, request_dict, operation_model) + assert request_dict['body'] == original_body + assert ce_header == request_dict['headers'].get('Content-Encoding') + + +@pytest.mark.parametrize( + 'operation_model, expected_body', + [ + ( + OP_WITH_COMPRESSION, + ( + b'\x1f\x8b\x08\x00\x01\x00\x00\x00\x02\xffK\xcb' + b'\xcf\xb7MJ,\x02\x00v\x8e5\x1c\x07\x00\x00\x00' + ), + ), + (OP_NO_COMPRESSION, {'foo': 'bar'}), + ], +) +@mock.patch.object(botocore.compress, 'gzip_compress', static_compress) +@pytest.mark.skipif( + sys.version_info < (3, 8), reason='requires python3.8 or higher' +) +def test_dict_compression(operation_model, expected_body): + request_dict = _request_dict({'foo': 'bar'}) + maybe_compress_request( + COMPRESSION_CONFIG_1_BYTE, request_dict, operation_model + ) + body = request_dict['body'] + assert body == expected_body + + +@pytest.mark.parametrize('body', [1, object(), True, 1.0]) +def test_maybe_compress_bad_types(body): + request_dict = _request_dict(body) + maybe_compress_request( + COMPRESSION_CONFIG_1_BYTE, request_dict, OP_WITH_COMPRESSION + ) + assert request_dict['body'] == body + + +@mock.patch.object(botocore.compress, 'GzipFile', StaticGzipFile) +def test_body_streams_position_reset(): + request_dict = _request_dict(io.BytesIO(REQUEST_BODY)) + maybe_compress_request( + COMPRESSION_CONFIG_128_BYTES, + request_dict, + OP_WITH_COMPRESSION, + ) + assert request_dict['body'].tell() == 0 + assert_request_compressed(request_dict, REQUEST_BODY_COMPRESSED) + + +@mock.patch.object(botocore.compress, 'gzip_compress', static_compress) +@mock.patch.object(botocore.compress, 'COMPRESSION_MAPPING', MOCK_COMPRESSION) +@pytest.mark.skipif( + sys.version_info < (3, 8), reason='requires python3.8 or higher' +) +def test_only_compress_once(): + request_dict = _request_dict() + maybe_compress_request( + COMPRESSION_CONFIG_128_BYTES, + request_dict, + OP_MULTIPLE_COMPRESSIONS, + ) + assert_request_compressed(request_dict, REQUEST_BODY_COMPRESSED) diff --git a/testbed/boto__botocore/tests/unit/test_config_provider.py b/testbed/boto__botocore/tests/unit/test_config_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..4a7d91b0d6604b01cfe05e03277a6e565cbfcf93 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_config_provider.py @@ -0,0 +1,1148 @@ +# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import copy +import os + +import pytest + +import botocore.configprovider +import botocore.session as session +from botocore.configprovider import ( + BaseProvider, + ChainProvider, + ConfigChainFactory, + ConfiguredEndpointProvider, + ConfigValueStore, + ConstantProvider, + DefaultConfigResolver, + EnvironmentProvider, + InstanceVarProvider, + ScopedConfigProvider, + SectionConfigProvider, + SmartDefaultsConfigStoreFactory, +) +from botocore.exceptions import ConnectTimeoutError +from botocore.utils import IMDSRegionProvider +from tests import mock, unittest + + +class TestConfigChainFactory(unittest.TestCase): + def assert_chain_does_provide( + self, + instance_map, + environ_map, + scoped_config_map, + create_config_chain_args, + expected_value, + ): + fake_session = mock.Mock(spec=session.Session) + fake_session.get_scoped_config.return_value = scoped_config_map + fake_session.instance_variables.return_value = instance_map + builder = ConfigChainFactory(fake_session, environ=environ_map) + chain = builder.create_config_chain(**create_config_chain_args) + value = chain.provide() + self.assertEqual(value, expected_value) + + def test_chain_builder_can_provide_instance(self): + self.assert_chain_does_provide( + instance_map={'instance_var': 'from-instance'}, + environ_map={}, + scoped_config_map={}, + create_config_chain_args={ + 'instance_name': 'instance_var', + }, + expected_value='from-instance', + ) + + def test_chain_builder_can_skip_instance(self): + self.assert_chain_does_provide( + instance_map={'wrong_instance_var': 'instance'}, + environ_map={'ENV_VAR': 'env'}, + scoped_config_map={}, + create_config_chain_args={ + 'instance_name': 'instance_var', + 'env_var_names': 'ENV_VAR', + }, + expected_value='env', + ) + + def test_chain_builder_can_provide_env_var(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={'ENV_VAR': 'from-env'}, + scoped_config_map={}, + create_config_chain_args={ + 'env_var_names': 'ENV_VAR', + }, + expected_value='from-env', + ) + + def test_does_provide_none_if_no_variable_exists_in_env_var_list(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={}, + create_config_chain_args={ + 'env_var_names': ['FOO'], + }, + expected_value=None, + ) + + def test_does_provide_value_if_variable_exists_in_env_var_list(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={'FOO': 'bar'}, + scoped_config_map={}, + create_config_chain_args={ + 'env_var_names': ['FOO'], + }, + expected_value='bar', + ) + + def test_does_provide_first_non_none_value_first_in_env_var_list(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={'FOO': 'baz'}, + scoped_config_map={}, + create_config_chain_args={ + 'env_var_names': ['FOO', 'BAR'], + }, + expected_value='baz', + ) + + def test_does_provide_first_non_none_value_second_in_env_var_list(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={'BAR': 'baz'}, + scoped_config_map={}, + create_config_chain_args={ + 'env_var_names': ['FOO', 'BAR'], + }, + expected_value='baz', + ) + + def test_does_provide_none_if_all_list_env_vars_are_none(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={}, + create_config_chain_args={ + 'env_var_names': ['FOO', 'BAR'], + }, + expected_value=None, + ) + + def test_does_provide_first_value_when_both_env_vars_exist(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={'FOO': 'baz', 'BAR': 'buz'}, + scoped_config_map={}, + create_config_chain_args={ + 'env_var_names': ['FOO', 'BAR'], + }, + expected_value='baz', + ) + + def test_chain_builder_can_provide_config_var(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={'config_var': 'from-config'}, + create_config_chain_args={ + 'config_property_names': 'config_var', + }, + expected_value='from-config', + ) + + def test_chain_builder_can_provide_nested_config_var(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={'config_var': {'nested-key': 'nested-val'}}, + create_config_chain_args={ + 'config_property_names': ('config_var', 'nested-key'), + }, + expected_value='nested-val', + ) + + def test_provide_value_from_config_list(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={'var': 'val'}, + create_config_chain_args={ + 'config_property_names': ['var'], + }, + expected_value='val', + ) + + def test_provide_value_from_config_list_looks_for_non_none_vals(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={'non_none_var': 'non_none_val'}, + create_config_chain_args={ + 'config_property_names': ['none_var', 'non_none_var'], + }, + expected_value='non_none_val', + ) + + def test_provide_value_from_config_list_retrieves_first_non_none_val(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={'first': 'first_val', 'second': 'second_val'}, + create_config_chain_args={ + 'config_property_names': ['first', 'second'], + }, + expected_value='first_val', + ) + + def test_provide_value_from_config_list_if_all_vars_are_none(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={}, + create_config_chain_args={ + 'config_property_names': ['config1', 'config2'], + }, + expected_value=None, + ) + + def test_provide_value_from_list_with_nested_var(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={'section': {'nested_var': 'nested_val'}}, + create_config_chain_args={ + 'config_property_names': [('section', 'nested_var')], + }, + expected_value='nested_val', + ) + + def test_chain_builder_can_provide_default(self): + self.assert_chain_does_provide( + instance_map={}, + environ_map={}, + scoped_config_map={}, + create_config_chain_args={'default': 'from-default'}, + expected_value='from-default', + ) + + def test_chain_provider_does_follow_priority_instance_var(self): + self.assert_chain_does_provide( + instance_map={'instance_var': 'from-instance'}, + environ_map={'ENV_VAR': 'from-env'}, + scoped_config_map={'config_var': 'from-config'}, + create_config_chain_args={ + 'instance_name': 'instance_var', + 'env_var_names': 'ENV_VAR', + 'config_property_names': 'config_var', + 'default': 'from-default', + }, + expected_value='from-instance', + ) + + def test_chain_provider_does_follow_priority_env_var(self): + self.assert_chain_does_provide( + instance_map={'wrong_instance_var': 'from-instance'}, + environ_map={'ENV_VAR': 'from-env'}, + scoped_config_map={'config_var': 'from-confi'}, + create_config_chain_args={ + 'instance_name': 'instance_var', + 'env_var_names': 'ENV_VAR', + 'config_property_names': 'config_var', + 'default': 'from-default', + }, + expected_value='from-env', + ) + + def test_chain_provider_does_follow_priority_config(self): + self.assert_chain_does_provide( + instance_map={'wrong_instance_var': 'from-instance'}, + environ_map={'WRONG_ENV_VAR': 'from-env'}, + scoped_config_map={'config_var': 'from-config'}, + create_config_chain_args={ + 'instance_name': 'instance_var', + 'env_var_names': 'ENV_VAR', + 'config_property_names': 'config_var', + 'default': 'from-default', + }, + expected_value='from-config', + ) + + def test_chain_provider_does_follow_priority_default(self): + self.assert_chain_does_provide( + instance_map={'wrong_instance_var': 'from-instance'}, + environ_map={'WRONG_ENV_VAR': 'from-env'}, + scoped_config_map={'wrong_config_var': 'from-config'}, + create_config_chain_args={ + 'instance_name': 'instance_var', + 'env_var_names': 'ENV_VAR', + 'config_property_names': 'config_var', + 'default': 'from-default', + }, + expected_value='from-default', + ) + + +class TestConfigValueStore(unittest.TestCase): + def test_does_provide_none_if_no_variable_exists(self): + provider = ConfigValueStore() + value = provider.get_config_variable('fake_variable') + self.assertIsNone(value) + + def test_does_provide_value_if_variable_exists(self): + mock_value_provider = mock.Mock(spec=BaseProvider) + mock_value_provider.provide.return_value = 'foo' + provider = ConfigValueStore( + mapping={ + 'fake_variable': mock_value_provider, + } + ) + value = provider.get_config_variable('fake_variable') + self.assertEqual(value, 'foo') + + def test_can_set_variable(self): + provider = ConfigValueStore() + provider.set_config_variable('fake_variable', 'foo') + value = provider.get_config_variable('fake_variable') + self.assertEqual(value, 'foo') + + def test_can_set_config_provider(self): + foo_value_provider = mock.Mock(spec=BaseProvider) + foo_value_provider.provide.return_value = 'foo' + provider = ConfigValueStore( + mapping={ + 'fake_variable': foo_value_provider, + } + ) + + value = provider.get_config_variable('fake_variable') + self.assertEqual(value, 'foo') + + bar_value_provider = mock.Mock(spec=BaseProvider) + bar_value_provider.provide.return_value = 'bar' + provider.set_config_provider('fake_variable', bar_value_provider) + + value = provider.get_config_variable('fake_variable') + self.assertEqual(value, 'bar') + + def test_can_get_config_provider(self): + chain_provider = ChainProvider( + providers=[ConstantProvider(value='bar')] + ) + config_value_store = ConfigValueStore( + mapping={ + 'fake_variable': chain_provider, + } + ) + provider = config_value_store.get_config_provider('fake_variable') + value = config_value_store.get_config_variable('fake_variable') + self.assertIsInstance(provider, ChainProvider) + self.assertEqual(value, 'bar') + + def test_can_get_config_provider_non_chain_provider(self): + constant_provider = ConstantProvider(value='bar') + config_value_store = ConfigValueStore( + mapping={ + 'fake_variable': constant_provider, + } + ) + provider = config_value_store.get_config_provider('fake_variable') + value = config_value_store.get_config_variable('fake_variable') + self.assertIsInstance(provider, ConstantProvider) + self.assertEqual(value, 'bar') + + def test_deepcopy_preserves_overrides(self): + provider = ConstantProvider(100) + config_store = ConfigValueStore(mapping={'fake_variable': provider}) + config_store.set_config_variable('fake_variable', 'override-value') + + config_store_deepcopy = copy.deepcopy(config_store) + + value = config_store_deepcopy.get_config_variable('fake_variable') + self.assertEqual(value, 'override-value') + + def test_copy_preserves_provider_identities(self): + fake_variable_provider = ConstantProvider(100) + config_store = ConfigValueStore( + mapping={ + 'fake_variable': fake_variable_provider, + } + ) + + config_store_copy = copy.copy(config_store) + + self.assertIs( + config_store.get_config_provider('fake_variable'), + config_store_copy.get_config_provider('fake_variable'), + ) + + def test_copy_preserves_overrides(self): + provider = ConstantProvider(100) + config_store = ConfigValueStore(mapping={'fake_variable': provider}) + config_store.set_config_variable('fake_variable', 'override-value') + + config_store_copy = copy.copy(config_store) + + value = config_store_copy.get_config_variable('fake_variable') + self.assertEqual(value, 'override-value') + + def test_copy_update_does_not_mutate_source_config_store(self): + fake_variable_provider = ConstantProvider(100) + config_store = ConfigValueStore( + mapping={ + 'fake_variable': fake_variable_provider, + } + ) + + config_store_copy = copy.copy(config_store) + + another_variable_provider = ConstantProvider('ABC') + + config_store_copy.set_config_provider( + 'fake_variable', another_variable_provider + ) + + assert config_store.get_config_variable('fake_variable') == 100 + assert config_store_copy.get_config_variable('fake_variable') == 'ABC' + + +class TestInstanceVarProvider(unittest.TestCase): + def assert_provides_value(self, name, instance_map, expected_value): + fake_session = mock.Mock(spec=session.Session) + fake_session.instance_variables.return_value = instance_map + + provider = InstanceVarProvider( + instance_var=name, + session=fake_session, + ) + value = provider.provide() + self.assertEqual(value, expected_value) + + def test_can_provide_value(self): + self.assert_provides_value( + name='foo', + instance_map={'foo': 'bar'}, + expected_value='bar', + ) + + def test_does_provide_none_if_value_not_in_dict(self): + self.assert_provides_value( + name='foo', + instance_map={}, + expected_value=None, + ) + + +class TestEnvironmentProvider(unittest.TestCase): + def assert_does_provide(self, env, name, expected_value): + provider = EnvironmentProvider(name=name, env=env) + value = provider.provide() + self.assertEqual(value, expected_value) + + def test_does_provide_none_if_no_variable_exists(self): + self.assert_does_provide( + name='FOO', + env={}, + expected_value=None, + ) + + def test_does_provide_value_if_variable_exists(self): + self.assert_does_provide( + name='FOO', + env={ + 'FOO': 'bar', + }, + expected_value='bar', + ) + + +class TestScopedConfigProvider(unittest.TestCase): + def assert_provides_value( + self, config_file_values, config_var_name, expected_value + ): + fake_session = mock.Mock(spec=session.Session) + fake_session.get_scoped_config.return_value = config_file_values + property_provider = ScopedConfigProvider( + config_var_name=config_var_name, + session=fake_session, + ) + value = property_provider.provide() + self.assertEqual(value, expected_value) + + def test_can_provide_value(self): + self.assert_provides_value( + config_file_values={'foo': 'bar'}, + config_var_name='foo', + expected_value='bar', + ) + + def test_does_provide_none_if_var_not_in_config(self): + self.assert_provides_value( + config_file_values={'foo': 'bar'}, + config_var_name='no_such_var', + expected_value=None, + ) + + def test_provide_nested_value(self): + self.assert_provides_value( + config_file_values={'section': {'nested_var': 'nested_val'}}, + config_var_name=('section', 'nested_var'), + expected_value='nested_val', + ) + + def test_provide_nested_value_but_not_section(self): + self.assert_provides_value( + config_file_values={'section': 'not-nested'}, + config_var_name=('section', 'nested_var'), + expected_value=None, + ) + + +def _make_provider_that_returns(return_value): + provider = mock.Mock(spec=BaseProvider) + provider.provide.return_value = return_value + return provider + + +def _make_providers_that_return(return_values): + mocks = [] + for return_value in return_values: + provider = _make_provider_that_returns(return_value) + mocks.append(provider) + return mocks + + +def assert_chain_does_provide(providers, expected_value): + provider = ChainProvider( + providers=providers, + ) + assert provider.provide() == expected_value + + +@pytest.mark.parametrize( + 'case', + ( + (None, []), + (None, [None]), + ('foo', ['foo']), + ('foo', ['foo', 'bar']), + ('bar', [None, 'bar']), + ('foo', ['foo', None]), + ('baz', [None, None, 'baz']), + ('bar', [None, 'bar', None]), + ('foo', ['foo', 'bar', None]), + ('foo', ['foo', 'bar', 'baz']), + ), +) +def test_chain_provider(case): + # Each case is a tuple with the first element being the expected return + # value from the ChainProvider. The second value being a list of return + # values from the individual providers that are in the chain. + assert_chain_does_provide(_make_providers_that_return(case[1]), case[0]) + + +class TestChainProvider(unittest.TestCase): + def test_can_convert_provided_value(self): + chain_provider = ChainProvider( + providers=_make_providers_that_return(['1']), + conversion_func=int, + ) + value = chain_provider.provide() + self.assertIsInstance(value, int) + self.assertEqual(value, 1) + + +class TestConstantProvider(unittest.TestCase): + def test_can_provide_value(self): + provider = ConstantProvider(value='foo') + value = provider.provide() + self.assertEqual(value, 'foo') + + +class TestSectionConfigProvider(unittest.TestCase): + def assert_provides_value( + self, + config_file_values, + section_name, + expected_value, + override_providers=None, + ): + fake_session = mock.Mock(spec=session.Session) + fake_session.get_scoped_config.return_value = config_file_values + provider = SectionConfigProvider( + section_name=section_name, + session=fake_session, + override_providers=override_providers, + ) + value = provider.provide() + self.assertEqual(value, expected_value) + + def test_provide_section_config(self): + self.assert_provides_value( + config_file_values={'mysection': {'section_var': 'section_val'}}, + section_name='mysection', + expected_value={'section_var': 'section_val'}, + ) + + def test_provide_service_config_missing_service(self): + self.assert_provides_value( + config_file_values={}, + section_name='mysection', + expected_value=None, + ) + + def test_provide_service_config_not_a_section(self): + self.assert_provides_value( + config_file_values={'myservice': 'not-a-section'}, + section_name='mysection', + expected_value=None, + ) + + def test_provide_section_config_with_overrides(self): + self.assert_provides_value( + config_file_values={ + 'mysection': { + 'override_var': 'from_config_file', + 'no_override_var': 'from_config_file', + } + }, + section_name='mysection', + override_providers={'override_var': ConstantProvider('override')}, + expected_value={ + 'override_var': 'override', + 'no_override_var': 'from_config_file', + }, + ) + + def test_provide_section_config_with_only_overrides(self): + self.assert_provides_value( + config_file_values={}, + section_name='mysection', + override_providers={'override_var': ConstantProvider('override')}, + expected_value={ + 'override_var': 'override', + }, + ) + + +class TestSmartDefaults: + def _template(self): + return { + "base": { + "retryMode": "standard", + "stsRegionalEndpoints": "regional", + "s3UsEast1RegionalEndpoints": "regional", + "connectTimeoutInMillis": 1000, + "tlsNegotiationTimeoutInMillis": 1000, + }, + "modes": { + "standard": { + "connectTimeoutInMillis": {"multiply": 2}, + "tlsNegotiationTimeoutInMillis": {"multiply": 2}, + }, + "in-region": { + "connectTimeoutInMillis": {"multiply": 1}, + "tlsNegotiationTimeoutInMillis": {"multiply": 1}, + }, + "cross-region": { + "connectTimeoutInMillis": {"multiply": 2.8}, + "tlsNegotiationTimeoutInMillis": {"multiply": 2.8}, + }, + "mobile": { + "connectTimeoutInMillis": {"override": 10000}, + "tlsNegotiationTimeoutInMillis": {"add": 10000}, + "retryMode": {"override": "adaptive"}, + }, + }, + } + + def _create_default_config_resolver(self): + return DefaultConfigResolver(self._template()) + + @pytest.fixture + def smart_defaults_factory(self): + fake_session = mock.Mock(spec=session.Session) + fake_session.get_scoped_config.return_value = {} + default_config_resolver = self._create_default_config_resolver() + return SmartDefaultsConfigStoreFactory( + default_config_resolver, imds_region_provider=mock.Mock() + ) + + @pytest.fixture + def fake_session(self): + fake_session = mock.Mock(spec=session.Session) + fake_session.get_scoped_config.return_value = {} + return fake_session + + def _create_config_value_store(self, s3_mapping={}, **override_kwargs): + constant_provider = ConstantProvider(value='my_sts_regional_endpoint') + environment_provider = EnvironmentProvider( + name='AWS_RETRY_MODE', env={'AWS_RETRY_MODE': None} + ) + fake_session = mock.Mock(spec=session.Session) + fake_session.get_scoped_config.return_value = {} + # Testing with three different providers to validate + # SmartDefaultsConfigStoreFactory._get_new_chain_provider + mapping = { + 'sts_regional_endpoints': ChainProvider( + providers=[constant_provider] + ), + 'retry_mode': ChainProvider(providers=[environment_provider]), + 's3': SectionConfigProvider('s3', fake_session, s3_mapping), + } + mapping.update(**override_kwargs) + config_store = ConfigValueStore(mapping=mapping) + return config_store + + def _create_os_environ_patcher(self): + return mock.patch.object( + botocore.configprovider.os, 'environ', mock.Mock(wraps=os.environ) + ) + + def test_config_store_deepcopy(self): + config_store = ConfigValueStore() + config_store.set_config_provider( + 'constant_value', ConstantProvider('ABC') + ) + config_store_copy = copy.deepcopy(config_store) + config_store_copy.set_config_provider( + 'constant_value_copy', ConstantProvider('123') + ) + assert config_store.get_config_variable('constant_value_copy') is None + assert config_store_copy.get_config_variable('constant_value') == 'ABC' + + def _create_config_value_store_to_test_merge(self): + environment_provider = EnvironmentProvider( + name='AWS_S3_US_EAST_1_REGIONAL_ENDPOINT', + env={}, + ) + + s3_mapping = { + 'us_east_1_regional_endpoint': ChainProvider( + providers=[environment_provider] + ) + } + + override_kwargs = {'connect_timeout': ConstantProvider(value=None)} + + config_value_store = self._create_config_value_store( + s3_mapping=s3_mapping, **override_kwargs + ) + + return config_value_store + + @pytest.mark.parametrize( + 'config_variable,expected_value_before,expected_value_after', + [ + ['retry_mode', None, 'standard'], + ['sts_regional_endpoints', 'my_sts_regional_endpoint', 'regional'], + ['connect_timeout', None, 2], + ['s3', None, {'us_east_1_regional_endpoint': 'regional'}], + ], + ) + def test_config_store_providers_not_mutated_after_merge( + self, + config_variable, + expected_value_before, + expected_value_after, + smart_defaults_factory, + ): + """Test uses the standard default mode from the template""" + + config_value_store = self._create_config_value_store_to_test_merge() + + provider = config_value_store.get_config_provider(config_variable) + + smart_defaults_factory.merge_smart_defaults( + config_value_store, 'standard', 'some-region' + ) + + assert provider.provide() == expected_value_before + + assert ( + config_value_store.get_config_variable(config_variable) + == expected_value_after + ) + + @pytest.mark.parametrize( + 'defaults_mode, retry_mode, sts_regional_endpoints,' + ' us_east_1_regional_endpoint, connect_timeout', + [ + ('standard', 'standard', 'regional', 'regional', 2000), + ('in-region', 'standard', 'regional', 'regional', 1000), + ('cross-region', 'standard', 'regional', 'regional', 2800), + ('mobile', 'adaptive', 'regional', 'regional', 10000), + ], + ) + def test_get_defualt_config_values( + self, + defaults_mode, + retry_mode, + sts_regional_endpoints, + us_east_1_regional_endpoint, + connect_timeout, + ): + default_config_resolver = self._create_default_config_resolver() + default_values = default_config_resolver.get_default_config_values( + defaults_mode + ) + assert default_values['retryMode'] == retry_mode + assert default_values['stsRegionalEndpoints'] == sts_regional_endpoints + assert ( + default_values['s3UsEast1RegionalEndpoints'] + == us_east_1_regional_endpoint + ) + assert default_values['connectTimeoutInMillis'] == connect_timeout + + def test_resolve_default_values_on_config( + self, smart_defaults_factory, fake_session + ): + config_store = self._create_config_value_store() + smart_defaults_factory.merge_smart_defaults( + config_store, 'standard', 'foo' + ) + s3_config = config_store.get_config_variable('s3') + assert s3_config['us_east_1_regional_endpoint'] == 'regional' + assert config_store.get_config_variable('retry_mode') == 'standard' + assert ( + config_store.get_config_variable('sts_regional_endpoints') + == 'regional' + ) + assert config_store.get_config_variable('connect_timeout') == 2 + + def test_no_resolve_default_s3_values_on_config( + self, smart_defaults_factory + ): + environment_provider = EnvironmentProvider( + name='AWS_S3_US_EAST_1_REGIONAL_ENDPOINT', + env={'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT': 'legacy'}, + ) + s3_mapping = { + 'us_east_1_regional_endpoint': ChainProvider( + providers=[environment_provider] + ) + } + config_store = self._create_config_value_store(s3_mapping=s3_mapping) + smart_defaults_factory.merge_smart_defaults( + config_store, 'standard', 'foo' + ) + s3_config = config_store.get_config_variable('s3') + assert s3_config['us_east_1_regional_endpoint'] == 'legacy' + assert config_store.get_config_variable('retry_mode') == 'standard' + assert ( + config_store.get_config_variable('sts_regional_endpoints') + == 'regional' + ) + assert config_store.get_config_variable('connect_timeout') == 2 + + def test_resolve_default_s3_values_on_config( + self, smart_defaults_factory, fake_session + ): + s3_mapping = { + 'use_arn_region': ChainProvider( + providers=[ConstantProvider(value=False)] + ) + } + config_store = self._create_config_value_store(s3_mapping=s3_mapping) + smart_defaults_factory.merge_smart_defaults( + config_store, 'standard', 'foo' + ) + s3_config = config_store.get_config_variable('s3') + assert s3_config['us_east_1_regional_endpoint'] == 'regional' + assert config_store.get_config_variable('retry_mode') == 'standard' + assert ( + config_store.get_config_variable('sts_regional_endpoints') + == 'regional' + ) + assert config_store.get_config_variable('connect_timeout') == 2 + + @pytest.mark.parametrize( + 'execution_env_var, region_env_var, default_region_env_var, ' + 'imds_region, client_region, resolved_mode', + [ + ( + 'AWS_Lambda_python3.6', + 'us-east-1', + None, + None, + 'us-east-1', + 'in-region', + ), + ( + 'AWS_Lambda_python3.6', + 'us-west-2', + 'us-west-2', + None, + 'us-east-1', + 'cross-region', + ), + ( + 'AWS_Lambda_python3.6', + None, + None, + 'us-west-2', + 'us-east-1', + 'cross-region', + ), + (None, None, 'us-east-1', 'us-east-1', 'us-east-1', 'in-region'), + (None, None, None, 'us-west-2', 'us-east-1', 'cross-region'), + (None, None, None, None, 'us-west-2', 'standard'), + ], + ) + def test_resolve_auto_mode( + self, + execution_env_var, + region_env_var, + default_region_env_var, + imds_region, + client_region, + resolved_mode, + ): + imds_region_provider = mock.Mock(spec=IMDSRegionProvider) + imds_region_provider.provide.return_value = imds_region + default_config_resolver = mock.Mock() + with mock.patch.object( + botocore.configprovider.os, 'environ', mock.Mock(wraps=os.environ) + ) as os_environ_patcher: + os_environ_patcher.get.side_effect = [ + execution_env_var, + default_region_env_var, + region_env_var, + ] + smart_defaults_factory = SmartDefaultsConfigStoreFactory( + default_config_resolver, imds_region_provider + ) + mode = smart_defaults_factory.resolve_auto_mode(client_region) + assert mode == resolved_mode + + def test_resolve_auto_mode_imds_region_provider_connect_timeout(self): + imds_region_provider = mock.Mock(spec=IMDSRegionProvider) + imds_region_provider.provide.side_effect = ConnectTimeoutError( + endpoint_url='foo' + ) + default_config_resolver = mock.Mock() + with mock.patch.object( + botocore.configprovider.os, 'environ', mock.Mock(wraps=os.environ) + ) as os_environ_patcher: + os_environ_patcher.get.side_effect = [None] * 3 + smart_defaults_factory = SmartDefaultsConfigStoreFactory( + default_config_resolver, imds_region_provider + ) + mode = smart_defaults_factory.resolve_auto_mode('us-west-2') + assert mode == 'standard' + + +def create_cases(): + service = 'batch' + + return [ + dict( + service=service, + environ_map={}, + full_config_map={}, + expected_value=None, + ), + dict( + service=service, + environ_map={'AWS_ENDPOINT_URL': 'global-from-env'}, + full_config_map={}, + expected_value='global-from-env', + ), + dict( + service=service, + environ_map={ + f'AWS_ENDPOINT_URL_{service.upper()}': 'service-from-env', + 'AWS_ENDPOINT_URL': 'global-from-env', + }, + full_config_map={}, + expected_value='service-from-env', + ), + dict( + service=service, + environ_map={ + 'AWS_ENDPOINT_URL': 'global-from-env', + 'AWS_ENDPOINT_URL_S3': 's3-endpoint-url', + }, + full_config_map={}, + expected_value='global-from-env', + ), + dict( + service=service, + environ_map={}, + full_config_map={ + 'profiles': {'default': {'endpoint_url': 'global-from-config'}} + }, + expected_value='global-from-config', + ), + dict( + service=service, + environ_map={}, + full_config_map={ + 'profiles': { + 'default': { + 'services': 'my-services', + } + }, + 'services': { + 'my-services': { + service: {'endpoint_url': "service-from-config"} + } + }, + }, + expected_value='service-from-config', + ), + dict( + service=service, + environ_map={}, + full_config_map={ + 'profiles': { + 'default': { + 'services': 'my-services', + 'endpoint_url': 'global-from-config', + } + }, + 'services': { + 'my-services': { + service: {'endpoint_url': "service-from-config"} + } + }, + }, + expected_value='service-from-config', + ), + dict( + service=service, + environ_map={ + 'AWS_ENDPOINT_URL': 'global-from-env', + }, + full_config_map={ + 'profiles': { + 'default': { + 'endpoint_url': 'global-from-config', + } + }, + }, + expected_value='global-from-env', + ), + dict( + service=service, + environ_map={ + f'AWS_ENDPOINT_URL_{service.upper()}': 'service-from-env', + }, + full_config_map={ + 'profiles': { + 'default': { + 'endpoint_url': 'global-from-config', + } + }, + }, + expected_value='service-from-env', + ), + dict( + service='s3', + environ_map={}, + full_config_map={ + 'profiles': { + 'default': { + 'services': 'my-services', + 'endpoint_url': 'global-from-config', + } + }, + 'services': { + 'my-services': { + service: {'endpoint_url': "service-from-config"} + } + }, + }, + expected_value='global-from-config', + ), + dict( + service='runtime.sagemaker', + environ_map={}, + full_config_map={ + 'profiles': { + 'default': { + 'services': 'my-services', + } + }, + 'services': { + 'my-services': { + 'sagemaker_runtime': { + 'endpoint_url': "service-from-config" + } + } + }, + }, + expected_value='service-from-config', + ), + dict( + service='apigateway', + environ_map={}, + full_config_map={ + 'profiles': { + 'default': { + 'services': 'my-services', + } + }, + 'services': { + 'my-services': { + 'api_gateway': {'endpoint_url': "service-from-config"} + } + }, + }, + expected_value='service-from-config', + ), + ] + + +class TestConfiguredEndpointProvider: + def assert_does_provide( + self, + service, + environ_map, + full_config_map, + expected_value, + ): + scoped_config_map = full_config_map.get('profiles', {}).get( + 'default', {} + ) + + chain = ConfiguredEndpointProvider( + scoped_config=scoped_config_map, + full_config=full_config_map, + client_name=service, + environ=environ_map, + ) + value = chain.provide() + assert value == expected_value + + @pytest.mark.parametrize('test_case', create_cases()) + def test_does_provide(self, test_case): + self.assert_does_provide(**test_case) + + def test_is_deepcopyable(self): + env = {'AWS_ENDPOINT_URL_BATCH': 'https://endpoint-override'} + provider = ConfiguredEndpointProvider( + full_config={}, scoped_config={}, client_name='batch', environ=env + ) + + provider_deepcopy = copy.deepcopy(provider) + assert provider is not provider_deepcopy + assert provider.provide() == 'https://endpoint-override' + assert provider_deepcopy.provide() == 'https://endpoint-override' + + env['AWS_ENDPOINT_URL_BATCH'] = 'https://another-new-endpoint-override' + assert provider.provide() == 'https://another-new-endpoint-override' + assert provider_deepcopy.provide() == 'https://endpoint-override' diff --git a/testbed/boto__botocore/tests/unit/test_configloader.py b/testbed/boto__botocore/tests/unit/test_configloader.py new file mode 100644 index 0000000000000000000000000000000000000000..a6e02f7d4f104cb7ba0db6e0332faf586c17cc78 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_configloader.py @@ -0,0 +1,211 @@ +#!/usr/bin/env +# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import os +import shutil +import tempfile + +import botocore.exceptions +from botocore.configloader import ( + load_config, + multi_file_load_config, + raw_config_parse, +) +from tests import mock, unittest + + +def path(filename): + directory = os.path.join(os.path.dirname(__file__), 'cfg') + if isinstance(filename, bytes): + directory = directory.encode('latin-1') + return os.path.join(directory, filename) + + +class TestConfigLoader(unittest.TestCase): + def setUp(self): + self.tempdir = tempfile.mkdtemp() + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def create_config_file(self, filename): + contents = ( + '[default]\n' + 'aws_access_key_id = foo\n' + 'aws_secret_access_key = bar\n\n' + '[profile "personal"]\n' + 'aws_access_key_id = fie\n' + 'aws_secret_access_key = baz\n' + 'aws_security_token = fiebaz\n' + ) + + directory = self.tempdir + if isinstance(filename, bytes): + directory = directory.encode('latin-1') + full_path = os.path.join(directory, filename) + + with open(full_path, 'w') as f: + f.write(contents) + return full_path + + def test_config_not_found(self): + with self.assertRaises(botocore.exceptions.ConfigNotFound): + raw_config_parse(path('aws_config_notfound')) + + def test_config_parse_error(self): + filename = path('aws_config_bad') + with self.assertRaises(botocore.exceptions.ConfigParseError): + raw_config_parse(filename) + + def test_config_parse_error_bad_unicode(self): + filename = path('aws_config_badbytes') + with self.assertRaises(botocore.exceptions.ConfigParseError): + raw_config_parse(filename) + + def test_config_parse_error_filesystem_encoding_none(self): + filename = path('aws_config_bad') + with mock.patch('sys.getfilesystemencoding') as encoding: + encoding.return_value = None + with self.assertRaises(botocore.exceptions.ConfigParseError): + raw_config_parse(filename) + + def test_config(self): + loaded_config = raw_config_parse(path('aws_config')) + self.assertIn('default', loaded_config) + self.assertIn('profile "personal"', loaded_config) + + def test_profile_map_conversion(self): + loaded_config = load_config(path('aws_config')) + self.assertIn('profiles', loaded_config) + self.assertEqual( + sorted(loaded_config['profiles'].keys()), ['default', 'personal'] + ) + + def test_bad_profiles_are_ignored(self): + filename = path('aws_bad_profile') + loaded_config = load_config(filename) + self.assertEqual(len(loaded_config['profiles']), 3) + profiles = loaded_config['profiles'] + self.assertIn('my profile', profiles) + self.assertIn('personal1', profiles) + self.assertIn('default', profiles) + + def test_nested_hierarchy_parsing(self): + filename = path('aws_config_nested') + loaded_config = load_config(filename) + config = loaded_config['profiles']['default'] + self.assertEqual(config['aws_access_key_id'], 'foo') + self.assertEqual(config['region'], 'us-west-2') + self.assertEqual(config['s3']['signature_version'], 's3v4') + self.assertEqual(config['cloudwatch']['signature_version'], 'v4') + + def test_nested_hierarchy_with_no_subsection_parsing(self): + filename = path('aws_config_nested') + raw_config = raw_config_parse(filename, False)['default'] + self.assertEqual(raw_config['aws_access_key_id'], 'foo') + self.assertEqual(raw_config['region'], 'us-west-2') + # Specifying False for pase_subsections in raw_config_parse + # will make sure that indented sections such as singature_version + # will not be treated as another subsection but rather + # its literal value. + self.assertEqual(raw_config['cloudwatch'], '\nsignature_version = v4') + self.assertEqual( + raw_config['s3'], + '\nsignature_version = s3v4' '\naddressing_style = path', + ) + + def test_nested_bad_config(self): + filename = path('aws_config_nested_bad') + with self.assertRaises(botocore.exceptions.ConfigParseError): + load_config(filename) + + def test_nested_bad_config_filesystem_encoding_none(self): + filename = path('aws_config_nested_bad') + with mock.patch('sys.getfilesystemencoding') as encoding: + encoding.return_value = None + with self.assertRaises(botocore.exceptions.ConfigParseError): + load_config(filename) + + def test_multi_file_load(self): + filenames = [ + path('aws_config_other'), + path('aws_config'), + path('aws_third_config'), + path('aws_config_notfound'), + ] + loaded_config = multi_file_load_config(*filenames) + config = loaded_config['profiles']['default'] + self.assertEqual(config['aws_access_key_id'], 'other_foo') + self.assertEqual(config['aws_secret_access_key'], 'other_bar') + second_config = loaded_config['profiles']['personal'] + self.assertEqual(second_config['aws_access_key_id'], 'fie') + self.assertEqual(second_config['aws_secret_access_key'], 'baz') + self.assertEqual(second_config['aws_security_token'], 'fiebaz') + third_config = loaded_config['profiles']['third'] + self.assertEqual(third_config['aws_access_key_id'], 'third_fie') + self.assertEqual(third_config['aws_secret_access_key'], 'third_baz') + self.assertEqual(third_config['aws_security_token'], 'third_fiebaz') + + def test_unicode_bytes_path_not_found(self): + with self.assertRaises(botocore.exceptions.ConfigNotFound): + with mock.patch('sys.getfilesystemencoding') as encoding: + encoding.return_value = 'utf-8' + load_config(path(b'\xe2\x9c\x93')) + + def test_unicode_bytes_path_not_found_filesystem_encoding_none(self): + with mock.patch('sys.getfilesystemencoding') as encoding: + encoding.return_value = None + with self.assertRaises(botocore.exceptions.ConfigNotFound): + load_config(path(b'\xe2\x9c\x93')) + + def test_unicode_bytes_path(self): + filename = self.create_config_file(b'aws_config_unicode\xe2\x9c\x93') + with mock.patch('sys.getfilesystemencoding') as encoding: + encoding.return_value = 'utf-8' + loaded_config = load_config(filename) + self.assertIn('default', loaded_config['profiles']) + self.assertIn('personal', loaded_config['profiles']) + + def test_sso_session_config(self): + filename = path('aws_sso_session_config') + loaded_config = load_config(filename) + self.assertIn('profiles', loaded_config) + self.assertIn('default', loaded_config['profiles']) + self.assertIn('sso_sessions', loaded_config) + self.assertIn('sso', loaded_config['sso_sessions']) + sso_config = loaded_config['sso_sessions']['sso'] + self.assertEqual(sso_config['sso_region'], 'us-east-1') + self.assertEqual(sso_config['sso_start_url'], 'https://example.com') + + def test_services_config(self): + filename = path('aws_services_config') + loaded_config = load_config(filename) + self.assertIn('profiles', loaded_config) + self.assertIn('default', loaded_config['profiles']) + self.assertIn('services', loaded_config) + self.assertIn('my-services', loaded_config['services']) + services_config = loaded_config['services']['my-services'] + self.assertIn('s3', services_config) + self.assertIn('dynamodb', services_config) + self.assertEqual( + services_config['s3']['endpoint_url'], 'https://localhost:5678/' + ) + self.assertEqual( + services_config['dynamodb']['endpoint_url'], + 'https://localhost:8888/', + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/testbed/boto__botocore/tests/unit/test_credentials.py b/testbed/boto__botocore/tests/unit/test_credentials.py new file mode 100644 index 0000000000000000000000000000000000000000..3017444a6f38741a30e8c2a7ad48e7611ae1e2ab --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_credentials.py @@ -0,0 +1,3737 @@ +# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ +# Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import os +import shutil +import subprocess +import tempfile +import time +from datetime import datetime, timedelta +from pathlib import Path + +import pytest +from dateutil.tz import tzlocal, tzutc + +import botocore.exceptions +import botocore.session +from botocore import credentials +from botocore.compat import json +from botocore.configprovider import ConfigValueStore +from botocore.credentials import ( + AssumeRoleProvider, + AssumeRoleWithWebIdentityProvider, + ConfigProvider, + CredentialProvider, + Credentials, + EnvProvider, + ProcessProvider, + ProfileProviderBuilder, + SharedCredentialProvider, + SSOCredentialFetcher, + SSOProvider, + create_assume_role_refresher, +) +from botocore.session import Session +from botocore.stub import Stubber +from botocore.utils import ( + ContainerMetadataFetcher, + FileWebIdentityTokenLoader, + SSOTokenLoader, + datetime2timestamp, +) +from tests import ( + BaseEnvVar, + IntegerRefresher, + mock, + skip_if_windows, + temporary_file, + unittest, +) + +# Passed to session to keep it from finding default config file +TESTENVVARS = {'config_file': (None, 'AWS_CONFIG_FILE', None)} + + +raw_metadata = { + 'foobar': { + 'Code': 'Success', + 'LastUpdated': '2012-12-03T14:38:21Z', + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'Token': 'foobar', + 'Expiration': '2012-12-03T20:48:03Z', + 'Type': 'AWS-HMAC', + } +} +post_processed_metadata = { + 'role_name': 'foobar', + 'access_key': raw_metadata['foobar']['AccessKeyId'], + 'secret_key': raw_metadata['foobar']['SecretAccessKey'], + 'token': raw_metadata['foobar']['Token'], + 'expiry_time': raw_metadata['foobar']['Expiration'], +} + + +def path(filename): + return os.path.join(os.path.dirname(__file__), 'cfg', filename) + + +class TestCredentials(BaseEnvVar): + def _ensure_credential_is_normalized_as_unicode(self, access, secret): + c = credentials.Credentials(access, secret) + self.assertTrue(isinstance(c.access_key, str)) + self.assertTrue(isinstance(c.secret_key, str)) + + def test_detect_nonascii_character(self): + self._ensure_credential_is_normalized_as_unicode( + 'foo\xe2\x80\x99', 'bar\xe2\x80\x99' + ) + + def test_unicode_input(self): + self._ensure_credential_is_normalized_as_unicode('foo', 'bar') + + +class TestRefreshableCredentials(TestCredentials): + def setUp(self): + super().setUp() + self.refresher = mock.Mock() + self.future_time = datetime.now(tzlocal()) + timedelta(hours=24) + self.expiry_time = datetime.now(tzlocal()) - timedelta(minutes=30) + self.metadata = { + 'access_key': 'NEW-ACCESS', + 'secret_key': 'NEW-SECRET', + 'token': 'NEW-TOKEN', + 'expiry_time': self.future_time.isoformat(), + 'role_name': 'rolename', + } + self.refresher.return_value = self.metadata + self.mock_time = mock.Mock() + self.creds = credentials.RefreshableCredentials( + 'ORIGINAL-ACCESS', + 'ORIGINAL-SECRET', + 'ORIGINAL-TOKEN', + self.expiry_time, + self.refresher, + 'iam-role', + time_fetcher=self.mock_time, + ) + + def test_refresh_needed(self): + # The expiry time was set for 30 minutes ago, so if we + # say the current time is utcnow(), then we should need + # a refresh. + self.mock_time.return_value = datetime.now(tzlocal()) + self.assertTrue(self.creds.refresh_needed()) + # We should refresh creds, if we try to access "access_key" + # or any of the cred vars. + self.assertEqual(self.creds.access_key, 'NEW-ACCESS') + self.assertEqual(self.creds.secret_key, 'NEW-SECRET') + self.assertEqual(self.creds.token, 'NEW-TOKEN') + + def test_no_expiration(self): + creds = credentials.RefreshableCredentials( + 'ORIGINAL-ACCESS', + 'ORIGINAL-SECRET', + 'ORIGINAL-TOKEN', + None, + self.refresher, + 'iam-role', + time_fetcher=self.mock_time, + ) + self.assertFalse(creds.refresh_needed()) + + def test_no_refresh_needed(self): + # The expiry time was 30 minutes ago, let's say it's an hour + # ago currently. That would mean we don't need a refresh. + self.mock_time.return_value = datetime.now(tzlocal()) - timedelta( + minutes=60 + ) + self.assertTrue(not self.creds.refresh_needed()) + + self.assertEqual(self.creds.access_key, 'ORIGINAL-ACCESS') + self.assertEqual(self.creds.secret_key, 'ORIGINAL-SECRET') + self.assertEqual(self.creds.token, 'ORIGINAL-TOKEN') + + def test_get_credentials_set(self): + # We need to return a consistent set of credentials to use during the + # signing process. + self.mock_time.return_value = datetime.now(tzlocal()) - timedelta( + minutes=60 + ) + self.assertTrue(not self.creds.refresh_needed()) + credential_set = self.creds.get_frozen_credentials() + self.assertEqual(credential_set.access_key, 'ORIGINAL-ACCESS') + self.assertEqual(credential_set.secret_key, 'ORIGINAL-SECRET') + self.assertEqual(credential_set.token, 'ORIGINAL-TOKEN') + + def test_refresh_returns_empty_dict(self): + self.refresher.return_value = {} + self.mock_time.return_value = datetime.now(tzlocal()) + self.assertTrue(self.creds.refresh_needed()) + + with self.assertRaises(botocore.exceptions.CredentialRetrievalError): + self.creds.access_key + + def test_refresh_returns_none(self): + self.refresher.return_value = None + self.mock_time.return_value = datetime.now(tzlocal()) + self.assertTrue(self.creds.refresh_needed()) + + with self.assertRaises(botocore.exceptions.CredentialRetrievalError): + self.creds.access_key + + def test_refresh_returns_partial_credentials(self): + self.refresher.return_value = {'access_key': 'akid'} + self.mock_time.return_value = datetime.now(tzlocal()) + self.assertTrue(self.creds.refresh_needed()) + + with self.assertRaises(botocore.exceptions.CredentialRetrievalError): + self.creds.access_key + + +class TestDeferredRefreshableCredentials(unittest.TestCase): + def setUp(self): + self.refresher = mock.Mock() + self.future_time = datetime.now(tzlocal()) + timedelta(hours=24) + self.metadata = { + 'access_key': 'NEW-ACCESS', + 'secret_key': 'NEW-SECRET', + 'token': 'NEW-TOKEN', + 'expiry_time': self.future_time.isoformat(), + 'role_name': 'rolename', + } + self.refresher.return_value = self.metadata + self.mock_time = mock.Mock() + self.mock_time.return_value = datetime.now(tzlocal()) + + def test_refresh_using_called_on_first_access(self): + creds = credentials.DeferredRefreshableCredentials( + self.refresher, 'iam-role', self.mock_time + ) + + # The credentials haven't been accessed, so there should be no calls. + self.refresher.assert_not_called() + + # Now that the object has been accessed, it should have called the + # refresher + creds.get_frozen_credentials() + self.assertEqual(self.refresher.call_count, 1) + + def test_refresh_only_called_once(self): + creds = credentials.DeferredRefreshableCredentials( + self.refresher, 'iam-role', self.mock_time + ) + + for _ in range(5): + creds.get_frozen_credentials() + + # The credentials were accessed several times in a row, but only + # should call refresh once. + self.assertEqual(self.refresher.call_count, 1) + + +class TestAssumeRoleCredentialFetcher(BaseEnvVar): + def setUp(self): + super().setUp() + self.source_creds = credentials.Credentials('a', 'b', 'c') + self.role_arn = 'myrole' + + def create_client_creator(self, with_response): + # Create a mock sts client that returns a specific response + # for assume_role. + client = mock.Mock() + if isinstance(with_response, list): + client.assume_role.side_effect = with_response + else: + client.assume_role.return_value = with_response + return mock.Mock(return_value=client) + + def get_expected_creds_from_response(self, response): + expiration = response['Credentials']['Expiration'] + if isinstance(expiration, datetime): + expiration = expiration.isoformat() + return { + 'access_key': response['Credentials']['AccessKeyId'], + 'secret_key': response['Credentials']['SecretAccessKey'], + 'token': response['Credentials']['SessionToken'], + 'expiry_time': expiration, + } + + def some_future_time(self): + timeobj = datetime.now(tzlocal()) + return timeobj + timedelta(hours=24) + + def test_no_cache(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, self.source_creds, self.role_arn + ) + + expected_response = self.get_expected_creds_from_response(response) + response = refresher.fetch_credentials() + + self.assertEqual(response, expected_response) + + def test_expiration_in_datetime_format(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + # Note the lack of isoformat(), we're using + # a datetime.datetime type. This will ensure + # we test both parsing as well as serializing + # from a given datetime because the credentials + # are immediately expired. + 'Expiration': self.some_future_time(), + }, + } + client_creator = self.create_client_creator(with_response=response) + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, self.source_creds, self.role_arn + ) + + expected_response = self.get_expected_creds_from_response(response) + response = refresher.fetch_credentials() + + self.assertEqual(response, expected_response) + + def test_retrieves_from_cache(self): + date_in_future = datetime.utcnow() + timedelta(seconds=1000) + utc_timestamp = date_in_future.isoformat() + 'Z' + cache_key = '793d6e2f27667ab2da104824407e486bfec24a47' + cache = { + cache_key: { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': utc_timestamp, + } + } + } + client_creator = mock.Mock() + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, self.source_creds, self.role_arn, cache=cache + ) + + expected_response = self.get_expected_creds_from_response( + cache[cache_key] + ) + response = refresher.fetch_credentials() + + self.assertEqual(response, expected_response) + client_creator.assert_not_called() + + def test_cache_key_is_windows_safe(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + cache = {} + client_creator = self.create_client_creator(with_response=response) + + role_arn = 'arn:aws:iam::role/foo-role' + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, self.source_creds, role_arn, cache=cache + ) + + refresher.fetch_credentials() + + # On windows, you cannot use a a ':' in the filename, so + # we need to make sure that it doesn't make it into the cache key. + cache_key = '75c539f0711ba78c5b9e488d0add95f178a54d74' + self.assertIn(cache_key, cache) + self.assertEqual(cache[cache_key], response) + + def test_cache_key_with_role_session_name(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + cache = {} + client_creator = self.create_client_creator(with_response=response) + role_session_name = 'my_session_name' + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + cache=cache, + extra_args={'RoleSessionName': role_session_name}, + ) + refresher.fetch_credentials() + + # This is the sha256 hex digest of the expected assume role args. + cache_key = '2964201f5648c8be5b9460a9cf842d73a266daf2' + self.assertIn(cache_key, cache) + self.assertEqual(cache[cache_key], response) + + def test_cache_key_with_policy(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + cache = {} + client_creator = self.create_client_creator(with_response=response) + policy = json.dumps( + { + "Version": "2012-10-17", + "Statement": [ + {"Effect": "Allow", "Action": "*", "Resource": "*"} + ], + } + ) + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + cache=cache, + extra_args={'Policy': policy}, + ) + refresher.fetch_credentials() + + # This is the sha256 hex digest of the expected assume role args. + cache_key = '176f223d915e82456c253545e192aa21d68f5ab8' + self.assertIn(cache_key, cache) + self.assertEqual(cache[cache_key], response) + + def test_assume_role_in_cache_but_expired(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + cache = { + 'development--myrole': { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': datetime.now(tzlocal()), + } + } + } + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, self.source_creds, self.role_arn, cache=cache + ) + expected = self.get_expected_creds_from_response(response) + response = refresher.fetch_credentials() + + self.assertEqual(response, expected) + + def test_role_session_name_can_be_provided(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + role_session_name = 'myname' + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + extra_args={'RoleSessionName': role_session_name}, + ) + refresher.fetch_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn=self.role_arn, RoleSessionName=role_session_name + ) + + def test_external_id_can_be_provided(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + external_id = 'my_external_id' + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + extra_args={'ExternalId': external_id}, + ) + refresher.fetch_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn=self.role_arn, + ExternalId=external_id, + RoleSessionName=mock.ANY, + ) + + def test_policy_can_be_provided(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + policy = json.dumps( + { + "Version": "2012-10-17", + "Statement": [ + {"Effect": "Allow", "Action": "*", "Resource": "*"} + ], + } + ) + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + extra_args={'Policy': policy}, + ) + refresher.fetch_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn=self.role_arn, Policy=policy, RoleSessionName=mock.ANY + ) + + def test_duration_seconds_can_be_provided(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + duration = 1234 + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + extra_args={'DurationSeconds': duration}, + ) + refresher.fetch_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn=self.role_arn, + DurationSeconds=duration, + RoleSessionName=mock.ANY, + ) + + def test_mfa(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + prompter = mock.Mock(return_value='token-code') + mfa_serial = 'mfa' + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + extra_args={'SerialNumber': mfa_serial}, + mfa_prompter=prompter, + ) + refresher.fetch_credentials() + + client = client_creator.return_value + # In addition to the normal assume role args, we should also + # inject the serial number from the config as well as the + # token code that comes from prompting the user (the prompter + # object). + client.assume_role.assert_called_with( + RoleArn='myrole', + RoleSessionName=mock.ANY, + SerialNumber='mfa', + TokenCode='token-code', + ) + + def test_refreshes(self): + responses = [ + { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + # We're creating an expiry time in the past so as + # soon as we try to access the credentials, the + # refresh behavior will be triggered. + 'Expiration': ( + datetime.now(tzlocal()) - timedelta(seconds=100) + ).isoformat(), + }, + }, + { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + } + }, + ] + client_creator = self.create_client_creator(with_response=responses) + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, self.source_creds, self.role_arn + ) + + # The first call will simply use whatever credentials it is given. + # The second will check the cache, and only make a call if the + # cached credentials are expired. + refresher.fetch_credentials() + refresher.fetch_credentials() + + client = client_creator.return_value + assume_role_calls = client.assume_role.call_args_list + self.assertEqual(len(assume_role_calls), 2, assume_role_calls) + + def test_mfa_refresh_enabled(self): + responses = [ + { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + # We're creating an expiry time in the past so as + # soon as we try to access the credentials, the + # refresh behavior will be triggered. + 'Expiration': ( + datetime.now(tzlocal()) - timedelta(seconds=100) + ).isoformat(), + }, + }, + { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + } + }, + ] + client_creator = self.create_client_creator(with_response=responses) + + token_code = 'token-code-1' + prompter = mock.Mock(side_effect=[token_code]) + mfa_serial = 'mfa' + + refresher = credentials.AssumeRoleCredentialFetcher( + client_creator, + self.source_creds, + self.role_arn, + extra_args={'SerialNumber': mfa_serial}, + mfa_prompter=prompter, + ) + + # This is will refresh credentials if they're expired. Because + # we set the expiry time to something in the past, this will + # trigger the refresh behavior. + refresher.fetch_credentials() + + assume_role = client_creator.return_value.assume_role + calls = [c[1] for c in assume_role.call_args_list] + expected_calls = [ + { + 'RoleArn': self.role_arn, + 'RoleSessionName': mock.ANY, + 'SerialNumber': mfa_serial, + 'TokenCode': token_code, + } + ] + self.assertEqual(calls, expected_calls) + + +class TestAssumeRoleWithWebIdentityCredentialFetcher(BaseEnvVar): + def setUp(self): + super().setUp() + self.role_arn = 'myrole' + + def load_token(self): + return 'totally.a.token' + + def some_future_time(self): + timeobj = datetime.now(tzlocal()) + return timeobj + timedelta(hours=24) + + def create_client_creator(self, with_response): + # Create a mock sts client that returns a specific response + # for assume_role. + client = mock.Mock() + if isinstance(with_response, list): + client.assume_role_with_web_identity.side_effect = with_response + else: + client.assume_role_with_web_identity.return_value = with_response + return mock.Mock(return_value=client) + + def get_expected_creds_from_response(self, response): + expiration = response['Credentials']['Expiration'] + if isinstance(expiration, datetime): + expiration = expiration.isoformat() + return { + 'access_key': response['Credentials']['AccessKeyId'], + 'secret_key': response['Credentials']['SecretAccessKey'], + 'token': response['Credentials']['SessionToken'], + 'expiry_time': expiration, + } + + def test_no_cache(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + refresher = credentials.AssumeRoleWithWebIdentityCredentialFetcher( + client_creator, self.load_token, self.role_arn + ) + expected_response = self.get_expected_creds_from_response(response) + response = refresher.fetch_credentials() + + self.assertEqual(response, expected_response) + + def test_retrieves_from_cache(self): + date_in_future = datetime.utcnow() + timedelta(seconds=1000) + utc_timestamp = date_in_future.isoformat() + 'Z' + cache_key = '793d6e2f27667ab2da104824407e486bfec24a47' + cache = { + cache_key: { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': utc_timestamp, + } + } + } + client_creator = mock.Mock() + refresher = credentials.AssumeRoleWithWebIdentityCredentialFetcher( + client_creator, self.load_token, self.role_arn, cache=cache + ) + expected_response = self.get_expected_creds_from_response( + cache[cache_key] + ) + response = refresher.fetch_credentials() + + self.assertEqual(response, expected_response) + client_creator.assert_not_called() + + def test_assume_role_in_cache_but_expired(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + cache = { + 'development--myrole': { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': datetime.now(tzlocal()), + } + } + } + + refresher = credentials.AssumeRoleWithWebIdentityCredentialFetcher( + client_creator, self.load_token, self.role_arn, cache=cache + ) + expected = self.get_expected_creds_from_response(response) + response = refresher.fetch_credentials() + + self.assertEqual(response, expected) + + +class TestAssumeRoleWithWebIdentityCredentialProvider(unittest.TestCase): + def setUp(self): + self.profile_name = 'some-profile' + self.config = { + 'role_arn': 'arn:aws:iam::123:role/role-name', + 'web_identity_token_file': '/some/path/token.jwt', + } + + def create_client_creator(self, with_response): + # Create a mock sts client that returns a specific response + # for assume_role. + client = mock.Mock() + if isinstance(with_response, list): + client.assume_role_with_web_identity.side_effect = with_response + else: + client.assume_role_with_web_identity.return_value = with_response + return mock.Mock(return_value=client) + + def some_future_time(self): + timeobj = datetime.now(tzlocal()) + return timeobj + timedelta(hours=24) + + def _mock_loader_cls(self, token=''): + mock_loader = mock.Mock(spec=FileWebIdentityTokenLoader) + mock_loader.return_value = token + mock_cls = mock.Mock() + mock_cls.return_value = mock_loader + return mock_cls + + def _load_config(self): + return { + 'profiles': { + self.profile_name: self.config, + } + } + + def test_assume_role_with_no_cache(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + mock_loader_cls = self._mock_loader_cls('totally.a.token') + provider = credentials.AssumeRoleWithWebIdentityProvider( + load_config=self._load_config, + client_creator=client_creator, + cache={}, + profile_name=self.profile_name, + token_loader_cls=mock_loader_cls, + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + mock_loader_cls.assert_called_with('/some/path/token.jwt') + + def test_assume_role_retrieves_from_cache(self): + date_in_future = datetime.utcnow() + timedelta(seconds=1000) + utc_timestamp = date_in_future.isoformat() + 'Z' + + cache_key = 'c29461feeacfbed43017d20612606ff76abc073d' + cache = { + cache_key: { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': utc_timestamp, + } + } + } + mock_loader_cls = self._mock_loader_cls('totally.a.token') + client_creator = mock.Mock() + provider = credentials.AssumeRoleWithWebIdentityProvider( + load_config=self._load_config, + client_creator=client_creator, + cache=cache, + profile_name=self.profile_name, + token_loader_cls=mock_loader_cls, + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo-cached') + self.assertEqual(creds.secret_key, 'bar-cached') + self.assertEqual(creds.token, 'baz-cached') + client_creator.assert_not_called() + + def test_assume_role_in_cache_but_expired(self): + expired_creds = datetime.now(tzlocal()) + valid_creds = expired_creds + timedelta(hours=1) + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': valid_creds, + }, + } + cache = { + 'development--myrole': { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': expired_creds, + } + } + } + client_creator = self.create_client_creator(with_response=response) + mock_loader_cls = self._mock_loader_cls('totally.a.token') + provider = credentials.AssumeRoleWithWebIdentityProvider( + load_config=self._load_config, + client_creator=client_creator, + cache=cache, + profile_name=self.profile_name, + token_loader_cls=mock_loader_cls, + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + mock_loader_cls.assert_called_with('/some/path/token.jwt') + + def test_role_session_name_provided(self): + self.config['role_session_name'] = 'myname' + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + mock_loader_cls = self._mock_loader_cls('totally.a.token') + provider = credentials.AssumeRoleWithWebIdentityProvider( + load_config=self._load_config, + client_creator=client_creator, + cache={}, + profile_name=self.profile_name, + token_loader_cls=mock_loader_cls, + ) + # The credentials won't actually be assumed until they're requested. + provider.load().get_frozen_credentials() + + client = client_creator.return_value + client.assume_role_with_web_identity.assert_called_with( + RoleArn='arn:aws:iam::123:role/role-name', + RoleSessionName='myname', + WebIdentityToken='totally.a.token', + ) + + def test_role_arn_not_set(self): + del self.config['role_arn'] + client_creator = self.create_client_creator(with_response={}) + provider = credentials.AssumeRoleWithWebIdentityProvider( + load_config=self._load_config, + client_creator=client_creator, + cache={}, + profile_name=self.profile_name, + ) + # If the role arn isn't set but the token path is raise an error + with self.assertRaises(botocore.exceptions.InvalidConfigError): + provider.load() + + +class TestEnvVar(BaseEnvVar): + def test_envvars_are_found_no_token(self): + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.method, 'env') + + def test_envvars_found_with_security_token(self): + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SECURITY_TOKEN': 'baz', + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + self.assertEqual(creds.method, 'env') + + def test_envvars_found_with_session_token(self): + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + self.assertEqual(creds.method, 'env') + + def test_envvars_not_found(self): + provider = credentials.EnvProvider(environ={}) + creds = provider.load() + self.assertIsNone(creds) + + def test_envvars_empty_string(self): + environ = { + 'AWS_ACCESS_KEY_ID': '', + 'AWS_SECRET_ACCESS_KEY': '', + 'AWS_SECURITY_TOKEN': '', + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + self.assertIsNone(creds) + + def test_expiry_omitted_if_envvar_empty(self): + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + 'AWS_CREDENTIAL_EXPIRATION': '', + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + # Because we treat empty env vars the same as not being provided, + # we should return static credentials and not a refreshable + # credential. + self.assertNotIsInstance(creds, credentials.RefreshableCredentials) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + def test_error_when_expiry_required_but_empty(self): + expiry_time = datetime.now(tzlocal()) - timedelta(hours=1) + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + + del environ['AWS_CREDENTIAL_EXPIRATION'] + + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + creds.get_frozen_credentials() + + def test_can_override_env_var_mapping(self): + # We can change the env var provider to + # use our specified env var names. + environ = { + 'FOO_ACCESS_KEY': 'foo', + 'FOO_SECRET_KEY': 'bar', + 'FOO_SESSION_TOKEN': 'baz', + } + mapping = { + 'access_key': 'FOO_ACCESS_KEY', + 'secret_key': 'FOO_SECRET_KEY', + 'token': 'FOO_SESSION_TOKEN', + } + provider = credentials.EnvProvider(environ, mapping) + creds = provider.load() + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + def test_can_override_partial_env_var_mapping(self): + # Only changing the access key mapping. + # The other 2 use the default values of + # AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN + # use our specified env var names. + environ = { + 'FOO_ACCESS_KEY': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + } + provider = credentials.EnvProvider( + environ, {'access_key': 'FOO_ACCESS_KEY'} + ) + creds = provider.load() + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + def test_can_override_expiry_env_var_mapping(self): + expiry_time = datetime.now(tzlocal()) - timedelta(hours=1) + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + 'FOO_EXPIRY': expiry_time.isoformat(), + } + provider = credentials.EnvProvider( + environ, {'expiry_time': 'FOO_EXPIRY'} + ) + creds = provider.load() + + # Since the credentials are expired, we'll trigger a refresh whenever + # we try to access them. Since the environment credentials are still + # expired, this will raise an error. + error_message = ( + "Credentials were refreshed, but the refreshed credentials are " + "still expired." + ) + with self.assertRaisesRegex(RuntimeError, error_message): + creds.get_frozen_credentials() + + def test_partial_creds_is_an_error(self): + # If the user provides an access key, they must also + # provide a secret key. Not doing so will generate an + # error. + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + # Missing the AWS_SECRET_ACCESS_KEY + } + provider = credentials.EnvProvider(environ) + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + provider.load() + + def test_partial_creds_is_an_error_empty_string(self): + # If the user provides an access key, they must also + # provide a secret key. Not doing so will generate an + # error. + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': '', + } + provider = credentials.EnvProvider(environ) + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + provider.load() + + def test_missing_access_key_id_raises_error(self): + expiry_time = datetime.now(tzlocal()) - timedelta(hours=1) + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + + del environ['AWS_ACCESS_KEY_ID'] + + # Since the credentials are expired, we'll trigger a refresh + # whenever we try to access them. At that refresh time, the relevant + # environment variables are incomplete, so an error will be raised. + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + creds.get_frozen_credentials() + + def test_credentials_refresh(self): + # First initialize the credentials with an expired credential set. + expiry_time = datetime.now(tzlocal()) - timedelta(hours=1) + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + self.assertIsInstance(creds, credentials.RefreshableCredentials) + + # Since the credentials are expired, we'll trigger a refresh whenever + # we try to access them. But at this point the environment hasn't been + # updated, so when it refreshes it will trigger an exception because + # the new creds are still expired. + error_message = ( + "Credentials were refreshed, but the refreshed credentials are " + "still expired." + ) + with self.assertRaisesRegex(RuntimeError, error_message): + creds.get_frozen_credentials() + + # Now we update the environment with non-expired credentials, + # so when we access the creds it will refresh and grab the new ones. + expiry_time = datetime.now(tzlocal()) + timedelta(hours=1) + environ.update( + { + 'AWS_ACCESS_KEY_ID': 'bin', + 'AWS_SECRET_ACCESS_KEY': 'bam', + 'AWS_SESSION_TOKEN': 'biz', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + ) + + frozen = creds.get_frozen_credentials() + self.assertEqual(frozen.access_key, 'bin') + self.assertEqual(frozen.secret_key, 'bam') + self.assertEqual(frozen.token, 'biz') + + def test_credentials_only_refresh_when_needed(self): + expiry_time = datetime.now(tzlocal()) + timedelta(hours=2) + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + provider = credentials.EnvProvider(environ) + + # Perform the initial credential load + creds = provider.load() + + # Now that the initial load has been performed, we go ahead and + # change the environment. If the credentials were expired, + # they would immediately refresh upon access and we'd get the new + # ones. Since they've got plenty of time, they shouldn't refresh. + expiry_time = datetime.now(tzlocal()) + timedelta(hours=3) + environ.update( + { + 'AWS_ACCESS_KEY_ID': 'bin', + 'AWS_SECRET_ACCESS_KEY': 'bam', + 'AWS_SESSION_TOKEN': 'biz', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + ) + + frozen = creds.get_frozen_credentials() + self.assertEqual(frozen.access_key, 'foo') + self.assertEqual(frozen.secret_key, 'bar') + self.assertEqual(frozen.token, 'baz') + + def test_credentials_not_refreshable_if_no_expiry_present(self): + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + self.assertNotIsInstance(creds, credentials.RefreshableCredentials) + self.assertIsInstance(creds, credentials.Credentials) + + def test_credentials_do_not_become_refreshable(self): + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_SESSION_TOKEN': 'baz', + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + frozen = creds.get_frozen_credentials() + self.assertEqual(frozen.access_key, 'foo') + self.assertEqual(frozen.secret_key, 'bar') + self.assertEqual(frozen.token, 'baz') + + expiry_time = datetime.now(tzlocal()) - timedelta(hours=1) + environ.update( + { + 'AWS_ACCESS_KEY_ID': 'bin', + 'AWS_SECRET_ACCESS_KEY': 'bam', + 'AWS_SESSION_TOKEN': 'biz', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + ) + + frozen = creds.get_frozen_credentials() + self.assertEqual(frozen.access_key, 'foo') + self.assertEqual(frozen.secret_key, 'bar') + self.assertEqual(frozen.token, 'baz') + self.assertNotIsInstance(creds, credentials.RefreshableCredentials) + + def test_credentials_throw_error_if_expiry_goes_away(self): + expiry_time = datetime.now(tzlocal()) - timedelta(hours=1) + environ = { + 'AWS_ACCESS_KEY_ID': 'foo', + 'AWS_SECRET_ACCESS_KEY': 'bar', + 'AWS_CREDENTIAL_EXPIRATION': expiry_time.isoformat(), + } + provider = credentials.EnvProvider(environ) + creds = provider.load() + + del environ['AWS_CREDENTIAL_EXPIRATION'] + + with self.assertRaises(credentials.PartialCredentialsError): + creds.get_frozen_credentials() + + +class TestSharedCredentialsProvider(BaseEnvVar): + def setUp(self): + super().setUp() + self.ini_parser = mock.Mock() + + def test_credential_file_exists_default_profile(self): + self.ini_parser.return_value = { + 'default': { + 'aws_access_key_id': 'foo', + 'aws_secret_access_key': 'bar', + } + } + provider = credentials.SharedCredentialProvider( + creds_filename='~/.aws/creds', + profile_name='default', + ini_parser=self.ini_parser, + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertIsNone(creds.token) + self.assertEqual(creds.method, 'shared-credentials-file') + + def test_partial_creds_raise_error(self): + self.ini_parser.return_value = { + 'default': { + 'aws_access_key_id': 'foo', + # Missing 'aws_secret_access_key'. + } + } + provider = credentials.SharedCredentialProvider( + creds_filename='~/.aws/creds', + profile_name='default', + ini_parser=self.ini_parser, + ) + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + provider.load() + + def test_credentials_file_exists_with_session_token(self): + self.ini_parser.return_value = { + 'default': { + 'aws_access_key_id': 'foo', + 'aws_secret_access_key': 'bar', + 'aws_session_token': 'baz', + } + } + provider = credentials.SharedCredentialProvider( + creds_filename='~/.aws/creds', + profile_name='default', + ini_parser=self.ini_parser, + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + self.assertEqual(creds.method, 'shared-credentials-file') + + def test_credentials_file_with_multiple_profiles(self): + self.ini_parser.return_value = { + # Here the user has a 'default' and a 'dev' profile. + 'default': { + 'aws_access_key_id': 'a', + 'aws_secret_access_key': 'b', + 'aws_session_token': 'c', + }, + 'dev': { + 'aws_access_key_id': 'd', + 'aws_secret_access_key': 'e', + 'aws_session_token': 'f', + }, + } + # And we specify a profile_name of 'dev'. + provider = credentials.SharedCredentialProvider( + creds_filename='~/.aws/creds', + profile_name='dev', + ini_parser=self.ini_parser, + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'd') + self.assertEqual(creds.secret_key, 'e') + self.assertEqual(creds.token, 'f') + self.assertEqual(creds.method, 'shared-credentials-file') + + def test_credentials_file_does_not_exist_returns_none(self): + # It's ok if the credentials file does not exist, we should + # just catch the appropriate errors and return None. + self.ini_parser.side_effect = botocore.exceptions.ConfigNotFound( + path='foo' + ) + provider = credentials.SharedCredentialProvider( + creds_filename='~/.aws/creds', + profile_name='dev', + ini_parser=self.ini_parser, + ) + creds = provider.load() + self.assertIsNone(creds) + + +class TestConfigFileProvider(BaseEnvVar): + def setUp(self): + super().setUp() + profile_config = { + 'aws_access_key_id': 'a', + 'aws_secret_access_key': 'b', + 'aws_session_token': 'c', + # Non creds related configs can be in a session's # config. + 'region': 'us-west-2', + 'output': 'json', + } + parsed = {'profiles': {'default': profile_config}} + parser = mock.Mock() + parser.return_value = parsed + self.parser = parser + + def test_config_file_exists(self): + provider = credentials.ConfigProvider( + 'cli.cfg', 'default', self.parser + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertEqual(creds.token, 'c') + self.assertEqual(creds.method, 'config-file') + + def test_config_file_missing_profile_config(self): + # Referring to a profile that's not in the config file + # will result in session.config returning an empty dict. + profile_name = 'NOT-default' + provider = credentials.ConfigProvider( + 'cli.cfg', profile_name, self.parser + ) + creds = provider.load() + self.assertIsNone(creds) + + def test_config_file_errors_ignored(self): + # We should move on to the next provider if the config file + # can't be found. + self.parser.side_effect = botocore.exceptions.ConfigNotFound( + path='cli.cfg' + ) + provider = credentials.ConfigProvider( + 'cli.cfg', 'default', self.parser + ) + creds = provider.load() + self.assertIsNone(creds) + + def test_partial_creds_is_error(self): + profile_config = { + 'aws_access_key_id': 'a', + # Missing aws_secret_access_key + } + parsed = {'profiles': {'default': profile_config}} + parser = mock.Mock() + parser.return_value = parsed + provider = credentials.ConfigProvider('cli.cfg', 'default', parser) + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + provider.load() + + +class TestBotoProvider(BaseEnvVar): + def setUp(self): + super().setUp() + self.ini_parser = mock.Mock() + + def test_boto_config_file_exists_in_home_dir(self): + environ = {} + self.ini_parser.return_value = { + 'Credentials': { + # boto's config file does not support a session token + # so we only test for access_key/secret_key. + 'aws_access_key_id': 'a', + 'aws_secret_access_key': 'b', + } + } + provider = credentials.BotoProvider( + environ=environ, ini_parser=self.ini_parser + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertIsNone(creds.token) + self.assertEqual(creds.method, 'boto-config') + + def test_env_var_set_for_boto_location(self): + environ = {'BOTO_CONFIG': 'alternate-config.cfg'} + self.ini_parser.return_value = { + 'Credentials': { + # boto's config file does not support a session token + # so we only test for access_key/secret_key. + 'aws_access_key_id': 'a', + 'aws_secret_access_key': 'b', + } + } + provider = credentials.BotoProvider( + environ=environ, ini_parser=self.ini_parser + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertIsNone(creds.token) + self.assertEqual(creds.method, 'boto-config') + + # Assert that the parser was called with the filename specified + # in the env var. + self.ini_parser.assert_called_with('alternate-config.cfg') + + def test_no_boto_config_file_exists(self): + self.ini_parser.side_effect = botocore.exceptions.ConfigNotFound( + path='foo' + ) + provider = credentials.BotoProvider( + environ={}, ini_parser=self.ini_parser + ) + creds = provider.load() + self.assertIsNone(creds) + + def test_partial_creds_is_error(self): + ini_parser = mock.Mock() + ini_parser.return_value = { + 'Credentials': { + 'aws_access_key_id': 'a', + # Missing aws_secret_access_key. + } + } + provider = credentials.BotoProvider(environ={}, ini_parser=ini_parser) + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + provider.load() + + +class TestOriginalEC2Provider(BaseEnvVar): + def test_load_ec2_credentials_file_not_exist(self): + provider = credentials.OriginalEC2Provider(environ={}) + creds = provider.load() + self.assertIsNone(creds) + + def test_load_ec2_credentials_file_exists(self): + environ = { + 'AWS_CREDENTIAL_FILE': 'foo.cfg', + } + parser = mock.Mock() + parser.return_value = { + 'AWSAccessKeyId': 'a', + 'AWSSecretKey': 'b', + } + provider = credentials.OriginalEC2Provider( + environ=environ, parser=parser + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertIsNone(creds.token) + self.assertEqual(creds.method, 'ec2-credentials-file') + + +class TestInstanceMetadataProvider(BaseEnvVar): + def test_load_from_instance_metadata(self): + timeobj = datetime.now(tzlocal()) + timestamp = (timeobj + timedelta(hours=24)).isoformat() + fetcher = mock.Mock() + fetcher.retrieve_iam_role_credentials.return_value = { + 'access_key': 'a', + 'secret_key': 'b', + 'token': 'c', + 'expiry_time': timestamp, + 'role_name': 'myrole', + } + provider = credentials.InstanceMetadataProvider( + iam_role_fetcher=fetcher + ) + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertEqual(creds.token, 'c') + self.assertEqual(creds.method, 'iam-role') + + def test_no_role_creds_exist(self): + fetcher = mock.Mock() + fetcher.retrieve_iam_role_credentials.return_value = {} + provider = credentials.InstanceMetadataProvider( + iam_role_fetcher=fetcher + ) + creds = provider.load() + self.assertIsNone(creds) + fetcher.retrieve_iam_role_credentials.assert_called_with() + + +class CredentialResolverTest(BaseEnvVar): + def setUp(self): + super().setUp() + self.provider1 = mock.Mock() + self.provider1.METHOD = 'provider1' + self.provider1.CANONICAL_NAME = 'CustomProvider1' + self.provider2 = mock.Mock() + self.provider2.METHOD = 'provider2' + self.provider2.CANONICAL_NAME = 'CustomProvider2' + self.fake_creds = credentials.Credentials('a', 'b', 'c') + + def test_load_credentials_single_provider(self): + self.provider1.load.return_value = self.fake_creds + resolver = credentials.CredentialResolver(providers=[self.provider1]) + creds = resolver.load_credentials() + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertEqual(creds.token, 'c') + + def test_get_provider_by_name(self): + resolver = credentials.CredentialResolver(providers=[self.provider1]) + result = resolver.get_provider('provider1') + self.assertIs(result, self.provider1) + + def test_get_unknown_provider_raises_error(self): + resolver = credentials.CredentialResolver(providers=[self.provider1]) + with self.assertRaises(botocore.exceptions.UnknownCredentialError): + resolver.get_provider('unknown-foo') + + def test_first_credential_non_none_wins(self): + self.provider1.load.return_value = None + self.provider2.load.return_value = self.fake_creds + resolver = credentials.CredentialResolver( + providers=[self.provider1, self.provider2] + ) + creds = resolver.load_credentials() + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertEqual(creds.token, 'c') + self.provider1.load.assert_called_with() + self.provider2.load.assert_called_with() + + def test_no_creds_loaded(self): + self.provider1.load.return_value = None + self.provider2.load.return_value = None + resolver = credentials.CredentialResolver( + providers=[self.provider1, self.provider2] + ) + creds = resolver.load_credentials() + self.assertIsNone(creds) + + def test_inject_additional_providers_after_existing(self): + self.provider1.load.return_value = None + self.provider2.load.return_value = self.fake_creds + resolver = credentials.CredentialResolver( + providers=[self.provider1, self.provider2] + ) + # Now, if we were to call resolver.load() now, provider2 would + # win because it's returning a non None response. + # However we can inject a new provider before provider2 to + # override this process. + # Providers can be added by the METHOD name of each provider. + new_provider = mock.Mock() + new_provider.METHOD = 'new_provider' + new_provider.load.return_value = credentials.Credentials('d', 'e', 'f') + + resolver.insert_after('provider1', new_provider) + + creds = resolver.load_credentials() + self.assertIsNotNone(creds) + + self.assertEqual(creds.access_key, 'd') + self.assertEqual(creds.secret_key, 'e') + self.assertEqual(creds.token, 'f') + # Provider 1 should have been called, but provider2 should + # *not* have been called because new_provider already returned + # a non-None response. + self.provider1.load.assert_called_with() + self.assertTrue(not self.provider2.called) + + def test_inject_provider_before_existing(self): + new_provider = mock.Mock() + new_provider.METHOD = 'override' + new_provider.load.return_value = credentials.Credentials('x', 'y', 'z') + + resolver = credentials.CredentialResolver( + providers=[self.provider1, self.provider2] + ) + resolver.insert_before(self.provider1.METHOD, new_provider) + creds = resolver.load_credentials() + self.assertEqual(creds.access_key, 'x') + self.assertEqual(creds.secret_key, 'y') + self.assertEqual(creds.token, 'z') + + def test_can_remove_providers(self): + self.provider1.load.return_value = credentials.Credentials( + 'a', 'b', 'c' + ) + self.provider2.load.return_value = credentials.Credentials( + 'd', 'e', 'f' + ) + resolver = credentials.CredentialResolver( + providers=[self.provider1, self.provider2] + ) + resolver.remove('provider1') + creds = resolver.load_credentials() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'd') + self.assertEqual(creds.secret_key, 'e') + self.assertEqual(creds.token, 'f') + self.assertTrue(not self.provider1.load.called) + self.provider2.load.assert_called_with() + + def test_provider_unknown(self): + resolver = credentials.CredentialResolver( + providers=[self.provider1, self.provider2] + ) + # No error is raised if you try to remove an unknown provider. + resolver.remove('providerFOO') + # But an error IS raised if you try to insert after an unknown + # provider. + with self.assertRaises(botocore.exceptions.UnknownCredentialError): + resolver.insert_after('providerFoo', None) + + +class TestCreateCredentialResolver(BaseEnvVar): + def setUp(self): + super().setUp() + + self.session = mock.Mock(spec=botocore.session.Session) + self.session.get_component = self.fake_get_component + + self.fake_instance_variables = { + 'credentials_file': 'a', + 'legacy_config_file': 'b', + 'config_file': 'c', + 'metadata_service_timeout': 1, + 'metadata_service_num_attempts': 1, + 'imds_use_ipv6': 'false', + } + self.config_loader = ConfigValueStore() + for name, value in self.fake_instance_variables.items(): + self.config_loader.set_config_variable(name, value) + + self.session.get_config_variable = ( + self.config_loader.get_config_variable + ) + self.session.set_config_variable = self.fake_set_config_variable + self.session.instance_variables = self.fake_instance_variable_lookup + + def fake_get_component(self, key): + if key == 'config_provider': + return self.config_loader + return None + + def fake_instance_variable_lookup(self): + return self.fake_instance_variables + + def fake_set_config_variable(self, logical_name, value): + self.fake_instance_variables[logical_name] = value + + def test_create_credential_resolver(self): + resolver = credentials.create_credential_resolver(self.session) + self.assertIsInstance(resolver, credentials.CredentialResolver) + + def test_explicit_profile_ignores_env_provider(self): + self.session.set_config_variable('profile', 'dev') + resolver = credentials.create_credential_resolver(self.session) + + self.assertTrue( + all(not isinstance(p, EnvProvider) for p in resolver.providers) + ) + + def test_no_profile_checks_env_provider(self): + # If no profile is provided, + self.config_loader.set_config_variable('profile', None) + resolver = credentials.create_credential_resolver(self.session) + # Then an EnvProvider should be part of our credential lookup chain. + self.assertTrue( + any(isinstance(p, EnvProvider) for p in resolver.providers) + ) + + def test_default_cache(self): + resolver = credentials.create_credential_resolver(self.session) + cache = resolver.get_provider('assume-role').cache + self.assertIsInstance(cache, dict) + self.assertEqual(cache, {}) + + def test_custom_cache(self): + custom_cache = credentials.JSONFileCache() + resolver = credentials.create_credential_resolver( + self.session, custom_cache + ) + cache = resolver.get_provider('assume-role').cache + self.assertIs(cache, custom_cache) + + +class TestCanonicalNameSourceProvider(BaseEnvVar): + def setUp(self): + super().setUp() + self.custom_provider1 = mock.Mock(spec=CredentialProvider) + self.custom_provider1.METHOD = 'provider1' + self.custom_provider1.CANONICAL_NAME = 'CustomProvider1' + self.custom_provider2 = mock.Mock(spec=CredentialProvider) + self.custom_provider2.METHOD = 'provider2' + self.custom_provider2.CANONICAL_NAME = 'CustomProvider2' + self.fake_creds = credentials.Credentials('a', 'b', 'c') + + def test_load_source_credentials(self): + provider = credentials.CanonicalNameCredentialSourcer( + providers=[self.custom_provider1, self.custom_provider2] + ) + self.custom_provider1.load.return_value = self.fake_creds + result = provider.source_credentials('CustomProvider1') + self.assertIs(result, self.fake_creds) + + def test_load_source_credentials_case_insensitive(self): + provider = credentials.CanonicalNameCredentialSourcer( + providers=[self.custom_provider1, self.custom_provider2] + ) + self.custom_provider1.load.return_value = self.fake_creds + result = provider.source_credentials('cUsToMpRoViDeR1') + self.assertIs(result, self.fake_creds) + + def test_load_unknown_canonical_name_raises_error(self): + provider = credentials.CanonicalNameCredentialSourcer( + providers=[self.custom_provider1] + ) + with self.assertRaises(botocore.exceptions.UnknownCredentialError): + provider.source_credentials('CustomUnknown') + + def _assert_assume_role_creds_returned_with_shared_file(self, provider): + assume_role_provider = mock.Mock(spec=AssumeRoleProvider) + assume_role_provider.METHOD = 'assume-role' + assume_role_provider.CANONICAL_NAME = None + + source = credentials.CanonicalNameCredentialSourcer( + providers=[assume_role_provider, provider] + ) + + # If the assume role provider returns credentials, those should be + # what is returned. + assume_role_provider.load.return_value = self.fake_creds + provider.load.return_value = credentials.Credentials('d', 'e', 'f') + + creds = source.source_credentials(provider.CANONICAL_NAME) + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertEqual(creds.token, 'c') + self.assertFalse(provider.load.called) + + def _assert_returns_creds_if_assume_role_not_used(self, provider): + assume_role_provider = mock.Mock(spec=AssumeRoleProvider) + assume_role_provider.METHOD = 'assume-role' + assume_role_provider.CANONICAL_NAME = None + + source = credentials.CanonicalNameCredentialSourcer( + providers=[assume_role_provider, provider] + ) + + # If the assume role provider returns nothing, then whatever is in + # the config provider should be returned. + assume_role_provider.load.return_value = None + provider.load.return_value = credentials.Credentials('d', 'e', 'f') + + creds = source.source_credentials(provider.CANONICAL_NAME) + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'd') + self.assertEqual(creds.secret_key, 'e') + self.assertEqual(creds.token, 'f') + self.assertTrue(assume_role_provider.load.called) + + def test_assume_role_creds_returned_with_config_file(self): + provider = mock.Mock(spec=ConfigProvider) + provider.METHOD = 'config-file' + provider.CANONICAL_NAME = 'SharedConfig' + self._assert_assume_role_creds_returned_with_shared_file(provider) + + def test_config_file_returns_creds_if_assume_role_not_used(self): + provider = mock.Mock(spec=ConfigProvider) + provider.METHOD = 'config-file' + provider.CANONICAL_NAME = 'SharedConfig' + self._assert_returns_creds_if_assume_role_not_used(provider) + + def test_assume_role_creds_returned_with_cred_file(self): + provider = mock.Mock(spec=SharedCredentialProvider) + provider.METHOD = 'credentials-file' + provider.CANONICAL_NAME = 'SharedCredentials' + self._assert_assume_role_creds_returned_with_shared_file(provider) + + def test_creds_file_returns_creds_if_assume_role_not_used(self): + provider = mock.Mock(spec=SharedCredentialProvider) + provider.METHOD = 'credentials-file' + provider.CANONICAL_NAME = 'SharedCredentials' + self._assert_returns_creds_if_assume_role_not_used(provider) + + def test_get_canonical_assume_role_without_shared_files(self): + assume_role_provider = mock.Mock(spec=AssumeRoleProvider) + assume_role_provider.METHOD = 'assume-role' + assume_role_provider.CANONICAL_NAME = None + assume_role_provider.load.return_value = self.fake_creds + + provider = credentials.CanonicalNameCredentialSourcer( + providers=[assume_role_provider] + ) + + creds = provider.source_credentials('SharedConfig') + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertEqual(creds.token, 'c') + + creds = provider.source_credentials('SharedCredentials') + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'a') + self.assertEqual(creds.secret_key, 'b') + self.assertEqual(creds.token, 'c') + + def test_get_canonical_shared_files_without_assume_role(self): + provider = credentials.CanonicalNameCredentialSourcer( + providers=[self.custom_provider1] + ) + with self.assertRaises(botocore.exceptions.UnknownCredentialError): + provider.source_credentials('SharedConfig') + with self.assertRaises(botocore.exceptions.UnknownCredentialError): + provider.source_credentials('SharedCredentials') + + +class TestAssumeRoleCredentialProvider(unittest.TestCase): + maxDiff = None + + def setUp(self): + self.fake_config = { + 'profiles': { + 'development': { + 'role_arn': 'myrole', + 'source_profile': 'longterm', + }, + 'longterm': { + 'aws_access_key_id': 'akid', + 'aws_secret_access_key': 'skid', + }, + 'non-static': { + 'role_arn': 'myrole', + 'credential_source': 'Environment', + }, + 'chained': { + 'role_arn': 'chained-role', + 'source_profile': 'development', + }, + } + } + + def create_config_loader(self, with_config=None): + if with_config is None: + with_config = self.fake_config + load_config = mock.Mock() + load_config.return_value = with_config + return load_config + + def create_client_creator(self, with_response): + # Create a mock sts client that returns a specific response + # for assume_role. + client = mock.Mock() + if isinstance(with_response, list): + client.assume_role.side_effect = with_response + else: + client.assume_role.return_value = with_response + return mock.Mock(return_value=client) + + def some_future_time(self): + timeobj = datetime.now(tzlocal()) + return timeobj + timedelta(hours=24) + + def test_assume_role_with_no_cache(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + def test_assume_role_with_datetime(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + # Note the lack of isoformat(), we're using + # a datetime.datetime type. This will ensure + # we test both parsing as well as serializing + # from a given datetime because the credentials + # are immediately expired. + 'Expiration': datetime.now(tzlocal()) + timedelta(hours=20), + }, + } + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + def test_assume_role_refresher_serializes_datetime(self): + client = mock.Mock() + time_zone = tzutc() + expiration = datetime( + year=2016, month=11, day=6, hour=1, minute=30, tzinfo=time_zone + ) + client.assume_role.return_value = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': expiration, + } + } + refresh = create_assume_role_refresher(client, {}) + expiry_time = refresh()['expiry_time'] + self.assertEqual(expiry_time, '2016-11-06T01:30:00UTC') + + def test_assume_role_retrieves_from_cache(self): + date_in_future = datetime.utcnow() + timedelta(seconds=1000) + utc_timestamp = date_in_future.isoformat() + 'Z' + self.fake_config['profiles']['development']['role_arn'] = 'myrole' + + cache_key = '793d6e2f27667ab2da104824407e486bfec24a47' + cache = { + cache_key: { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': utc_timestamp, + } + } + } + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache=cache, + profile_name='development', + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo-cached') + self.assertEqual(creds.secret_key, 'bar-cached') + self.assertEqual(creds.token, 'baz-cached') + + def test_chain_prefers_cache(self): + date_in_future = datetime.utcnow() + timedelta(seconds=1000) + utc_timestamp = date_in_future.isoformat() + 'Z' + + # The profile we will be using has a cache entry, but the profile it + # is sourcing from does not. This should result in the cached + # credentials being used, and the source profile not being called. + cache_key = '3d440bf424caf7a5ee664fbf89139a84409f95c2' + cache = { + cache_key: { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': utc_timestamp, + } + } + } + + client_creator = self.create_client_creator( + [Exception("Attempted to call assume role when not needed.")] + ) + + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache=cache, + profile_name='chained', + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo-cached') + self.assertEqual(creds.secret_key, 'bar-cached') + self.assertEqual(creds.token, 'baz-cached') + + def test_cache_key_is_windows_safe(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + cache = {} + self.fake_config['profiles']['development']['role_arn'] = ( + 'arn:aws:iam::foo-role' + ) + + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache=cache, + profile_name='development', + ) + + provider.load().get_frozen_credentials() + # On windows, you cannot use a a ':' in the filename, so + # we need to make sure it doesn't come up in the cache key. + cache_key = '3f8e35c8dca6211d496e830a2de723b2387921e3' + self.assertIn(cache_key, cache) + self.assertEqual(cache[cache_key], response) + + def test_cache_key_with_role_session_name(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + cache = {} + self.fake_config['profiles']['development']['role_arn'] = ( + 'arn:aws:iam::foo-role' + ) + self.fake_config['profiles']['development']['role_session_name'] = ( + 'foo_role_session_name' + ) + + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache=cache, + profile_name='development', + ) + + # The credentials won't actually be assumed until they're requested. + provider.load().get_frozen_credentials() + + cache_key = '5e75ce21b6a64ab183b29c4a159b6f0248121d51' + self.assertIn(cache_key, cache) + self.assertEqual(cache[cache_key], response) + + def test_assume_role_in_cache_but_expired(self): + expired_creds = datetime.now(tzlocal()) + valid_creds = expired_creds + timedelta(hours=1) + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': valid_creds, + }, + } + client_creator = self.create_client_creator(with_response=response) + cache = { + 'development--myrole': { + 'Credentials': { + 'AccessKeyId': 'foo-cached', + 'SecretAccessKey': 'bar-cached', + 'SessionToken': 'baz-cached', + 'Expiration': expired_creds, + } + } + } + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache=cache, + profile_name='development', + ) + + creds = provider.load() + + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + def test_role_session_name_provided(self): + dev_profile = self.fake_config['profiles']['development'] + dev_profile['role_session_name'] = 'myname' + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + ) + + # The credentials won't actually be assumed until they're requested. + provider.load().get_frozen_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn='myrole', RoleSessionName='myname' + ) + + def test_external_id_provided(self): + self.fake_config['profiles']['development']['external_id'] = 'myid' + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + ) + + # The credentials won't actually be assumed until they're requested. + provider.load().get_frozen_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn='myrole', ExternalId='myid', RoleSessionName=mock.ANY + ) + + def test_assume_role_with_duration(self): + self.fake_config['profiles']['development']['duration_seconds'] = 7200 + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + ) + + # The credentials won't actually be assumed until they're requested. + provider.load().get_frozen_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn='myrole', RoleSessionName=mock.ANY, DurationSeconds=7200 + ) + + def test_assume_role_with_bad_duration(self): + self.fake_config['profiles']['development']['duration_seconds'] = ( + 'garbage value' + ) + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + ) + + # The credentials won't actually be assumed until they're requested. + provider.load().get_frozen_credentials() + + client = client_creator.return_value + client.assume_role.assert_called_with( + RoleArn='myrole', RoleSessionName=mock.ANY + ) + + def test_assume_role_with_mfa(self): + self.fake_config['profiles']['development']['mfa_serial'] = 'mfa' + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + prompter = mock.Mock(return_value='token-code') + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + prompter=prompter, + ) + + # The credentials won't actually be assumed until they're requested. + provider.load().get_frozen_credentials() + + client = client_creator.return_value + # In addition to the normal assume role args, we should also + # inject the serial number from the config as well as the + # token code that comes from prompting the user (the prompter + # object). + client.assume_role.assert_called_with( + RoleArn='myrole', + RoleSessionName=mock.ANY, + SerialNumber='mfa', + TokenCode='token-code', + ) + + def test_assume_role_populates_session_name_on_refresh(self): + expiration_time = self.some_future_time() + next_expiration_time = expiration_time + timedelta(hours=4) + responses = [ + { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + # We're creating an expiry time in the past so as + # soon as we try to access the credentials, the + # refresh behavior will be triggered. + 'Expiration': expiration_time.isoformat(), + }, + }, + { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': next_expiration_time.isoformat(), + } + }, + ] + client_creator = self.create_client_creator(with_response=responses) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + prompter=mock.Mock(return_value='token-code'), + ) + + local_now = mock.Mock(return_value=datetime.now(tzlocal())) + with mock.patch('botocore.credentials._local_now', local_now): + # This will trigger the first assume_role() call. It returns + # credentials that are expired and will trigger a refresh. + creds = provider.load() + creds.get_frozen_credentials() + + # This will trigger the second assume_role() call because + # a refresh is needed. + local_now.return_value = expiration_time + creds.get_frozen_credentials() + + client = client_creator.return_value + assume_role_calls = client.assume_role.call_args_list + self.assertEqual(len(assume_role_calls), 2, assume_role_calls) + # The args should be identical. That is, the second + # assume_role call should have the exact same args as the + # initial assume_role call. + self.assertEqual(assume_role_calls[0], assume_role_calls[1]) + + def test_assume_role_mfa_cannot_refresh_credentials(self): + # Note: we should look into supporting optional behavior + # in the future that allows for reprompting for credentials. + # But for now, if we get temp creds with MFA then when those + # creds expire, we can't refresh the credentials. + self.fake_config['profiles']['development']['mfa_serial'] = 'mfa' + expiration_time = self.some_future_time() + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + # We're creating an expiry time in the past so as + # soon as we try to access the credentials, the + # refresh behavior will be triggered. + 'Expiration': expiration_time.isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + prompter=mock.Mock(return_value='token-code'), + ) + + local_now = mock.Mock(return_value=datetime.now(tzlocal())) + with mock.patch('botocore.credentials._local_now', local_now): + # Loads the credentials, resulting in the first assume role call. + creds = provider.load() + creds.get_frozen_credentials() + + local_now.return_value = expiration_time + with self.assertRaises(credentials.RefreshWithMFAUnsupportedError): + # access_key is a property that will refresh credentials + # if they're expired. Because we set the expiry time to + # something in the past, this will trigger the refresh + # behavior, with with MFA will currently raise an exception. + creds.access_key + + def test_no_config_is_noop(self): + self.fake_config['profiles']['development'] = { + 'aws_access_key_id': 'foo', + 'aws_secret_access_key': 'bar', + } + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='development', + ) + + # Because a role_arn was not specified, the AssumeRoleProvider + # is a noop and will not return credentials (which means we + # move on to the next provider). + creds = provider.load() + self.assertIsNone(creds) + + def test_source_profile_not_provided(self): + del self.fake_config['profiles']['development']['source_profile'] + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='development', + ) + + # source_profile is required, we shoudl get an error. + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + provider.load() + + def test_source_profile_does_not_exist(self): + dev_profile = self.fake_config['profiles']['development'] + dev_profile['source_profile'] = 'does-not-exist' + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='development', + ) + + # source_profile is required, we shoudl get an error. + with self.assertRaises(botocore.exceptions.InvalidConfigError): + provider.load() + + def test_incomplete_source_credentials_raises_error(self): + del self.fake_config['profiles']['longterm']['aws_access_key_id'] + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='development', + ) + + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + provider.load() + + def test_source_profile_and_credential_source_provided(self): + profile = self.fake_config['profiles']['development'] + profile['credential_source'] = 'SomeCredentialProvider' + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='development', + ) + + with self.assertRaises(botocore.exceptions.InvalidConfigError): + provider.load() + + def test_credential_source_with_no_resolver_configured(self): + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='non-static', + ) + + with self.assertRaises(botocore.exceptions.InvalidConfigError): + provider.load() + + def test_credential_source_with_no_providers_configured(self): + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='non-static', + credential_sourcer=credentials.CanonicalNameCredentialSourcer([]), + ) + + with self.assertRaises(botocore.exceptions.InvalidConfigError): + provider.load() + + def test_credential_source_not_among_providers(self): + fake_provider = mock.Mock() + fake_provider.CANONICAL_NAME = 'CustomFakeProvider' + + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + mock.Mock(), + cache={}, + profile_name='non-static', + credential_sourcer=credentials.CanonicalNameCredentialSourcer( + [fake_provider] + ), + ) + + # We configured the assume role provider with a single fake source + # provider, CustomFakeProvider. The profile we are attempting to use + # calls for the Environment credential provider as the credentials + # source. Since that isn't one of the configured source providers, + # an error is thrown. + with self.assertRaises(botocore.exceptions.InvalidConfigError): + provider.load() + + def test_assume_role_with_credential_source(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + + config = { + 'profiles': { + 'sourced': { + 'role_arn': 'myrole', + 'credential_source': 'CustomMockProvider', + } + } + } + config_loader = self.create_config_loader(with_config=config) + + fake_provider = mock.Mock() + fake_provider.CANONICAL_NAME = 'CustomMockProvider' + fake_creds = credentials.Credentials('akid', 'skid', 'token') + fake_provider.load.return_value = fake_creds + + provider = credentials.AssumeRoleProvider( + config_loader, + client_creator, + cache={}, + profile_name='sourced', + credential_sourcer=credentials.CanonicalNameCredentialSourcer( + [fake_provider] + ), + ) + + creds = provider.load() + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + client_creator.assert_called_with( + 'sts', + aws_access_key_id=fake_creds.access_key, + aws_secret_access_key=fake_creds.secret_key, + aws_session_token=fake_creds.token, + ) + + def test_credential_source_returns_none(self): + config = { + 'profiles': { + 'sourced': { + 'role_arn': 'myrole', + 'credential_source': 'CustomMockProvider', + } + } + } + config_loader = self.create_config_loader(with_config=config) + + fake_provider = mock.Mock() + fake_provider.CANONICAL_NAME = 'CustomMockProvider' + fake_provider.load.return_value = None + + provider = credentials.AssumeRoleProvider( + config_loader, + mock.Mock(), + cache={}, + profile_name='sourced', + credential_sourcer=credentials.CanonicalNameCredentialSourcer( + [fake_provider] + ), + ) + + with self.assertRaises(botocore.exceptions.CredentialRetrievalError): + provider.load() + + def test_source_profile_can_reference_self(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + + config = { + 'profiles': { + 'self-referencial': { + 'aws_access_key_id': 'akid', + 'aws_secret_access_key': 'skid', + 'role_arn': 'myrole', + 'source_profile': 'self-referencial', + } + } + } + + provider = credentials.AssumeRoleProvider( + self.create_config_loader(config), + client_creator, + cache={}, + profile_name='self-referencial', + ) + + creds = provider.load() + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + def test_infinite_looping_profiles_raises_error(self): + config = { + 'profiles': { + 'first': {'role_arn': 'first', 'source_profile': 'second'}, + 'second': {'role_arn': 'second', 'source_profile': 'first'}, + } + } + + provider = credentials.AssumeRoleProvider( + self.create_config_loader(config), + mock.Mock(), + cache={}, + profile_name='first', + ) + + with self.assertRaises(botocore.credentials.InfiniteLoopConfigError): + provider.load() + + def test_recursive_assume_role(self): + assume_responses = [ + Credentials('foo', 'bar', 'baz'), + Credentials('spam', 'eggs', 'spamandegss'), + ] + responses = [] + for credential_set in assume_responses: + responses.append( + { + 'Credentials': { + 'AccessKeyId': credential_set.access_key, + 'SecretAccessKey': credential_set.secret_key, + 'SessionToken': credential_set.token, + 'Expiration': self.some_future_time().isoformat(), + } + } + ) + client_creator = self.create_client_creator(with_response=responses) + + static_credentials = Credentials('akid', 'skid') + config = { + 'profiles': { + 'first': {'role_arn': 'first', 'source_profile': 'second'}, + 'second': {'role_arn': 'second', 'source_profile': 'third'}, + 'third': { + 'aws_access_key_id': static_credentials.access_key, + 'aws_secret_access_key': static_credentials.secret_key, + }, + } + } + + provider = credentials.AssumeRoleProvider( + self.create_config_loader(config), + client_creator, + cache={}, + profile_name='first', + ) + + creds = provider.load() + expected_creds = assume_responses[-1] + self.assertEqual(creds.access_key, expected_creds.access_key) + self.assertEqual(creds.secret_key, expected_creds.secret_key) + self.assertEqual(creds.token, expected_creds.token) + + client_creator.assert_has_calls( + [ + mock.call( + 'sts', + aws_access_key_id=static_credentials.access_key, + aws_secret_access_key=static_credentials.secret_key, + aws_session_token=static_credentials.token, + ), + mock.call( + 'sts', + aws_access_key_id=assume_responses[0].access_key, + aws_secret_access_key=assume_responses[0].secret_key, + aws_session_token=assume_responses[0].token, + ), + ] + ) + + def test_assume_role_with_profile_provider(self): + response = { + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': self.some_future_time().isoformat(), + }, + } + client_creator = self.create_client_creator(with_response=response) + mock_builder = mock.Mock(spec=ProfileProviderBuilder) + mock_builder.providers.return_value = [ProfileProvider('foo-profile')] + + provider = credentials.AssumeRoleProvider( + self.create_config_loader(), + client_creator, + cache={}, + profile_name='development', + profile_provider_builder=mock_builder, + ) + + creds = provider.load().get_frozen_credentials() + + self.assertEqual(client_creator.call_count, 1) + client_creator.assert_called_with( + 'sts', + aws_access_key_id='foo-profile-access-key', + aws_secret_access_key='foo-profile-secret-key', + aws_session_token='foo-profile-token', + ) + + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + + +class ProfileProvider: + METHOD = 'fake' + + def __init__(self, profile_name): + self._profile_name = profile_name + + def load(self): + return Credentials( + f'{self._profile_name}-access-key', + f'{self._profile_name}-secret-key', + f'{self._profile_name}-token', + self.METHOD, + ) + + +class TestJSONCache(unittest.TestCase): + def setUp(self): + self.tempdir = tempfile.mkdtemp() + self.cache = credentials.JSONFileCache(self.tempdir) + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def test_supports_contains_check(self): + # By default the cache is empty because we're + # using a new temp dir everytime. + self.assertTrue('mykey' not in self.cache) + + def test_add_key_and_contains_check(self): + self.cache['mykey'] = {'foo': 'bar'} + self.assertTrue('mykey' in self.cache) + + def test_added_key_can_be_retrieved(self): + self.cache['mykey'] = {'foo': 'bar'} + self.assertEqual(self.cache['mykey'], {'foo': 'bar'}) + + def test_only_accepts_json_serializable_data(self): + with self.assertRaises(ValueError): + # set()'s cannot be serialized to a JSON string. + self.cache['mykey'] = set() + + def test_can_override_existing_values(self): + self.cache['mykey'] = {'foo': 'bar'} + self.cache['mykey'] = {'baz': 'newvalue'} + self.assertEqual(self.cache['mykey'], {'baz': 'newvalue'}) + + def test_can_delete_existing_values(self): + key_path = Path(os.path.join(self.tempdir, 'deleteme.json')) + self.cache['deleteme'] = {'foo': 'bar'} + assert self.cache['deleteme'] == {'foo': 'bar'} + assert key_path.exists() + + del self.cache['deleteme'] + # Validate key removed + with pytest.raises(KeyError): + self.cache['deleteme'] + # Validate file removed + assert not key_path.exists() + + self.cache['deleteme'] = {'bar': 'baz'} + assert self.cache['deleteme'] == {'bar': 'baz'} + + def test_can_delete_missing_values(self): + key_path = Path(os.path.join(self.tempdir, 'deleteme.json')) + assert not key_path.exists() + + with pytest.raises(KeyError): + del self.cache['deleteme'] + + def test_can_add_multiple_keys(self): + self.cache['mykey'] = {'foo': 'bar'} + self.cache['mykey2'] = {'baz': 'qux'} + self.assertEqual(self.cache['mykey'], {'foo': 'bar'}) + self.assertEqual(self.cache['mykey2'], {'baz': 'qux'}) + + def test_working_dir_does_not_exist(self): + working_dir = os.path.join(self.tempdir, 'foo') + cache = credentials.JSONFileCache(working_dir) + cache['foo'] = {'bar': 'baz'} + self.assertEqual(cache['foo'], {'bar': 'baz'}) + + def test_key_error_raised_when_cache_key_does_not_exist(self): + with self.assertRaises(KeyError): + self.cache['foo'] + + def test_file_is_truncated_before_writing(self): + self.cache['mykey'] = { + 'really long key in the cache': 'really long value in cache' + } + # Now overwrite it with a smaller value. + self.cache['mykey'] = {'a': 'b'} + self.assertEqual(self.cache['mykey'], {'a': 'b'}) + + @skip_if_windows('File permissions tests not supported on Windows.') + def test_permissions_for_file_restricted(self): + self.cache['mykey'] = {'foo': 'bar'} + filename = os.path.join(self.tempdir, 'mykey.json') + self.assertEqual(os.stat(filename).st_mode & 0xFFF, 0o600) + + def test_cache_with_custom_dumps_func(self): + def _custom_serializer(obj): + return "custom foo" + + def _custom_dumps(obj): + return json.dumps(obj, default=_custom_serializer) + + custom_dir = os.path.join(self.tempdir, 'custom') + custom_cache = credentials.JSONFileCache( + custom_dir, dumps_func=_custom_dumps + ) + custom_cache['test'] = {'bar': object()} + self.assertEqual(custom_cache['test'], {'bar': 'custom foo'}) + + +class TestRefreshLogic(unittest.TestCase): + def test_mandatory_refresh_needed(self): + creds = IntegerRefresher( + # These values will immediately trigger + # a manadatory refresh. + creds_last_for=2, + mandatory_refresh=3, + advisory_refresh=3, + ) + temp = creds.get_frozen_credentials() + self.assertEqual(temp, credentials.ReadOnlyCredentials('1', '1', '1')) + + def test_advisory_refresh_needed(self): + creds = IntegerRefresher( + # These values will immediately trigger + # a manadatory refresh. + creds_last_for=4, + mandatory_refresh=2, + advisory_refresh=5, + ) + temp = creds.get_frozen_credentials() + self.assertEqual(temp, credentials.ReadOnlyCredentials('1', '1', '1')) + + def test_refresh_fails_is_not_an_error_during_advisory_period(self): + fail_refresh = mock.Mock(side_effect=Exception("refresh failed")) + creds = IntegerRefresher( + creds_last_for=5, + advisory_refresh=7, + mandatory_refresh=3, + refresh_function=fail_refresh, + ) + temp = creds.get_frozen_credentials() + # We should have called the refresh function. + self.assertTrue(fail_refresh.called) + # The fail_refresh function will raise an exception. + # Because we're in the advisory period we'll not propogate + # the exception and return the current set of credentials + # (generation '1'). + self.assertEqual(temp, credentials.ReadOnlyCredentials('0', '0', '0')) + + def test_exception_propogated_on_error_during_mandatory_period(self): + fail_refresh = mock.Mock(side_effect=Exception("refresh failed")) + creds = IntegerRefresher( + creds_last_for=5, + advisory_refresh=10, + # Note we're in the mandatory period now (5 < 7< 10). + mandatory_refresh=7, + refresh_function=fail_refresh, + ) + with self.assertRaisesRegex(Exception, 'refresh failed'): + creds.get_frozen_credentials() + + def test_exception_propogated_on_expired_credentials(self): + fail_refresh = mock.Mock(side_effect=Exception("refresh failed")) + creds = IntegerRefresher( + # Setting this to 0 mean the credentials are immediately + # expired. + creds_last_for=0, + advisory_refresh=10, + mandatory_refresh=7, + refresh_function=fail_refresh, + ) + with self.assertRaisesRegex(Exception, 'refresh failed'): + # Because credentials are actually expired, any + # failure to refresh should be propagated. + creds.get_frozen_credentials() + + def test_refresh_giving_expired_credentials_raises_exception(self): + # This verifies an edge cases where refreshed credentials + # still give expired credentials: + # 1. We see credentials are expired. + # 2. We try to refresh the credentials. + # 3. The "refreshed" credentials are still expired. + # + # In this case, we hard fail and let the user know what + # happened. + creds = IntegerRefresher( + # Negative number indicates that the credentials + # have already been expired for 2 seconds, even + # on refresh. + creds_last_for=-2, + ) + err_msg = 'refreshed credentials are still expired' + with self.assertRaisesRegex(RuntimeError, err_msg): + # Because credentials are actually expired, any + # failure to refresh should be propagated. + creds.get_frozen_credentials() + + +class TestContainerProvider(BaseEnvVar): + def setUp(self): + super().setUp() + self.tempdir = tempfile.mkdtemp() + + def tearDown(self): + super().tearDown() + shutil.rmtree(self.tempdir) + + def test_noop_if_env_var_is_not_set(self): + # The 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' env var + # is not present as an env var. + environ = {} + provider = credentials.ContainerProvider(environ) + creds = provider.load() + self.assertIsNone(creds) + + def full_url(self, url): + return f'http://{ContainerMetadataFetcher.IP_ADDRESS}{url}' + + def create_fetcher(self): + fetcher = mock.Mock(spec=ContainerMetadataFetcher) + fetcher.full_url = self.full_url + return fetcher + + def test_retrieve_from_provider_if_env_var_present(self): + environ = { + 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI': '/latest/credentials?id=foo' + } + fetcher = self.create_fetcher() + timeobj = datetime.now(tzlocal()) + timestamp = (timeobj + timedelta(hours=24)).isoformat() + fetcher.retrieve_full_uri.return_value = { + "AccessKeyId": "access_key", + "SecretAccessKey": "secret_key", + "Token": "token", + "Expiration": timestamp, + } + provider = credentials.ContainerProvider(environ, fetcher) + creds = provider.load() + + fetcher.retrieve_full_uri.assert_called_with( + self.full_url('/latest/credentials?id=foo'), headers=None + ) + self.assertEqual(creds.access_key, 'access_key') + self.assertEqual(creds.secret_key, 'secret_key') + self.assertEqual(creds.token, 'token') + self.assertEqual(creds.method, 'container-role') + + def test_creds_refresh_when_needed(self): + environ = { + 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI': '/latest/credentials?id=foo' + } + fetcher = mock.Mock(spec=credentials.ContainerMetadataFetcher) + timeobj = datetime.now(tzlocal()) + expired_timestamp = (timeobj - timedelta(hours=23)).isoformat() + future_timestamp = (timeobj + timedelta(hours=1)).isoformat() + fetcher.retrieve_full_uri.side_effect = [ + { + "AccessKeyId": "access_key_old", + "SecretAccessKey": "secret_key_old", + "Token": "token_old", + "Expiration": expired_timestamp, + }, + { + "AccessKeyId": "access_key_new", + "SecretAccessKey": "secret_key_new", + "Token": "token_new", + "Expiration": future_timestamp, + }, + ] + provider = credentials.ContainerProvider(environ, fetcher) + creds = provider.load() + frozen_creds = creds.get_frozen_credentials() + self.assertEqual(frozen_creds.access_key, 'access_key_new') + self.assertEqual(frozen_creds.secret_key, 'secret_key_new') + self.assertEqual(frozen_creds.token, 'token_new') + + def test_http_error_propagated(self): + environ = { + 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI': '/latest/credentials?id=foo' + } + fetcher = mock.Mock(spec=credentials.ContainerMetadataFetcher) + exception = botocore.exceptions.CredentialRetrievalError + fetcher.retrieve_full_uri.side_effect = exception( + provider='ecs-role', error_msg='fake http error' + ) + provider = credentials.ContainerProvider(environ, fetcher) + + with self.assertRaises(exception): + provider.load() + + def test_http_error_propagated_on_refresh(self): + # We should ensure errors are still propagated even in the + # case of a failed refresh. + environ = { + 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI': '/latest/credentials?id=foo' + } + fetcher = mock.Mock(spec=credentials.ContainerMetadataFetcher) + timeobj = datetime.now(tzlocal()) + expired_timestamp = (timeobj - timedelta(hours=23)).isoformat() + http_exception = botocore.exceptions.MetadataRetrievalError + raised_exception = botocore.exceptions.CredentialRetrievalError + fetcher.retrieve_full_uri.side_effect = [ + { + "AccessKeyId": "access_key_old", + "SecretAccessKey": "secret_key_old", + "Token": "token_old", + "Expiration": expired_timestamp, + }, + http_exception(error_msg='HTTP connection timeout'), + ] + provider = credentials.ContainerProvider(environ, fetcher) + # First time works with no issues. + creds = provider.load() + # Second time with a refresh should propagate an error. + with self.assertRaises(raised_exception): + creds.get_frozen_credentials() + + def test_can_use_full_url(self): + environ = { + 'AWS_CONTAINER_CREDENTIALS_FULL_URI': 'http://localhost/foo' + } + fetcher = self.create_fetcher() + timeobj = datetime.now(tzlocal()) + timestamp = (timeobj + timedelta(hours=24)).isoformat() + fetcher.retrieve_full_uri.return_value = { + "AccessKeyId": "access_key", + "SecretAccessKey": "secret_key", + "Token": "token", + "Expiration": timestamp, + } + provider = credentials.ContainerProvider(environ, fetcher) + creds = provider.load() + + fetcher.retrieve_full_uri.assert_called_with( + 'http://localhost/foo', headers=None + ) + self.assertEqual(creds.access_key, 'access_key') + self.assertEqual(creds.secret_key, 'secret_key') + self.assertEqual(creds.token, 'token') + self.assertEqual(creds.method, 'container-role') + + def test_can_pass_basic_auth_token(self): + environ = { + 'AWS_CONTAINER_CREDENTIALS_FULL_URI': 'http://localhost/foo', + 'AWS_CONTAINER_AUTHORIZATION_TOKEN': 'Basic auth-token', + } + fetcher = self.create_fetcher() + timeobj = datetime.now(tzlocal()) + timestamp = (timeobj + timedelta(hours=24)).isoformat() + fetcher.retrieve_full_uri.return_value = { + "AccessKeyId": "access_key", + "SecretAccessKey": "secret_key", + "Token": "token", + "Expiration": timestamp, + } + provider = credentials.ContainerProvider(environ, fetcher) + creds = provider.load() + + fetcher.retrieve_full_uri.assert_called_with( + 'http://localhost/foo', + headers={'Authorization': 'Basic auth-token'}, + ) + self.assertEqual(creds.access_key, 'access_key') + self.assertEqual(creds.secret_key, 'secret_key') + self.assertEqual(creds.token, 'token') + self.assertEqual(creds.method, 'container-role') + + def test_can_pass_auth_token_from_file(self): + with temporary_file('w') as f: + f.write('Basic auth-token') + f.flush() + environ = { + 'AWS_CONTAINER_CREDENTIALS_FULL_URI': 'http://localhost/foo', + 'AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE': f.name, + } + fetcher = self.create_fetcher() + timeobj = datetime.now(tzlocal()) + timestamp = (timeobj + timedelta(hours=24)).isoformat() + fetcher.retrieve_full_uri.return_value = { + "AccessKeyId": "access_key", + "SecretAccessKey": "secret_key", + "Token": "token", + "Expiration": timestamp, + } + provider = credentials.ContainerProvider(environ, fetcher) + creds = provider.load() + + fetcher.retrieve_full_uri.assert_called_with( + 'http://localhost/foo', + headers={'Authorization': 'Basic auth-token'}, + ) + self.assertEqual(creds.access_key, 'access_key') + self.assertEqual(creds.secret_key, 'secret_key') + self.assertEqual(creds.token, 'token') + self.assertEqual(creds.method, 'container-role') + + def test_reloads_auth_token_from_file(self): + with temporary_file('w') as f: + f.write('First auth token') + f.flush() + environ = { + 'AWS_CONTAINER_CREDENTIALS_FULL_URI': 'http://localhost/foo', + 'AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE': f.name, + } + fetcher = self.create_fetcher() + timeobj = datetime.now(tzlocal()) + fetcher.retrieve_full_uri.side_effect = [ + { + "AccessKeyId": "first_key", + "SecretAccessKey": "first_secret", + "Token": "first_token", + "Expiration": (timeobj + timedelta(seconds=1)).isoformat(), + }, + { + "AccessKeyId": "second_key", + "SecretAccessKey": "second_secret", + "Token": "second_token", + "Expiration": (timeobj + timedelta(minutes=5)).isoformat(), + }, + ] + provider = credentials.ContainerProvider(environ, fetcher) + creds = provider.load() + fetcher.retrieve_full_uri.assert_called_with( + 'http://localhost/foo', + headers={'Authorization': 'First auth token'}, + ) + time.sleep(1.5) + f.seek(0) + f.truncate() + f.write('Second auth token') + f.flush() + creds._refresh() + fetcher.retrieve_full_uri.assert_called_with( + 'http://localhost/foo', + headers={'Authorization': 'Second auth token'}, + ) + + def test_throws_error_on_invalid_token_file(self): + token_file_path = '/some/path/token.jwt' + environ = { + 'AWS_CONTAINER_CREDENTIALS_FULL_URI': 'http://localhost/foo', + 'AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE': token_file_path, + } + fetcher = self.create_fetcher() + provider = credentials.ContainerProvider(environ, fetcher) + + with self.assertRaises(FileNotFoundError): + provider.load() + + def test_throws_error_on_illegal_header(self): + environ = { + 'AWS_CONTAINER_CREDENTIALS_FULL_URI': 'http://localhost/foo', + 'AWS_CONTAINER_AUTHORIZATION_TOKEN': 'invalid\r\ntoken', + } + fetcher = self.create_fetcher() + provider = credentials.ContainerProvider(environ, fetcher) + + with self.assertRaises(ValueError): + provider.load() + + +class TestProcessProvider(BaseEnvVar): + def setUp(self): + super().setUp() + self.loaded_config = {} + self.load_config = mock.Mock(return_value=self.loaded_config) + self.invoked_process = mock.Mock() + self.popen_mock = mock.Mock( + return_value=self.invoked_process, spec=subprocess.Popen + ) + + def create_process_provider(self, profile_name='default'): + provider = ProcessProvider( + profile_name, self.load_config, popen=self.popen_mock + ) + return provider + + def _get_output(self, stdout, stderr=''): + return json.dumps(stdout).encode('utf-8'), stderr.encode('utf-8') + + def _set_process_return_value(self, stdout, stderr='', rc=0): + output = self._get_output(stdout, stderr) + self.invoked_process.communicate.return_value = output + self.invoked_process.returncode = rc + + def test_process_not_invoked_if_profile_does_not_exist(self): + # self.loaded_config is an empty dictionary with no profile + # information. + provider = self.create_process_provider() + self.assertIsNone(provider.load()) + + def test_process_not_invoked_if_not_configured_for_empty_config(self): + # No credential_process configured so we skip this provider. + self.loaded_config['profiles'] = {'default': {}} + provider = self.create_process_provider() + self.assertIsNone(provider.load()) + + def test_can_retrieve_via_process(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value( + { + 'Version': 1, + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': '2999-01-01T00:00:00Z', + } + ) + + provider = self.create_process_provider() + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + self.assertEqual(creds.method, 'custom-process') + self.popen_mock.assert_called_with( + ['my-process'], stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + + def test_can_pass_arguments_through(self): + self.loaded_config['profiles'] = { + 'default': { + 'credential_process': 'my-process --foo --bar "one two"' + } + } + self._set_process_return_value( + { + 'Version': 1, + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': '2999-01-01T00:00:00Z', + } + ) + + provider = self.create_process_provider() + creds = provider.load() + self.assertIsNotNone(creds) + self.popen_mock.assert_called_with( + ['my-process', '--foo', '--bar', 'one two'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + def test_can_refresh_credentials(self): + # We given a time that's already expired so .access_key + # will trigger the refresh worfklow. We just need to verify + # that the refresh function gives the same result as the + # initial retrieval. + expired_date = '2016-01-01T00:00:00Z' + future_date = str(datetime.now(tzlocal()) + timedelta(hours=24)) + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + old_creds = self._get_output( + { + 'Version': 1, + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': expired_date, + } + ) + new_creds = self._get_output( + { + 'Version': 1, + 'AccessKeyId': 'foo2', + 'SecretAccessKey': 'bar2', + 'SessionToken': 'baz2', + 'Expiration': future_date, + } + ) + self.invoked_process.communicate.side_effect = [old_creds, new_creds] + self.invoked_process.returncode = 0 + + provider = self.create_process_provider() + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo2') + self.assertEqual(creds.secret_key, 'bar2') + self.assertEqual(creds.token, 'baz2') + self.assertEqual(creds.method, 'custom-process') + + def test_non_zero_rc_raises_exception(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value('', 'Error Message', 1) + + provider = self.create_process_provider() + exception = botocore.exceptions.CredentialRetrievalError + with self.assertRaisesRegex(exception, 'Error Message'): + provider.load() + + def test_unsupported_version_raises_mismatch(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + bad_version = 100 + self._set_process_return_value( + { + 'Version': bad_version, + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': '2999-01-01T00:00:00Z', + } + ) + + provider = self.create_process_provider() + exception = botocore.exceptions.CredentialRetrievalError + with self.assertRaisesRegex(exception, 'Unsupported version'): + provider.load() + + def test_missing_version_in_payload_returned_raises_exception(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value( + { + # Let's say they forget a 'Version' key. + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': '2999-01-01T00:00:00Z', + } + ) + + provider = self.create_process_provider() + exception = botocore.exceptions.CredentialRetrievalError + with self.assertRaisesRegex(exception, 'Unsupported version'): + provider.load() + + def test_missing_access_key_raises_exception(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value( + { + 'Version': 1, + # Missing access key. + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': '2999-01-01T00:00:00Z', + } + ) + + provider = self.create_process_provider() + exception = botocore.exceptions.CredentialRetrievalError + with self.assertRaisesRegex(exception, 'Missing required key'): + provider.load() + + def test_missing_secret_key_raises_exception(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value( + { + 'Version': 1, + 'AccessKeyId': 'foo', + # Missing secret key. + 'SessionToken': 'baz', + 'Expiration': '2999-01-01T00:00:00Z', + } + ) + + provider = self.create_process_provider() + exception = botocore.exceptions.CredentialRetrievalError + with self.assertRaisesRegex(exception, 'Missing required key'): + provider.load() + + def test_missing_session_token(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value( + { + 'Version': 1, + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + # Missing session token. + 'Expiration': '2999-01-01T00:00:00Z', + } + ) + + provider = self.create_process_provider() + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertIsNone(creds.token) + self.assertEqual(creds.method, 'custom-process') + + def test_missing_expiration(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value( + { + 'Version': 1, + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + # Missing expiration. + } + ) + + provider = self.create_process_provider() + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertEqual(creds.token, 'baz') + self.assertEqual(creds.method, 'custom-process') + + def test_missing_expiration_and_session_token(self): + self.loaded_config['profiles'] = { + 'default': {'credential_process': 'my-process'} + } + self._set_process_return_value( + { + 'Version': 1, + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + # Missing session token and expiration + } + ) + + provider = self.create_process_provider() + creds = provider.load() + self.assertIsNotNone(creds) + self.assertEqual(creds.access_key, 'foo') + self.assertEqual(creds.secret_key, 'bar') + self.assertIsNone(creds.token) + self.assertEqual(creds.method, 'custom-process') + + +class TestProfileProviderBuilder(unittest.TestCase): + def setUp(self): + super().setUp() + self.mock_session = mock.Mock(spec=Session) + self.builder = ProfileProviderBuilder(self.mock_session) + + def test_profile_provider_builder_order(self): + providers = self.builder.providers('some-profile') + expected_providers = [ + AssumeRoleWithWebIdentityProvider, + SSOProvider, + SharedCredentialProvider, + ProcessProvider, + ConfigProvider, + ] + self.assertEqual(len(providers), len(expected_providers)) + zipped_providers = zip(providers, expected_providers) + for provider, expected_type in zipped_providers: + self.assertTrue(isinstance(provider, expected_type)) + + +class TestSSOCredentialFetcher(unittest.TestCase): + def setUp(self): + self.sso = Session().create_client('sso', region_name='us-east-1') + self.stubber = Stubber(self.sso) + self.mock_session = mock.Mock(spec=Session) + self.mock_session.create_client.return_value = self.sso + + self.cache = {} + self.sso_region = 'us-east-1' + self.start_url = 'https://d-92671207e4.awsapps.com/start' + self.role_name = 'test-role' + self.account_id = '1234567890' + self.access_token = { + 'accessToken': 'some.sso.token', + } + # This is just an arbitrary point in time we can pin to + self.now = datetime(2008, 9, 23, 12, 26, 40, tzinfo=tzutc()) + # The SSO endpoint uses ms whereas the OIDC endpoint uses seconds + self.now_timestamp = 1222172800000 + + self.loader = mock.Mock(spec=SSOTokenLoader) + self.loader.return_value = self.access_token + self.fetcher = SSOCredentialFetcher( + self.start_url, + self.sso_region, + self.role_name, + self.account_id, + self.mock_session.create_client, + token_loader=self.loader, + cache=self.cache, + ) + + def test_can_fetch_credentials(self): + expected_params = { + 'roleName': self.role_name, + 'accountId': self.account_id, + 'accessToken': self.access_token['accessToken'], + } + expected_response = { + 'roleCredentials': { + 'accessKeyId': 'foo', + 'secretAccessKey': 'bar', + 'sessionToken': 'baz', + 'expiration': self.now_timestamp + 1000000, + } + } + self.stubber.add_response( + 'get_role_credentials', + expected_response, + expected_params=expected_params, + ) + with self.stubber: + credentials = self.fetcher.fetch_credentials() + self.assertEqual(credentials['access_key'], 'foo') + self.assertEqual(credentials['secret_key'], 'bar') + self.assertEqual(credentials['token'], 'baz') + self.assertEqual(credentials['expiry_time'], '2008-09-23T12:43:20Z') + cache_key = '048db75bbe50955c16af7aba6ff9c41a3131bb7e' + expected_cached_credentials = { + 'ProviderType': 'sso', + 'Credentials': { + 'AccessKeyId': 'foo', + 'SecretAccessKey': 'bar', + 'SessionToken': 'baz', + 'Expiration': '2008-09-23T12:43:20Z', + }, + } + self.assertEqual(self.cache[cache_key], expected_cached_credentials) + + def test_raises_helpful_message_on_unauthorized_exception(self): + expected_params = { + 'roleName': self.role_name, + 'accountId': self.account_id, + 'accessToken': self.access_token['accessToken'], + } + self.stubber.add_client_error( + 'get_role_credentials', + service_error_code='UnauthorizedException', + expected_params=expected_params, + ) + with self.assertRaises(botocore.exceptions.UnauthorizedSSOTokenError): + with self.stubber: + self.fetcher.fetch_credentials() + + +class TestSSOProvider(unittest.TestCase): + def setUp(self): + self.sso = Session().create_client('sso', region_name='us-east-1') + self.stubber = Stubber(self.sso) + self.mock_session = mock.Mock(spec=Session) + self.mock_session.create_client.return_value = self.sso + + self.sso_region = 'us-east-1' + self.start_url = 'https://d-92671207e4.awsapps.com/start' + self.role_name = 'test-role' + self.account_id = '1234567890' + self.access_token = 'some.sso.token' + + self.profile_name = 'sso-profile' + self.config = { + 'sso_region': self.sso_region, + 'sso_start_url': self.start_url, + 'sso_role_name': self.role_name, + 'sso_account_id': self.account_id, + } + self.expires_at = datetime.now(tzutc()) + timedelta(hours=24) + self.cached_creds_key = '048db75bbe50955c16af7aba6ff9c41a3131bb7e' + self.cached_token_key = '13f9d35043871d073ab260e020f0ffde092cb14b' + self.cache = { + self.cached_token_key: { + 'accessToken': self.access_token, + 'expiresAt': self.expires_at.strftime('%Y-%m-%dT%H:%M:%S%Z'), + } + } + self.provider = SSOProvider( + load_config=self._mock_load_config, + client_creator=self.mock_session.create_client, + profile_name=self.profile_name, + cache=self.cache, + token_cache=self.cache, + ) + + self.expected_get_role_credentials_params = { + 'roleName': self.role_name, + 'accountId': self.account_id, + 'accessToken': self.access_token, + } + expiration = datetime2timestamp(self.expires_at) + self.expected_get_role_credentials_response = { + 'roleCredentials': { + 'accessKeyId': 'foo', + 'secretAccessKey': 'bar', + 'sessionToken': 'baz', + 'expiration': int(expiration * 1000), + } + } + + def _mock_load_config(self): + return { + 'profiles': { + self.profile_name: self.config, + } + } + + def _add_get_role_credentials_response(self): + self.stubber.add_response( + 'get_role_credentials', + self.expected_get_role_credentials_response, + self.expected_get_role_credentials_params, + ) + + def test_load_sso_credentials_without_cache(self): + self._add_get_role_credentials_response() + with self.stubber: + credentials = self.provider.load() + self.assertEqual(credentials.access_key, 'foo') + self.assertEqual(credentials.secret_key, 'bar') + self.assertEqual(credentials.token, 'baz') + + def test_load_sso_credentials_with_cache(self): + cached_creds = { + 'Credentials': { + 'AccessKeyId': 'cached-akid', + 'SecretAccessKey': 'cached-sak', + 'SessionToken': 'cached-st', + 'Expiration': self.expires_at.strftime('%Y-%m-%dT%H:%M:%S%Z'), + } + } + self.cache[self.cached_creds_key] = cached_creds + credentials = self.provider.load() + self.assertEqual(credentials.access_key, 'cached-akid') + self.assertEqual(credentials.secret_key, 'cached-sak') + self.assertEqual(credentials.token, 'cached-st') + + def test_load_sso_credentials_with_cache_expired(self): + cached_creds = { + 'Credentials': { + 'AccessKeyId': 'expired-akid', + 'SecretAccessKey': 'expired-sak', + 'SessionToken': 'expired-st', + 'Expiration': '2002-10-22T20:52:11UTC', + } + } + self.cache[self.cached_creds_key] = cached_creds + + self._add_get_role_credentials_response() + with self.stubber: + credentials = self.provider.load() + self.assertEqual(credentials.access_key, 'foo') + self.assertEqual(credentials.secret_key, 'bar') + self.assertEqual(credentials.token, 'baz') + + def test_required_config_not_set(self): + del self.config['sso_start_url'] + # If any required configuration is missing we should get an error + with self.assertRaises(botocore.exceptions.InvalidConfigError): + self.provider.load() diff --git a/testbed/boto__botocore/tests/unit/test_discovery.py b/testbed/boto__botocore/tests/unit/test_discovery.py new file mode 100644 index 0000000000000000000000000000000000000000..b8d8892608fde2e4b437607203ad526040a79006 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_discovery.py @@ -0,0 +1,495 @@ +import time + +from botocore.awsrequest import AWSRequest +from botocore.client import ClientMeta +from botocore.discovery import ( + EndpointDiscoveryHandler, + EndpointDiscoveryManager, + EndpointDiscoveryRefreshFailed, + EndpointDiscoveryRequired, + block_endpoint_discovery_required_operations, +) +from botocore.exceptions import ConnectionError +from botocore.handlers import inject_api_version_header_if_needed +from botocore.hooks import HierarchicalEmitter +from botocore.model import ServiceModel +from tests import mock, unittest + + +class BaseEndpointDiscoveryTest(unittest.TestCase): + def setUp(self): + self.service_description = { + 'version': '2.0', + 'metadata': { + 'apiVersion': '2018-08-31', + 'endpointPrefix': 'fooendpoint', + 'jsonVersion': '1.1', + 'protocol': 'json', + 'serviceAbbreviation': 'FooService', + 'serviceId': 'FooService', + 'serviceFullName': 'AwsFooService', + 'signatureVersion': 'v4', + 'signingName': 'awsfooservice', + 'targetPrefix': 'awsfooservice', + }, + 'operations': { + 'DescribeEndpoints': { + 'name': 'DescribeEndpoints', + 'http': {'method': 'POST', 'requestUri': '/'}, + 'input': {'shape': 'DescribeEndpointsRequest'}, + 'output': {'shape': 'DescribeEndpointsResponse'}, + 'endpointoperation': True, + }, + 'TestDiscoveryRequired': { + 'name': 'TestDiscoveryRequired', + 'http': {'method': 'POST', 'requestUri': '/'}, + 'input': {'shape': 'TestDiscoveryIdsRequest'}, + 'output': {'shape': 'EmptyStruct'}, + 'endpointdiscovery': {'required': True}, + }, + 'TestDiscoveryOptional': { + 'name': 'TestDiscoveryOptional', + 'http': {'method': 'POST', 'requestUri': '/'}, + 'input': {'shape': 'TestDiscoveryIdsRequest'}, + 'output': {'shape': 'EmptyStruct'}, + 'endpointdiscovery': {}, + }, + 'TestDiscovery': { + 'name': 'TestDiscovery', + 'http': {'method': 'POST', 'requestUri': '/'}, + 'input': {'shape': 'EmptyStruct'}, + 'output': {'shape': 'EmptyStruct'}, + 'endpointdiscovery': {}, + }, + }, + 'shapes': { + 'Boolean': {'type': 'boolean'}, + 'DescribeEndpointsRequest': { + 'type': 'structure', + 'members': { + 'Operation': {'shape': 'String'}, + 'Identifiers': {'shape': 'Identifiers'}, + }, + }, + 'DescribeEndpointsResponse': { + 'type': 'structure', + 'required': ['Endpoints'], + 'members': {'Endpoints': {'shape': 'Endpoints'}}, + }, + 'Endpoint': { + 'type': 'structure', + 'required': ['Address', 'CachePeriodInMinutes'], + 'members': { + 'Address': {'shape': 'String'}, + 'CachePeriodInMinutes': {'shape': 'Long'}, + }, + }, + 'Endpoints': {'type': 'list', 'member': {'shape': 'Endpoint'}}, + 'Identifiers': { + 'type': 'map', + 'key': {'shape': 'String'}, + 'value': {'shape': 'String'}, + }, + 'Long': {'type': 'long'}, + 'String': {'type': 'string'}, + 'TestDiscoveryIdsRequest': { + 'type': 'structure', + 'required': ['Foo', 'Nested'], + 'members': { + 'Foo': { + 'shape': 'String', + 'endpointdiscoveryid': True, + }, + 'Baz': {'shape': 'String'}, + 'Nested': {'shape': 'Nested'}, + }, + }, + 'EmptyStruct': {'type': 'structure', 'members': {}}, + 'Nested': { + 'type': 'structure', + 'required': 'Bar', + 'members': { + 'Bar': { + 'shape': 'String', + 'endpointdiscoveryid': True, + } + }, + }, + }, + } + + +class TestEndpointDiscoveryManager(BaseEndpointDiscoveryTest): + def setUp(self): + super().setUp() + self.construct_manager() + + def construct_manager(self, cache=None, time=None, side_effect=None): + self.service_model = ServiceModel(self.service_description) + self.meta = mock.Mock(spec=ClientMeta) + self.meta.service_model = self.service_model + self.client = mock.Mock() + if side_effect is None: + side_effect = [ + { + 'Endpoints': [ + { + 'Address': 'new.com', + 'CachePeriodInMinutes': 2, + } + ] + } + ] + self.client.describe_endpoints.side_effect = side_effect + self.client.meta = self.meta + self.manager = EndpointDiscoveryManager( + self.client, cache=cache, current_time=time + ) + + def test_injects_api_version_if_endpoint_operation(self): + model = self.service_model.operation_model('DescribeEndpoints') + params = {'headers': {}} + inject_api_version_header_if_needed(model, params) + self.assertEqual( + params['headers'].get('x-amz-api-version'), '2018-08-31' + ) + + def test_no_inject_api_version_if_not_endpoint_operation(self): + model = self.service_model.operation_model('TestDiscoveryRequired') + params = {'headers': {}} + inject_api_version_header_if_needed(model, params) + self.assertNotIn('x-amz-api-version', params['headers']) + + def test_gather_identifiers(self): + params = {'Foo': 'value1', 'Nested': {'Bar': 'value2'}} + operation = self.service_model.operation_model('TestDiscoveryRequired') + ids = self.manager.gather_identifiers(operation, params) + self.assertEqual(ids, {'Foo': 'value1', 'Bar': 'value2'}) + + def test_gather_identifiers_none(self): + operation = self.service_model.operation_model('TestDiscovery') + ids = self.manager.gather_identifiers(operation, {}) + self.assertEqual(ids, {}) + + def test_describe_endpoint(self): + kwargs = { + 'Operation': 'FooBar', + 'Identifiers': {'Foo': 'value1', 'Bar': 'value2'}, + } + self.manager.describe_endpoint(**kwargs) + self.client.describe_endpoints.assert_called_with(**kwargs) + + def test_describe_endpoint_no_input(self): + describe = self.service_description['operations']['DescribeEndpoints'] + del describe['input'] + self.construct_manager() + self.manager.describe_endpoint(Operation='FooBar', Identifiers={}) + self.client.describe_endpoints.assert_called_with() + + def test_describe_endpoint_empty_input(self): + describe = self.service_description['operations']['DescribeEndpoints'] + describe['input'] = {'shape': 'EmptyStruct'} + self.construct_manager() + self.manager.describe_endpoint(Operation='FooBar', Identifiers={}) + self.client.describe_endpoints.assert_called_with() + + def test_describe_endpoint_ids_and_operation(self): + cache = {} + self.construct_manager(cache=cache) + ids = {'Foo': 'value1', 'Bar': 'value2'} + kwargs = { + 'Operation': 'TestDiscoveryRequired', + 'Identifiers': ids, + } + self.manager.describe_endpoint(**kwargs) + self.client.describe_endpoints.assert_called_with(**kwargs) + key = ((('Bar', 'value2'), ('Foo', 'value1')), 'TestDiscoveryRequired') + self.assertIn(key, cache) + self.assertEqual(cache[key][0]['Address'], 'new.com') + self.manager.describe_endpoint(**kwargs) + call_count = self.client.describe_endpoints.call_count + self.assertEqual(call_count, 1) + + def test_describe_endpoint_no_ids_or_operation(self): + cache = {} + describe = self.service_description['operations']['DescribeEndpoints'] + describe['input'] = {'shape': 'EmptyStruct'} + self.construct_manager(cache=cache) + self.manager.describe_endpoint( + Operation='TestDiscoveryRequired', Identifiers={} + ) + self.client.describe_endpoints.assert_called_with() + key = () + self.assertIn(key, cache) + self.assertEqual(cache[key][0]['Address'], 'new.com') + self.manager.describe_endpoint( + Operation='TestDiscoveryRequired', Identifiers={} + ) + call_count = self.client.describe_endpoints.call_count + self.assertEqual(call_count, 1) + + def test_describe_endpoint_expired_entry(self): + current_time = time.time() + key = () + cache = { + key: [{'Address': 'old.com', 'Expiration': current_time - 10}] + } + self.construct_manager(cache=cache) + kwargs = { + 'Identifiers': {}, + 'Operation': 'TestDiscoveryRequired', + } + self.manager.describe_endpoint(**kwargs) + self.client.describe_endpoints.assert_called_with() + self.assertIn(key, cache) + self.assertEqual(cache[key][0]['Address'], 'new.com') + self.manager.describe_endpoint(**kwargs) + call_count = self.client.describe_endpoints.call_count + self.assertEqual(call_count, 1) + + def test_describe_endpoint_cache_expiration(self): + def _time(): + return float(0) + + cache = {} + self.construct_manager(cache=cache, time=_time) + self.manager.describe_endpoint( + Operation='TestDiscoveryRequired', Identifiers={} + ) + key = () + self.assertIn(key, cache) + self.assertEqual(cache[key][0]['Expiration'], float(120)) + + def test_delete_endpoints_present(self): + key = () + cache = {key: [{'Address': 'old.com', 'Expiration': 0}]} + self.construct_manager(cache=cache) + kwargs = { + 'Identifiers': {}, + 'Operation': 'TestDiscoveryRequired', + } + self.manager.delete_endpoints(**kwargs) + self.assertEqual(cache, {}) + + def test_delete_endpoints_absent(self): + cache = {} + self.construct_manager(cache=cache) + kwargs = { + 'Identifiers': {}, + 'Operation': 'TestDiscoveryRequired', + } + self.manager.delete_endpoints(**kwargs) + self.assertEqual(cache, {}) + + def test_describe_endpoint_optional_fails_no_cache(self): + side_effect = [ConnectionError(error=None)] + self.construct_manager(side_effect=side_effect) + kwargs = {'Operation': 'TestDiscoveryOptional'} + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertIsNone(endpoint) + # This second call should be blocked as we just failed + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertIsNone(endpoint) + self.client.describe_endpoints.call_args_list == [mock.call()] + + def test_describe_endpoint_optional_fails_stale_cache(self): + key = () + cache = {key: [{'Address': 'old.com', 'Expiration': 0}]} + side_effect = [ConnectionError(error=None)] * 2 + self.construct_manager(cache=cache, side_effect=side_effect) + kwargs = {'Operation': 'TestDiscoveryOptional'} + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertEqual(endpoint, 'old.com') + # This second call shouldn't go through as we just failed + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertEqual(endpoint, 'old.com') + self.client.describe_endpoints.call_args_list == [mock.call()] + + def test_describe_endpoint_required_fails_no_cache(self): + side_effect = [ConnectionError(error=None)] * 2 + self.construct_manager(side_effect=side_effect) + kwargs = {'Operation': 'TestDiscoveryRequired'} + with self.assertRaises(EndpointDiscoveryRefreshFailed): + self.manager.describe_endpoint(**kwargs) + # This second call should go through, as we have no cache + with self.assertRaises(EndpointDiscoveryRefreshFailed): + self.manager.describe_endpoint(**kwargs) + describe_count = self.client.describe_endpoints.call_count + self.assertEqual(describe_count, 2) + + def test_describe_endpoint_required_fails_stale_cache(self): + key = () + cache = {key: [{'Address': 'old.com', 'Expiration': 0}]} + side_effect = [ConnectionError(error=None)] * 2 + self.construct_manager(cache=cache, side_effect=side_effect) + kwargs = {'Operation': 'TestDiscoveryRequired'} + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertEqual(endpoint, 'old.com') + # We have a stale endpoint, so this shouldn't fail or force a refresh + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertEqual(endpoint, 'old.com') + self.client.describe_endpoints.call_args_list == [mock.call()] + + def test_describe_endpoint_required_force_refresh_success(self): + side_effect = [ + ConnectionError(error=None), + { + 'Endpoints': [ + { + 'Address': 'new.com', + 'CachePeriodInMinutes': 2, + } + ] + }, + ] + self.construct_manager(side_effect=side_effect) + kwargs = {'Operation': 'TestDiscoveryRequired'} + # First call will fail + with self.assertRaises(EndpointDiscoveryRefreshFailed): + self.manager.describe_endpoint(**kwargs) + self.client.describe_endpoints.call_args_list == [mock.call()] + # Force a refresh if the cache is empty but discovery is required + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertEqual(endpoint, 'new.com') + + def test_describe_endpoint_retries_after_failing(self): + fake_time = mock.Mock() + fake_time.side_effect = [0, 100, 200] + side_effect = [ + ConnectionError(error=None), + { + 'Endpoints': [ + { + 'Address': 'new.com', + 'CachePeriodInMinutes': 2, + } + ] + }, + ] + self.construct_manager(side_effect=side_effect, time=fake_time) + kwargs = {'Operation': 'TestDiscoveryOptional'} + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertIsNone(endpoint) + self.client.describe_endpoints.call_args_list == [mock.call()] + # Second time should try again as enough time has elapsed + endpoint = self.manager.describe_endpoint(**kwargs) + self.assertEqual(endpoint, 'new.com') + + +class TestEndpointDiscoveryHandler(BaseEndpointDiscoveryTest): + def setUp(self): + super().setUp() + self.manager = mock.Mock(spec=EndpointDiscoveryManager) + self.handler = EndpointDiscoveryHandler(self.manager) + self.service_model = ServiceModel(self.service_description) + + def test_register_handler(self): + events = mock.Mock(spec=HierarchicalEmitter) + self.handler.register(events, 'foo-bar') + events.register.assert_any_call( + 'before-parameter-build.foo-bar', self.handler.gather_identifiers + ) + events.register.assert_any_call( + 'needs-retry.foo-bar', self.handler.handle_retries + ) + events.register_first.assert_called_with( + 'request-created.foo-bar', self.handler.discover_endpoint + ) + + def test_discover_endpoint(self): + request = AWSRequest() + request.context = {'discovery': {'identifiers': {}}} + self.manager.describe_endpoint.return_value = 'https://new.foo' + self.handler.discover_endpoint(request, 'TestOperation') + self.assertEqual(request.url, 'https://new.foo') + self.manager.describe_endpoint.assert_called_with( + Operation='TestOperation', Identifiers={} + ) + + def test_discover_endpoint_fails(self): + request = AWSRequest() + request.context = {'discovery': {'identifiers': {}}} + request.url = 'old.com' + self.manager.describe_endpoint.return_value = None + self.handler.discover_endpoint(request, 'TestOperation') + self.assertEqual(request.url, 'old.com') + self.manager.describe_endpoint.assert_called_with( + Operation='TestOperation', Identifiers={} + ) + + def test_discover_endpoint_no_protocol(self): + request = AWSRequest() + request.context = {'discovery': {'identifiers': {}}} + self.manager.describe_endpoint.return_value = 'new.foo' + self.handler.discover_endpoint(request, 'TestOperation') + self.assertEqual(request.url, 'https://new.foo') + self.manager.describe_endpoint.assert_called_with( + Operation='TestOperation', Identifiers={} + ) + + def test_inject_no_context(self): + request = AWSRequest(url='https://original.foo') + self.handler.discover_endpoint(request, 'TestOperation') + self.assertEqual(request.url, 'https://original.foo') + self.manager.describe_endpoint.assert_not_called() + + def test_gather_identifiers(self): + context = {} + params = {'Foo': 'value1', 'Nested': {'Bar': 'value2'}} + ids = {'Foo': 'value1', 'Bar': 'value2'} + model = self.service_model.operation_model('TestDiscoveryRequired') + self.manager.gather_identifiers.return_value = ids + self.handler.gather_identifiers(params, model, context) + self.assertEqual(context['discovery']['identifiers'], ids) + + def test_gather_identifiers_not_discoverable(self): + context = {} + model = self.service_model.operation_model('DescribeEndpoints') + self.handler.gather_identifiers({}, model, context) + self.assertEqual(context, {}) + + def test_discovery_disabled_but_required(self): + model = self.service_model.operation_model('TestDiscoveryRequired') + with self.assertRaises(EndpointDiscoveryRequired): + block_endpoint_discovery_required_operations(model) + + def test_discovery_disabled_but_optional(self): + context = {} + model = self.service_model.operation_model('TestDiscoveryOptional') + block_endpoint_discovery_required_operations(model, context=context) + self.assertEqual(context, {}) + + def test_does_not_retry_no_response(self): + retry = self.handler.handle_retries(None, None, None) + self.assertIsNone(retry) + + def test_does_not_retry_other_errors(self): + parsed_response = {'ResponseMetadata': {'HTTPStatusCode': 200}} + response = (None, parsed_response) + retry = self.handler.handle_retries(None, response, None) + self.assertIsNone(retry) + + def test_does_not_retry_if_no_context(self): + request_dict = {'context': {}} + parsed_response = {'ResponseMetadata': {'HTTPStatusCode': 421}} + response = (None, parsed_response) + retry = self.handler.handle_retries(request_dict, response, None) + self.assertIsNone(retry) + + def _assert_retries(self, parsed_response): + request_dict = {'context': {'discovery': {'identifiers': {}}}} + response = (None, parsed_response) + model = self.service_model.operation_model('TestDiscoveryOptional') + retry = self.handler.handle_retries(request_dict, response, model) + self.assertEqual(retry, 0) + self.manager.delete_endpoints.assert_called_with( + Operation='TestDiscoveryOptional', Identifiers={} + ) + + def test_retries_421_status_code(self): + parsed_response = {'ResponseMetadata': {'HTTPStatusCode': 421}} + self._assert_retries(parsed_response) + + def test_retries_invalid_endpoint_exception(self): + parsed_response = {'Error': {'Code': 'InvalidEndpointException'}} + self._assert_retries(parsed_response) diff --git a/testbed/boto__botocore/tests/unit/test_endpoint.py b/testbed/boto__botocore/tests/unit/test_endpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..00790e4ecb6a04fe4fdb63903ac49251d0712b8b --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_endpoint.py @@ -0,0 +1,490 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import datetime +import io +import socket + +import pytest + +import botocore.endpoint +from botocore.config import Config +from botocore.endpoint import DEFAULT_TIMEOUT, Endpoint, EndpointCreator +from botocore.exceptions import HTTPClientError +from botocore.httpsession import URLLib3Session +from botocore.model import ( + OperationModel, + ServiceId, + ServiceModel, + StructureShape, +) +from tests import mock, unittest + + +def request_dict(**kwargs): + base = { + 'headers': {}, + 'body': '', + 'url_path': '/', + 'query_string': '', + 'method': 'POST', + 'url': 'https://example.com', + 'context': {}, + } + base.update(kwargs) + return base + + +class RecordStreamResets(io.StringIO): + def __init__(self, value): + io.StringIO.__init__(self, value) + self.total_resets = 0 + + def seek(self, where, whence=0): + self.total_resets += 1 + io.StringIO.seek(self, where, whence) + + +class TestEndpointBase(unittest.TestCase): + def setUp(self): + self.op = mock.Mock() + self.op.has_streaming_output = False + self.op.has_event_stream_output = False + self.op.metadata = {'protocol': 'json'} + self.event_emitter = mock.Mock() + self.event_emitter.emit.return_value = [] + self.factory_patch = mock.patch( + 'botocore.parsers.ResponseParserFactory' + ) + self.factory = self.factory_patch.start() + self.endpoint = Endpoint( + 'https://ec2.us-west-2.amazonaws.com/', + endpoint_prefix='ec2', + event_emitter=self.event_emitter, + ) + self.http_session = mock.Mock() + self.http_session.send.return_value = mock.Mock( + status_code=200, + headers={}, + content=b'{"Foo": "bar"}', + ) + self.endpoint.http_session = self.http_session + + def tearDown(self): + self.factory_patch.stop() + + def get_emitter_responses(self, num_retries=0, sleep_time=0, num_events=4): + emitter_responses = [] + # We emit the following events: + # 1. request-created + # 2. before-send + # 3. before-parse (may not be emitted if certain errors are thrown) + # 4. response-received + response_request_emitter_responses = [ + [(None, None)] # emit() response for each emitted event + ] * num_events + for _ in range(num_retries): + emitter_responses.extend(response_request_emitter_responses) + # emit() response for retry for sleep time + emitter_responses.append([(None, sleep_time)]) + emitter_responses.extend(response_request_emitter_responses) + # emit() response for no retry + emitter_responses.append([(None, None)]) + return emitter_responses + + def get_events_emitted(self, event_emitter): + return [ + call_arg[0][0] for call_arg in event_emitter.emit.call_args_list + ] + + +class TestEndpointFeatures(TestEndpointBase): + def test_make_request_with_no_auth(self): + self.endpoint.auth = None + self.endpoint.make_request(self.op, request_dict()) + + # http_session should be used to send the request. + self.assertTrue(self.http_session.send.called) + prepared_request = self.http_session.send.call_args[0][0] + self.assertNotIn('Authorization', prepared_request.headers) + + def test_make_request_no_signature_version(self): + self.endpoint.make_request(self.op, request_dict()) + + # http_session should be used to send the request. + self.assertTrue(self.http_session.send.called) + prepared_request = self.http_session.send.call_args[0][0] + self.assertNotIn('Authorization', prepared_request.headers) + + def test_make_request_with_context(self): + r = request_dict() + r['context'] = {'signing': {'region': 'us-west-2'}} + with mock.patch( + 'botocore.endpoint.Endpoint.prepare_request' + ) as prepare: + self.endpoint.make_request(self.op, r) + request = prepare.call_args[0][0] + self.assertEqual(request.context['signing']['region'], 'us-west-2') + + def test_make_request_sets_retries_config_in_context(self): + r = request_dict() + r['context'] = {'signing': {'region': 'us-west-2'}} + with mock.patch( + 'botocore.endpoint.Endpoint.prepare_request' + ) as prepare: + self.endpoint.make_request(self.op, r) + request = prepare.call_args[0][0] + self.assertIn('retries', request.context) + + def test_exception_caught_when_constructing_retries_context(self): + r = request_dict() + datetime_patcher = mock.patch.object( + botocore.endpoint.datetime, + 'datetime', + mock.Mock(wraps=datetime.datetime), + ) + r['context'] = {'signing': {'region': 'us-west-2'}} + with mock.patch( + 'botocore.endpoint.Endpoint.prepare_request' + ) as prepare: + mocked_datetime = datetime_patcher.start() + mocked_datetime.side_effect = Exception() + self.endpoint.make_request(self.op, r) + datetime_patcher.stop() + request = prepare.call_args[0][0] + self.assertIn('retries', request.context) + + def test_parses_modeled_exception_fields(self): + # Setup the service model to have exceptions to generate the mapping + self.service_model = mock.Mock(spec=ServiceModel) + self.op.service_model = self.service_model + self.exception_shape = mock.Mock(spec=StructureShape) + shape_for_error_code = self.service_model.shape_for_error_code + shape_for_error_code.return_value = self.exception_shape + + r = request_dict() + self.http_session.send.return_value = mock.Mock( + status_code=400, + headers={}, + content=b'', + ) + parser = mock.Mock() + parser.parse.side_effect = [ + { + 'Error': { + 'Code': 'ExceptionShape', + 'Message': 'Some message', + } + }, + {'SomeField': 'Foo'}, + ] + self.factory.return_value.create_parser.return_value = parser + _, response = self.endpoint.make_request(self.op, r) + # The parser should be called twice, once for the original + # error parse and once again for the modeled exception parse + self.assertEqual(parser.parse.call_count, 2) + parse_calls = parser.parse.call_args_list + self.assertEqual(parse_calls[1][0][1], self.exception_shape) + self.assertEqual(parse_calls[0][0][1], self.op.output_shape) + expected_response = { + 'Error': { + 'Code': 'ExceptionShape', + 'Message': 'Some message', + }, + 'SomeField': 'Foo', + } + self.assertEqual(response, expected_response) + + def test_close(self): + self.endpoint.close() + self.endpoint.http_session.close.assert_called_once_with() + + +class TestRetryInterface(TestEndpointBase): + def setUp(self): + super().setUp() + self.retried_on_exception = None + self._operation = mock.Mock(spec=OperationModel) + self._operation.name = 'DescribeInstances' + self._operation.metadata = {'protocol': 'query'} + self._operation.service_model.service_id = ServiceId('EC2') + self._operation.has_streaming_output = False + self._operation.has_event_stream_output = False + + def assert_events_emitted(self, event_emitter, expected_events): + self.assertEqual( + self.get_events_emitted(event_emitter), expected_events + ) + + def test_retry_events_are_emitted(self): + self.endpoint.make_request(self._operation, request_dict()) + call_args = self.event_emitter.emit.call_args + self.assertEqual(call_args[0][0], 'needs-retry.ec2.DescribeInstances') + + def test_retry_events_can_alter_behavior(self): + self.event_emitter.emit.side_effect = self.get_emitter_responses( + num_retries=1 + ) + r = request_dict() + r['context']['client_config'] = Config() + self.endpoint.make_request(self._operation, r) + self.assert_events_emitted( + self.event_emitter, + expected_events=[ + 'request-created.ec2.DescribeInstances', + 'before-send.ec2.DescribeInstances', + 'before-parse.ec2.DescribeInstances', + 'response-received.ec2.DescribeInstances', + 'needs-retry.ec2.DescribeInstances', + ] + * 2, + ) + + def test_retry_on_socket_errors(self): + self.event_emitter.emit.side_effect = self.get_emitter_responses( + num_retries=1, num_events=3 + ) + self.http_session.send.side_effect = HTTPClientError(error='wrapped') + with self.assertRaises(HTTPClientError): + self.endpoint.make_request(self._operation, request_dict()) + self.assert_events_emitted( + self.event_emitter, + expected_events=[ + 'request-created.ec2.DescribeInstances', + 'before-send.ec2.DescribeInstances', + 'response-received.ec2.DescribeInstances', + 'needs-retry.ec2.DescribeInstances', + ] + * 2, + ) + + def test_retry_attempts_added_to_response_metadata(self): + self.event_emitter.emit.side_effect = self.get_emitter_responses( + num_retries=1 + ) + parser = mock.Mock() + parser.parse.return_value = {'ResponseMetadata': {}} + self.factory.return_value.create_parser.return_value = parser + r = request_dict() + r['context']['client_config'] = Config() + response = self.endpoint.make_request(self._operation, r) + self.assertEqual(response[1]['ResponseMetadata']['RetryAttempts'], 1) + + def test_retry_attempts_is_zero_when_not_retried(self): + self.event_emitter.emit.side_effect = self.get_emitter_responses( + num_retries=0 + ) + parser = mock.Mock() + parser.parse.return_value = {'ResponseMetadata': {}} + self.factory.return_value.create_parser.return_value = parser + response = self.endpoint.make_request(self._operation, request_dict()) + self.assertEqual(response[1]['ResponseMetadata']['RetryAttempts'], 0) + + +class TestS3ResetStreamOnRetry(TestEndpointBase): + def setUp(self): + super().setUp() + + def max_attempts_retry_handler(self, attempts, **kwargs): + # Simulate a max requests of 3. + self.total_calls += 1 + if attempts == 3: + return None + else: + # Returning anything non-None will trigger a retry, + # but 0 here is so that time.sleep(0) happens. + return 0 + + def test_reset_stream_on_retry(self): + op = mock.Mock() + body = RecordStreamResets('foobar') + op.name = 'PutObject' + op.has_streaming_output = True + op.has_event_stream_output = False + op.metadata = {'protocol': 'rest-xml'} + request = request_dict() + request['body'] = body + request['context']['client_config'] = Config() + self.event_emitter.emit.side_effect = self.get_emitter_responses( + num_retries=2 + ) + self.endpoint.make_request(op, request) + # 2 seeks for the resets and 6 (2 per creation) for content-length + self.assertEqual(body.total_resets, 8) + + +class TestEventStreamBody(TestEndpointBase): + def test_event_stream_body_is_streaming(self): + self.op.has_event_stream_output = True + request = request_dict() + self.endpoint.make_request(self.op, request) + sent_request = self.http_session.send.call_args[0][0] + self.assertTrue(sent_request.stream_output) + + +class TestEndpointCreator(unittest.TestCase): + def setUp(self): + self.service_model = mock.Mock( + endpoint_prefix='ec2', signature_version='v2', signing_name='ec2' + ) + self.environ = {} + self.environ_patch = mock.patch('os.environ', self.environ) + self.environ_patch.start() + self.creator = EndpointCreator(mock.Mock()) + self.mock_session = mock.Mock(spec=URLLib3Session) + + def tearDown(self): + self.environ_patch.stop() + + def test_creates_endpoint_with_configured_url(self): + endpoint = self.creator.create_endpoint( + self.service_model, + region_name='us-east-1', + endpoint_url='https://endpoint.url', + ) + self.assertEqual(endpoint.host, 'https://endpoint.url') + + def test_creates_endpoint_with_ipv4_url(self): + endpoint = self.creator.create_endpoint( + self.service_model, + region_name='us-east-1', + endpoint_url='https://192.168.0.0', + ) + self.assertEqual(endpoint.host, 'https://192.168.0.0') + + def test_creates_endpoint_with_ipv6_url(self): + endpoint = self.creator.create_endpoint( + self.service_model, + region_name='us-east-1', + endpoint_url='https://[100:0:2::61]:7480', + ) + self.assertEqual(endpoint.host, 'https://[100:0:2::61]:7480') + + def test_raises_error_with_invalid_url(self): + with pytest.raises(ValueError): + self.creator.create_endpoint( + self.service_model, + region_name='us-east-1', + endpoint_url='https://*.aws.amazon.com/', + ) + + def test_create_endpoint_with_default_timeout(self): + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertEqual(session_args.get('timeout'), DEFAULT_TIMEOUT) + + def test_create_endpoint_with_customized_timeout(self): + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + timeout=123, + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertEqual(session_args.get('timeout'), 123) + + def test_get_endpoint_default_verify_ssl(self): + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertTrue(session_args.get('verify')) + + def test_verify_ssl_can_be_disabled(self): + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + verify=False, + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertFalse(session_args.get('verify')) + + def test_verify_ssl_can_specify_cert_bundle(self): + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + verify='/path/cacerts.pem', + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertEqual(session_args.get('verify'), '/path/cacerts.pem') + + def test_client_cert_can_specify_path(self): + client_cert = '/some/path/cert' + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + client_cert=client_cert, + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertEqual(session_args.get('client_cert'), '/some/path/cert') + + def test_honor_cert_bundle_env_var(self): + self.environ['REQUESTS_CA_BUNDLE'] = '/env/cacerts.pem' + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertEqual(session_args.get('verify'), '/env/cacerts.pem') + + def test_env_ignored_if_explicitly_passed(self): + self.environ['REQUESTS_CA_BUNDLE'] = '/env/cacerts.pem' + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + verify='/path/cacerts.pem', + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + # /path/cacerts.pem wins over the value from the env var. + self.assertEqual(session_args.get('verify'), '/path/cacerts.pem') + + def test_can_specify_max_pool_conns(self): + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + max_pool_connections=100, + http_session_cls=self.mock_session, + ) + session_args = self.mock_session.call_args[1] + self.assertEqual(session_args.get('max_pool_connections'), 100) + + def test_socket_options(self): + socket_options = [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)] + self.creator.create_endpoint( + self.service_model, + region_name='us-west-2', + endpoint_url='https://example.com', + http_session_cls=self.mock_session, + socket_options=socket_options, + ) + session_args = self.mock_session.call_args[1] + self.assertEqual(session_args.get('socket_options'), socket_options) diff --git a/testbed/boto__botocore/tests/unit/test_endpoint_provider.py b/testbed/boto__botocore/tests/unit/test_endpoint_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..c1f82ace2ece786ee0f8d056aa87e31e8ccab1da --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_endpoint_provider.py @@ -0,0 +1,512 @@ +# Copyright 2012-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +import json +import logging +import os +from unittest.mock import Mock + +import pytest + +from botocore.endpoint_provider import ( + EndpointProvider, + EndpointRule, + ErrorRule, + RuleCreator, + RuleSet, + RuleSetStandardLibrary, + TreeRule, +) +from botocore.exceptions import ( + EndpointResolutionError, + MissingDependencyException, + UnknownSignatureVersionError, +) +from botocore.loaders import Loader +from botocore.regions import EndpointRulesetResolver +from tests import requires_crt + +REGION_TEMPLATE = "{Region}" +REGION_REF = {"ref": "Region"} +BUCKET_ARN_REF = {"ref": "bucketArn"} +PARSE_ARN_FUNC = { + "fn": "aws.parseArn", + "argv": [{"ref": "Bucket"}], + "assign": "bucketArn", +} +STRING_EQUALS_FUNC = { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [BUCKET_ARN_REF, "region"], + "assign": "bucketRegion", + }, + "", + ], +} +DNS_SUFFIX_TEMPLATE = "{PartitionResults#dnsSuffix}" +URL_TEMPLATE = ( + f"https://{REGION_TEMPLATE}.myGreatService.{DNS_SUFFIX_TEMPLATE}" +) +ENDPOINT_DICT = { + "url": URL_TEMPLATE, + "properties": { + "authSchemes": [ + { + "signingName": "s3", + "signingScope": REGION_TEMPLATE, + "name": "s3v4", + } + ], + }, + "headers": { + "x-amz-region-set": [ + REGION_REF, + { + "fn": "getAttr", + "argv": [BUCKET_ARN_REF, "region"], + }, + "us-east-2", + ], + }, +} + + +@pytest.fixture(scope="module") +def loader(): + return Loader() + + +@pytest.fixture(scope="module") +def partitions(loader): + return loader.load_data("partitions") + + +@pytest.fixture(scope="module") +def rule_lib(partitions): + return RuleSetStandardLibrary(partitions) + + +@pytest.fixture(scope="module") +def ruleset_dict(): + path = os.path.join( + os.path.dirname(__file__), + "data", + "endpoints", + "valid-rules", + "deprecated-param.json", + ) + with open(path) as f: + return json.load(f) + + +@pytest.fixture(scope="module") +def endpoint_provider(ruleset_dict, partitions): + return EndpointProvider(ruleset_dict, partitions) + + +@pytest.fixture(scope="module") +def endpoint_rule(): + return EndpointRule( + endpoint=ENDPOINT_DICT, + conditions=[ + PARSE_ARN_FUNC, + { + "fn": "not", + "argv": [STRING_EQUALS_FUNC], + }, + { + "fn": "aws.partition", + "argv": [REGION_REF], + "assign": "PartitionResults", + }, + ], + ) + + +def ruleset_testcases(): + filenames = [ + "aws-region", + "default-values", + "eventbridge", + "fns", + "headers", + "is-virtual-hostable-s3-bucket", + "local-region-override", + "parse-arn", + "parse-url", + "substring", + "uri-encode", + "valid-hostlabel", + ] + error_cases = [] + endpoint_cases = [] + base_path = os.path.join(os.path.dirname(__file__), "data", "endpoints") + for name in filenames: + with open(os.path.join(base_path, "valid-rules", f"{name}.json")) as f: + ruleset = json.load(f) + with open(os.path.join(base_path, "test-cases", f"{name}.json")) as f: + tests = json.load(f) + + for test in tests["testCases"]: + input_params = test["params"] + expected_object = test["expect"] + if "error" in expected_object: + error_cases.append( + (ruleset, input_params, expected_object["error"]) + ) + elif "endpoint" in expected_object: + endpoint_cases.append( + (ruleset, input_params, expected_object["endpoint"]) + ) + else: + raise ValueError("Expected `error` or `endpoint` in test case") + return error_cases, endpoint_cases + + +ERROR_TEST_CASES, ENDPOINT_TEST_CASES = ruleset_testcases() + + +@pytest.mark.parametrize( + "ruleset,input_params,expected_error", + ERROR_TEST_CASES, +) +def test_endpoint_resolution_raises( + partitions, ruleset, input_params, expected_error +): + endpoint_provider = EndpointProvider(ruleset, partitions) + with pytest.raises(EndpointResolutionError) as exc_info: + endpoint_provider.resolve_endpoint(**input_params) + assert str(exc_info.value) == expected_error + + +@pytest.mark.parametrize( + "ruleset,input_params,expected_endpoint", + ENDPOINT_TEST_CASES, +) +def test_endpoint_resolution( + partitions, ruleset, input_params, expected_endpoint +): + endpoint_provider = EndpointProvider(ruleset, partitions) + endpoint = endpoint_provider.resolve_endpoint(**input_params) + assert endpoint.url == expected_endpoint["url"] + assert endpoint.properties == expected_endpoint.get("properties", {}) + assert endpoint.headers == expected_endpoint.get("headers", {}) + + +def test_none_returns_default_partition(rule_lib): + partition_dict = rule_lib.aws_partition(None) + assert partition_dict['name'] == "aws" + + +def test_no_match_region_returns_default_partition(rule_lib): + partition_dict = rule_lib.aws_partition("invalid-region-42") + assert partition_dict['name'] == "aws" + + +def test_invalid_arn_returns_none(rule_lib): + assert rule_lib.aws_parse_arn("arn:aws:this-is-not-an-arn:foo") is None + + +@pytest.mark.parametrize( + "arn, expected_resource_id", + [ + ( + "arn:aws:s3:::myBucket/key", + { + "partition": "aws", + "service": "s3", + "region": "", + "accountId": "", + "resourceId": ["myBucket", "key"], + }, + ), + ( + "arn:aws:kinesis:us-east-1:1234567890:stream/mystream:foo", + { + "partition": "aws", + "service": "kinesis", + "region": "us-east-1", + "accountId": "1234567890", + "resourceId": ["stream", "mystream", "foo"], + }, + ), + ( + "arn:aws:s3:::myBucket", + { + "partition": "aws", + "service": "s3", + "region": "", + "accountId": "", + "resourceId": ["myBucket"], + }, + ), + ], +) +def test_parse_arn_delimiters(rule_lib, arn, expected_resource_id): + parsed_arn = rule_lib.aws_parse_arn(arn) + assert parsed_arn == expected_resource_id + + +def test_uri_encode_none_returns_none(rule_lib): + assert rule_lib.uri_encode(None) is None + + +def test_parse_url_none_return_none(rule_lib): + assert rule_lib.parse_url(None) is None + + +def test_string_equals_wrong_type_raises(rule_lib): + with pytest.raises(EndpointResolutionError) as exc_info: + rule_lib.string_equals(1, 2) + assert "Both values must be strings" in str(exc_info.value) + + +def test_boolean_equals_wrong_type_raises(rule_lib): + with pytest.raises(EndpointResolutionError) as exc_info: + rule_lib.boolean_equals(1, 2) + assert "Both arguments must be bools" in str(exc_info.value) + + +def test_substring_wrong_type_raises(rule_lib): + with pytest.raises(EndpointResolutionError) as exc_info: + rule_lib.substring(["h", "e", "l", "l", "o"], 0, 5, False) + assert "Input must be a string" in str(exc_info.value) + + +def test_creator_unknown_type_raises(): + with pytest.raises(EndpointResolutionError) as exc_info: + RuleCreator.create(type="foo") + assert "Unknown rule type: foo." in str(exc_info.value) + + +def test_parameter_wrong_type_raises(endpoint_provider): + param = endpoint_provider.ruleset.parameters["Region"] + with pytest.raises(EndpointResolutionError) as exc_info: + param.validate_input(1) + assert "Value (Region) is the wrong type" in str(exc_info.value) + + +def test_deprecated_parameter_logs(endpoint_provider, caplog): + caplog.set_level(logging.INFO) + param = endpoint_provider.ruleset.parameters["Region"] + param.validate_input("foo") + assert "Region has been deprecated." in caplog.text + + +def test_no_endpoint_found_error(endpoint_provider): + with pytest.raises(EndpointResolutionError) as exc_info: + endpoint_provider.resolve_endpoint( + **{"Endpoint": "mygreatendpoint.com", "Bucket": "mybucket"} + ) + assert "No endpoint found for parameters" in str(exc_info.value) + + +@pytest.mark.parametrize( + "rule_dict,expected_rule_type", + [ + ( + { + "type": "endpoint", + "conditions": [], + "endpoint": { + "url": ( + "https://{Region}.myGreatService." + "{PartitionResult#dualStackDnsSuffix}" + ), + "properties": {}, + "headers": {}, + }, + }, + EndpointRule, + ), + ( + { + "type": "error", + "conditions": [], + "error": ( + "Dualstack is enabled but this partition " + "does not support DualStack" + ), + }, + ErrorRule, + ), + ({"type": "tree", "conditions": [], "rules": []}, TreeRule), + ], +) +def test_rule_creation(rule_dict, expected_rule_type): + rule = RuleCreator.create(**rule_dict) + assert isinstance(rule, expected_rule_type) + + +def test_assign_existing_scope_var_raises(rule_lib): + rule = EndpointRule( + conditions=[ + { + 'fn': 'aws.parseArn', + 'argv': ['{Bucket}'], + 'assign': 'bucketArn', + }, + { + 'fn': 'aws.parseArn', + 'argv': ['{Bucket}'], + 'assign': 'bucketArn', + }, + ], + endpoint={'url': 'foo.bar'}, + ) + with pytest.raises(EndpointResolutionError) as exc_info: + rule.evaluate_conditions( + scope_vars={ + 'Bucket': 'arn:aws:s3:us-east-1:123456789012:mybucket' + }, + rule_lib=rule_lib, + ) + assert str(exc_info.value) == ( + "Assignment bucketArn already exists in " + "scoped variables and cannot be overwritten" + ) + + +def test_ruleset_unknown_parameter_type_raises(partitions): + with pytest.raises(EndpointResolutionError) as exc_info: + RuleSet( + version='1.0', + parameters={ + 'Bucket': {"type": "list"}, + }, + rules=[], + partitions=partitions, + ) + assert "Unknown parameter type: list." in str(exc_info.value) + + +@pytest.fixture() +def empty_resolver(): + return EndpointRulesetResolver( + endpoint_ruleset_data={ + 'version': '1.0', + 'parameters': {}, + 'rules': [], + }, + partition_data={}, + service_model=None, + builtins={}, + client_context=None, + event_emitter=None, + use_ssl=True, + requested_auth_scheme=None, + ) + + +def test_auth_schemes_conversion_sigv4(empty_resolver): + auth_schemes = [ + { + 'name': 'sigv4', + 'signingName': 'dynamodb', + 'signingRegion': 'my-region-1', + 'disableDoubleEncoding': True, + 'otherParameter': 'otherValue', + } + ] + at, sc = empty_resolver.auth_schemes_to_signing_ctx(auth_schemes) + assert at == 'v4' + assert sc == { + 'region': 'my-region-1', + 'signing_name': 'dynamodb', + 'disableDoubleEncoding': True, + } + + +@requires_crt() +def test_auth_schemes_conversion_sigv4a_with_crt(monkeypatch, empty_resolver): + monkeypatch.setattr('botocore.regions.HAS_CRT', True) + auth_schemes = [ + {'name': 'sigv4a', 'signingName': 's3', 'signingRegionSet': ['*']} + ] + at, sc = empty_resolver.auth_schemes_to_signing_ctx(auth_schemes) + assert at == 'v4a' + assert sc == {'region': '*', 'signing_name': 's3'} + + +def test_auth_schemes_conversion_sigv4a_without_crt( + monkeypatch, empty_resolver +): + monkeypatch.setattr('botocore.regions.HAS_CRT', False) + monkeypatch.setattr('botocore.regions.AUTH_TYPE_MAPS', {}) + auth_schemes = [ + {'name': 'sigv4a', 'signingName': 's3', 'signingRegionSet': ['*']} + ] + with pytest.raises(MissingDependencyException): + empty_resolver.auth_schemes_to_signing_ctx(auth_schemes) + + +def test_auth_schemes_conversion_no_known_auth_types(empty_resolver): + auth_schemes = [ + {'name': 'foo', 'signingName': 's3', 'signingRegion': 'ap-south-2'}, + {'name': 'bar', 'otherParamKey': 'otherParamVal'}, + ] + with pytest.raises(UnknownSignatureVersionError): + empty_resolver.auth_schemes_to_signing_ctx(auth_schemes) + + +def test_auth_schemes_conversion_first_authtype_unknown( + monkeypatch, empty_resolver +): + monkeypatch.setattr('botocore.regions.HAS_CRT', False) + monkeypatch.setattr('botocore.regions.AUTH_TYPE_MAPS', {'bar': None}) + auth_schemes = [ + {'name': 'foo', 'signingName': 's3', 'signingRegion': 'ap-south-1'}, + {'name': 'bar', 'signingName': 's3', 'signingRegion': 'ap-south-2'}, + ] + at, sc = empty_resolver.auth_schemes_to_signing_ctx(auth_schemes) + assert at == 'bar' + assert sc == {'region': 'ap-south-2', 'signing_name': 's3'} + + +def test_endpoint_resolution_caches(endpoint_provider, monkeypatch): + mock_evaluate = Mock() + monkeypatch.setattr(RuleSet, "evaluate", mock_evaluate) + for _ in range(5): + endpoint_provider.resolve_endpoint(Region="us-east-2") + mock_evaluate.assert_called_once_with({"Region": "us-east-2"}) + + +def test_endpoint_reevaluates_result(endpoint_provider, monkeypatch): + regions = ["us-east-1", "us-west-2"] + mock_evaluate = Mock() + monkeypatch.setattr(RuleSet, "evaluate", mock_evaluate) + for region in regions: + endpoint_provider.resolve_endpoint(Region=region) + assert mock_evaluate.call_count == 2 + + +@pytest.mark.parametrize( + "bucket, expected_value", + [ + ("mybucket", True), + ("ab", False), + ("a.b", True), + ("my.great.bucket.aws.com", True), + ("mY.GREAT.bucket.aws.com", False), + ("192.168.1.1", False), + ], +) +def test_aws_is_virtual_hostable_s3_bucket_allow_subdomains( + rule_lib, bucket, expected_value +): + assert ( + rule_lib.aws_is_virtual_hostable_s3_bucket(bucket, True) + == expected_value + ) diff --git a/testbed/boto__botocore/tests/unit/test_errorfactory.py b/testbed/boto__botocore/tests/unit/test_errorfactory.py new file mode 100644 index 0000000000000000000000000000000000000000..6652007300c475c916b40de4bcffba8c3e675f4c --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_errorfactory.py @@ -0,0 +1,139 @@ +# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +from botocore.errorfactory import BaseClientExceptions, ClientExceptionsFactory +from botocore.exceptions import ClientError +from botocore.model import ServiceModel +from tests import unittest + + +class TestBaseClientExceptions(unittest.TestCase): + def setUp(self): + self.code_to_exception = {} + self.exceptions = BaseClientExceptions(self.code_to_exception) + + def test_has_client_error(self): + self.assertIs(self.exceptions.ClientError, ClientError) + + def test_from_code(self): + exception_cls = type('MyException', (ClientError,), {}) + self.code_to_exception['MyExceptionCode'] = exception_cls + self.assertIs( + self.exceptions.from_code('MyExceptionCode'), exception_cls + ) + + def test_from_code_nonmatch_defaults_to_client_error(self): + self.assertIs( + self.exceptions.from_code('SomeUnknownErrorCode'), ClientError + ) + + def test_gettattr_message(self): + exception_cls = type('MyException', (ClientError,), {}) + self.code_to_exception['MyExceptionCode'] = exception_cls + with self.assertRaisesRegex( + AttributeError, 'Valid exceptions are: MyException' + ): + self.exceptions.SomeUnmodeledError + + +class TestClientExceptionsFactory(unittest.TestCase): + def setUp(self): + self.model = { + "metadata": { + 'endpointPrefix': 'myservice', + 'serviceFullName': 'MyService', + }, + 'operations': { + 'OperationName': { + 'name': 'OperationName', + 'errors': [ + {'shape': 'ExceptionMissingCode'}, + {'shape': 'ExceptionWithModeledCode'}, + ], + }, + 'AnotherOperationName': { + 'name': 'AnotherOperationName', + 'errors': [ + {'shape': 'ExceptionForAnotherOperation'}, + {'shape': 'ExceptionWithModeledCode'}, + ], + }, + }, + 'shapes': { + 'ExceptionWithModeledCode': { + 'type': 'structure', + 'members': {}, + 'error': {'code': 'ModeledCode'}, + 'exception': True, + }, + 'ExceptionMissingCode': { + 'type': 'structure', + 'members': {}, + 'exception': True, + }, + 'ExceptionForAnotherOperation': { + 'type': 'structure', + 'members': {}, + 'exception': True, + }, + }, + } + self.service_model = ServiceModel(self.model) + self.exceptions_factory = ClientExceptionsFactory() + + def test_class_name(self): + exceptions = self.exceptions_factory.create_client_exceptions( + self.service_model + ) + self.assertEqual(exceptions.__class__.__name__, 'MyServiceExceptions') + + def test_creates_modeled_exception(self): + exceptions = self.exceptions_factory.create_client_exceptions( + self.service_model + ) + self.assertTrue(hasattr(exceptions, 'ExceptionWithModeledCode')) + modeled_exception = exceptions.ExceptionWithModeledCode + self.assertEqual( + modeled_exception.__name__, 'ExceptionWithModeledCode' + ) + self.assertTrue(issubclass(modeled_exception, ClientError)) + + def test_collects_modeled_exceptions_for_all_operations(self): + exceptions = self.exceptions_factory.create_client_exceptions( + self.service_model + ) + # Make sure exceptions were added for all operations by checking + # an exception only found on an a different operation. + self.assertTrue(hasattr(exceptions, 'ExceptionForAnotherOperation')) + modeled_exception = exceptions.ExceptionForAnotherOperation + self.assertEqual( + modeled_exception.__name__, 'ExceptionForAnotherOperation' + ) + self.assertTrue(issubclass(modeled_exception, ClientError)) + + def test_creates_modeled_exception_mapping_that_has_code(self): + exceptions = self.exceptions_factory.create_client_exceptions( + self.service_model + ) + exception = exceptions.from_code('ModeledCode') + self.assertEqual(exception.__name__, 'ExceptionWithModeledCode') + self.assertTrue(issubclass(exception, ClientError)) + + def test_creates_modeled_exception_mapping_that_has_no_code(self): + exceptions = self.exceptions_factory.create_client_exceptions( + self.service_model + ) + # For exceptions that do not have an explicit code associated to them, + # the code is the name of the exception. + exception = exceptions.from_code('ExceptionMissingCode') + self.assertEqual(exception.__name__, 'ExceptionMissingCode') + self.assertTrue(issubclass(exception, ClientError)) diff --git a/testbed/boto__botocore/tests/unit/test_eventstream.py b/testbed/boto__botocore/tests/unit/test_eventstream.py new file mode 100644 index 0000000000000000000000000000000000000000..26db9758fd9820aa5cb0aa31a68a1dd176f4741a --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_eventstream.py @@ -0,0 +1,568 @@ +# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Unit tests for the binary event stream decoder.""" + +import pytest + +from botocore.eventstream import ( + ChecksumMismatch, + DecodeUtils, + DuplicateHeader, + EventStream, + EventStreamBuffer, + EventStreamHeaderParser, + EventStreamMessage, + InvalidHeadersLength, + InvalidPayloadLength, + MessagePrelude, + NoInitialResponseError, +) +from botocore.exceptions import EventStreamError +from botocore.parsers import EventStreamXMLParser +from tests import mock + +EMPTY_MESSAGE = ( + b'\x00\x00\x00\x10\x00\x00\x00\x00\x05\xc2H\xeb}\x98\xc8\xff', + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x10, + headers_length=0, + crc=0x05C248EB, + ), + headers={}, + payload=b'', + crc=0x7D98C8FF, + ), +) + +INT8_HEADER = ( + ( + b"\x00\x00\x00\x17\x00\x00\x00\x07)\x86\x01X\x04" + b"byte\x02\xff\xc2\xf8i\xdc" + ), + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x17, + headers_length=0x7, + crc=0x29860158, + ), + headers={'byte': -1}, + payload=b'', + crc=0xC2F869DC, + ), +) + +INT16_HEADER = ( + ( + b"\x00\x00\x00\x19\x00\x00\x00\tq\x0e\x92>\x05" + b"short\x03\xff\xff\xb2|\xb6\xcc" + ), + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x19, + headers_length=0x9, + crc=0x710E923E, + ), + headers={'short': -1}, + payload=b'', + crc=0xB27CB6CC, + ), +) + +INT32_HEADER = ( + ( + b"\x00\x00\x00\x1d\x00\x00\x00\r\x83\xe3\xf0\xe7\x07" + b"integer\x04\xff\xff\xff\xff\x8b\x8e\x12\xeb" + ), + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x1D, + headers_length=0xD, + crc=0x83E3F0E7, + ), + headers={'integer': -1}, + payload=b'', + crc=0x8B8E12EB, + ), +) + +INT64_HEADER = ( + ( + b"\x00\x00\x00\x1e\x00\x00\x00\x0e]J\xdb\x8d\x04" + b"long\x05\xff\xff\xff\xff\xff\xff\xff\xffK\xc22\xda" + ), + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x1E, + headers_length=0xE, + crc=0x5D4ADB8D, + ), + headers={'long': -1}, + payload=b'', + crc=0x4BC232DA, + ), +) + +PAYLOAD_NO_HEADERS = ( + b"\x00\x00\x00\x1d\x00\x00\x00\x00\xfdR\x8cZ{'foo':'bar'}\xc3e96", + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x1D, + headers_length=0, + crc=0xFD528C5A, + ), + headers={}, + payload=b"{'foo':'bar'}", + crc=0xC3653936, + ), +) + +PAYLOAD_ONE_STR_HEADER = ( + ( + b"\x00\x00\x00=\x00\x00\x00 \x07\xfd\x83\x96\x0ccontent-type\x07\x00\x10" + b"application/json{'foo':'bar'}\x8d\x9c\x08\xb1" + ), + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x3D, + headers_length=0x20, + crc=0x07FD8396, + ), + headers={'content-type': 'application/json'}, + payload=b"{'foo':'bar'}", + crc=0x8D9C08B1, + ), +) + +ALL_HEADERS_TYPES = ( + ( + b"\x00\x00\x00\x62\x00\x00\x00\x52\x03\xb5\xcb\x9c" + b"\x010\x00\x011\x01\x012\x02\x02\x013\x03\x00\x03" + b"\x014\x04\x00\x00\x00\x04\x015\x05\x00\x00\x00\x00\x00\x00\x00\x05" + b"\x016\x06\x00\x05bytes\x017\x07\x00\x04utf8" + b"\x018\x08\x00\x00\x00\x00\x00\x00\x00\x08\x019\x090123456789abcdef" + b"\x63\x35\x36\x71" + ), + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x62, + headers_length=0x52, + crc=0x03B5CB9C, + ), + headers={ + '0': True, + '1': False, + '2': 0x02, + '3': 0x03, + '4': 0x04, + '5': 0x05, + '6': b'bytes', + '7': 'utf8', + '8': 0x08, + '9': b'0123456789abcdef', + }, + payload=b"", + crc=0x63353671, + ), +) + +ERROR_EVENT_MESSAGE = ( + ( + b"\x00\x00\x00\x52\x00\x00\x00\x42\xbf\x23\x63\x7e" + b"\x0d:message-type\x07\x00\x05error" + b"\x0b:error-code\x07\x00\x04code" + b"\x0e:error-message\x07\x00\x07message" + b"\x6b\x6c\xea\x3d" + ), + EventStreamMessage( + prelude=MessagePrelude( + total_length=0x52, + headers_length=0x42, + crc=0xBF23637E, + ), + headers={ + ':message-type': 'error', + ':error-code': 'code', + ':error-message': 'message', + }, + payload=b'', + crc=0x6B6CEA3D, + ), +) + +# Tuples of encoded messages and their expected decoded output +POSITIVE_CASES = [ + EMPTY_MESSAGE, + INT8_HEADER, + INT16_HEADER, + INT32_HEADER, + INT64_HEADER, + PAYLOAD_NO_HEADERS, + PAYLOAD_ONE_STR_HEADER, + ALL_HEADERS_TYPES, + ERROR_EVENT_MESSAGE, +] + +CORRUPTED_HEADER_LENGTH = ( + ( + b"\x00\x00\x00=\xff\x00\x01\x02\x07\xfd\x83\x96\x0ccontent-type\x07\x00" + b"\x10application/json{'foo':'bar'}\x8d\x9c\x08\xb1" + ), + ChecksumMismatch, +) + +CORRUPTED_HEADERS = ( + ( + b"\x00\x00\x00=\x00\x00\x00 \x07\xfd\x83\x96\x0ccontent+type\x07\x00\x10" + b"application/json{'foo':'bar'}\x8d\x9c\x08\xb1" + ), + ChecksumMismatch, +) + +CORRUPTED_LENGTH = ( + b"\x01\x00\x00\x1d\x00\x00\x00\x00\xfdR\x8cZ{'foo':'bar'}\xc3e96", + ChecksumMismatch, +) + +CORRUPTED_PAYLOAD = ( + b"\x00\x00\x00\x1d\x00\x00\x00\x00\xfdR\x8cZ{'foo':'bar'\x8d\xc3e96", + ChecksumMismatch, +) + +DUPLICATE_HEADER = ( + ( + b"\x00\x00\x00\x24\x00\x00\x00\x14\x4b\xb9\x82\xd0" + b"\x04test\x04asdf\x04test\x04asdf\xf3\xf4\x75\x63" + ), + DuplicateHeader, +) + +# In contrast to the CORRUPTED_HEADERS case, this message is otherwise +# well-formed - the checksums match. +INVALID_HEADERS_LENGTH = ( + ( + b"\x00\x00\x00\x3d" # total length + b"\xff\x00\x01\x02" # headers length + b"\x15\x83\xf5\xc2" # prelude crc + b"\x0ccontent-type\x07\x00\x10application/json" # headers + b"{'foo':'bar'}" # payload + b"\x2f\x37\x7f\x5d" # message crc + ), + InvalidHeadersLength, +) + +# In contrast to the CORRUPTED_PAYLOAD case, this message is otherwise +# well-formed - the checksums match. +INVALID_PAYLOAD_LENGTH = ( + b"\x01\x00\x00\x11" # total length + + b"\x00\x00\x00\x00" # headers length + + b"\xf4\x08\x61\xc5" # prelude crc + + b"0" * (16 * 1024**2 + 1) # payload + + b"\x2a\xb4\xc5\xa5", # message crc + InvalidPayloadLength, +) + +# Tuples of encoded messages and their expected exception +NEGATIVE_CASES = [ + CORRUPTED_LENGTH, + CORRUPTED_PAYLOAD, + CORRUPTED_HEADERS, + CORRUPTED_HEADER_LENGTH, + DUPLICATE_HEADER, + INVALID_HEADERS_LENGTH, + INVALID_PAYLOAD_LENGTH, +] + + +def assert_message_equal(message_a, message_b): + """Asserts all fields for two messages are equal.""" + assert message_a.prelude.total_length == message_b.prelude.total_length + assert message_a.prelude.headers_length == message_b.prelude.headers_length + assert message_a.prelude.crc == message_b.prelude.crc + assert message_a.headers == message_b.headers + assert message_a.payload == message_b.payload + assert message_a.crc == message_b.crc + + +def test_partial_message(): + """Ensure that we can receive partial payloads.""" + data = EMPTY_MESSAGE[0] + event_buffer = EventStreamBuffer() + # This mid point is an arbitrary break in the middle of the headers + mid_point = 15 + event_buffer.add_data(data[:mid_point]) + messages = list(event_buffer) + assert messages == [] + event_buffer.add_data(data[mid_point : len(data)]) + for message in event_buffer: + assert_message_equal(message, EMPTY_MESSAGE[1]) + + +def check_message_decodes(encoded, decoded): + """Ensure the message decodes to what we expect.""" + event_buffer = EventStreamBuffer() + event_buffer.add_data(encoded) + messages = list(event_buffer) + assert len(messages) == 1 + assert_message_equal(messages[0], decoded) + + +@pytest.mark.parametrize("encoded, decoded", POSITIVE_CASES) +def test_positive_cases(encoded, decoded): + """Test that all positive cases decode how we expect.""" + check_message_decodes(encoded, decoded) + + +def test_all_positive_cases(): + """Test all positive cases can be decoded on the same buffer.""" + event_buffer = EventStreamBuffer() + # add all positive test cases to the same buffer + for encoded, _ in POSITIVE_CASES: + event_buffer.add_data(encoded) + # collect all of the expected messages + expected_messages = [decoded for (_, decoded) in POSITIVE_CASES] + # collect all of the decoded messages + decoded_messages = list(event_buffer) + # assert all messages match what we expect + for expected, decoded in zip(expected_messages, decoded_messages): + assert_message_equal(expected, decoded) + + +@pytest.mark.parametrize( + "encoded, exception", + NEGATIVE_CASES, + ids=[ + "corrupted-length", + "corrupted-payload", + "corrupted-headers", + "corrupted-headers-length", + "duplicate-headers", + "invalid-headers-length", + "invalid-payload-length", + ], +) +def test_negative_cases(encoded, exception): + """Test that all negative cases raise the expected exception.""" + with pytest.raises(exception): + check_message_decodes(encoded, None) + + +def test_header_parser(): + """Test that the header parser supports all header types.""" + headers_data = ( + b"\x010\x00\x011\x01\x012\x02\x02\x013\x03\x00\x03" + b"\x014\x04\x00\x00\x00\x04\x015\x05\x00\x00\x00\x00\x00\x00\x00\x05" + b"\x016\x06\x00\x05bytes\x017\x07\x00\x04utf8" + b"\x018\x08\x00\x00\x00\x00\x00\x00\x00\x08\x019\x090123456789abcdef" + ) + + expected_headers = { + '0': True, + '1': False, + '2': 0x02, + '3': 0x03, + '4': 0x04, + '5': 0x05, + '6': b'bytes', + '7': 'utf8', + '8': 0x08, + '9': b'0123456789abcdef', + } + + parser = EventStreamHeaderParser() + headers = parser.parse(headers_data) + assert headers == expected_headers + + +def test_message_prelude_properties(): + """Test that calculated properties from the payload are correct.""" + # Total length: 40, Headers Length: 15, random crc + prelude = MessagePrelude(40, 15, 0x00000000) + assert prelude.payload_length == 9 + assert prelude.headers_end == 27 + assert prelude.payload_end == 36 + + +def test_message_to_response_dict(): + response_dict = PAYLOAD_ONE_STR_HEADER[1].to_response_dict() + assert response_dict['status_code'] == 200 + + expected_headers = {'content-type': 'application/json'} + assert response_dict['headers'] == expected_headers + assert response_dict['body'] == b"{'foo':'bar'}" + + +def test_message_to_response_dict_error(): + response_dict = ERROR_EVENT_MESSAGE[1].to_response_dict() + assert response_dict['status_code'] == 400 + headers = { + ':message-type': 'error', + ':error-code': 'code', + ':error-message': 'message', + } + assert response_dict['headers'] == headers + assert response_dict['body'] == b'' + + +def test_unpack_uint8(): + (value, bytes_consumed) = DecodeUtils.unpack_uint8(b'\xde') + assert bytes_consumed == 1 + assert value == 0xDE + + +def test_unpack_uint32(): + (value, bytes_consumed) = DecodeUtils.unpack_uint32(b'\xde\xad\xbe\xef') + assert bytes_consumed == 4 + assert value == 0xDEADBEEF + + +def test_unpack_int8(): + (value, bytes_consumed) = DecodeUtils.unpack_int8(b'\xfe') + assert bytes_consumed == 1 + assert value == -2 + + +def test_unpack_int16(): + (value, bytes_consumed) = DecodeUtils.unpack_int16(b'\xff\xfe') + assert bytes_consumed == 2 + assert value == -2 + + +def test_unpack_int32(): + (value, bytes_consumed) = DecodeUtils.unpack_int32(b'\xff\xff\xff\xfe') + assert bytes_consumed == 4 + assert value == -2 + + +def test_unpack_int64(): + test_bytes = b'\xff\xff\xff\xff\xff\xff\xff\xfe' + (value, bytes_consumed) = DecodeUtils.unpack_int64(test_bytes) + assert bytes_consumed == 8 + assert value == -2 + + +def test_unpack_array_short(): + test_bytes = b'\x00\x10application/json' + (value, bytes_consumed) = DecodeUtils.unpack_byte_array(test_bytes) + assert bytes_consumed == 18 + assert value == b'application/json' + + +def test_unpack_byte_array_int(): + (value, array_bytes_consumed) = DecodeUtils.unpack_byte_array( + b'\x00\x00\x00\x10application/json', length_byte_size=4 + ) + assert array_bytes_consumed == 20 + assert value == b'application/json' + + +def test_unpack_utf8_string(): + length = b'\x00\x09' + utf8_string = b'\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e' + encoded = length + utf8_string + (value, bytes_consumed) = DecodeUtils.unpack_utf8_string(encoded) + assert bytes_consumed == 11 + assert value == utf8_string.decode('utf-8') + + +def test_unpack_prelude(): + data = b'\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03' + prelude = DecodeUtils.unpack_prelude(data) + assert prelude == ((1, 2, 3), 12) + + +def create_mock_raw_stream(*data): + raw_stream = mock.Mock() + + def generator(): + yield from data + + raw_stream.stream = generator + return raw_stream + + +def test_event_stream_wrapper_iteration(): + raw_stream = create_mock_raw_stream( + b"\x00\x00\x00+\x00\x00\x00\x0e4\x8b\xec{\x08event-id\x04\x00", + b"\x00\xa0\x0c{'foo':'bar'}\xd3\x89\x02\x85", + ) + parser = mock.Mock(spec=EventStreamXMLParser) + output_shape = mock.Mock() + event_stream = EventStream(raw_stream, output_shape, parser, '') + events = list(event_stream) + assert len(events) == 1 + + response_dict = { + 'headers': {'event-id': 0x0000A00C}, + 'body': b"{'foo':'bar'}", + 'status_code': 200, + } + parser.parse.assert_called_with(response_dict, output_shape) + + +def test_eventstream_wrapper_iteration_error(): + raw_stream = create_mock_raw_stream(ERROR_EVENT_MESSAGE[0]) + parser = mock.Mock(spec=EventStreamXMLParser) + parser.parse.return_value = {} + output_shape = mock.Mock() + event_stream = EventStream(raw_stream, output_shape, parser, '') + with pytest.raises(EventStreamError): + list(event_stream) + + +def test_event_stream_wrapper_close(): + raw_stream = mock.Mock() + event_stream = EventStream(raw_stream, None, None, '') + event_stream.close() + raw_stream.close.assert_called_once_with() + + +def test_event_stream_initial_response(): + raw_stream = create_mock_raw_stream( + b'\x00\x00\x00~\x00\x00\x00O\xc5\xa3\xdd\xc6\r:message-type\x07\x00', + b'\x05event\x0b:event-type\x07\x00\x10initial-response\r:content-type', + b'\x07\x00\ttext/json{"InitialResponse": "sometext"}\xf6\x98$\x83', + ) + parser = mock.Mock(spec=EventStreamXMLParser) + output_shape = mock.Mock() + event_stream = EventStream(raw_stream, output_shape, parser, '') + event = event_stream.get_initial_response() + headers = { + ':message-type': 'event', + ':event-type': 'initial-response', + ':content-type': 'text/json', + } + payload = b'{"InitialResponse": "sometext"}' + assert event.headers == headers + assert event.payload == payload + + +def test_event_stream_initial_response_wrong_type(): + raw_stream = create_mock_raw_stream( + b"\x00\x00\x00+\x00\x00\x00\x0e4\x8b\xec{\x08event-id\x04\x00", + b"\x00\xa0\x0c{'foo':'bar'}\xd3\x89\x02\x85", + ) + parser = mock.Mock(spec=EventStreamXMLParser) + output_shape = mock.Mock() + event_stream = EventStream(raw_stream, output_shape, parser, '') + with pytest.raises(NoInitialResponseError): + event_stream.get_initial_response() + + +def test_event_stream_initial_response_no_event(): + raw_stream = create_mock_raw_stream(b'') + parser = mock.Mock(spec=EventStreamXMLParser) + output_shape = mock.Mock() + event_stream = EventStream(raw_stream, output_shape, parser, '') + with pytest.raises(NoInitialResponseError): + event_stream.get_initial_response() diff --git a/testbed/boto__botocore/tests/unit/test_exceptions.py b/testbed/boto__botocore/tests/unit/test_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..4d1c84c802e466d2d1c1bf9f87d1f9c10c19b3e1 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_exceptions.py @@ -0,0 +1,169 @@ +#!/usr/bin/env +# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import pickle + +import botocore.awsrequest +import botocore.session +from botocore import exceptions +from tests import unittest + + +def test_client_error_can_handle_missing_code_or_message(): + response = {'Error': {}} + expect = 'An error occurred (Unknown) when calling the blackhole operation: Unknown' + assert str(exceptions.ClientError(response, 'blackhole')) == expect + + +def test_client_error_has_operation_name_set(): + response = {'Error': {}} + exception = exceptions.ClientError(response, 'blackhole') + assert hasattr(exception, 'operation_name') + + +def test_client_error_set_correct_operation_name(): + response = {'Error': {}} + exception = exceptions.ClientError(response, 'blackhole') + assert exception.operation_name == 'blackhole' + + +def test_retry_info_added_when_present(): + response = { + 'Error': {}, + 'ResponseMetadata': { + 'MaxAttemptsReached': True, + 'RetryAttempts': 3, + }, + } + error_msg = str(exceptions.ClientError(response, 'operation')) + if '(reached max retries: 3)' not in error_msg: + raise AssertionError( + "retry information not inject into error " f"message: {error_msg}" + ) + + +def test_retry_info_not_added_if_retry_attempts_not_present(): + response = { + 'Error': {}, + 'ResponseMetadata': { + 'MaxAttemptsReached': True, + }, + } + # Because RetryAttempts is missing, retry info is not + # in the error message. + error_msg = str(exceptions.ClientError(response, 'operation')) + if 'max retries' in error_msg: + raise AssertionError( + "Retry information should not be in exception " + "message when retry attempts not in response " + f"metadata: {error_msg}" + ) + + +def test_can_handle_when_response_missing_error_key(): + response = { + 'ResponseMetadata': { + 'HTTPHeaders': {}, + 'HTTPStatusCode': 503, + 'MaxAttemptsReached': True, + 'RetryAttempts': 4, + } + } + e = exceptions.ClientError(response, 'SomeOperation') + if 'An error occurred (Unknown)' not in str(e): + raise AssertionError( + "Error code should default to 'Unknown' " + f"when missing error response, instead got: {str(e)}" + ) + + +class TestPickleExceptions(unittest.TestCase): + def test_single_kwarg_botocore_error(self): + exception = botocore.exceptions.DataNotFoundError(data_path='mypath') + unpickled_exception = pickle.loads(pickle.dumps(exception)) + self.assertIsInstance( + unpickled_exception, botocore.exceptions.DataNotFoundError + ) + self.assertEqual(str(unpickled_exception), str(exception)) + self.assertEqual(unpickled_exception.kwargs, exception.kwargs) + + def test_multiple_kwarg_botocore_error(self): + exception = botocore.exceptions.UnknownServiceError( + service_name='myservice', known_service_names=['s3'] + ) + unpickled_exception = pickle.loads(pickle.dumps(exception)) + self.assertIsInstance( + unpickled_exception, botocore.exceptions.UnknownServiceError + ) + self.assertEqual(str(unpickled_exception), str(exception)) + self.assertEqual(unpickled_exception.kwargs, exception.kwargs) + + def test_client_error(self): + exception = botocore.exceptions.ClientError( + error_response={ + 'Error': {'Code': 'MyCode', 'Message': 'MyMessage'} + }, + operation_name='myoperation', + ) + unpickled_exception = pickle.loads(pickle.dumps(exception)) + self.assertIsInstance( + unpickled_exception, botocore.exceptions.ClientError + ) + self.assertEqual(str(unpickled_exception), str(exception)) + self.assertEqual( + unpickled_exception.operation_name, exception.operation_name + ) + self.assertEqual(unpickled_exception.response, exception.response) + + def test_dynamic_client_error(self): + session = botocore.session.Session() + client = session.create_client('s3', 'us-west-2') + exception = client.exceptions.NoSuchKey( + error_response={ + 'Error': {'Code': 'NoSuchKey', 'Message': 'Not Found'} + }, + operation_name='myoperation', + ) + unpickled_exception = pickle.loads(pickle.dumps(exception)) + self.assertIsInstance( + unpickled_exception, botocore.exceptions.ClientError + ) + self.assertEqual(str(unpickled_exception), str(exception)) + self.assertEqual( + unpickled_exception.operation_name, exception.operation_name + ) + self.assertEqual(unpickled_exception.response, exception.response) + + def test_http_client_error(self): + exception = botocore.exceptions.HTTPClientError( + botocore.awsrequest.AWSRequest(), + botocore.awsrequest.AWSResponse( + url='https://foo.com', status_code=400, headers={}, raw=b'' + ), + error='error', + ) + unpickled_exception = pickle.loads(pickle.dumps(exception)) + self.assertIsInstance( + unpickled_exception, botocore.exceptions.HTTPClientError + ) + self.assertEqual(str(unpickled_exception), str(exception)) + self.assertEqual(unpickled_exception.kwargs, exception.kwargs) + # The request/response properties on the HTTPClientError do not have + # __eq__ defined so we want to make sure properties are at least + # of the expected type + self.assertIsInstance( + unpickled_exception.request, botocore.awsrequest.AWSRequest + ) + self.assertIsInstance( + unpickled_exception.response, botocore.awsrequest.AWSResponse + ) diff --git a/testbed/boto__botocore/tests/unit/test_handlers.py b/testbed/boto__botocore/tests/unit/test_handlers.py new file mode 100644 index 0000000000000000000000000000000000000000..7e283564422e70715145845dafef12745c11b295 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_handlers.py @@ -0,0 +1,1946 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +import base64 +import copy +import io +import json +import logging +import os + +import pytest + +import botocore +import botocore.session +from botocore import handlers +from botocore.awsrequest import AWSRequest +from botocore.compat import OrderedDict, quote +from botocore.config import Config +from botocore.credentials import Credentials +from botocore.docs.bcdoc.restdoc import DocumentStructure +from botocore.docs.example import RequestExampleDocumenter +from botocore.docs.params import RequestParamsDocumenter +from botocore.exceptions import ( + AliasConflictParameterError, + MD5UnavailableError, + ParamValidationError, +) +from botocore.hooks import HierarchicalEmitter +from botocore.model import ( + DenormalizedStructureBuilder, + OperationModel, + ServiceId, + ServiceModel, +) +from botocore.signers import RequestSigner +from botocore.utils import conditionally_calculate_md5 +from tests import BaseSessionTest, mock, unittest + + +class TestHandlers(BaseSessionTest): + def test_get_console_output(self): + parsed = {'Output': base64.b64encode(b'foobar').decode('utf-8')} + handlers.decode_console_output(parsed) + self.assertEqual(parsed['Output'], 'foobar') + + def test_get_console_output_cant_be_decoded(self): + parsed = {'Output': 1} + handlers.decode_console_output(parsed) + self.assertEqual(parsed['Output'], 1) + + def test_get_console_output_bad_unicode_errors(self): + original = base64.b64encode(b'before\xffafter').decode('utf-8') + parsed = {'Output': original} + handlers.decode_console_output(parsed) + self.assertEqual(parsed['Output'], 'before\ufffdafter') + + def test_noop_if_output_key_does_not_exist(self): + original = {'foo': 'bar'} + parsed = original.copy() + + handlers.decode_console_output(parsed) + # Should be unchanged because the 'Output' + # key is not in the output. + self.assertEqual(parsed, original) + + def test_decode_quoted_jsondoc(self): + value = quote('{"foo":"bar"}') + converted_value = handlers.decode_quoted_jsondoc(value) + self.assertEqual(converted_value, {'foo': 'bar'}) + + def test_cant_decode_quoted_jsondoc(self): + value = quote('{"foo": "missing end quote}') + converted_value = handlers.decode_quoted_jsondoc(value) + self.assertEqual(converted_value, value) + + def test_disable_signing(self): + self.assertEqual(handlers.disable_signing(), botocore.UNSIGNED) + + def test_only_quote_url_path_not_version_id(self): + params = {'CopySource': '/foo/bar++baz?versionId=123'} + handlers.handle_copy_source_param(params) + self.assertEqual( + params['CopySource'], '/foo/bar%2B%2Bbaz?versionId=123' + ) + + def test_only_version_id_is_special_cased(self): + params = {'CopySource': '/foo/bar++baz?notVersion=foo+'} + handlers.handle_copy_source_param(params) + self.assertEqual( + params['CopySource'], '/foo/bar%2B%2Bbaz%3FnotVersion%3Dfoo%2B' + ) + + def test_copy_source_with_multiple_questions(self): + params = {'CopySource': '/foo/bar+baz?a=baz+?versionId=a+'} + handlers.handle_copy_source_param(params) + self.assertEqual( + params['CopySource'], '/foo/bar%2Bbaz%3Fa%3Dbaz%2B?versionId=a+' + ) + + def test_copy_source_supports_dict(self): + params = {'CopySource': {'Bucket': 'foo', 'Key': 'keyname+'}} + handlers.handle_copy_source_param(params) + self.assertEqual(params['CopySource'], 'foo/keyname%2B') + + def test_copy_source_ignored_if_not_dict(self): + params = {'CopySource': 'stringvalue'} + handlers.handle_copy_source_param(params) + self.assertEqual(params['CopySource'], 'stringvalue') + + def test_copy_source_supports_optional_version_id(self): + params = { + 'CopySource': { + 'Bucket': 'foo', + 'Key': 'keyname+', + 'VersionId': 'asdf+', + } + } + handlers.handle_copy_source_param(params) + self.assertEqual( + params['CopySource'], + # Note, versionId is not url encoded. + 'foo/keyname%2B?versionId=asdf+', + ) + + def test_copy_source_has_validation_failure(self): + with self.assertRaisesRegex(ParamValidationError, 'Key'): + handlers.handle_copy_source_param( + {'CopySource': {'Bucket': 'foo'}} + ) + + def test_quote_source_header_needs_no_changes(self): + params = {'CopySource': '/foo/bar?versionId=123'} + handlers.handle_copy_source_param(params) + self.assertEqual(params['CopySource'], '/foo/bar?versionId=123') + + def test_presigned_url_already_present_ec2(self): + operation_model = mock.Mock() + operation_model.name = 'CopySnapshot' + params = {'body': {'PresignedUrl': 'https://foo'}} + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('ec2'), + 'us-east-1', + 'ec2', + 'v4', + credentials, + event_emitter, + ) + handlers.inject_presigned_url_ec2( + params, request_signer, operation_model + ) + self.assertEqual(params['body']['PresignedUrl'], 'https://foo') + + def test_presigned_url_with_source_region_ec2(self): + operation_model = mock.Mock() + operation_model.name = 'CopySnapshot' + params = { + 'body': { + 'PresignedUrl': 'https://foo', + 'SourceRegion': 'us-east-1', + } + } + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('ec2'), + 'us-east-1', + 'ec2', + 'v4', + credentials, + event_emitter, + ) + handlers.inject_presigned_url_ec2( + params, request_signer, operation_model + ) + self.assertEqual(params['body']['PresignedUrl'], 'https://foo') + self.assertEqual(params['body']['SourceRegion'], 'us-east-1') + + def test_presigned_url_already_present_rds(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + params = {'body': {'PreSignedUrl': 'https://foo'}} + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + handlers.inject_presigned_url_rds( + params, request_signer, operation_model + ) + self.assertEqual(params['body']['PreSignedUrl'], 'https://foo') + + def test_presigned_url_with_source_region_rds(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + params = { + 'body': { + 'PreSignedUrl': 'https://foo', + 'SourceRegion': 'us-east-1', + } + } + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + handlers.inject_presigned_url_rds( + params, request_signer, operation_model + ) + self.assertEqual(params['body']['PreSignedUrl'], 'https://foo') + self.assertNotIn('SourceRegion', params['body']) + + def test_inject_presigned_url_ec2(self): + operation_model = mock.Mock() + operation_model.name = 'CopySnapshot' + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('ec2'), + 'us-east-1', + 'ec2', + 'v4', + credentials, + event_emitter, + ) + request_dict = {} + params = {'SourceRegion': 'us-west-2'} + request_dict['body'] = params + request_dict['url'] = 'https://ec2.us-east-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + handlers.inject_presigned_url_ec2( + request_dict, request_signer, operation_model + ) + + self.assertIn( + 'https://ec2.us-west-2.amazonaws.com?', params['PresignedUrl'] + ) + self.assertIn('X-Amz-Signature', params['PresignedUrl']) + self.assertIn('DestinationRegion', params['PresignedUrl']) + # We should also populate the DestinationRegion with the + # region_name of the endpoint object. + self.assertEqual(params['DestinationRegion'], 'us-east-1') + + def test_use_event_operation_name(self): + operation_model = mock.Mock() + operation_model.name = 'FakeOperation' + request_signer = mock.Mock() + request_signer._region_name = 'us-east-1' + request_dict = {} + params = {'SourceRegion': 'us-west-2'} + request_dict['body'] = params + request_dict['url'] = 'https://myservice.us-east-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + handlers.inject_presigned_url_ec2( + request_dict, request_signer, operation_model + ) + + call_args = request_signer.generate_presigned_url.call_args + operation_name = call_args[1].get('operation_name') + self.assertEqual(operation_name, 'FakeOperation') + + def test_destination_region_always_changed(self): + # If the user provides a destination region, we will still + # override the DesinationRegion with the region_name from + # the endpoint object. + actual_region = 'us-west-1' + operation_model = mock.Mock() + operation_model.name = 'CopySnapshot' + + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('ec2'), + actual_region, + 'ec2', + 'v4', + credentials, + event_emitter, + ) + request_dict = {} + params = { + 'SourceRegion': 'us-west-2', + 'DestinationRegion': 'us-east-1', + } + request_dict['body'] = params + request_dict['url'] = 'https://ec2.us-west-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + # The user provides us-east-1, but we will override this to + # endpoint.region_name, of 'us-west-1' in this case. + handlers.inject_presigned_url_ec2( + request_dict, request_signer, operation_model + ) + + self.assertIn( + 'https://ec2.us-west-2.amazonaws.com?', params['PresignedUrl'] + ) + + # Always use the DestinationRegion from the endpoint, regardless of + # whatever value the user provides. + self.assertEqual(params['DestinationRegion'], actual_region) + + def test_inject_presigned_url_rds(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + request_dict = {} + params = {'SourceRegion': 'us-west-2'} + request_dict['body'] = params + request_dict['url'] = 'https://rds.us-east-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + handlers.inject_presigned_url_rds( + request_dict, request_signer, operation_model + ) + + self.assertIn( + 'https://rds.us-west-2.amazonaws.com?', params['PreSignedUrl'] + ) + self.assertIn('X-Amz-Signature', params['PreSignedUrl']) + self.assertIn('DestinationRegion', params['PreSignedUrl']) + # We should not populate the destination region for rds + self.assertNotIn('DestinationRegion', params) + + def test_source_region_removed(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + request_dict = {} + params = {'SourceRegion': 'us-west-2'} + request_dict['body'] = params + request_dict['url'] = 'https://rds.us-east-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + handlers.inject_presigned_url_rds( + params=request_dict, + request_signer=request_signer, + model=operation_model, + ) + + self.assertNotIn('SourceRegion', params) + + def test_source_region_removed_when_presigned_url_provided_for_rds(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + request_dict = {} + params = {'SourceRegion': 'us-west-2', 'PreSignedUrl': 'https://foo'} + request_dict['body'] = params + request_dict['url'] = 'https://rds.us-east-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + handlers.inject_presigned_url_rds( + params=request_dict, + request_signer=request_signer, + model=operation_model, + ) + + self.assertNotIn('SourceRegion', params) + + def test_dest_region_removed(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + request_dict = {} + params = {'SourceRegion': 'us-west-2'} + request_dict['body'] = params + request_dict['url'] = 'https://rds.us-east-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + handlers.inject_presigned_url_rds( + params=request_dict, + request_signer=request_signer, + model=operation_model, + ) + + self.assertNotIn('DestinationRegion', params) + + def test_presigned_url_already_present_for_rds(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + params = {'body': {'PresignedUrl': 'https://foo'}} + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + handlers.inject_presigned_url_rds( + params=params, request_signer=request_signer, model=operation_model + ) + self.assertEqual(params['body']['PresignedUrl'], 'https://foo') + + def test_presigned_url_casing_changed_for_rds(self): + operation_model = mock.Mock() + operation_model.name = 'CopyDBSnapshot' + credentials = Credentials('key', 'secret') + event_emitter = HierarchicalEmitter() + request_signer = RequestSigner( + ServiceId('rds'), + 'us-east-1', + 'rds', + 'v4', + credentials, + event_emitter, + ) + request_dict = {} + params = {'SourceRegion': 'us-west-2'} + request_dict['body'] = params + request_dict['url'] = 'https://rds.us-east-1.amazonaws.com' + request_dict['method'] = 'POST' + request_dict['headers'] = {} + request_dict['context'] = {} + + handlers.inject_presigned_url_rds( + params=request_dict, + request_signer=request_signer, + model=operation_model, + ) + + self.assertNotIn('PresignedUrl', params) + self.assertIn( + 'https://rds.us-west-2.amazonaws.com?', params['PreSignedUrl'] + ) + self.assertIn('X-Amz-Signature', params['PreSignedUrl']) + + def test_500_status_code_set_for_200_response(self): + http_response = mock.Mock() + http_response.status_code = 200 + http_response.content = """ + + AccessDenied + Access Denied + id + hostid + + """ + handlers.check_for_200_error((http_response, {})) + self.assertEqual(http_response.status_code, 500) + + def test_200_response_with_no_error_left_untouched(self): + http_response = mock.Mock() + http_response.status_code = 200 + http_response.content = "" + handlers.check_for_200_error((http_response, {})) + # We don't touch the status code since there are no errors present. + self.assertEqual(http_response.status_code, 200) + + def test_500_response_can_be_none(self): + # A 500 response can raise an exception, which means the response + # object is None. We need to handle this case. + handlers.check_for_200_error(None) + + def test_route53_resource_id(self): + event = 'before-parameter-build.route53.GetHostedZone' + params = { + 'Id': '/hostedzone/ABC123', + 'HostedZoneId': '/hostedzone/ABC123', + 'ResourceId': '/hostedzone/DEF456', + 'DelegationSetId': '/hostedzone/GHI789', + 'ChangeId': '/hostedzone/JKL012', + 'Other': '/hostedzone/foo', + } + operation_def = { + 'name': 'GetHostedZone', + 'input': {'shape': 'GetHostedZoneInput'}, + } + service_def = { + 'metadata': {}, + 'shapes': { + 'GetHostedZoneInput': { + 'type': 'structure', + 'members': { + 'Id': {'shape': 'ResourceId'}, + 'HostedZoneId': {'shape': 'ResourceId'}, + 'ResourceId': {'shape': 'ResourceId'}, + 'DelegationSetId': {'shape': 'DelegationSetId'}, + 'ChangeId': {'shape': 'ChangeId'}, + 'Other': {'shape': 'String'}, + }, + }, + 'ResourceId': {'type': 'string'}, + 'DelegationSetId': {'type': 'string'}, + 'ChangeId': {'type': 'string'}, + 'String': {'type': 'string'}, + }, + } + model = OperationModel(operation_def, ServiceModel(service_def)) + self.session.emit(event, params=params, model=model) + + self.assertEqual(params['Id'], 'ABC123') + self.assertEqual(params['HostedZoneId'], 'ABC123') + self.assertEqual(params['ResourceId'], 'DEF456') + self.assertEqual(params['DelegationSetId'], 'GHI789') + self.assertEqual(params['ChangeId'], 'JKL012') + + # This one should have been left alone + self.assertEqual(params['Other'], '/hostedzone/foo') + + def test_route53_resource_id_missing_input_shape(self): + event = 'before-parameter-build.route53.GetHostedZone' + params = {'HostedZoneId': '/hostedzone/ABC123'} + operation_def = {'name': 'GetHostedZone'} + service_def = {'metadata': {}, 'shapes': {}} + model = OperationModel(operation_def, ServiceModel(service_def)) + self.session.emit(event, params=params, model=model) + + self.assertEqual(params['HostedZoneId'], '/hostedzone/ABC123') + + def test_run_instances_userdata(self): + user_data = 'This is a test' + b64_user_data = base64.b64encode(user_data.encode('latin-1')).decode( + 'utf-8' + ) + params = dict( + ImageId='img-12345678', MinCount=1, MaxCount=5, UserData=user_data + ) + handlers.base64_encode_user_data(params=params) + result = { + 'ImageId': 'img-12345678', + 'MinCount': 1, + 'MaxCount': 5, + 'UserData': b64_user_data, + } + self.assertEqual(params, result) + + def test_run_instances_userdata_blob(self): + # Ensure that binary can be passed in as user data. + # This is valid because you can send gzip compressed files as + # user data. + user_data = b'\xc7\xa9This is a test' + b64_user_data = base64.b64encode(user_data).decode('utf-8') + params = dict( + ImageId='img-12345678', MinCount=1, MaxCount=5, UserData=user_data + ) + handlers.base64_encode_user_data(params=params) + result = { + 'ImageId': 'img-12345678', + 'MinCount': 1, + 'MaxCount': 5, + 'UserData': b64_user_data, + } + self.assertEqual(params, result) + + def test_get_template_has_error_response(self): + original = {'Error': {'Code': 'Message'}} + handler_input = copy.deepcopy(original) + handlers.json_decode_template_body(parsed=handler_input) + # The handler should not have changed the response because it's + # an error response. + self.assertEqual(original, handler_input) + + def test_does_decode_template_body_in_order(self): + expected_ordering = OrderedDict( + [ + ('TemplateVersion', 1.0), + ('APropertyOfSomeKind', 'a value'), + ('list', [1, 2, 3]), + ('nested', OrderedDict([('key', 'value'), ('foo', 'bar')])), + ] + ) + template_string = json.dumps(expected_ordering) + parsed_response = {'TemplateBody': template_string} + + handlers.json_decode_template_body(parsed=parsed_response) + result = parsed_response['TemplateBody'] + + self.assertTrue(isinstance(result, OrderedDict)) + for element, expected_element in zip(result, expected_ordering): + self.assertEqual(element, expected_element) + + def test_decode_json_policy(self): + parsed = { + 'Document': '{"foo": "foobarbaz"}', + 'Other': 'bar', + } + service_def = { + 'operations': { + 'Foo': { + 'output': {'shape': 'PolicyOutput'}, + } + }, + 'shapes': { + 'PolicyOutput': { + 'type': 'structure', + 'members': { + 'Document': {'shape': 'policyDocumentType'}, + 'Other': {'shape': 'stringType'}, + }, + }, + 'policyDocumentType': {'type': 'string'}, + 'stringType': {'type': 'string'}, + }, + } + model = ServiceModel(service_def) + op_model = model.operation_model('Foo') + handlers.json_decode_policies(parsed, op_model) + self.assertEqual(parsed['Document'], {'foo': 'foobarbaz'}) + + no_document = {'Other': 'bar'} + handlers.json_decode_policies(no_document, op_model) + self.assertEqual(no_document, {'Other': 'bar'}) + + def test_inject_account_id(self): + params = {} + handlers.inject_account_id(params) + self.assertEqual(params['accountId'], '-') + + def test_account_id_not_added_if_present(self): + params = {'accountId': 'foo'} + handlers.inject_account_id(params) + self.assertEqual(params['accountId'], 'foo') + + def test_glacier_version_header_added(self): + request_dict = {'headers': {}} + model = ServiceModel({'metadata': {'apiVersion': '2012-01-01'}}) + handlers.add_glacier_version(model, request_dict) + self.assertEqual( + request_dict['headers']['x-amz-glacier-version'], '2012-01-01' + ) + + def test_application_json_header_added(self): + request_dict = {'headers': {}} + handlers.add_accept_header(None, request_dict) + self.assertEqual(request_dict['headers']['Accept'], 'application/json') + + def test_accept_header_not_added_if_present(self): + request_dict = {'headers': {'Accept': 'application/yaml'}} + handlers.add_accept_header(None, request_dict) + self.assertEqual(request_dict['headers']['Accept'], 'application/yaml') + + def test_glacier_checksums_added(self): + request_dict = { + 'headers': {}, + 'body': io.BytesIO(b'hello world'), + } + handlers.add_glacier_checksums(request_dict) + self.assertIn('x-amz-content-sha256', request_dict['headers']) + self.assertIn('x-amz-sha256-tree-hash', request_dict['headers']) + self.assertEqual( + request_dict['headers']['x-amz-content-sha256'], + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9', + ) + self.assertEqual( + request_dict['headers']['x-amz-sha256-tree-hash'], + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9', + ) + # And verify that the body can still be read. + self.assertEqual(request_dict['body'].read(), b'hello world') + + def test_tree_hash_added_only_if_not_exists(self): + request_dict = { + 'headers': { + 'x-amz-sha256-tree-hash': 'pre-exists', + }, + 'body': io.BytesIO(b'hello world'), + } + handlers.add_glacier_checksums(request_dict) + self.assertEqual( + request_dict['headers']['x-amz-sha256-tree-hash'], 'pre-exists' + ) + + def test_checksum_added_only_if_not_exists(self): + request_dict = { + 'headers': { + 'x-amz-content-sha256': 'pre-exists', + }, + 'body': io.BytesIO(b'hello world'), + } + handlers.add_glacier_checksums(request_dict) + self.assertEqual( + request_dict['headers']['x-amz-content-sha256'], 'pre-exists' + ) + + def test_glacier_checksums_support_raw_bytes(self): + request_dict = { + 'headers': {}, + 'body': b'hello world', + } + handlers.add_glacier_checksums(request_dict) + self.assertEqual( + request_dict['headers']['x-amz-content-sha256'], + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9', + ) + self.assertEqual( + request_dict['headers']['x-amz-sha256-tree-hash'], + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9', + ) + + def test_switch_host_with_param(self): + request = AWSRequest() + url = 'https://machinelearning.us-east-1.amazonaws.com' + new_endpoint = 'https://my-custom-endpoint.amazonaws.com' + data = f'{{"PredictEndpoint":"{new_endpoint}"}}' + request.data = data.encode('utf-8') + request.url = url + handlers.switch_host_with_param(request, 'PredictEndpoint') + self.assertEqual(request.url, new_endpoint) + + def test_invalid_char_in_bucket_raises_exception(self): + params = { + 'Bucket': 'bad/bucket/name', + 'Key': 'foo', + 'Body': b'asdf', + } + with self.assertRaises(ParamValidationError): + handlers.validate_bucket_name(params) + + def test_bucket_too_long_raises_exception(self): + params = { + 'Bucket': 'a' * 300, + 'Key': 'foo', + 'Body': b'asdf', + } + with self.assertRaises(ParamValidationError): + handlers.validate_bucket_name(params) + + def test_not_dns_compat_but_still_valid_bucket_name(self): + params = { + 'Bucket': 'foasdf......bar--baz-a_b_CD10', + 'Key': 'foo', + 'Body': b'asdf', + } + self.assertIsNone(handlers.validate_bucket_name(params)) + + def test_valid_bucket_name_hyphen(self): + self.assertIsNone( + handlers.validate_bucket_name({'Bucket': 'my-bucket-name'}) + ) + + def test_valid_bucket_name_underscore(self): + self.assertIsNone( + handlers.validate_bucket_name({'Bucket': 'my_bucket_name'}) + ) + + def test_valid_bucket_name_period(self): + self.assertIsNone( + handlers.validate_bucket_name({'Bucket': 'my.bucket.name'}) + ) + + def test_validation_is_noop_if_no_bucket_param_exists(self): + self.assertIsNone(handlers.validate_bucket_name(params={})) + + def test_validation_is_s3_accesspoint_arn(self): + try: + arn = 'arn:aws:s3:us-west-2:123456789012:accesspoint:endpoint' + handlers.validate_bucket_name({'Bucket': arn}) + except ParamValidationError: + self.fail(f'The s3 arn: {arn} should pass validation') + + def test_validation_is_s3_outpost_arn(self): + try: + arn = ( + 'arn:aws:s3-outposts:us-west-2:123456789012:outpost:' + 'op-01234567890123456:accesspoint:myaccesspoint' + ) + handlers.validate_bucket_name({'Bucket': arn}) + except ParamValidationError: + self.fail(f'The s3 arn: {arn} should pass validation') + + def test_validation_is_global_s3_bucket_arn(self): + with self.assertRaises(ParamValidationError): + arn = 'arn:aws:s3:::mybucket' + handlers.validate_bucket_name({'Bucket': arn}) + + def test_validation_is_other_service_arn(self): + with self.assertRaises(ParamValidationError): + arn = 'arn:aws:ec2:us-west-2:123456789012:instance:myinstance' + handlers.validate_bucket_name({'Bucket': arn}) + + def test_validate_non_ascii_metadata_values(self): + with self.assertRaises(ParamValidationError): + handlers.validate_ascii_metadata({'Metadata': {'foo': '\u2713'}}) + + def test_validate_non_ascii_metadata_keys(self): + with self.assertRaises(ParamValidationError): + handlers.validate_ascii_metadata({'Metadata': {'\u2713': 'bar'}}) + + def test_validate_non_triggered_when_no_md_specified(self): + original = {'NotMetadata': ''} + copied = original.copy() + handlers.validate_ascii_metadata(copied) + self.assertEqual(original, copied) + + def test_validation_passes_when_all_ascii_chars(self): + original = {'Metadata': {'foo': 'bar'}} + copied = original.copy() + handlers.validate_ascii_metadata(original) + self.assertEqual(original, copied) + + def test_set_encoding_type(self): + params = {} + context = {} + handlers.set_list_objects_encoding_type_url(params, context=context) + self.assertEqual(params['EncodingType'], 'url') + self.assertTrue(context['encoding_type_auto_set']) + + params['EncodingType'] = 'new_value' + handlers.set_list_objects_encoding_type_url(params, context={}) + self.assertEqual(params['EncodingType'], 'new_value') + + def test_decode_list_objects(self): + parsed = { + 'Contents': [{'Key': "%C3%A7%C3%B6s%25asd%08"}], + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object(parsed, context=context) + self.assertEqual(parsed['Contents'][0]['Key'], '\xe7\xf6s%asd\x08') + + def test_decode_list_objects_does_not_decode_without_context(self): + parsed = { + 'Contents': [{'Key': "%C3%A7%C3%B6s%25asd"}], + 'EncodingType': 'url', + } + handlers.decode_list_object(parsed, context={}) + self.assertEqual(parsed['Contents'][0]['Key'], '%C3%A7%C3%B6s%25asd') + + def test_decode_list_objects_with_marker(self): + parsed = { + 'Marker': "%C3%A7%C3%B6s%25%20asd%08+c", + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object(parsed, context=context) + self.assertEqual(parsed['Marker'], '\xe7\xf6s% asd\x08 c') + + def test_decode_list_objects_with_nextmarker(self): + parsed = { + 'NextMarker': "%C3%A7%C3%B6s%25%20asd%08+c", + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object(parsed, context=context) + self.assertEqual(parsed['NextMarker'], '\xe7\xf6s% asd\x08 c') + + def test_decode_list_objects_with_common_prefixes(self): + parsed = { + 'CommonPrefixes': [{'Prefix': "%C3%A7%C3%B6s%25%20asd%08+c"}], + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object(parsed, context=context) + self.assertEqual( + parsed['CommonPrefixes'][0]['Prefix'], '\xe7\xf6s% asd\x08 c' + ) + + def test_decode_list_objects_with_delimiter(self): + parsed = { + 'Delimiter': "%C3%A7%C3%B6s%25%20asd%08+c", + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object(parsed, context=context) + self.assertEqual(parsed['Delimiter'], '\xe7\xf6s% asd\x08 c') + + def test_decode_list_objects_v2(self): + parsed = { + 'Contents': [{'Key': "%C3%A7%C3%B6s%25asd%08"}], + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object_v2(parsed, context=context) + self.assertEqual(parsed['Contents'][0]['Key'], '\xe7\xf6s%asd\x08') + + def test_decode_list_objects_v2_does_not_decode_without_context(self): + parsed = { + 'Contents': [{'Key': "%C3%A7%C3%B6s%25asd"}], + 'EncodingType': 'url', + } + handlers.decode_list_object_v2(parsed, context={}) + self.assertEqual(parsed['Contents'][0]['Key'], '%C3%A7%C3%B6s%25asd') + + def test_decode_list_objects_v2_with_delimiter(self): + parsed = { + 'Delimiter': "%C3%A7%C3%B6s%25%20asd%08+c", + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object_v2(parsed, context=context) + self.assertEqual(parsed['Delimiter'], '\xe7\xf6s% asd\x08 c') + + def test_decode_list_objects_v2_with_prefix(self): + parsed = { + 'Prefix': "%C3%A7%C3%B6s%25%20asd%08+c", + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object_v2(parsed, context=context) + self.assertEqual(parsed['Prefix'], '\xe7\xf6s% asd\x08 c') + + def test_decode_list_objects_v2_does_not_decode_continuationtoken(self): + parsed = { + 'ContinuationToken': "%C3%A7%C3%B6s%25%20asd%08+c", + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object_v2(parsed, context=context) + self.assertEqual( + parsed['ContinuationToken'], "%C3%A7%C3%B6s%25%20asd%08+c" + ) + + def test_decode_list_objects_v2_with_startafter(self): + parsed = { + 'StartAfter': "%C3%A7%C3%B6s%25%20asd%08+c", + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object_v2(parsed, context=context) + self.assertEqual(parsed['StartAfter'], '\xe7\xf6s% asd\x08 c') + + def test_decode_list_objects_v2_with_common_prefixes(self): + parsed = { + 'CommonPrefixes': [{'Prefix': "%C3%A7%C3%B6s%25%20asd%08+c"}], + 'EncodingType': 'url', + } + context = {'encoding_type_auto_set': True} + handlers.decode_list_object_v2(parsed, context=context) + self.assertEqual( + parsed['CommonPrefixes'][0]['Prefix'], '\xe7\xf6s% asd\x08 c' + ) + + def test_set_operation_specific_signer_no_auth_type(self): + signing_name = 'myservice' + context = {'auth_type': None} + response = handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertIsNone(response) + + def test_set_operation_specific_signer_unsigned(self): + signing_name = 'myservice' + context = {'auth_type': 'none'} + response = handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(response, botocore.UNSIGNED) + + def test_set_operation_specific_signer_v4(self): + signing_name = 'myservice' + context = {'auth_type': 'v4'} + response = handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(response, 'v4') + + def test_set_operation_specific_signer_v4a(self): + signing_name = 'myservice' + context = {'auth_type': 'v4a'} + response = handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(response, 'v4a') + # for v4a, context gets updated in place + self.assertIsNotNone(context.get('signing')) + self.assertEqual(context['signing']['region'], '*') + self.assertEqual(context['signing']['signing_name'], signing_name) + + def test_set_operation_specific_signer_v4a_existing_signing_context(self): + signing_name = 'myservice' + context = { + 'auth_type': 'v4a', + 'signing': {'foo': 'bar'}, + } + handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + # signing_name has been added + self.assertEqual(context['signing']['signing_name'], signing_name) + # foo remained untouched + self.assertEqual(context['signing']['foo'], 'bar') + + def test_set_operation_specific_signer_v4_unsinged_payload(self): + signing_name = 'myservice' + context = {'auth_type': 'v4-unsigned-body'} + response = handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(response, 'v4') + self.assertEqual(context.get('payload_signing_enabled'), False) + + def test_set_operation_specific_signer_s3v4_unsigned_payload(self): + signing_name = 's3' + context = { + 'auth_type': 'v4-unsigned-body', + 'signing': { + 'foo': 'bar', + 'region': 'abc', + 'disableDoubleEncoding': True, + }, + } + response = handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(response, 's3v4') + self.assertEqual(context.get('payload_signing_enabled'), False) + + def test_set_operation_specific_signer_defaults_to_asterisk(self): + signing_name = 'myservice' + context = { + 'auth_type': 'v4a', + } + handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(context['signing']['region'], '*') + + def test_set_operation_specific_signer_prefers_client_config(self): + signing_name = 'myservice' + context = { + 'auth_type': 'v4a', + 'client_config': Config( + sigv4a_signing_region_set="region_1,region_2" + ), + 'signing': { + 'region': 'abc', + }, + } + handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(context['signing']['region'], 'region_1,region_2') + + def test_payload_signing_disabled_sets_proper_key(self): + signing_name = 'myservice' + context = { + 'auth_type': 'v4', + 'signing': { + 'foo': 'bar', + 'region': 'abc', + }, + 'unsigned_payload': True, + } + handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertEqual(context.get('payload_signing_enabled'), False) + + def test_no_payload_signing_disabled_does_not_set_key(self): + signing_name = 'myservice' + context = { + 'auth_type': 'v4', + 'signing': { + 'foo': 'bar', + 'region': 'abc', + }, + } + handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + self.assertNotIn('payload_signing_enabled', context) + + +@pytest.mark.parametrize( + 'auth_type, expected_response', [('v4', 's3v4'), ('v4a', 's3v4a')] +) +def test_set_operation_specific_signer_s3v4(auth_type, expected_response): + signing_name = 's3' + context = { + 'auth_type': auth_type, + 'signing': {'disableDoubleEncoding': True}, + } + response = handlers.set_operation_specific_signer( + context=context, signing_name=signing_name + ) + assert response == expected_response + + +class TestConvertStringBodyToFileLikeObject(BaseSessionTest): + def assert_converts_to_file_like_object_with_bytes(self, body, body_bytes): + params = {'Body': body} + handlers.convert_body_to_file_like_object(params) + self.assertTrue(hasattr(params['Body'], 'read')) + contents = params['Body'].read() + self.assertIsInstance(contents, bytes) + self.assertEqual(contents, body_bytes) + + def test_string(self): + self.assert_converts_to_file_like_object_with_bytes('foo', b'foo') + + def test_binary(self): + body = os.urandom(500) + body_bytes = body + self.assert_converts_to_file_like_object_with_bytes(body, body_bytes) + + def test_file(self): + body = io.StringIO() + params = {'Body': body} + handlers.convert_body_to_file_like_object(params) + self.assertEqual(params['Body'], body) + + def test_unicode(self): + self.assert_converts_to_file_like_object_with_bytes('bar', b'bar') + + def test_non_ascii_characters(self): + self.assert_converts_to_file_like_object_with_bytes( + '\u2713', b'\xe2\x9c\x93' + ) + + +class TestRetryHandlerOrder(BaseSessionTest): + def get_handler_names(self, responses): + names = [] + for response in responses: + handler = response[0] + if hasattr(handler, '__name__'): + names.append(handler.__name__) + elif hasattr(handler, '__class__'): + names.append(handler.__class__.__name__) + else: + names.append(str(handler)) + return names + + def test_s3_special_case_is_before_other_retry(self): + client = self.session.create_client('s3') + service_model = self.session.get_service_model('s3') + operation = service_model.operation_model('CopyObject') + responses = client.meta.events.emit( + 'needs-retry.s3.CopyObject', + request_dict={'context': {}}, + response=(mock.Mock(), mock.Mock()), + endpoint=mock.Mock(), + operation=operation, + attempts=1, + caught_exception=None, + ) + # This is implementation specific, but we're trying to verify that + # the check_for_200_error is before any of the retry logic in + # botocore.retryhandlers. + # Technically, as long as the relative order is preserved, we don't + # care about the absolute order. + names = self.get_handler_names(responses) + self.assertIn('check_for_200_error', names) + self.assertIn('RetryHandler', names) + s3_200_handler = names.index('check_for_200_error') + general_retry_handler = names.index('RetryHandler') + self.assertTrue( + s3_200_handler < general_retry_handler, + "S3 200 error handler was supposed to be before " + "the general retry handler, but it was not.", + ) + + +class BaseMD5Test(BaseSessionTest): + def setUp(self, **environ): + super().setUp(**environ) + self.md5_object = mock.Mock() + self.md5_digest = mock.Mock(return_value=b'foo') + self.md5_object.digest = self.md5_digest + md5_builder = mock.Mock(return_value=self.md5_object) + self.md5_patch = mock.patch('hashlib.md5', md5_builder) + self.md5_patch.start() + self._md5_available_patch = None + self.set_md5_available() + + def tearDown(self): + super().tearDown() + self.md5_patch.stop() + if self._md5_available_patch: + self._md5_available_patch.stop() + + def set_md5_available(self, is_available=True): + if self._md5_available_patch: + self._md5_available_patch.stop() + + self._md5_available_patch = mock.patch( + 'botocore.compat.MD5_AVAILABLE', is_available + ) + self._md5_available_patch.start() + + +class TestSSEMD5(BaseMD5Test): + def test_raises_error_when_md5_unavailable(self): + self.set_md5_available(False) + + with self.assertRaises(MD5UnavailableError): + handlers.sse_md5({'SSECustomerKey': b'foo'}) + + with self.assertRaises(MD5UnavailableError): + handlers.copy_source_sse_md5({'CopySourceSSECustomerKey': b'foo'}) + + def test_sse_params(self): + for op in ( + 'HeadObject', + 'GetObject', + 'PutObject', + 'CopyObject', + 'CreateMultipartUpload', + 'UploadPart', + 'UploadPartCopy', + 'SelectObjectContent', + ): + event = f'before-parameter-build.s3.{op}' + params = { + 'SSECustomerKey': b'bar', + 'SSECustomerAlgorithm': 'AES256', + } + self.session.emit( + event, params=params, model=mock.MagicMock(), context={} + ) + self.assertEqual(params['SSECustomerKey'], 'YmFy') + self.assertEqual(params['SSECustomerKeyMD5'], 'Zm9v') + + def test_sse_params_as_str(self): + event = 'before-parameter-build.s3.PutObject' + params = {'SSECustomerKey': 'bar', 'SSECustomerAlgorithm': 'AES256'} + self.session.emit( + event, params=params, model=mock.MagicMock(), context={} + ) + self.assertEqual(params['SSECustomerKey'], 'YmFy') + self.assertEqual(params['SSECustomerKeyMD5'], 'Zm9v') + + def test_copy_source_sse_params(self): + for op in ['CopyObject', 'UploadPartCopy']: + event = f'before-parameter-build.s3.{op}' + params = { + 'CopySourceSSECustomerKey': b'bar', + 'CopySourceSSECustomerAlgorithm': 'AES256', + } + self.session.emit( + event, params=params, model=mock.MagicMock(), context={} + ) + self.assertEqual(params['CopySourceSSECustomerKey'], 'YmFy') + self.assertEqual(params['CopySourceSSECustomerKeyMD5'], 'Zm9v') + + def test_copy_source_sse_params_as_str(self): + event = 'before-parameter-build.s3.CopyObject' + params = { + 'CopySourceSSECustomerKey': 'bar', + 'CopySourceSSECustomerAlgorithm': 'AES256', + } + self.session.emit( + event, params=params, model=mock.MagicMock(), context={} + ) + self.assertEqual(params['CopySourceSSECustomerKey'], 'YmFy') + self.assertEqual(params['CopySourceSSECustomerKeyMD5'], 'Zm9v') + + +class TestAddMD5(BaseMD5Test): + def get_context(self, s3_config=None): + if s3_config is None: + s3_config = {} + return {'client_config': Config(s3=s3_config)} + + def test_adds_md5_when_v4(self): + credentials = Credentials('key', 'secret') + request_signer = RequestSigner( + ServiceId('s3'), 'us-east-1', 's3', 'v4', credentials, mock.Mock() + ) + request_dict = { + 'body': b'bar', + 'url': 'https://s3.us-east-1.amazonaws.com', + 'method': 'PUT', + 'headers': {}, + } + context = self.get_context() + conditionally_calculate_md5( + request_dict, request_signer=request_signer, context=context + ) + self.assertTrue('Content-MD5' in request_dict['headers']) + + def test_adds_md5_when_s3v4(self): + credentials = Credentials('key', 'secret') + request_signer = RequestSigner( + ServiceId('s3'), + 'us-east-1', + 's3', + 's3v4', + credentials, + mock.Mock(), + ) + request_dict = { + 'body': b'bar', + 'url': 'https://s3.us-east-1.amazonaws.com', + 'method': 'PUT', + 'headers': {}, + } + context = self.get_context({'payload_signing_enabled': False}) + conditionally_calculate_md5( + request_dict, request_signer=request_signer, context=context + ) + self.assertTrue('Content-MD5' in request_dict['headers']) + + def test_conditional_does_not_add_when_md5_unavailable(self): + credentials = Credentials('key', 'secret') + request_signer = RequestSigner( + 's3', 'us-east-1', 's3', 's3', credentials, mock.Mock() + ) + request_dict = { + 'body': b'bar', + 'url': 'https://s3.us-east-1.amazonaws.com', + 'method': 'PUT', + 'headers': {}, + } + + context = self.get_context() + self.set_md5_available(False) + with mock.patch('botocore.utils.MD5_AVAILABLE', False): + conditionally_calculate_md5( + request_dict, request_signer=request_signer, context=context + ) + self.assertFalse('Content-MD5' in request_dict['headers']) + + def test_add_md5_raises_error_when_md5_unavailable(self): + credentials = Credentials('key', 'secret') + request_signer = RequestSigner( + ServiceId('s3'), 'us-east-1', 's3', 's3', credentials, mock.Mock() + ) + request_dict = { + 'body': b'bar', + 'url': 'https://s3.us-east-1.amazonaws.com', + 'method': 'PUT', + 'headers': {}, + } + + self.set_md5_available(False) + with self.assertRaises(MD5UnavailableError): + conditionally_calculate_md5( + request_dict, request_signer=request_signer + ) + + def test_adds_md5_when_s3v2(self): + credentials = Credentials('key', 'secret') + request_signer = RequestSigner( + ServiceId('s3'), 'us-east-1', 's3', 's3', credentials, mock.Mock() + ) + request_dict = { + 'body': b'bar', + 'url': 'https://s3.us-east-1.amazonaws.com', + 'method': 'PUT', + 'headers': {}, + } + context = self.get_context() + conditionally_calculate_md5( + request_dict, request_signer=request_signer, context=context + ) + self.assertTrue('Content-MD5' in request_dict['headers']) + + def test_add_md5_with_file_like_body(self): + request_dict = {'body': io.BytesIO(b'foobar'), 'headers': {}} + self.md5_digest.return_value = b'8X\xf6"0\xac<\x91_0\x0cfC\x12\xc6?' + conditionally_calculate_md5(request_dict) + self.assertEqual( + request_dict['headers']['Content-MD5'], 'OFj2IjCsPJFfMAxmQxLGPw==' + ) + + def test_add_md5_with_bytes_object(self): + request_dict = {'body': b'foobar', 'headers': {}} + self.md5_digest.return_value = b'8X\xf6"0\xac<\x91_0\x0cfC\x12\xc6?' + conditionally_calculate_md5(request_dict) + self.assertEqual( + request_dict['headers']['Content-MD5'], 'OFj2IjCsPJFfMAxmQxLGPw==' + ) + + def test_add_md5_with_empty_body(self): + request_dict = {'body': b'', 'headers': {}} + self.md5_digest.return_value = b'8X\xf6"0\xac<\x91_0\x0cfC\x12\xc6?' + conditionally_calculate_md5(request_dict) + self.assertEqual( + request_dict['headers']['Content-MD5'], 'OFj2IjCsPJFfMAxmQxLGPw==' + ) + + def test_add_md5_with_bytearray_object(self): + request_dict = {'body': bytearray(b'foobar'), 'headers': {}} + self.md5_digest.return_value = b'8X\xf6"0\xac<\x91_0\x0cfC\x12\xc6?' + conditionally_calculate_md5(request_dict) + self.assertEqual( + request_dict['headers']['Content-MD5'], 'OFj2IjCsPJFfMAxmQxLGPw==' + ) + + def test_skip_md5_when_flexible_checksum_context(self): + request_dict = { + 'body': io.BytesIO(b'foobar'), + 'headers': {}, + 'context': { + 'checksum': { + 'request_algorithm': { + 'in': 'header', + 'algorithm': 'crc32', + 'name': 'x-amz-checksum-crc32', + } + } + }, + } + conditionally_calculate_md5(request_dict) + self.assertNotIn('Content-MD5', request_dict['headers']) + + def test_skip_md5_when_flexible_checksum_explicit_header(self): + request_dict = { + 'body': io.BytesIO(b'foobar'), + 'headers': {'x-amz-checksum-crc32': 'foo'}, + } + conditionally_calculate_md5(request_dict) + self.assertNotIn('Content-MD5', request_dict['headers']) + + +class TestParameterAlias(unittest.TestCase): + def setUp(self): + self.original_name = 'original' + self.alias_name = 'alias' + self.parameter_alias = handlers.ParameterAlias( + self.original_name, self.alias_name + ) + + self.operation_model = mock.Mock() + request_shape = ( + DenormalizedStructureBuilder() + .with_members({self.original_name: {'type': 'string'}}) + .build_model() + ) + self.operation_model.input_shape = request_shape + self.sample_section = DocumentStructure('') + self.event_emitter = HierarchicalEmitter() + + def test_alias_parameter_in_call(self): + value = 'value' + params = {self.alias_name: value} + self.parameter_alias.alias_parameter_in_call( + params, self.operation_model + ) + self.assertEqual(params, {self.original_name: value}) + + def test_alias_parameter_and_original_in_call(self): + params = { + self.original_name: 'orginal_value', + self.alias_name: 'alias_value', + } + with self.assertRaises(AliasConflictParameterError): + self.parameter_alias.alias_parameter_in_call( + params, self.operation_model + ) + + def test_alias_parameter_in_call_does_not_touch_original(self): + value = 'value' + params = {self.original_name: value} + self.parameter_alias.alias_parameter_in_call( + params, self.operation_model + ) + self.assertEqual(params, {self.original_name: value}) + + def test_does_not_alias_parameter_for_no_input_shape(self): + value = 'value' + params = {self.alias_name: value} + self.operation_model.input_shape = None + self.parameter_alias.alias_parameter_in_call( + params, self.operation_model + ) + self.assertEqual(params, {self.alias_name: value}) + + def test_does_not_alias_parameter_for_not_modeled_member(self): + value = 'value' + params = {self.alias_name: value} + + request_shape = ( + DenormalizedStructureBuilder() + .with_members({'foo': {'type': 'string'}}) + .build_model() + ) + self.operation_model.input_shape = request_shape + self.parameter_alias.alias_parameter_in_call( + params, self.operation_model + ) + self.assertEqual(params, {self.alias_name: value}) + + def test_alias_parameter_in_documentation_request_params(self): + RequestParamsDocumenter( + 'myservice', 'myoperation', self.event_emitter + ).document_params( + self.sample_section, self.operation_model.input_shape + ) + self.parameter_alias.alias_parameter_in_documentation( + 'docs.request-params.myservice.myoperation.complete-section', + self.sample_section, + ) + contents = self.sample_section.flush_structure().decode('utf-8') + self.assertIn(':type ' + self.alias_name + ':', contents) + self.assertIn(':param ' + self.alias_name + ':', contents) + self.assertNotIn(':type ' + self.original_name + ':', contents) + self.assertNotIn(':param ' + self.original_name + ':', contents) + + def test_alias_parameter_in_documentation_request_example(self): + RequestExampleDocumenter( + 'myservice', 'myoperation', self.event_emitter + ).document_example( + self.sample_section, self.operation_model.input_shape + ) + self.parameter_alias.alias_parameter_in_documentation( + 'docs.request-example.myservice.myoperation.complete-section', + self.sample_section, + ) + contents = self.sample_section.flush_structure().decode('utf-8') + self.assertIn(self.alias_name + '=', contents) + self.assertNotIn(self.original_name + '=', contents) + + +class TestCommandAlias(unittest.TestCase): + def test_command_alias(self): + alias = handlers.ClientMethodAlias('foo') + client = mock.Mock() + client.foo.return_value = 'bar' + + response = alias(client=client)() + self.assertEqual(response, 'bar') + + +class TestPrependToHost(unittest.TestCase): + def setUp(self): + self.hoister = handlers.HeaderToHostHoister('test-header') + + def _prepend_to_host(self, url, prepend_string): + params = { + 'headers': { + 'test-header': prepend_string, + }, + 'url': url, + } + self.hoister.hoist(params=params) + return params['url'] + + def test_does_prepend_to_host(self): + prepended = self._prepend_to_host('https://bar.example.com/', 'foo') + self.assertEqual(prepended, 'https://foo.bar.example.com/') + + def test_does_prepend_to_host_with_http(self): + prepended = self._prepend_to_host('http://bar.example.com/', 'foo') + self.assertEqual(prepended, 'http://foo.bar.example.com/') + + def test_does_prepend_to_host_with_path(self): + prepended = self._prepend_to_host( + 'https://bar.example.com/path', 'foo' + ) + self.assertEqual(prepended, 'https://foo.bar.example.com/path') + + def test_does_prepend_to_host_with_more_components(self): + prepended = self._prepend_to_host( + 'https://bar.baz.example.com/path', 'foo' + ) + self.assertEqual(prepended, 'https://foo.bar.baz.example.com/path') + + def test_does_validate_long_host(self): + with self.assertRaises(ParamValidationError): + self._prepend_to_host('https://example.com/path', 'toolong' * 100) + + def test_does_validate_host_with_illegal_char(self): + with self.assertRaises(ParamValidationError): + self._prepend_to_host('https://example.com/path', 'host#name') + + +@pytest.mark.parametrize( + 'environ, header_before, header_after', + [ + ({}, {}, {}), + ({'AWS_LAMBDA_FUNCTION_NAME': 'some-function'}, {}, {}), + ( + { + '_X_AMZN_TRACE_ID': ( + 'Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;' + 'Sampled=1;lineage=a87bd80c:0,68fd508a:5,c512fbe3:2' + ) + }, + {}, + {}, + ), + ( + { + 'AWS_LAMBDA_FUNCTION_NAME': 'some-function', + '_X_AMZN_TRACE_ID': ( + 'Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;' + 'Sampled=1;lineage=a87bd80c:0,68fd508a:5,c512fbe3:2' + ), + }, + {}, + { + 'X-Amzn-Trace-Id': ( + 'Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;' + 'Sampled=1;lineage=a87bd80c:0,68fd508a:5,c512fbe3:2' + ) + }, + ), + ( + { + 'AWS_LAMBDA_FUNCTION_NAME': 'some-function', + '_X_AMZN_TRACE_ID': 'EnvValue', + }, + {'X-Amzn-Trace-Id': 'OriginalValue'}, + {'X-Amzn-Trace-Id': 'OriginalValue'}, + ), + ( + { + 'AWS_LAMBDA_FUNCTION_NAME': 'foo', + '_X_AMZN_TRACE_ID': 'first\nsecond', + }, + {}, + {'X-Amzn-Trace-Id': 'first%0Asecond'}, + ), + ( + { + 'AWS_LAMBDA_FUNCTION_NAME': 'foo', + '_X_AMZN_TRACE_ID': 'test123-=;:+&[]{}"\'', + }, + {}, + {'X-Amzn-Trace-Id': 'test123-=;:+&[]{}"\''}, + ), + ], +) +def test_add_recursion_detection_header(environ, header_before, header_after): + request_dict = {'headers': header_before} + with mock.patch('os.environ', environ): + handlers.add_recursion_detection_header(request_dict) + assert request_dict['headers'] == header_after + + +@pytest.mark.parametrize( + 'auth_path_in, auth_path_expected', + [ + # access points should be stripped + ( + '/arn%3Aaws%3As3%3Aus-west-2%3A1234567890%3Aaccesspoint%2Fmy-ap/object.txt', + '/object.txt', + ), + ( + '/arn%3Aaws%3As3%3Aus-west-2%3A1234567890%3Aaccesspoint%2Fmy-ap/foo/foo/foo/object.txt', + '/foo/foo/foo/object.txt', + ), + # regular bucket names should not be stripped + ( + '/mybucket/object.txt', + '/mybucket/object.txt', + ), + ( + '/mybucket/foo/foo/foo/object.txt', + '/mybucket/foo/foo/foo/object.txt', + ), + ( + '/arn-is-a-valid-bucketname/object.txt', + '/arn-is-a-valid-bucketname/object.txt', + ), + # non-bucket cases + ( + '', + '', + ), + ( + None, + None, + ), + ( + 123, + 123, + ), + ], +) +def test_remove_arn_from_signing_path(auth_path_in, auth_path_expected): + request = AWSRequest(method='GET', auth_path=auth_path_in) + # the handler modifies the request in place + handlers.remove_arn_from_signing_path( + request=request, some='other', kwarg='values' + ) + assert request.auth_path == auth_path_expected + + +@pytest.mark.parametrize( + 'request_uri_before, request_uri_after, auth_path', + [ + ('/{Bucket}', '', '/{Bucket}/'), + ('/{Bucket}?query', '?query', '/{Bucket}/'), + ('/{Bucket}/123', '/123', '/{Bucket}/123'), + ('/{Bucket}/123?query', '/123?query', '/{Bucket}/123'), + ], +) +def test_remove_bucket_from_url_paths_from_model( + request_uri_before, request_uri_after, auth_path +): + operation_def = { + 'name': 'TestOp', + 'http': { + 'method': 'GET', + 'requestUri': request_uri_before, + 'responseCode': 200, + }, + 'input': {'shape': 'TestOpInput'}, + } + service_def = { + 'metadata': {}, + 'shapes': { + 'TestOpInput': { + 'type': 'structure', + 'required': ['Bucket'], + 'members': { + 'Bucket': { + 'shape': 'String', + 'contextParam': {'name': 'Bucket'}, + 'location': 'uri', + 'locationName': 'Bucket', + }, + }, + }, + }, + } + model = OperationModel(operation_def, ServiceModel(service_def)) + # the handler modifies ``model`` in place + handlers.remove_bucket_from_url_paths_from_model( + params=None, model=model, context=None + ) + assert model.http['requestUri'] == request_uri_after + assert model.http['authPath'] == auth_path + + +@pytest.fixture() +def operation_model_mock(): + operation_model = mock.Mock() + operation_model.output_shape = mock.Mock() + operation_model.output_shape.members = {'Expires': mock.Mock()} + operation_model.output_shape.members['Expires'].name = 'Expires' + operation_model.output_shape.members['Expires'].serialization = { + 'name': 'Expires' + } + return operation_model + + +@pytest.mark.parametrize( + "expires, expect_expires_header", + [ + # Valid expires values + ("Thu, 01 Jan 2015 00:00:00 GMT", True), + ("10/21/2018", True), + ("01 dec 2100", True), + ("2023-11-02 08:43:04 -0400", True), + ("Sun, 22 Oct 23 00:45:02 UTC", True), + # Invalid expires values + ("Invalid Date", False), + ("access plus 1 month", False), + ("Expires: Thu, 9 Sep 2013 14:19:41 GMT", False), + ("{ts '2023-10-10 09:27:14'}", False), + (-33702800404003370280040400, False), + ], +) +def test_handle_expires_header( + expires, expect_expires_header, operation_model_mock +): + response_dict = { + 'headers': { + 'Expires': expires, + } + } + customized_response_dict = {} + handlers.handle_expires_header( + operation_model_mock, response_dict, customized_response_dict + ) + assert customized_response_dict.get('ExpiresString') == expires + assert ('Expires' in response_dict['headers']) == expect_expires_header + + +def test_handle_expires_header_logs_warning(operation_model_mock, caplog): + response_dict = { + 'headers': { + 'Expires': 'Invalid Date', + } + } + with caplog.at_level(logging.WARNING): + handlers.handle_expires_header(operation_model_mock, response_dict, {}) + assert len(caplog.records) == 1 + assert 'Failed to parse the "Expires" member as a timestamp' in caplog.text + + +def test_handle_expires_header_does_not_log_warning( + operation_model_mock, caplog +): + response_dict = { + 'headers': { + 'Expires': 'Thu, 01 Jan 2015 00:00:00 GMT', + } + } + with caplog.at_level(logging.WARNING): + handlers.handle_expires_header(operation_model_mock, response_dict, {}) + assert len(caplog.records) == 0 + + +@pytest.fixture() +def document_expires_mocks(): + return { + 'section': mock.Mock(), + 'parent': mock.Mock(), + 'param_line': mock.Mock(), + 'param_section': mock.Mock(), + 'doc_section': mock.Mock(), + 'new_param_line': mock.Mock(), + 'new_param_section': mock.Mock(), + 'response_example_event': 'docs.response-example.s3.TestOperation.complete-section', + 'response_params_event': 'docs.response-params.s3.TestOperation.complete-section', + } + + +def test_document_response_example_with_expires(document_expires_mocks): + mocks = document_expires_mocks + mocks['section'].has_section.return_value = True + mocks['section'].get_section.return_value = mocks['parent'] + mocks['parent'].has_section.return_value = True + mocks['parent'].get_section.return_value = mocks['param_line'] + mocks['param_line'].has_section.return_value = True + mocks['param_line'].get_section.return_value = mocks['new_param_line'] + handlers.document_expires_shape( + mocks['section'], mocks['response_example_event'] + ) + mocks['param_line'].add_new_section.assert_called_once_with( + 'ExpiresString' + ) + mocks['new_param_line'].write.assert_called_once_with( + "'ExpiresString': 'string'," + ) + mocks['new_param_line'].style.new_line.assert_called_once() + + +def test_document_response_example_without_expires(document_expires_mocks): + mocks = document_expires_mocks + mocks['section'].has_section.return_value = True + mocks['section'].get_section.return_value = mocks['parent'] + mocks['parent'].has_section.return_value = False + handlers.document_expires_shape( + mocks['section'], mocks['response_example_event'] + ) + mocks['parent'].add_new_section.assert_not_called() + mocks['parent'].get_section.assert_not_called() + mocks['new_param_line'].write.assert_not_called() + + +def test_document_response_params_with_expires(document_expires_mocks): + mocks = document_expires_mocks + mocks['section'].has_section.return_value = True + mocks['section'].get_section.return_value = mocks['param_section'] + mocks['param_section'].get_section.side_effect = [ + mocks['doc_section'], + ] + mocks['param_section'].add_new_section.side_effect = [ + mocks['new_param_section'], + ] + mocks['doc_section'].style = mock.Mock() + mocks['new_param_section'].style = mock.Mock() + handlers.document_expires_shape( + mocks['section'], mocks['response_params_event'] + ) + mocks['param_section'].get_section.assert_any_call('param-documentation') + mocks['doc_section'].style.start_note.assert_called_once() + mocks['doc_section'].write.assert_called_once_with( + 'This member has been deprecated. Please use ``ExpiresString`` instead.' + ) + mocks['doc_section'].style.end_note.assert_called_once() + mocks['param_section'].add_new_section.assert_called_once_with( + 'ExpiresString' + ) + mocks['new_param_section'].style.new_paragraph.assert_any_call() + mocks['new_param_section'].write.assert_any_call( + '- **ExpiresString** *(string) --*' + ) + mocks['new_param_section'].style.indent.assert_called_once() + mocks['new_param_section'].write.assert_any_call( + 'The raw, unparsed value of the ``Expires`` field.' + ) + + +def test_document_response_params_without_expires(document_expires_mocks): + mocks = document_expires_mocks + mocks['section'].has_section.return_value = False + handlers.document_expires_shape( + mocks['section'], mocks['response_params_event'] + ) + mocks['section'].get_section.assert_not_called() + mocks['param_section'].add_new_section.assert_not_called() + mocks['doc_section'].write.assert_not_called() diff --git a/testbed/boto__botocore/tests/unit/test_history.py b/testbed/boto__botocore/tests/unit/test_history.py new file mode 100644 index 0000000000000000000000000000000000000000..ce810b98ff2a5786e1563c9b286f3218556eb2a1 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_history.py @@ -0,0 +1,89 @@ +from botocore.history import ( + BaseHistoryHandler, + HistoryRecorder, + get_global_history_recorder, +) +from tests import mock, unittest + + +class TerribleError(Exception): + pass + + +class ExceptionThrowingHandler(BaseHistoryHandler): + def emit(self, event_type, payload, source): + raise TerribleError('Bad behaving handler') + + +class TestHistoryRecorder(unittest.TestCase): + def test_can_attach_and_call_handler_emit(self): + mock_handler = mock.Mock(spec=BaseHistoryHandler) + recorder = HistoryRecorder() + recorder.enable() + recorder.add_handler(mock_handler) + recorder.record('foo', 'bar', source='source') + + mock_handler.emit.assert_called_with('foo', 'bar', 'source') + + def test_can_call_multiple_handlers(self): + first_handler = mock.Mock(spec=BaseHistoryHandler) + second_handler = mock.Mock(spec=BaseHistoryHandler) + recorder = HistoryRecorder() + recorder.enable() + recorder.add_handler(first_handler) + recorder.add_handler(second_handler) + recorder.record('foo', 'bar', source='source') + + first_handler.emit.assert_called_with('foo', 'bar', 'source') + second_handler.emit.assert_called_with('foo', 'bar', 'source') + + def test_does_use_botocore_source_by_default(self): + mock_handler = mock.Mock(spec=BaseHistoryHandler) + recorder = HistoryRecorder() + recorder.enable() + recorder.add_handler(mock_handler) + recorder.record('foo', 'bar') + + mock_handler.emit.assert_called_with('foo', 'bar', 'BOTOCORE') + + def test_does_not_call_handlers_when_never_enabled(self): + mock_handler = mock.Mock(spec=BaseHistoryHandler) + recorder = HistoryRecorder() + recorder.add_handler(mock_handler) + recorder.record('foo', 'bar') + + mock_handler.emit.assert_not_called() + + def test_does_not_call_handlers_when_disabled(self): + mock_handler = mock.Mock(spec=BaseHistoryHandler) + recorder = HistoryRecorder() + recorder.enable() + recorder.disable() + recorder.add_handler(mock_handler) + recorder.record('foo', 'bar') + + mock_handler.emit.assert_not_called() + + def test_can_ignore_handler_exceptions(self): + mock_handler = mock.Mock(spec=BaseHistoryHandler) + recorder = HistoryRecorder() + recorder.enable() + bad_handler = ExceptionThrowingHandler() + recorder.add_handler(bad_handler) + recorder.add_handler(mock_handler) + try: + recorder.record('foo', 'bar') + except TerribleError: + self.fail('Should not have raised a TerribleError') + mock_handler.emit.assert_called_with('foo', 'bar', 'BOTOCORE') + + +class TestGetHistoryRecorder(unittest.TestCase): + def test_can_get_history_recorder(self): + recorder = get_global_history_recorder() + self.assertTrue(isinstance(recorder, HistoryRecorder)) + + def test_does_reuse_history_recorder(self): + recorder_1 = get_global_history_recorder() + recorder_2 = get_global_history_recorder() + self.assertIs(recorder_1, recorder_2) diff --git a/testbed/boto__botocore/tests/unit/test_hooks.py b/testbed/boto__botocore/tests/unit/test_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..5b085e5b2202258c56f292363d026ddf76cbccb7 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_hooks.py @@ -0,0 +1,688 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import copy +import functools +from functools import partial + +from botocore.hooks import ( + EventAliaser, + HierarchicalEmitter, + first_non_none_response, +) +from tests import unittest + + +class TestHierarchicalEventEmitter(unittest.TestCase): + def setUp(self): + self.emitter = HierarchicalEmitter() + self.hook_calls = [] + + def hook(self, **kwargs): + self.hook_calls.append(kwargs) + + def test_non_dot_behavior(self): + self.emitter.register('no-dot', self.hook) + self.emitter.emit('no-dot') + self.assertEqual(len(self.hook_calls), 1) + + def test_with_dots(self): + self.emitter.register('foo.bar.baz', self.hook) + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 1) + + def test_catch_all_hook(self): + self.emitter.register('foo', self.hook) + self.emitter.register('foo.bar', self.hook) + self.emitter.register('foo.bar.baz', self.hook) + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 3, self.hook_calls) + # The hook is called with the same event name three times. + self.assertEqual( + [e['event_name'] for e in self.hook_calls], + ['foo.bar.baz', 'foo.bar.baz', 'foo.bar.baz'], + ) + + def test_hook_called_in_proper_order(self): + # We should call the hooks from most specific to least + # specific. + calls = [] + self.emitter.register('foo', lambda **kwargs: calls.append('foo')) + self.emitter.register( + 'foo.bar', lambda **kwargs: calls.append('foo.bar') + ) + self.emitter.register( + 'foo.bar.baz', lambda **kwargs: calls.append('foo.bar.baz') + ) + + self.emitter.emit('foo.bar.baz') + self.assertEqual(calls, ['foo.bar.baz', 'foo.bar', 'foo']) + + +class TestAliasedEmitter(unittest.TestCase): + def setUp(self): + self.hook_calls = [] + + def hook(self, **kwargs): + self.hook_calls.append(kwargs) + + def get_emitter(self, event_aliases): + emitter = HierarchicalEmitter() + return EventAliaser(emitter, event_aliases) + + def test_event_emitted(self): + aliases = {'bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + emitter.register('foo.bear.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + def test_aliased_event_emitted(self): + aliases = {'bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + emitter.register('foo.bear.baz', self.hook) + emitter.emit('foo.bar.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + def test_alias_with_dots_emitted(self): + aliases = {'api.bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + emitter.register('foo.bear.baz', self.hook) + emitter.emit('foo.api.bar.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + def test_aliased_event_registered(self): + aliases = {'bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + emitter.register('foo.bar.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + def test_aliased_event_with_dots_registered(self): + aliases = {'api.bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + emitter.register('foo.api.bar.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + def test_event_unregistered(self): + aliases = {'bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + + emitter.register('foo.bar.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + self.hook_calls = [] + emitter.unregister('foo.bear.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, []) + + def test_aliased_event_unregistered(self): + aliases = {'bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + + emitter.register('foo.bar.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + self.hook_calls = [] + emitter.unregister('foo.bar.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, []) + + def test_aliased_event_with_dots_unregistered(self): + aliases = {'api.bar': 'bear'} + emitter = self.get_emitter(event_aliases=aliases) + + emitter.register('foo.api.bar.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, ['foo.bear.baz']) + + self.hook_calls = [] + emitter.unregister('foo.api.bar.baz', self.hook) + emitter.emit('foo.bear.baz') + calls = [e['event_name'] for e in self.hook_calls] + self.assertEqual(calls, []) + + +class TestStopProcessing(unittest.TestCase): + def setUp(self): + self.emitter = HierarchicalEmitter() + self.hook_calls = [] + + def hook1(self, **kwargs): + self.hook_calls.append('hook1') + + def hook2(self, **kwargs): + self.hook_calls.append('hook2') + return 'hook2-response' + + def hook3(self, **kwargs): + self.hook_calls.append('hook3') + return 'hook3-response' + + def test_all_hooks(self): + # Here we register three hooks and sanity check + # that all three would be called by a normal emit. + # This ensures our hook calls are setup properly for + # later tests. + self.emitter.register('foo', self.hook1) + self.emitter.register('foo', self.hook2) + self.emitter.register('foo', self.hook3) + self.emitter.emit('foo') + + self.assertEqual(self.hook_calls, ['hook1', 'hook2', 'hook3']) + + def test_stop_processing_after_first_response(self): + # Here we register three hooks, but only the first + # two should ever execute. + self.emitter.register('foo', self.hook1) + self.emitter.register('foo', self.hook2) + self.emitter.register('foo', self.hook3) + handler, response = self.emitter.emit_until_response('foo') + + self.assertEqual(response, 'hook2-response') + self.assertEqual(self.hook_calls, ['hook1', 'hook2']) + + def test_no_responses(self): + # Here we register a handler that will not return a response + # and ensure we get back proper values. + self.emitter.register('foo', self.hook1) + responses = self.emitter.emit('foo') + + self.assertEqual(self.hook_calls, ['hook1']) + self.assertEqual(responses, [(self.hook1, None)]) + + def test_no_handlers(self): + # Here we have no handlers, but still expect a tuple of return + # values. + handler, response = self.emitter.emit_until_response('foo') + + self.assertIsNone(handler) + self.assertIsNone(response) + + +class TestFirstNonNoneResponse(unittest.TestCase): + def test_all_none(self): + self.assertIsNone(first_non_none_response([])) + + def test_first_non_none(self): + correct_value = 'correct_value' + wrong_value = 'wrong_value' + # The responses are tuples of (handler, response), + # and we don't care about the handler so we just use a value of + # None. + responses = [(None, None), (None, correct_value), (None, wrong_value)] + self.assertEqual(first_non_none_response(responses), correct_value) + + def test_default_value_if_non_none_found(self): + responses = [(None, None), (None, None)] + # If no response is found and a default value is passed in, it will + # be returned. + self.assertEqual( + first_non_none_response(responses, default='notfound'), 'notfound' + ) + + +class TestWildcardHandlers(unittest.TestCase): + def setUp(self): + self.emitter = HierarchicalEmitter() + self.hook_calls = [] + + def hook(self, **kwargs): + self.hook_calls.append(kwargs) + + def register(self, event_name): + func = partial(self.hook, registered_with=event_name) + self.emitter.register(event_name, func) + return func + + def assert_hook_is_called_given_event(self, event): + starting = len(self.hook_calls) + self.emitter.emit(event) + after = len(self.hook_calls) + if not after > starting: + self.fail(f"Handler was not called for event: {event}") + self.assertEqual(self.hook_calls[-1]['event_name'], event) + + def assert_hook_is_not_called_given_event(self, event): + starting = len(self.hook_calls) + self.emitter.emit(event) + after = len(self.hook_calls) + if not after == starting: + self.fail( + "Handler was called for event but was not " + f"suppose to be called: {event}, last_event: {self.hook_calls[-1]}" + ) + + def test_one_level_wildcard_handler(self): + self.emitter.register('foo.*.baz', self.hook) + # Also register for a number of other events to check + # for false positives. + self.emitter.register('other.bar.baz', self.hook) + self.emitter.register('qqq.baz', self.hook) + self.emitter.register('dont.call.me', self.hook) + self.emitter.register('dont', self.hook) + # These calls should trigger our hook. + self.assert_hook_is_called_given_event('foo.bar.baz') + self.assert_hook_is_called_given_event('foo.qux.baz') + self.assert_hook_is_called_given_event('foo.anything.baz') + + # These calls should not match our hook. + self.assert_hook_is_not_called_given_event('foo') + self.assert_hook_is_not_called_given_event('foo.bar') + self.assert_hook_is_not_called_given_event('bar.qux.baz') + self.assert_hook_is_not_called_given_event('foo-bar') + + def test_hierarchical_wildcard_handler(self): + self.emitter.register('foo.*.baz', self.hook) + self.assert_hook_is_called_given_event('foo.bar.baz.qux') + self.assert_hook_is_called_given_event('foo.bar.baz.qux.foo') + self.assert_hook_is_called_given_event('foo.qux.baz.qux') + self.assert_hook_is_called_given_event('foo.qux.baz.qux.foo') + + self.assert_hook_is_not_called_given_event('bar.qux.baz.foo') + + def test_multiple_wildcard_events(self): + self.emitter.register('foo.*.*.baz', self.hook) + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + self.assert_hook_is_called_given_event('foo.ANY.THING.baz') + self.assert_hook_is_called_given_event('foo.AT.ALL.baz') + + # More specific than what we registered for. + self.assert_hook_is_called_given_event('foo.bar.baz.baz.extra') + self.assert_hook_is_called_given_event('foo.bar.baz.baz.extra.stuff') + + # Too short: + self.assert_hook_is_not_called_given_event('foo') + self.assert_hook_is_not_called_given_event('foo.bar') + self.assert_hook_is_not_called_given_event('foo.bar.baz') + + # Bad ending segment. + self.assert_hook_is_not_called_given_event('foo.ANY.THING.notbaz') + self.assert_hook_is_not_called_given_event('foo.ANY.THING.stillnotbaz') + + def test_can_unregister_for_wildcard_events(self): + self.emitter.register('foo.*.*.baz', self.hook) + # Call multiple times to verify caching behavior. + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + + self.emitter.unregister('foo.*.*.baz', self.hook) + self.assert_hook_is_not_called_given_event('foo.bar.baz.baz') + self.assert_hook_is_not_called_given_event('foo.bar.baz.baz') + self.assert_hook_is_not_called_given_event('foo.bar.baz.baz') + + self.emitter.register('foo.*.*.baz', self.hook) + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + + def test_unregister_does_not_exist(self): + self.emitter.register('foo.*.*.baz', self.hook) + self.emitter.unregister('foo.*.*.baz', self.hook) + self.emitter.unregister('foo.*.*.baz', self.hook) + self.assert_hook_is_not_called_given_event('foo.bar.baz.baz') + + def test_cache_cleared_properly(self): + self.emitter.register('foo.*.*.baz', self.hook) + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + + self.emitter.register('foo.*.*.bar', self.hook) + self.assert_hook_is_called_given_event('foo.bar.baz.baz') + self.assert_hook_is_called_given_event('foo.bar.baz.bar') + + self.emitter.unregister('foo.*.*.baz', self.hook) + self.assert_hook_is_called_given_event('foo.bar.baz.bar') + self.assert_hook_is_not_called_given_event('foo.bar.baz.baz') + + def test_complicated_register_unregister(self): + r = self.emitter.register + u = partial(self.emitter.unregister, handler=self.hook) + r('foo.bar.baz.qux', self.hook) + r('foo.bar.baz', self.hook) + r('foo.bar', self.hook) + r('foo', self.hook) + + u('foo.bar.baz') + u('foo') + u('foo.bar') + + self.assert_hook_is_called_given_event('foo.bar.baz.qux') + + self.assert_hook_is_not_called_given_event('foo.bar.baz') + self.assert_hook_is_not_called_given_event('foo.bar') + self.assert_hook_is_not_called_given_event('foo') + + def test_register_multiple_handlers_for_same_event(self): + self.emitter.register('foo.bar.baz', self.hook) + self.emitter.register('foo.bar.baz', self.hook) + + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 2) + + def test_register_with_unique_id(self): + self.emitter.register('foo.bar.baz', self.hook, unique_id='foo') + # Since we're using the same unique_id, this registration is ignored. + self.emitter.register('foo.bar.baz', self.hook, unique_id='foo') + # This also works across event names, so this registration is ignored + # as well. + self.emitter.register('foo.other', self.hook, unique_id='foo') + + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 1) + + self.hook_calls = [] + + self.emitter.emit('foo.other') + self.assertEqual(len(self.hook_calls), 0) + + def test_remove_handler_with_unique_id(self): + def hook2(**kwargs): + return self.hook_calls.append(kwargs) + + self.emitter.register('foo.bar.baz', self.hook, unique_id='foo') + self.emitter.register('foo.bar.baz', hook2) + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 2) + + # Reset the hook calls. + self.hook_calls = [] + + self.emitter.unregister('foo.bar.baz', hook2) + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 1) + + self.hook_calls = [] + + # Can provide the unique_id to unregister. + self.emitter.unregister('foo.bar.baz', unique_id='foo') + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 0) + + # Same as with not specifying a unique_id, you can call + # unregister multiple times and not get an exception. + self.emitter.unregister('foo.bar.baz', unique_id='foo') + + def test_remove_handler_with_and_without_unique_id(self): + self.emitter.register('foo.bar.baz', self.hook, unique_id='foo') + self.emitter.register('foo.bar.baz', self.hook) + + self.emitter.unregister('foo.bar.baz', self.hook) + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 1) + + self.hook_calls = [] + + self.emitter.unregister('foo.bar.baz', self.hook) + self.emitter.emit('foo.bar.baz') + self.assertEqual(len(self.hook_calls), 0) + + def test_register_with_uses_count_initially(self): + self.emitter.register( + 'foo', self.hook, unique_id='foo', unique_id_uses_count=True + ) + # Subsequent calls must set ``unique_id_uses_count`` to True. + with self.assertRaises(ValueError): + self.emitter.register('foo', self.hook, unique_id='foo') + + def test_register_with_uses_count_not_initially(self): + self.emitter.register('foo', self.hook, unique_id='foo') + # Subsequent calls must set ``unique_id_uses_count`` to False. + with self.assertRaises(ValueError): + self.emitter.register( + 'foo', self.hook, unique_id='foo', unique_id_uses_count=True + ) + + def test_register_with_uses_count_unregister(self): + self.emitter.register( + 'foo', self.hook, unique_id='foo', unique_id_uses_count=True + ) + self.emitter.register( + 'foo', self.hook, unique_id='foo', unique_id_uses_count=True + ) + # Event was registered to use a count so it must be specified + # that a count is used when unregistering + with self.assertRaises(ValueError): + self.emitter.unregister('foo', self.hook, unique_id='foo') + # Event should not have been unregistered. + self.emitter.emit('foo') + self.assertEqual(len(self.hook_calls), 1) + self.emitter.unregister( + 'foo', self.hook, unique_id='foo', unique_id_uses_count=True + ) + # Event still should not be unregistered. + self.hook_calls = [] + self.emitter.emit('foo') + self.assertEqual(len(self.hook_calls), 1) + self.emitter.unregister( + 'foo', self.hook, unique_id='foo', unique_id_uses_count=True + ) + # Now the event should be unregistered. + self.hook_calls = [] + self.emitter.emit('foo') + self.assertEqual(len(self.hook_calls), 0) + + def test_register_with_no_uses_count_unregister(self): + self.emitter.register('foo', self.hook, unique_id='foo') + # The event was not registered to use a count initially + with self.assertRaises(ValueError): + self.emitter.unregister( + 'foo', self.hook, unique_id='foo', unique_id_uses_count=True + ) + + def test_handlers_called_in_order(self): + def handler(call_number, **kwargs): + kwargs['call_number'] = call_number + self.hook_calls.append(kwargs) + + self.emitter.register('foo', partial(handler, call_number=1)) + self.emitter.register('foo', partial(handler, call_number=2)) + self.emitter.emit('foo') + self.assertEqual([k['call_number'] for k in self.hook_calls], [1, 2]) + + def test_handler_call_order_with_hierarchy(self): + def handler(call_number, **kwargs): + kwargs['call_number'] = call_number + self.hook_calls.append(kwargs) + + # We go from most specific to least specific, and each level is called + # in the order they were registered for that particular hierarchy + # level. + self.emitter.register('foo.bar.baz', partial(handler, call_number=1)) + self.emitter.register('foo.bar', partial(handler, call_number=3)) + self.emitter.register('foo', partial(handler, call_number=5)) + self.emitter.register('foo.bar.baz', partial(handler, call_number=2)) + self.emitter.register('foo.bar', partial(handler, call_number=4)) + self.emitter.register('foo', partial(handler, call_number=6)) + + self.emitter.emit('foo.bar.baz') + self.assertEqual( + [k['call_number'] for k in self.hook_calls], [1, 2, 3, 4, 5, 6] + ) + + def test_register_first_single_level(self): + def handler(call_number, **kwargs): + kwargs['call_number'] = call_number + self.hook_calls.append(kwargs) + + # Handlers registered through register_first() are always called + # before handlers registered with register(). + self.emitter.register('foo', partial(handler, call_number=3)) + self.emitter.register('foo', partial(handler, call_number=4)) + self.emitter.register_first('foo', partial(handler, call_number=1)) + self.emitter.register_first('foo', partial(handler, call_number=2)) + self.emitter.register('foo', partial(handler, call_number=5)) + + self.emitter.emit('foo') + self.assertEqual( + [k['call_number'] for k in self.hook_calls], [1, 2, 3, 4, 5] + ) + + def test_register_first_hierarchy(self): + def handler(call_number, **kwargs): + kwargs['call_number'] = call_number + self.hook_calls.append(kwargs) + + self.emitter.register('foo', partial(handler, call_number=5)) + self.emitter.register('foo.bar', partial(handler, call_number=2)) + + self.emitter.register_first('foo', partial(handler, call_number=4)) + self.emitter.register_first('foo.bar', partial(handler, call_number=1)) + + self.emitter.register('foo', partial(handler, call_number=6)) + self.emitter.register('foo.bar', partial(handler, call_number=3)) + + self.emitter.emit('foo.bar') + self.assertEqual( + [k['call_number'] for k in self.hook_calls], [1, 2, 3, 4, 5, 6] + ) + + def test_register_last_hierarchy(self): + def handler(call_number, **kwargs): + kwargs['call_number'] = call_number + self.hook_calls.append(kwargs) + + self.emitter.register_last('foo', partial(handler, call_number=3)) + self.emitter.register('foo', partial(handler, call_number=2)) + self.emitter.register_first('foo', partial(handler, call_number=1)) + self.emitter.emit('foo') + self.assertEqual( + [k['call_number'] for k in self.hook_calls], [1, 2, 3] + ) + + def test_register_unregister_first_last(self): + self.emitter.register('foo', self.hook) + self.emitter.register_last('foo.bar', self.hook) + self.emitter.register_first('foo.bar.baz', self.hook) + + self.emitter.unregister('foo.bar.baz', self.hook) + self.emitter.unregister('foo.bar', self.hook) + self.emitter.unregister('foo', self.hook) + + self.emitter.emit('foo') + self.assertEqual(self.hook_calls, []) + + def test_copy_emitter(self): + # Here we're not testing copy directly, we're testing + # the observable behavior from copying an event emitter. + first = [] + + def first_handler(id_name, **kwargs): + first.append(id_name) + + second = [] + + def second_handler(id_name, **kwargs): + second.append(id_name) + + self.emitter.register('foo.bar.baz', first_handler) + # First time we emit, only the first handler should be called. + self.emitter.emit('foo.bar.baz', id_name='first-time') + self.assertEqual(first, ['first-time']) + self.assertEqual(second, []) + + copied_emitter = copy.copy(self.emitter) + # If we emit from the copied emitter, we should still + # only see the first handler called. + copied_emitter.emit('foo.bar.baz', id_name='second-time') + self.assertEqual(first, ['first-time', 'second-time']) + self.assertEqual(second, []) + + # However, if we register an event handler with the copied + # emitter, the first emitter will not see this. + copied_emitter.register('foo.bar.baz', second_handler) + + copied_emitter.emit('foo.bar.baz', id_name='third-time') + self.assertEqual(first, ['first-time', 'second-time', 'third-time']) + # And now the second handler is called. + self.assertEqual(second, ['third-time']) + + # And vice-versa, emitting from the original emitter + # will not trigger the second_handler. + # We'll double check this by unregistering/re-registering + # the event handler. + self.emitter.unregister('foo.bar.baz', first_handler) + self.emitter.register('foo.bar.baz', first_handler) + self.emitter.emit('foo.bar.baz', id_name='last-time') + self.assertEqual(second, ['third-time']) + + def test_copy_emitter_with_unique_id_event(self): + # Here we're not testing copy directly, we're testing + # the observable behavior from copying an event emitter. + first = [] + + def first_handler(id_name, **kwargs): + first.append(id_name) + + second = [] + + def second_handler(id_name, **kwargs): + second.append(id_name) + + self.emitter.register('foo', first_handler, 'bar') + self.emitter.emit('foo', id_name='first-time') + self.assertEqual(first, ['first-time']) + self.assertEqual(second, []) + + copied_emitter = copy.copy(self.emitter) + + # If we register an event handler with the copied + # emitter, the event should not get registered again + # because the unique id was already used. + copied_emitter.register('foo', second_handler, 'bar') + copied_emitter.emit('foo', id_name='second-time') + self.assertEqual(first, ['first-time', 'second-time']) + self.assertEqual(second, []) + + # If we unregister the first event from the copied emitter, + # We should be able to register the second handler. + copied_emitter.unregister('foo', first_handler, 'bar') + copied_emitter.register('foo', second_handler, 'bar') + copied_emitter.emit('foo', id_name='third-time') + self.assertEqual(first, ['first-time', 'second-time']) + self.assertEqual(second, ['third-time']) + + # The original event emitter should have the unique id event still + # registered though. + self.emitter.emit('foo', id_name='fourth-time') + self.assertEqual(first, ['first-time', 'second-time', 'fourth-time']) + self.assertEqual(second, ['third-time']) + + def test_copy_events_with_partials(self): + # There's a bug in python2.6 where you can't deepcopy + # a partial object. We want to ensure that doesn't + # break when a partial is hooked up as an event handler. + def handler(a, b, **kwargs): + return b + + f = functools.partial(handler, 1) + self.emitter.register('a.b', f) + copied = copy.copy(self.emitter) + self.assertEqual( + copied.emit_until_response('a.b', b='return-val')[1], 'return-val' + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/boto__botocore/tests/unit/test_http_client_exception_mapping.py b/testbed/boto__botocore/tests/unit/test_http_client_exception_mapping.py new file mode 100644 index 0000000000000000000000000000000000000000..54c9158260da64d98484f5e2fa11d41626fac86d --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_http_client_exception_mapping.py @@ -0,0 +1,35 @@ +import pytest + +from botocore import exceptions as botocore_exceptions +from botocore.vendored.requests import exceptions as requests_exceptions +from botocore.vendored.requests.packages.urllib3 import ( + exceptions as urllib3_exceptions, +) + + +@pytest.mark.parametrize( + "new_exception, old_exception", + ( + ( + botocore_exceptions.ReadTimeoutError, + requests_exceptions.ReadTimeout, + ), + ( + botocore_exceptions.ReadTimeoutError, + urllib3_exceptions.ReadTimeoutError, + ), + ( + botocore_exceptions.ConnectTimeoutError, + requests_exceptions.ConnectTimeout, + ), + ( + botocore_exceptions.ProxyConnectionError, + requests_exceptions.ProxyError, + ), + (botocore_exceptions.SSLError, requests_exceptions.SSLError), + ), +) +def test_http_client_exception_mapping(new_exception, old_exception): + # assert that the new exception can still be caught by the old vendored one + with pytest.raises(old_exception): + raise new_exception(endpoint_url=None, proxy_url=None, error=None) diff --git a/testbed/boto__botocore/tests/unit/test_http_session.py b/testbed/boto__botocore/tests/unit/test_http_session.py new file mode 100644 index 0000000000000000000000000000000000000000..8fb081e1abe4761424123a6b8b1d680d69bf5f0a --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_http_session.py @@ -0,0 +1,517 @@ +import socket + +import pytest +from urllib3.exceptions import NewConnectionError, ProtocolError, ProxyError + +from botocore.awsrequest import ( + AWSHTTPConnectionPool, + AWSHTTPSConnectionPool, + AWSRequest, +) +from botocore.exceptions import ( + ConnectionClosedError, + EndpointConnectionError, + ProxyConnectionError, +) +from botocore.httpsession import ( + ProxyConfiguration, + URLLib3Session, + get_cert_path, + mask_proxy_url, +) +from tests import mock, unittest + + +class TestProxyConfiguration(unittest.TestCase): + def setUp(self): + self.url = 'http://localhost/' + self.auth_url = 'http://user:pass@localhost/' + self.proxy_config = ProxyConfiguration( + proxies={'http': 'http://localhost:8081/'} + ) + + def update_http_proxy(self, url): + self.proxy_config = ProxyConfiguration(proxies={'http': url}) + + def test_construct_proxy_headers_with_auth(self): + headers = self.proxy_config.proxy_headers_for(self.auth_url) + proxy_auth = headers.get('Proxy-Authorization') + self.assertEqual('Basic dXNlcjpwYXNz', proxy_auth) + + def test_construct_proxy_headers_without_auth(self): + headers = self.proxy_config.proxy_headers_for(self.url) + self.assertEqual({}, headers) + + def test_proxy_for_url_no_slashes(self): + self.update_http_proxy('localhost:8081/') + proxy_url = self.proxy_config.proxy_url_for(self.url) + self.assertEqual('http://localhost:8081/', proxy_url) + + def test_proxy_for_url_no_protocol(self): + self.update_http_proxy('//localhost:8081/') + proxy_url = self.proxy_config.proxy_url_for(self.url) + self.assertEqual('http://localhost:8081/', proxy_url) + + def test_fix_proxy_url_has_protocol_http(self): + proxy_url = self.proxy_config.proxy_url_for(self.url) + self.assertEqual('http://localhost:8081/', proxy_url) + + +class TestHttpSessionUtils(unittest.TestCase): + def test_get_cert_path_path(self): + path = '/some/path' + cert_path = get_cert_path(path) + self.assertEqual(path, cert_path) + + def test_get_cert_path_certifi_or_default(self): + with mock.patch('botocore.httpsession.where') as where: + path = '/bundle/path' + where.return_value = path + cert_path = get_cert_path(True) + self.assertEqual(path, cert_path) + + +@pytest.mark.parametrize( + 'proxy_url, expected_mask_url', + ( + ('http://myproxy.amazonaws.com', 'http://myproxy.amazonaws.com'), + ( + 'http://user@myproxy.amazonaws.com', + 'http://***@myproxy.amazonaws.com', + ), + ( + 'http://user:pass@myproxy.amazonaws.com', + 'http://***:***@myproxy.amazonaws.com', + ), + ( + 'https://user:pass@myproxy.amazonaws.com', + 'https://***:***@myproxy.amazonaws.com', + ), + ('http://user:pass@localhost', 'http://***:***@localhost'), + ('http://user:pass@localhost:80', 'http://***:***@localhost:80'), + ('http://user:pass@userpass.com', 'http://***:***@userpass.com'), + ('http://user:pass@192.168.1.1', 'http://***:***@192.168.1.1'), + ('http://user:pass@[::1]', 'http://***:***@[::1]'), + ('http://user:pass@[::1]:80', 'http://***:***@[::1]:80'), + ), +) +def test_mask_proxy_url(proxy_url, expected_mask_url): + assert mask_proxy_url(proxy_url) == expected_mask_url + + +class TestURLLib3Session(unittest.TestCase): + def setUp(self): + self.request = AWSRequest( + method='GET', + url='http://example.com/', + headers={}, + data=b'', + ) + + self.response = mock.Mock() + self.response.headers = {} + self.response.stream.return_value = b'' + + self.pool_manager = mock.Mock() + self.connection = mock.Mock() + self.connection.urlopen.return_value = self.response + self.pool_manager.connection_from_url.return_value = self.connection + + self.pool_patch = mock.patch('botocore.httpsession.PoolManager') + self.proxy_patch = mock.patch('botocore.httpsession.proxy_from_url') + self.pool_manager_cls = self.pool_patch.start() + self.proxy_manager_fun = self.proxy_patch.start() + self.pool_manager_cls.return_value = self.pool_manager + self.proxy_manager_fun.return_value = self.pool_manager + + def tearDown(self): + self.pool_patch.stop() + self.proxy_patch.stop() + + def assert_request_sent( + self, headers=None, body=None, url='/', chunked=False + ): + if headers is None: + headers = {} + + self.connection.urlopen.assert_called_once_with( + method=self.request.method, + url=url, + body=body, + headers=headers, + retries=mock.ANY, + assert_same_host=False, + preload_content=False, + decode_content=False, + chunked=chunked, + ) + + def _assert_manager_call(self, manager, *assert_args, **assert_kwargs): + call_kwargs = { + 'maxsize': mock.ANY, + 'timeout': mock.ANY, + 'ssl_context': mock.ANY, + 'socket_options': [], + 'cert_file': None, + 'key_file': None, + } + call_kwargs.update(assert_kwargs) + manager.assert_called_with(*assert_args, **call_kwargs) + + def assert_pool_manager_call(self, *args, **kwargs): + self._assert_manager_call(self.pool_manager_cls, *args, **kwargs) + + def assert_proxy_manager_call(self, *args, **kwargs): + self._assert_manager_call(self.proxy_manager_fun, *args, **kwargs) + + def test_forwards_max_pool_size(self): + URLLib3Session(max_pool_connections=22) + self.assert_pool_manager_call(maxsize=22) + + def test_forwards_client_cert(self): + URLLib3Session(client_cert='/some/cert') + self.assert_pool_manager_call(cert_file='/some/cert', key_file=None) + + def test_forwards_client_cert_and_key_tuple(self): + cert = ('/some/cert', '/some/key') + URLLib3Session(client_cert=cert) + self.assert_pool_manager_call(cert_file=cert[0], key_file=cert[1]) + + def test_proxies_config_settings(self): + proxies = {'http': 'http://proxy.com'} + proxies_config = { + 'proxy_ca_bundle': 'path/to/bundle', + 'proxy_client_cert': ('path/to/cert', 'path/to/key'), + 'proxy_use_forwarding_for_https': False, + } + use_forwarding = proxies_config['proxy_use_forwarding_for_https'] + with mock.patch('botocore.httpsession.create_urllib3_context'): + session = URLLib3Session( + proxies=proxies, proxies_config=proxies_config + ) + self.request.url = 'http://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['http'], + proxy_headers={}, + proxy_ssl_context=mock.ANY, + use_forwarding_for_https=use_forwarding, + ) + self.assert_request_sent(url=self.request.url) + + def test_proxies_config_settings_unknown_config(self): + proxies = {'http': 'http://proxy.com'} + proxies_config = { + 'proxy_ca_bundle': None, + 'proxy_client_cert': None, + 'proxy_use_forwarding_for_https': True, + 'proxy_not_a_real_arg': 'do not pass', + } + use_forwarding = proxies_config['proxy_use_forwarding_for_https'] + session = URLLib3Session( + proxies=proxies, proxies_config=proxies_config + ) + self.request.url = 'http://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['http'], + proxy_headers={}, + use_forwarding_for_https=use_forwarding, + ) + self.assertNotIn( + 'proxy_not_a_real_arg', self.proxy_manager_fun.call_args + ) + self.assert_request_sent(url=self.request.url) + + def test_http_proxy_scheme_with_http_url(self): + proxies = {'http': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies) + self.request.url = 'http://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['http'], + proxy_headers={}, + ) + self.assert_request_sent(url=self.request.url) + + def test_http_proxy_scheme_with_https_url(self): + proxies = {'https': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['https'], + proxy_headers={}, + ) + self.assert_request_sent() + + def test_https_proxy_scheme_with_http_url(self): + proxies = {'http': 'https://proxy.com'} + session = URLLib3Session(proxies=proxies) + self.request.url = 'http://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['http'], + proxy_headers={}, + ) + self.assert_request_sent(url=self.request.url) + + def test_https_proxy_scheme_tls_in_tls(self): + proxies = {'https': 'https://proxy.com'} + session = URLLib3Session(proxies=proxies) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['https'], + proxy_headers={}, + ) + self.assert_request_sent() + + def test_https_proxy_scheme_forwarding_https_url(self): + proxies = {'https': 'https://proxy.com'} + proxies_config = {"proxy_use_forwarding_for_https": True} + session = URLLib3Session( + proxies=proxies, proxies_config=proxies_config + ) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['https'], + proxy_headers={}, + use_forwarding_for_https=True, + ) + self.assert_request_sent(url=self.request.url) + + def test_basic_https_proxy_with_client_cert(self): + proxies = {'https': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies, client_cert='/some/cert') + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['https'], + proxy_headers={}, + cert_file='/some/cert', + key_file=None, + ) + self.assert_request_sent() + + def test_basic_https_proxy_with_client_cert_and_key(self): + cert = ('/some/cert', '/some/key') + proxies = {'https': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies, client_cert=cert) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['https'], + proxy_headers={}, + cert_file=cert[0], + key_file=cert[1], + ) + self.assert_request_sent() + + def test_urllib3_proxies_kwargs_included(self): + cert = ('/some/cert', '/some/key') + proxies = {'https': 'https://proxy.com'} + proxies_config = {'proxy_client_cert': "path/to/cert"} + with mock.patch('botocore.httpsession.create_urllib3_context'): + session = URLLib3Session( + proxies=proxies, + client_cert=cert, + proxies_config=proxies_config, + ) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['https'], + proxy_headers={}, + cert_file=cert[0], + key_file=cert[1], + proxy_ssl_context=mock.ANY, + ) + self.assert_request_sent() + + def test_proxy_ssl_context_uses_check_hostname(self): + cert = ('/some/cert', '/some/key') + proxies = {'https': 'https://proxy.com'} + proxies_config = {'proxy_client_cert': "path/to/cert"} + with mock.patch('botocore.httpsession.create_urllib3_context'): + session = URLLib3Session( + proxies=proxies, + client_cert=cert, + proxies_config=proxies_config, + ) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + last_call = self.proxy_manager_fun.call_args[-1] + self.assertIs(last_call['ssl_context'].check_hostname, True) + + def test_proxy_ssl_context_does_not_use_check_hostname_if_ip_address(self): + cert = ('/some/cert', '/some/key') + proxies_config = {'proxy_client_cert': "path/to/cert"} + urls = [ + 'https://1.2.3.4:5678', + 'https://4.6.0.0', + 'https://[FE80::8939:7684:D84b:a5A4%251]:1234', + 'https://[FE80::8939:7684:D84b:a5A4%251]', + 'https://[FE80::8939:7684:D84b:a5A4]:999', + 'https://[FE80::8939:7684:D84b:a5A4]', + 'https://[::1]:789', + ] + for proxy_url in urls: + with mock.patch('botocore.httpsession.SSLContext'): + proxies = {'https': proxy_url} + session = URLLib3Session( + proxies=proxies, + client_cert=cert, + proxies_config=proxies_config, + ) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + last_call = self.proxy_manager_fun.call_args[-1] + self.assertIs(last_call['ssl_context'].check_hostname, False) + + def test_basic_request(self): + session = URLLib3Session() + session.send(self.request.prepare()) + self.assert_request_sent() + self.response.stream.assert_called_once_with() + + def test_basic_streaming_request(self): + session = URLLib3Session() + self.request.stream_output = True + session.send(self.request.prepare()) + self.assert_request_sent() + self.response.stream.assert_not_called() + + def test_basic_https_request(self): + session = URLLib3Session() + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_request_sent() + + def test_basic_https_proxy_request(self): + proxies = {'https': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + self.assert_proxy_manager_call(proxies['https'], proxy_headers={}) + self.assert_request_sent() + + def test_basic_proxy_request_caches_manager(self): + proxies = {'https': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies) + self.request.url = 'https://example.com/' + session.send(self.request.prepare()) + # assert we created the proxy manager + self.assert_proxy_manager_call(proxies['https'], proxy_headers={}) + session.send(self.request.prepare()) + # assert that we did not create another proxy manager + self.assertEqual(self.proxy_manager_fun.call_count, 1) + + def test_basic_http_proxy_request(self): + proxies = {'http': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies) + session.send(self.request.prepare()) + self.assert_proxy_manager_call(proxies['http'], proxy_headers={}) + self.assert_request_sent(url=self.request.url) + + def test_ssl_context_is_explicit(self): + session = URLLib3Session() + session.send(self.request.prepare()) + _, manager_kwargs = self.pool_manager_cls.call_args + self.assertIsNotNone(manager_kwargs.get('ssl_context')) + + def test_proxy_request_ssl_context_is_explicit(self): + proxies = {'http': 'http://proxy.com'} + session = URLLib3Session(proxies=proxies) + session.send(self.request.prepare()) + _, proxy_kwargs = self.proxy_manager_fun.call_args + self.assertIsNotNone(proxy_kwargs.get('ssl_context')) + + def test_session_forwards_socket_options_to_pool_manager(self): + socket_options = [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)] + URLLib3Session(socket_options=socket_options) + self.assert_pool_manager_call(socket_options=socket_options) + + def test_session_forwards_socket_options_to_proxy_manager(self): + proxies = {'http': 'http://proxy.com'} + socket_options = [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)] + session = URLLib3Session( + proxies=proxies, + socket_options=socket_options, + ) + session.send(self.request.prepare()) + self.assert_proxy_manager_call( + proxies['http'], + proxy_headers={}, + socket_options=socket_options, + ) + + def make_request_with_error(self, error): + self.connection.urlopen.side_effect = error + session = URLLib3Session() + session.send(self.request.prepare()) + + def test_catches_new_connection_error(self): + error = NewConnectionError(None, None) + with pytest.raises(EndpointConnectionError): + self.make_request_with_error(error) + + def test_catches_bad_status_line(self): + error = ProtocolError(None) + with pytest.raises(ConnectionClosedError): + self.make_request_with_error(error) + + def test_catches_proxy_error(self): + self.connection.urlopen.side_effect = ProxyError('test', None) + session = URLLib3Session( + proxies={'http': 'http://user:pass@proxy.com'} + ) + with pytest.raises(ProxyConnectionError) as e: + session.send(self.request.prepare()) + assert 'user:pass' not in str(e.value) + assert 'http://***:***@proxy.com' in str(e.value) + + def test_aws_connection_classes_are_used(self): + session = URLLib3Session() # noqa + # ensure the pool manager is using the correct classes + http_class = self.pool_manager.pool_classes_by_scheme.get('http') + self.assertIs(http_class, AWSHTTPConnectionPool) + https_class = self.pool_manager.pool_classes_by_scheme.get('https') + self.assertIs(https_class, AWSHTTPSConnectionPool) + + def test_chunked_encoding_is_set_with_header(self): + session = URLLib3Session() + self.request.headers['Transfer-Encoding'] = 'chunked' + + session.send(self.request.prepare()) + self.assert_request_sent( + chunked=True, + headers={'Transfer-Encoding': 'chunked'}, + ) + + def test_chunked_encoding_is_not_set_without_header(self): + session = URLLib3Session() + + session.send(self.request.prepare()) + self.assert_request_sent(chunked=False) + + def test_close(self): + session = URLLib3Session() + session.close() + self.pool_manager.clear.assert_called_once_with() + + def test_close_proxied(self): + proxies = {'https': 'http://proxy.com', 'http': 'http://proxy2.com'} + session = URLLib3Session(proxies=proxies) + for proxy, proxy_url in proxies.items(): + self.request.url = f'{proxy}://example.com/' + session.send(self.request.prepare()) + + session.close() + self.proxy_manager_fun.return_value.clear.assert_called_with() + # One call for pool manager, one call for each of the proxies + self.assertEqual( + self.proxy_manager_fun.return_value.clear.call_count, + 1 + len(proxies), + ) diff --git a/testbed/boto__botocore/tests/unit/test_httpchecksum.py b/testbed/boto__botocore/tests/unit/test_httpchecksum.py new file mode 100644 index 0000000000000000000000000000000000000000..bc8265a9b32be063068c81ba5759bbdc726ecd04 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_httpchecksum.py @@ -0,0 +1,756 @@ +# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import unittest +from io import BytesIO + +from botocore.awsrequest import AWSResponse +from botocore.compat import HAS_CRT +from botocore.exceptions import ( + AwsChunkedWrapperError, + FlexibleChecksumError, + MissingDependencyException, +) +from botocore.httpchecksum import ( + _CHECKSUM_CLS, + AwsChunkedWrapper, + Crc32Checksum, + CrtCrc32cChecksum, + CrtCrc32Checksum, + Sha1Checksum, + Sha256Checksum, + StreamingChecksumBody, + apply_request_checksum, + handle_checksum_body, + resolve_request_checksum_algorithm, + resolve_response_checksum_algorithms, +) +from botocore.model import OperationModel +from tests import mock, requires_crt + + +class TestHttpChecksumHandlers(unittest.TestCase): + def _make_operation_model( + self, + http_checksum=None, + streaming_output=False, + streaming_input=False, + required=False, + ): + operation = mock.Mock(spec=OperationModel) + if http_checksum is None: + http_checksum = {} + operation.http_checksum = http_checksum + operation.http_checksum_required = required + operation.has_streaming_output = streaming_output + operation.has_streaming_input = streaming_input + return operation + + def _make_http_response( + self, + body, + headers=None, + context=None, + streaming=False, + ): + if context is None: + context = {} + + if headers is None: + headers = {} + + http_response = mock.Mock(spec=AWSResponse) + http_response.raw = BytesIO(body) + http_response.content = body + http_response.status_code = 200 + http_response.headers = headers + response_dict = { + "headers": http_response.headers, + "status_code": http_response.status_code, + "context": context, + } + if streaming: + response_dict["body"] = BytesIO(body) + else: + response_dict["body"] = body + return http_response, response_dict + + def _build_request(self, body): + request = { + "headers": {}, + "body": body, + "context": {}, + "url": "https://example.com", + } + return request + + def test_request_checksum_algorithm_no_model(self): + request = self._build_request(b"") + operation_model = self._make_operation_model() + params = {} + resolve_request_checksum_algorithm(request, operation_model, params) + self.assertNotIn("checksum", request["context"]) + + def test_request_checksum_algorithm_model_opt_in(self): + operation_model = self._make_operation_model( + http_checksum={"requestAlgorithmMember": "Algorithm"} + ) + + # Param is not present, no checksum will be set + params = {} + request = self._build_request(b"") + resolve_request_checksum_algorithm(request, operation_model, params) + self.assertNotIn("checksum", request["context"]) + + # Param is present, crc32 checksum will be set + params = {"Algorithm": "crc32"} + request = self._build_request(b"") + resolve_request_checksum_algorithm(request, operation_model, params) + expected_algorithm = { + "algorithm": "crc32", + "in": "header", + "name": "x-amz-checksum-crc32", + } + actual_algorithm = request["context"]["checksum"]["request_algorithm"] + self.assertEqual(actual_algorithm, expected_algorithm) + + # Param present but header already set, checksum should be skipped + params = {"Algorithm": "crc32"} + request = self._build_request(b"") + request["headers"]["x-amz-checksum-crc32"] = "foo" + resolve_request_checksum_algorithm(request, operation_model, params) + self.assertNotIn("checksum", request["context"]) + + def test_request_checksum_algorithm_model_opt_in_streaming(self): + request = self._build_request(b"") + operation_model = self._make_operation_model( + http_checksum={"requestAlgorithmMember": "Algorithm"}, + streaming_input=True, + ) + + # Param is not present, no checksum will be set + params = {} + resolve_request_checksum_algorithm(request, operation_model, params) + self.assertNotIn("checksum", request["context"]) + + # Param is present, crc32 checksum will be set in the trailer + params = {"Algorithm": "crc32"} + resolve_request_checksum_algorithm(request, operation_model, params) + expected_algorithm = { + "algorithm": "crc32", + "in": "trailer", + "name": "x-amz-checksum-crc32", + } + actual_algorithm = request["context"]["checksum"]["request_algorithm"] + self.assertEqual(actual_algorithm, expected_algorithm) + + # Trailer should not be used for http endpoints + request = self._build_request(b"") + request["url"] = "http://example.com" + resolve_request_checksum_algorithm(request, operation_model, params) + expected_algorithm = { + "algorithm": "crc32", + "in": "header", + "name": "x-amz-checksum-crc32", + } + actual_algorithm = request["context"]["checksum"]["request_algorithm"] + self.assertEqual(actual_algorithm, expected_algorithm) + + def test_request_checksum_algorithm_model_unsupported_algorithm(self): + request = self._build_request(b"") + operation_model = self._make_operation_model( + http_checksum={"requestAlgorithmMember": "Algorithm"}, + ) + params = {"Algorithm": "sha256"} + + with self.assertRaises(FlexibleChecksumError): + resolve_request_checksum_algorithm( + request, operation_model, params, supported_algorithms=[] + ) + + @unittest.skipIf(HAS_CRT, "Error only expected when CRT is not available") + def test_request_checksum_algorithm_model_no_crt_crc32c_unsupported(self): + request = self._build_request(b"") + operation_model = self._make_operation_model( + http_checksum={"requestAlgorithmMember": "Algorithm"}, + ) + params = {"Algorithm": "crc32c"} + with self.assertRaises(MissingDependencyException) as context: + resolve_request_checksum_algorithm( + request, operation_model, params + ) + self.assertIn( + "Using CRC32C 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) + params = {} + + resolve_request_checksum_algorithm(request, operation_model, params) + actual_algorithm = request["context"]["checksum"]["request_algorithm"] + expected_algorithm = "conditional-md5" + self.assertEqual(actual_algorithm, expected_algorithm) + + def test_request_checksum_algorithm_model_new_md5(self): + request = self._build_request(b"") + operation_model = self._make_operation_model( + http_checksum={"requestChecksumRequired": True} + ) + params = {} + + resolve_request_checksum_algorithm(request, operation_model, params) + actual_algorithm = request["context"]["checksum"]["request_algorithm"] + expected_algorithm = "conditional-md5" + self.assertEqual(actual_algorithm, expected_algorithm) + + def test_apply_request_checksum_handles_no_checksum_context(self): + request = self._build_request(b"") + apply_request_checksum(request) + # Build another request and assert the original request is the same + expected_request = self._build_request(b"") + self.assertEqual(request, expected_request) + + def test_apply_request_checksum_handles_invalid_context(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": { + "in": "http-trailer", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + with self.assertRaises(FlexibleChecksumError): + apply_request_checksum(request) + + def test_apply_request_checksum_conditional_md5(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": "conditional-md5" + } + apply_request_checksum(request) + self.assertIn("Content-MD5", request["headers"]) + + def test_apply_request_checksum_flex_header_bytes(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": { + "in": "header", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + apply_request_checksum(request) + self.assertIn("x-amz-checksum-crc32", request["headers"]) + + def test_apply_request_checksum_flex_header_readable(self): + request = self._build_request(BytesIO(b"")) + request["context"]["checksum"] = { + "request_algorithm": { + "in": "header", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + apply_request_checksum(request) + self.assertIn("x-amz-checksum-crc32", request["headers"]) + + def test_apply_request_checksum_flex_header_explicit_digest(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": { + "in": "header", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + request["headers"]["x-amz-checksum-crc32"] = "foo" + apply_request_checksum(request) + # The checksum should not have been modified + self.assertEqual(request["headers"]["x-amz-checksum-crc32"], "foo") + + def test_apply_request_checksum_flex_trailer_bytes(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": { + "in": "trailer", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + apply_request_checksum(request) + self.assertNotIn("x-amz-checksum-crc32", request["headers"]) + self.assertIsInstance(request["body"], AwsChunkedWrapper) + + def test_apply_request_checksum_flex_trailer_readable(self): + request = self._build_request(BytesIO(b"")) + request["context"]["checksum"] = { + "request_algorithm": { + "in": "trailer", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + apply_request_checksum(request) + self.assertNotIn("x-amz-checksum-crc32", request["headers"]) + self.assertIsInstance(request["body"], AwsChunkedWrapper) + + def test_apply_request_checksum_flex_header_trailer_explicit_digest(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": { + "in": "trailer", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + request["headers"]["x-amz-checksum-crc32"] = "foo" + apply_request_checksum(request) + # The checksum should not have been modified + self.assertEqual(request["headers"]["x-amz-checksum-crc32"], "foo") + # The body should not have been wrapped + self.assertIsInstance(request["body"], bytes) + + def test_apply_request_checksum_content_encoding_preset(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": { + "in": "trailer", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + request["headers"]["Content-Encoding"] = "foo" + apply_request_checksum(request) + # The content encoding should only have been appended + self.assertEqual( + request["headers"]["Content-Encoding"], "foo,aws-chunked" + ) + + def test_apply_request_checksum_content_encoding_default(self): + request = self._build_request(b"") + request["context"]["checksum"] = { + "request_algorithm": { + "in": "trailer", + "algorithm": "crc32", + "name": "x-amz-checksum-crc32", + } + } + apply_request_checksum(request) + self.assertEqual(request["headers"]["Content-Encoding"], "aws-chunked") + + def test_response_checksum_algorithm_no_model(self): + request = self._build_request(b"") + operation_model = self._make_operation_model() + params = {} + resolve_response_checksum_algorithms(request, operation_model, params) + self.assertNotIn("checksum", request["context"]) + + def test_response_checksum_algorithm_model_opt_in(self): + request = self._build_request(b"") + operation_model = self._make_operation_model( + http_checksum={ + "responseAlgorithms": ["crc32", "sha1", "sha256"], + "requestValidationModeMember": "ChecksumMode", + } + ) + + # Param is not present, no algorithms will be set + params = {} + resolve_response_checksum_algorithms(request, operation_model, params) + self.assertNotIn("checksum", request["context"]) + + # Param is present, algorithms will be set + params = {"ChecksumMode": "enabled"} + resolve_response_checksum_algorithms( + request, + operation_model, + params, + supported_algorithms=["sha1", "sha256"], + ) + # CRC32 should have been filtered it out as it was not supported + expected_algorithms = ["sha1", "sha256"] + actual_algorithms = request["context"]["checksum"][ + "response_algorithms" + ] + self.assertEqual(actual_algorithms, expected_algorithms) + + def test_handle_checksum_body_checksum(self): + context = {"checksum": {"response_algorithms": ["sha1", "crc32"]}} + headers = {"x-amz-checksum-crc32": "DUoRhQ=="} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + ) + operation_model = self._make_operation_model() + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + body = response_dict["body"] + self.assertEqual(body, b"hello world") + algorithm = response_dict["context"]["checksum"]["response_algorithm"] + self.assertEqual(algorithm, "crc32") + + headers = {"x-amz-checksum-crc32": "WrOonG=="} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + ) + with self.assertRaises(FlexibleChecksumError): + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + + # This header should not be checked, we won't calculate a checksum + # but a proper body should still come out at the end + headers = {"x-amz-checksum-foo": "FOO=="} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + ) + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + body = response_dict["body"] + self.assertEqual(body, b"hello world") + algorithm = response_dict["context"]["checksum"]["response_algorithm"] + self.assertEqual(algorithm, "crc32") + + def test_handle_checksum_body_checksum_streaming(self): + context = {"checksum": {"response_algorithms": ["sha1", "crc32"]}} + headers = {"x-amz-checksum-crc32": "DUoRhQ=="} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + streaming=True, + ) + operation_model = self._make_operation_model(streaming_output=True) + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + body = response_dict["body"] + self.assertEqual(body.read(), b"hello world") + algorithm = response_dict["context"]["checksum"]["response_algorithm"] + self.assertEqual(algorithm, "crc32") + + headers = {"x-amz-checksum-crc32": "WrOonG=="} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + streaming=True, + ) + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + body = response_dict["body"] + with self.assertRaises(FlexibleChecksumError): + body.read() + + # This header should not be checked, we won't calculate a checksum + # but a proper body should still come out at the end + headers = {"x-amz-checksum-foo": "FOOO=="} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + streaming=True, + ) + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + body = response_dict["body"] + self.assertEqual(body.read(), b"hello world") + algorithm = response_dict["context"]["checksum"]["response_algorithm"] + self.assertEqual(algorithm, "crc32") + + def test_handle_checksum_body_checksum_skip_non_streaming(self): + context = {"checksum": {"response_algorithms": ["sha1", "crc32"]}} + # S3 will return checksums over the checksums of parts which are a + # special case that end with -#. These cannot be validated and are + # instead skipped + headers = {"x-amz-checksum-crc32": "FOOO==-123"} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + ) + operation_model = self._make_operation_model() + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + body = response_dict["body"] + self.assertEqual(body, b"hello world") + + def test_handle_checksum_body_checksum_skip_streaming(self): + context = {"checksum": {"response_algorithms": ["sha1", "crc32"]}} + # S3 will return checksums over the checksums of parts which are a + # special case that end with -#. These cannot be validated and are + # instead skipped + headers = {"x-amz-checksum-crc32": "FOOO==-123"} + http_response, response_dict = self._make_http_response( + b"hello world", + headers=headers, + context=context, + streaming=True, + ) + operation_model = self._make_operation_model(streaming_output=True) + handle_checksum_body( + http_response, + response_dict, + context, + operation_model, + ) + body = response_dict["body"] + self.assertEqual(body.read(), b"hello world") + + +class TestAwsChunkedWrapper(unittest.TestCase): + def test_single_chunk_body(self): + # Test a small body that fits in a single chunk + bytes = BytesIO(b"abcdefghijklmnopqrstuvwxyz") + wrapper = AwsChunkedWrapper(bytes) + body = wrapper.read() + expected = b"1a\r\n" b"abcdefghijklmnopqrstuvwxyz\r\n" b"0\r\n\r\n" + self.assertEqual(body, expected) + + def test_multi_chunk_body(self): + # Test a body that requires multiple chunks + bytes = BytesIO(b"abcdefghijklmnopqrstuvwxyz") + wrapper = AwsChunkedWrapper(bytes, chunk_size=10) + body = wrapper.read() + expected = ( + b"a\r\n" + b"abcdefghij\r\n" + b"a\r\n" + b"klmnopqrst\r\n" + b"6\r\n" + b"uvwxyz\r\n" + b"0\r\n\r\n" + ) + self.assertEqual(body, expected) + + def test_read_returns_less_data(self): + class OneLessBytesIO(BytesIO): + def read(self, size=-1): + # Return 1 less byte than was asked for + return super().read(size - 1) + + bytes = OneLessBytesIO(b"abcdefghijklmnopqrstuvwxyz") + wrapper = AwsChunkedWrapper(bytes, chunk_size=10) + body = wrapper.read() + # NOTE: This particular body is not important, but it is important that + # the actual size of the chunk matches the length sent which may not + # always be the configured chunk_size if the read does not return that + # much data. + expected = ( + b"9\r\n" + b"abcdefghi\r\n" + b"9\r\n" + b"jklmnopqr\r\n" + b"8\r\n" + b"stuvwxyz\r\n" + b"0\r\n\r\n" + ) + self.assertEqual(body, expected) + + def test_single_chunk_body_with_checksum(self): + wrapper = AwsChunkedWrapper( + BytesIO(b"hello world"), + checksum_cls=Crc32Checksum, + checksum_name="checksum", + ) + body = wrapper.read() + expected = ( + b"b\r\n" b"hello world\r\n" b"0\r\n" b"checksum:DUoRhQ==\r\n\r\n" + ) + self.assertEqual(body, expected) + + def test_multi_chunk_body_with_checksum(self): + wrapper = AwsChunkedWrapper( + BytesIO(b"hello world"), + chunk_size=5, + checksum_cls=Crc32Checksum, + checksum_name="checksum", + ) + body = wrapper.read() + expected = ( + b"5\r\n" + b"hello\r\n" + b"5\r\n" + b" worl\r\n" + b"1\r\n" + b"d\r\n" + b"0\r\n" + b"checksum:DUoRhQ==\r\n\r\n" + ) + self.assertEqual(body, expected) + + def test_multi_chunk_body_with_checksum_iter(self): + wrapper = AwsChunkedWrapper( + BytesIO(b"hello world"), + chunk_size=5, + checksum_cls=Crc32Checksum, + checksum_name="checksum", + ) + expected_chunks = [ + b"5\r\nhello\r\n", + b"5\r\n worl\r\n", + b"1\r\nd\r\n", + b"0\r\nchecksum:DUoRhQ==\r\n\r\n", + ] + self.assertListEqual(expected_chunks, list(wrapper)) + + def test_wrapper_can_be_reset(self): + wrapper = AwsChunkedWrapper( + BytesIO(b"hello world"), + chunk_size=5, + checksum_cls=Crc32Checksum, + checksum_name="checksum", + ) + first_read = wrapper.read() + self.assertEqual(b"", wrapper.read()) + wrapper.seek(0) + second_read = wrapper.read() + self.assertEqual(first_read, second_read) + self.assertIn(b"checksum:DUoRhQ==", first_read) + + def test_wrapper_can_only_seek_to_start(self): + wrapper = AwsChunkedWrapper(BytesIO()) + with self.assertRaises(AwsChunkedWrapperError): + wrapper.seek(1) + with self.assertRaises(AwsChunkedWrapperError): + wrapper.seek(0, whence=1) + with self.assertRaises(AwsChunkedWrapperError): + wrapper.seek(1, whence=2) + + +class TestChecksumImplementations(unittest.TestCase): + def assert_base64_checksum(self, checksum_cls, expected_digest): + checksum = checksum_cls() + checksum.update(b"hello world") + actual_digest = checksum.b64digest() + self.assertEqual(actual_digest, expected_digest) + + def test_crc32(self): + self.assert_base64_checksum(Crc32Checksum, "DUoRhQ==") + + def test_sha1(self): + self.assert_base64_checksum( + Sha1Checksum, + "Kq5sNclPz7QV2+lfQIuc6R7oRu0=", + ) + + def test_sha256(self): + self.assert_base64_checksum( + Sha256Checksum, + "uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek=", + ) + + @requires_crt() + def test_crt_crc32(self): + self.assert_base64_checksum(CrtCrc32Checksum, "DUoRhQ==") + + @requires_crt() + def test_crt_crc32c(self): + self.assert_base64_checksum(CrtCrc32cChecksum, "yZRlqg==") + + +class TestCrtChecksumOverrides(unittest.TestCase): + @requires_crt() + def test_crt_crc32_available(self): + actual_cls = _CHECKSUM_CLS.get("crc32") + self.assertEqual(actual_cls, CrtCrc32Checksum) + + @requires_crt() + def test_crt_crc32c_available(self): + actual_cls = _CHECKSUM_CLS.get("crc32c") + self.assertEqual(actual_cls, CrtCrc32cChecksum) + + +class TestStreamingChecksumBody(unittest.TestCase): + def setUp(self): + self.raw_bytes = b"hello world" + self.fake_body = BytesIO(self.raw_bytes) + self._make_wrapper("DUoRhQ==") + + def _make_wrapper(self, checksum): + self.wrapper = StreamingChecksumBody( + self.fake_body, + None, + Crc32Checksum(), + checksum, + ) + + def test_basic_read_good(self): + actual = self.wrapper.read() + self.assertEqual(actual, self.raw_bytes) + + def test_many_reads_good(self): + actual = b"" + actual += self.wrapper.read(5) + actual += self.wrapper.read(5) + actual += self.wrapper.read(1) + self.assertEqual(actual, self.raw_bytes) + + def test_basic_read_bad(self): + self._make_wrapper("duorhq==") + with self.assertRaises(FlexibleChecksumError): + self.wrapper.read() + + def test_many_reads_bad(self): + self._make_wrapper("duorhq==") + self.wrapper.read(5) + self.wrapper.read(6) + # Whole body has been read, next read signals the end of the stream and + # validates the checksum of the body contents read + with self.assertRaises(FlexibleChecksumError): + self.wrapper.read(1) + + def test_handles_variable_padding(self): + # This digest is equivalent but with more padding + self._make_wrapper("DUoRhQ=====") + actual = self.wrapper.read() + self.assertEqual(actual, self.raw_bytes) + + def test_iter_raises_error(self): + self._make_wrapper("duorhq==") + with self.assertRaises(FlexibleChecksumError): + for chunk in self.wrapper: + pass diff --git a/testbed/boto__botocore/tests/unit/test_idempotency.py b/testbed/boto__botocore/tests/unit/test_idempotency.py new file mode 100644 index 0000000000000000000000000000000000000000..8036d615a51d1a470e58ab5c072efdcdfa307c14 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_idempotency.py @@ -0,0 +1,39 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +import re + +from botocore.handlers import generate_idempotent_uuid +from tests import mock, unittest + + +class TestIdempotencyInjection(unittest.TestCase): + def setUp(self): + self.mock_model = mock.MagicMock() + self.mock_model.idempotent_members = ['RequiredKey'] + self.uuid_pattern = re.compile( + '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$', re.I + ) + + def test_injection(self): + # No parameters are provided, RequiredKey should be autofilled + params = {} + generate_idempotent_uuid(params, self.mock_model) + self.assertIn('RequiredKey', params) + self.assertIsNotNone(self.uuid_pattern.match(params['RequiredKey'])) + + def test_provided(self): + # RequiredKey is provided, should not be replaced + params = {'RequiredKey': 'already populated'} + generate_idempotent_uuid(params, self.mock_model) + self.assertEqual(params['RequiredKey'], 'already populated') diff --git a/testbed/boto__botocore/tests/unit/test_loaders.py b/testbed/boto__botocore/tests/unit/test_loaders.py new file mode 100644 index 0000000000000000000000000000000000000000..6fbbb956d5a1afb4ae780540ad68d487cac2bb3f --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_loaders.py @@ -0,0 +1,513 @@ +# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, dis- +# tribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the fol- +# lowing conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- +# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import contextlib +import copy +import os + +from botocore.exceptions import DataNotFoundError, UnknownServiceError +from botocore.loaders import ( + ExtrasProcessor, + JSONFileLoader, + Loader, + create_loader, +) +from tests import BaseEnvVar, mock + + +class TestJSONFileLoader(BaseEnvVar): + def setUp(self): + super().setUp() + self.data_path = os.path.join(os.path.dirname(__file__), 'data') + self.file_loader = JSONFileLoader() + self.valid_file_path = os.path.join(self.data_path, 'foo') + self.compressed_file_path = os.path.join(self.data_path, 'compressed') + + def test_load_file(self): + data = self.file_loader.load_file(self.valid_file_path) + self.assertEqual(len(data), 3) + self.assertTrue('test_key_1' in data) + + def test_load_compressed_file(self): + data = self.file_loader.load_file(self.compressed_file_path) + self.assertEqual(len(data), 3) + self.assertTrue('test_key_1' in data) + + def test_load_compressed_file_exists_check(self): + self.assertTrue(self.file_loader.exists(self.compressed_file_path)) + + def test_load_json_file_does_not_exist_returns_none(self): + # None is used to indicate that the loader could not find a + # file to load. + self.assertIsNone(self.file_loader.load_file('fooasdfasdfasdf')) + + def test_file_exists_check(self): + self.assertTrue(self.file_loader.exists(self.valid_file_path)) + + def test_file_does_not_exist_returns_false(self): + self.assertFalse( + self.file_loader.exists( + os.path.join(self.data_path, 'does', 'not', 'exist') + ) + ) + + def test_file_with_non_ascii(self): + try: + filename = os.path.join(self.data_path, 'non_ascii') + self.assertTrue(self.file_loader.load_file(filename) is not None) + except UnicodeDecodeError: + self.fail('Fail to handle data file with non-ascii characters') + + +class TestLoader(BaseEnvVar): + def test_default_search_paths(self): + loader = Loader() + self.assertEqual(len(loader.search_paths), 2) + # We should also have ~/.aws/models added to + # the search path. To deal with cross platform + # issues we'll just check for a path that ends + # with .aws/models. + home_dir_path = os.path.join('.aws', 'models') + self.assertTrue( + any(p.endswith(home_dir_path) for p in loader.search_paths) + ) + + def test_can_add_to_search_path(self): + loader = Loader() + loader.search_paths.append('mypath') + self.assertIn('mypath', loader.search_paths) + + def test_can_initialize_with_search_paths(self): + loader = Loader(extra_search_paths=['foo', 'bar']) + # Note that the extra search paths are before + # the customer/builtin data paths. + self.assertEqual( + loader.search_paths, + [ + 'foo', + 'bar', + loader.CUSTOMER_DATA_PATH, + loader.BUILTIN_DATA_PATH, + ], + ) + + # The file loader isn't consulted unless the current + # search path exists, so we're patching isdir to always + # say that a directory exists. + @mock.patch('os.path.isdir', mock.Mock(return_value=True)) + def test_load_data_uses_loader(self): + search_paths = ['foo', 'bar', 'baz'] + + class FakeLoader: + def load_file(self, name): + expected_ending = os.path.join('bar', 'baz') + if name.endswith(expected_ending): + return ['loaded data'] + + loader = Loader( + extra_search_paths=search_paths, file_loader=FakeLoader() + ) + loaded = loader.load_data('baz') + self.assertEqual(loaded, ['loaded data']) + + @mock.patch('os.path.isdir', mock.Mock(return_value=True)) + def test_load_data_with_path(self): + search_paths = ['foo', 'bar', 'baz'] + + class FakeLoader: + def load_file(self, name): + expected_ending = os.path.join('bar', 'abc') + if name.endswith(expected_ending): + return ['loaded data'] + + loader = Loader( + extra_search_paths=search_paths, file_loader=FakeLoader() + ) + loaded, path = loader.load_data_with_path('abc') + self.assertEqual(loaded, ['loaded data']) + self.assertEqual(path, os.path.join('bar', 'abc')) + + def test_data_not_found_raises_exception(self): + class FakeLoader: + def load_file(self, name): + # Returning None indicates that the + # loader couldn't find anything. + return None + + loader = Loader(file_loader=FakeLoader()) + with self.assertRaises(DataNotFoundError): + loader.load_data('baz') + + def test_data_not_found_raises_exception_load_data_with_path(self): + class FakeLoader: + def load_file(self, name): + return None + + loader = Loader(file_loader=FakeLoader()) + with self.assertRaises(DataNotFoundError): + loader.load_data_with_path('baz') + + @mock.patch('os.path.isdir', mock.Mock(return_value=True)) + def test_error_raised_if_service_does_not_exist(self): + loader = Loader( + extra_search_paths=[], include_default_search_paths=False + ) + with self.assertRaises(DataNotFoundError): + loader.determine_latest_version('unknownservice', 'service-2') + + @mock.patch('os.path.isdir', mock.Mock(return_value=True)) + def test_load_service_model(self): + class FakeLoader: + def load_file(self, name): + return ['loaded data'] + + loader = Loader( + extra_search_paths=['foo'], + file_loader=FakeLoader(), + include_default_search_paths=False, + include_default_extras=False, + ) + loader.determine_latest_version = mock.Mock(return_value='2015-03-01') + loader.list_available_services = mock.Mock(return_value=['baz']) + loaded = loader.load_service_model('baz', type_name='service-2') + self.assertEqual(loaded, ['loaded data']) + + @mock.patch('os.path.isdir', mock.Mock(return_value=True)) + def test_load_service_model_enforces_case(self): + class FakeLoader: + def load_file(self, name): + return ['loaded data'] + + loader = Loader( + extra_search_paths=['foo'], + file_loader=FakeLoader(), + include_default_search_paths=False, + ) + loader.determine_latest_version = mock.Mock(return_value='2015-03-01') + loader.list_available_services = mock.Mock(return_value=['baz']) + + # Should have a) the unknown service name and b) list of valid + # service names. + with self.assertRaisesRegex( + UnknownServiceError, 'Unknown service.*BAZ.*baz' + ): + loader.load_service_model('BAZ', type_name='service-2') + + def test_load_service_model_uses_provided_type_name(self): + loader = Loader( + extra_search_paths=['foo'], + file_loader=mock.Mock(), + include_default_search_paths=False, + ) + loader.list_available_services = mock.Mock(return_value=['baz']) + + # Should have a) the unknown service name and b) list of valid + # service names. + provided_type_name = 'not-service-2' + with self.assertRaisesRegex( + UnknownServiceError, 'Unknown service.*BAZ.*baz' + ): + loader.load_service_model('BAZ', type_name=provided_type_name) + + loader.list_available_services.assert_called_with(provided_type_name) + + def test_create_loader_parses_data_path(self): + search_path = os.pathsep.join(['foo', 'bar', 'baz']) + loader = create_loader(search_path) + self.assertIn('foo', loader.search_paths) + self.assertIn('bar', loader.search_paths) + self.assertIn('baz', loader.search_paths) + + def test_is_builtin_path(self): + loader = Loader() + path_in_builtins = os.path.join(loader.BUILTIN_DATA_PATH, "foo.txt") + path_elsewhere = __file__ + self.assertTrue(loader.is_builtin_path(path_in_builtins)) + self.assertFalse(loader.is_builtin_path(path_elsewhere)) + + +class TestMergeExtras(BaseEnvVar): + def setUp(self): + super().setUp() + self.file_loader = mock.Mock() + self.data_loader = Loader( + extra_search_paths=['datapath'], + file_loader=self.file_loader, + include_default_search_paths=False, + ) + self.data_loader.determine_latest_version = mock.Mock( + return_value='2015-03-01' + ) + self.data_loader.list_available_services = mock.Mock( + return_value=['myservice'] + ) + + isdir_mock = mock.Mock(return_value=True) + self.isdir_patch = mock.patch('os.path.isdir', isdir_mock) + self.isdir_patch.start() + + def tearDown(self): + super().tearDown() + self.isdir_patch.stop() + + def test_merge_extras(self): + service_data = {'foo': 'service', 'bar': 'service'} + sdk_extras = {'merge': {'foo': 'sdk'}} + self.file_loader.load_file.side_effect = [service_data, sdk_extras] + + loaded = self.data_loader.load_service_model('myservice', 'service-2') + expected = {'foo': 'sdk', 'bar': 'service'} + self.assertEqual(loaded, expected) + + call_args = self.file_loader.load_file.call_args_list + call_args = [c[0][0] for c in call_args] + base_path = os.path.join('datapath', 'myservice', '2015-03-01') + expected_call_args = [ + os.path.join(base_path, 'service-2'), + os.path.join(base_path, 'service-2.sdk-extras'), + ] + self.assertEqual(call_args, expected_call_args) + + def test_extras_not_found(self): + service_data = {'foo': 'service', 'bar': 'service'} + service_data_copy = copy.copy(service_data) + self.file_loader.load_file.side_effect = [service_data, None] + + loaded = self.data_loader.load_service_model('myservice', 'service-2') + self.assertEqual(loaded, service_data_copy) + + def test_no_merge_in_extras(self): + service_data = {'foo': 'service', 'bar': 'service'} + service_data_copy = copy.copy(service_data) + self.file_loader.load_file.side_effect = [service_data, {}] + + loaded = self.data_loader.load_service_model('myservice', 'service-2') + self.assertEqual(loaded, service_data_copy) + + def test_include_default_extras(self): + self.data_loader = Loader( + extra_search_paths=['datapath'], + file_loader=self.file_loader, + include_default_search_paths=False, + include_default_extras=False, + ) + self.data_loader.determine_latest_version = mock.Mock( + return_value='2015-03-01' + ) + self.data_loader.list_available_services = mock.Mock( + return_value=['myservice'] + ) + + service_data = {'foo': 'service', 'bar': 'service'} + service_data_copy = copy.copy(service_data) + sdk_extras = {'merge': {'foo': 'sdk'}} + self.file_loader.load_file.side_effect = [service_data, sdk_extras] + + loaded = self.data_loader.load_service_model('myservice', 'service-2') + self.assertEqual(loaded, service_data_copy) + + def test_append_extra_type(self): + service_data = {'foo': 'service', 'bar': 'service'} + sdk_extras = {'merge': {'foo': 'sdk'}} + cli_extras = {'merge': {'cli': True}} + self.file_loader.load_file.side_effect = [ + service_data, + sdk_extras, + cli_extras, + ] + + self.data_loader.extras_types.append('cli') + + loaded = self.data_loader.load_service_model('myservice', 'service-2') + expected = {'foo': 'sdk', 'bar': 'service', 'cli': True} + self.assertEqual(loaded, expected) + + call_args = self.file_loader.load_file.call_args_list + call_args = [c[0][0] for c in call_args] + base_path = os.path.join('datapath', 'myservice', '2015-03-01') + expected_call_args = [ + os.path.join(base_path, 'service-2'), + os.path.join(base_path, 'service-2.sdk-extras'), + os.path.join(base_path, 'service-2.cli-extras'), + ] + self.assertEqual(call_args, expected_call_args) + + def test_sdk_empty_extras_skipped(self): + service_data = {'foo': 'service', 'bar': 'service'} + cli_extras = {'merge': {'foo': 'cli'}} + self.file_loader.load_file.side_effect = [ + service_data, + None, + cli_extras, + ] + + self.data_loader.extras_types.append('cli') + + loaded = self.data_loader.load_service_model('myservice', 'service-2') + expected = {'foo': 'cli', 'bar': 'service'} + self.assertEqual(loaded, expected) + + +class TestExtrasProcessor(BaseEnvVar): + def setUp(self): + super().setUp() + self.processor = ExtrasProcessor() + self.service_data = { + 'shapes': { + 'StringShape': {'type': 'string'}, + } + } + self.service_data_copy = copy.deepcopy(self.service_data) + + def test_process_empty_list(self): + self.processor.process(self.service_data, []) + self.assertEqual(self.service_data, self.service_data_copy) + + def test_process_empty_extras(self): + self.processor.process(self.service_data, [{}]) + self.assertEqual(self.service_data, self.service_data_copy) + + def test_process_merge_key(self): + extras = {'merge': {'shapes': {'BooleanShape': {'type': 'boolean'}}}} + self.processor.process(self.service_data, [extras]) + self.assertNotEqual(self.service_data, self.service_data_copy) + + boolean_shape = self.service_data['shapes'].get('BooleanShape') + self.assertEqual(boolean_shape, {'type': 'boolean'}) + + def test_process_in_order(self): + extras = [ + {'merge': {'shapes': {'BooleanShape': {'type': 'boolean'}}}}, + {'merge': {'shapes': {'BooleanShape': {'type': 'string'}}}}, + ] + self.processor.process(self.service_data, extras) + self.assertNotEqual(self.service_data, self.service_data_copy) + + boolean_shape = self.service_data['shapes'].get('BooleanShape') + self.assertEqual(boolean_shape, {'type': 'string'}) + + +class TestLoadersWithDirectorySearching(BaseEnvVar): + def setUp(self): + super().setUp() + self.fake_directories = {} + + def tearDown(self): + super().tearDown() + + @contextlib.contextmanager + def loader_with_fake_dirs(self): + mock_file_loader = mock.Mock() + mock_file_loader.exists = self.fake_exists + search_paths = list(self.fake_directories) + loader = Loader( + extra_search_paths=search_paths, + include_default_search_paths=False, + file_loader=mock_file_loader, + ) + with mock.patch('os.listdir', self.fake_listdir): + with mock.patch('os.path.isdir', mock.Mock(return_value=True)): + yield loader + + def fake_listdir(self, dirname): + parts = dirname.split(os.path.sep) + result = self.fake_directories + while parts: + current = parts.pop(0) + result = result[current] + return list(result) + + def fake_exists(self, path): + parts = path.split(os.sep) + result = self.fake_directories + while len(parts) > 1: + current = parts.pop(0) + result = result[current] + return parts[0] in result + + def test_list_available_services(self): + self.fake_directories = { + 'foo': { + 'ec2': { + '2010-01-01': ['service-2'], + '2014-10-01': ['service-1'], + }, + 'dynamodb': { + '2010-01-01': ['service-2'], + }, + }, + 'bar': { + 'ec2': { + '2015-03-01': ['service-1'], + }, + 'rds': { + # This will not show up in + # list_available_services() for type + # service-2 because it does not contains + # a service-2. + '2012-01-01': ['resource-1'], + }, + }, + } + with self.loader_with_fake_dirs() as loader: + self.assertEqual( + loader.list_available_services(type_name='service-2'), + ['dynamodb', 'ec2'], + ) + self.assertEqual( + loader.list_available_services(type_name='resource-1'), ['rds'] + ) + + def test_determine_latest(self): + # Fake mapping of directories to subdirectories. + # In this example, we can see that the 'bar' directory + # contains the latest EC2 API version, 2015-03-01, + # so loader.determine_latest('ec2') should return + # this value 2015-03-01. + self.fake_directories = { + 'foo': { + 'ec2': { + '2010-01-01': ['service-2'], + # This directory contains the latest API version + # for EC2 because its the highest API directory + # that contains a service-2. + '2014-10-01': ['service-2'], + }, + }, + 'bar': { + 'ec2': { + '2012-01-01': ['service-2'], + # 2015-03-1 is *not* the latest for service-2, + # because its directory only has service-1.json. + '2015-03-01': ['service-1'], + }, + }, + } + with self.loader_with_fake_dirs() as loader: + loader.determine_latest_version('ec2', 'service-2') + self.assertEqual( + loader.determine_latest_version('ec2', 'service-2'), + '2014-10-01', + ) + self.assertEqual( + loader.determine_latest_version('ec2', 'service-1'), + '2015-03-01', + ) diff --git a/testbed/boto__botocore/tests/unit/test_model.py b/testbed/boto__botocore/tests/unit/test_model.py new file mode 100644 index 0000000000000000000000000000000000000000..da95a18beacb68dcb6789cacc71bd3af44dd8ea9 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_model.py @@ -0,0 +1,1221 @@ +import pytest + +from botocore import model +from botocore.compat import OrderedDict +from tests import unittest + + +@pytest.mark.parametrize("property_name", ['api_version', 'protocol']) +def test_missing_model_attribute_raises_exception(property_name): + service_model = model.ServiceModel({'metadata': {'endpointPrefix': 'foo'}}) + with pytest.raises(model.UndefinedModelAttributeError): + getattr(service_model, property_name) + + +class TestServiceId(unittest.TestCase): + def test_hypenize_replaces_spaces(self): + self.assertEqual( + model.ServiceId('my service').hyphenize(), 'my-service' + ) + + def test_hyphenize_lower_cases(self): + self.assertEqual(model.ServiceId('MyService').hyphenize(), 'myservice') + + +class TestServiceModel(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': { + 'protocol': 'query', + 'endpointPrefix': 'endpoint-prefix', + 'serviceId': 'MyService', + }, + 'documentation': 'Documentation value', + 'operations': {}, + 'shapes': {'StringShape': {'type': 'string'}}, + } + self.error_shapes = { + 'ExceptionOne': { + 'exception': True, + 'type': 'structure', + 'members': {}, + }, + 'ExceptionTwo': { + 'exception': True, + 'type': 'structure', + 'members': {}, + 'error': {'code': 'FooCode'}, + }, + } + self.service_model = model.ServiceModel(self.model) + + def test_metadata_available(self): + # You should be able to access the metadata in a service description + # through the service model object. + self.assertEqual(self.service_model.metadata.get('protocol'), 'query') + + def test_service_name_can_be_overriden(self): + service_model = model.ServiceModel( + self.model, service_name='myservice' + ) + self.assertEqual(service_model.service_name, 'myservice') + + def test_service_name_defaults_to_endpoint_prefix(self): + self.assertEqual(self.service_model.service_name, 'endpoint-prefix') + + def test_service_id(self): + self.assertEqual(self.service_model.service_id, 'MyService') + + def test_hyphenize_service_id(self): + self.assertEqual( + self.service_model.service_id.hyphenize(), 'myservice' + ) + + def test_service_id_does_not_exist(self): + service_model = { + 'metadata': { + 'protocol': 'query', + 'endpointPrefix': 'endpoint-prefix', + }, + 'documentation': 'Documentation value', + 'operations': {}, + 'shapes': {'StringShape': {'type': 'string'}}, + } + service_name = 'myservice' + service_model = model.ServiceModel(service_model, service_name) + with self.assertRaisesRegex( + model.UndefinedModelAttributeError, service_name + ): + service_model.service_id + + def test_operation_does_not_exist(self): + with self.assertRaises(model.OperationNotFoundError): + self.service_model.operation_model('NoExistOperation') + + def test_signing_name_defaults_to_endpoint_prefix(self): + self.assertEqual(self.service_model.signing_name, 'endpoint-prefix') + + def test_documentation_exposed_as_property(self): + self.assertEqual( + self.service_model.documentation, 'Documentation value' + ) + + def test_shape_names(self): + self.assertEqual(self.service_model.shape_names, ['StringShape']) + + def test_repr_has_service_name(self): + self.assertEqual( + repr(self.service_model), 'ServiceModel(endpoint-prefix)' + ) + + def test_shape_for_error_code(self): + self.model['shapes'].update(self.error_shapes) + self.service_model = model.ServiceModel(self.model) + shape = self.service_model.shape_for_error_code('ExceptionOne') + self.assertEqual(shape.name, 'ExceptionOne') + shape = self.service_model.shape_for_error_code('FooCode') + self.assertEqual(shape.name, 'ExceptionTwo') + + def test_error_shapes(self): + self.model['shapes'].update(self.error_shapes) + self.service_model = model.ServiceModel(self.model) + error_shapes = self.service_model.error_shapes + error_shape_names = [shape.name for shape in error_shapes] + self.assertEqual(len(error_shape_names), 2) + self.assertIn('ExceptionOne', error_shape_names) + self.assertIn('ExceptionTwo', error_shape_names) + + def test_client_context_params(self): + service_model = model.ServiceModel( + { + 'metadata': { + 'protocol': 'query', + 'endpointPrefix': 'endpoint-prefix', + 'serviceId': 'MyServiceWithClientContextParams', + }, + 'documentation': 'Documentation value', + 'operations': {}, + 'shapes': {}, + 'clientContextParams': { + 'stringClientContextParam': { + 'type': 'string', + 'documentation': 'str-valued', + }, + 'booleanClientContextParam': { + 'type': 'boolean', + 'documentation': 'bool-valued', + }, + }, + } + ) + self.assertEqual(len(service_model.client_context_parameters), 2) + client_ctx_param1 = service_model.client_context_parameters[0] + client_ctx_param2 = service_model.client_context_parameters[1] + self.assertEqual(client_ctx_param1.name, 'stringClientContextParam') + self.assertEqual(client_ctx_param1.type, 'string') + self.assertEqual(client_ctx_param1.documentation, 'str-valued') + self.assertEqual(client_ctx_param2.name, 'booleanClientContextParam') + + def test_client_context_params_absent(self): + self.assertIsInstance( + self.service_model.client_context_parameters, list + ) + self.assertEqual(len(self.service_model.client_context_parameters), 0) + + +class TestOperationModelFromService(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': {'protocol': 'query', 'endpointPrefix': 'foo'}, + 'documentation': '', + 'operations': { + 'OperationName': { + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'name': 'OperationName', + 'input': {'shape': 'OperationNameRequest'}, + 'output': { + 'shape': 'OperationNameResponse', + }, + 'errors': [{'shape': 'NoSuchResourceException'}], + 'documentation': 'Docs for OperationName', + 'authtype': 'v4', + 'auth': ['aws.auth#sigv4'], + }, + 'OperationTwo': { + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'name': 'OperationTwo', + 'input': {'shape': 'OperationNameRequest'}, + 'output': { + 'shape': 'OperationNameResponse', + }, + 'errors': [{'shape': 'NoSuchResourceException'}], + 'documentation': 'Docs for OperationTwo', + }, + 'PayloadOperation': { + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'name': 'PayloadOperation', + 'input': {'shape': 'PayloadOperationRequest'}, + 'output': { + 'shape': 'PayloadOperationResponse', + }, + 'errors': [{'shape': 'NoSuchResourceException'}], + 'documentation': 'Docs for PayloadOperation', + 'requestcompression': {'encodings': ['gzip']}, + }, + 'NoBodyOperation': { + 'http': { + 'method': 'GET', + 'requestUri': '/', + }, + 'name': 'NoBodyOperation', + 'input': {'shape': 'NoBodyOperationRequest'}, + 'output': { + 'shape': 'OperationNameResponse', + }, + 'errors': [{'shape': 'NoSuchResourceException'}], + 'documentation': 'Docs for NoBodyOperation', + }, + 'ContextParamOperation': { + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'name': 'ContextParamOperation', + 'input': {'shape': 'ContextParamOperationRequest'}, + 'output': {'shape': 'OperationNameResponse'}, + 'errors': [{'shape': 'NoSuchResourceException'}], + 'documentation': 'Docs for ContextParamOperation', + 'staticContextParams': { + 'stringStaticContextParam': { + 'value': 'Static Context Param Value', + }, + 'booleanStaticContextParam': { + 'value': True, + }, + }, + }, + }, + 'shapes': { + 'OperationNameRequest': { + 'type': 'structure', + 'members': { + 'Arg1': {'shape': 'stringType'}, + 'Arg2': {'shape': 'stringType'}, + }, + }, + 'OperationNameResponse': { + 'type': 'structure', + 'members': { + 'String': { + 'shape': 'stringType', + } + }, + }, + 'PayloadOperationRequest': { + 'type': 'structure', + 'members': { + 'Arg1': {'shape': 'TestConfig'}, + 'Arg2': {'shape': 'stringType'}, + }, + 'payload': 'Arg1', + }, + 'PayloadOperationResponse': { + 'type': 'structure', + 'members': { + 'String': { + 'shape': 'stringType', + } + }, + 'payload': 'String', + }, + 'NoBodyOperationRequest': { + 'type': 'structure', + 'members': { + 'data': { + 'location': 'header', + 'locationName': 'x-amz-data', + 'shape': 'stringType', + } + }, + }, + 'ContextParamOperationRequest': { + 'type': 'structure', + 'members': { + 'ContextParamArg': { + 'shape': 'stringType', + 'contextParam': { + 'name': 'contextParamName', + }, + } + }, + 'payload': 'ContextParamArg', + }, + 'NoSuchResourceException': { + 'type': 'structure', + 'members': {}, + }, + 'stringType': { + 'type': 'string', + }, + 'TestConfig': { + 'type': 'structure', + 'members': {'timeout': {'shape': 'stringType'}}, + }, + }, + } + self.service_model = model.ServiceModel(self.model) + + def test_wire_name_always_matches_model(self): + service_model = model.ServiceModel(self.model) + operation = model.OperationModel( + self.model['operations']['OperationName'], service_model, 'Foo' + ) + self.assertEqual(operation.name, 'Foo') + self.assertEqual(operation.wire_name, 'OperationName') + + def test_operation_name_in_repr(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertIn('OperationName', repr(operation)) + + def test_name_and_wire_name_defaults_to_same_value(self): + service_model = model.ServiceModel(self.model) + operation = model.OperationModel( + self.model['operations']['OperationName'], service_model + ) + self.assertEqual(operation.name, 'OperationName') + self.assertEqual(operation.wire_name, 'OperationName') + + def test_name_from_service(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertEqual(operation.name, 'OperationName') + + def test_name_from_service_model_when_differs_from_name(self): + self.model['operations']['Foo'] = self.model['operations'][ + 'OperationName' + ] + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('Foo') + self.assertEqual(operation.name, 'Foo') + + def test_operation_input_model(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertEqual(operation.name, 'OperationName') + # Operations should also have a reference to the top level metadata. + self.assertEqual(operation.metadata['protocol'], 'query') + self.assertEqual(operation.http['method'], 'POST') + self.assertEqual(operation.http['requestUri'], '/') + shape = operation.input_shape + self.assertEqual(shape.name, 'OperationNameRequest') + self.assertEqual(list(sorted(shape.members)), ['Arg1', 'Arg2']) + + def test_has_documentation_property(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertEqual(operation.documentation, 'Docs for OperationName') + + def test_service_model_available_from_operation_model(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + # This is an identity comparison because we don't implement + # __eq__, so we may need to change this in the future. + self.assertEqual(operation.service_model, service_model) + + def test_operation_output_model(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + output = operation.output_shape + self.assertEqual(list(output.members), ['String']) + self.assertFalse(operation.has_streaming_output) + + def test_operation_shape_not_required(self): + # It's ok if there's no output shape. We'll just get a return value of + # None. + del self.model['operations']['OperationName']['output'] + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + output_shape = operation.output_shape + self.assertIsNone(output_shape) + + def test_error_shapes(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + # OperationName only has a NoSuchResourceException + self.assertEqual(len(operation.error_shapes), 1) + self.assertEqual( + operation.error_shapes[0].name, 'NoSuchResourceException' + ) + + def test_has_auth(self): + operation = self.service_model.operation_model('OperationName') + self.assertEqual(operation.auth, ["aws.auth#sigv4"]) + + def test_auth_not_set(self): + operation = self.service_model.operation_model('OperationTwo') + self.assertIsNone(operation.auth) + + def test_has_resolved_auth_type(self): + operation = self.service_model.operation_model('OperationName') + self.assertEqual(operation.resolved_auth_type, 'v4') + + def test_resolved_auth_type_not_set(self): + operation = self.service_model.operation_model('OperationTwo') + self.assertIsNone(operation.resolved_auth_type) + + def test_has_auth_type(self): + operation = self.service_model.operation_model('OperationName') + self.assertEqual(operation.auth_type, 'v4') + + def test_auth_type_not_set(self): + operation = self.service_model.operation_model('OperationTwo') + self.assertIsNone(operation.auth_type) + + def test_deprecated_present(self): + self.model['operations']['OperationName']['deprecated'] = True + service_model = model.ServiceModel(self.model) + operation_name = service_model.operation_model('OperationName') + self.assertTrue(operation_name.deprecated) + + def test_deprecated_present_false(self): + self.model['operations']['OperationName']['deprecated'] = False + service_model = model.ServiceModel(self.model) + operation_name = service_model.operation_model('OperationName') + self.assertFalse(operation_name.deprecated) + + def test_deprecated_absent(self): + service_model = model.ServiceModel(self.model) + operation_two = service_model.operation_model('OperationTwo') + self.assertFalse(operation_two.deprecated) + + def test_endpoint_operation_present(self): + self.model['operations']['OperationName']['endpointoperation'] = True + service_model = model.ServiceModel(self.model) + operation_name = service_model.operation_model('OperationName') + self.assertTrue(operation_name.is_endpoint_discovery_operation) + + def test_endpoint_operation_present_false(self): + self.model['operations']['OperationName']['endpointoperation'] = False + service_model = model.ServiceModel(self.model) + operation_name = service_model.operation_model('OperationName') + self.assertFalse(operation_name.is_endpoint_discovery_operation) + + def test_endpoint_operation_absent(self): + operation_two = self.service_model.operation_model('OperationName') + self.assertFalse(operation_two.is_endpoint_discovery_operation) + + def test_endpoint_discovery_required(self): + operation = self.model['operations']['OperationName'] + operation['endpointdiscovery'] = {'required': True} + service_model = model.ServiceModel(self.model) + self.assertTrue(service_model.endpoint_discovery_required) + + def test_endpoint_discovery_required_false(self): + self.model['operations']['OperationName']['endpointdiscovery'] = {} + service_model = model.ServiceModel(self.model) + self.assertFalse(service_model.endpoint_discovery_required) + + def test_endpoint_discovery_required_no_value(self): + operation = self.model['operations']['OperationName'] + self.assertTrue(operation.get('endpointdiscovery') is None) + service_model = model.ServiceModel(self.model) + self.assertFalse(service_model.endpoint_discovery_required) + + def test_endpoint_discovery_present(self): + operation = self.model['operations']['OperationName'] + operation['endpointdiscovery'] = {'required': True} + service_model = model.ServiceModel(self.model) + operation_name = service_model.operation_model('OperationName') + self.assertTrue(operation_name.endpoint_discovery.get('required')) + + def test_endpoint_discovery_absent(self): + operation_name = self.service_model.operation_model('OperationName') + self.assertIsNone(operation_name.endpoint_discovery) + + def test_http_checksum_absent(self): + operation_name = self.service_model.operation_model('OperationName') + self.assertEqual(operation_name.http_checksum, {}) + + def test_http_checksum_present(self): + operation = self.model['operations']['OperationName'] + operation['httpChecksum'] = { + "requestChecksumRequired": True, + "requestAlgorithmMember": "ChecksumAlgorithm", + "requestValidationModeMember": "ChecksumMode", + "responseAlgorithms": ["crc32", "crc32c", "sha256", "sha1"], + } + service_model = model.ServiceModel(self.model) + operation_model = service_model.operation_model('OperationName') + http_checksum = operation_model.http_checksum + self.assertEqual( + http_checksum["requestChecksumRequired"], + True, + ) + self.assertEqual( + http_checksum["requestAlgorithmMember"], + "ChecksumAlgorithm", + ) + self.assertEqual( + http_checksum["requestValidationModeMember"], + "ChecksumMode", + ) + self.assertEqual( + http_checksum["responseAlgorithms"], + ["crc32", "crc32c", "sha256", "sha1"], + ) + + def test_context_parameter_present(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('ContextParamOperation') + self.assertEqual(len(operation.context_parameters), 1) + context_param = operation.context_parameters[0] + self.assertEqual(context_param.name, 'contextParamName') + self.assertEqual(context_param.member_name, 'ContextParamArg') + + def test_context_parameter_absent(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationTwo') + self.assertIsInstance(operation.context_parameters, list) + self.assertEqual(len(operation.context_parameters), 0) + + def test_static_context_parameter_present(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('ContextParamOperation') + self.assertEqual(len(operation.static_context_parameters), 2) + static_ctx_param1 = operation.static_context_parameters[0] + static_ctx_param2 = operation.static_context_parameters[1] + self.assertEqual(static_ctx_param1.name, 'stringStaticContextParam') + self.assertEqual(static_ctx_param1.value, 'Static Context Param Value') + self.assertEqual(static_ctx_param2.name, 'booleanStaticContextParam') + self.assertEqual(static_ctx_param2.value, True) + + def test_static_context_parameter_absent(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationTwo') + self.assertIsInstance(operation.static_context_parameters, list) + self.assertEqual(len(operation.static_context_parameters), 0) + + def test_request_compression(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('PayloadOperation') + self.assertEqual( + operation.request_compression, {'encodings': ['gzip']} + ) + + +class TestOperationModelEventStreamTypes(unittest.TestCase): + def setUp(self): + super().setUp() + self.model = { + 'metadata': {'protocol': 'rest-xml', 'endpointPrefix': 'foo'}, + 'documentation': '', + 'operations': { + 'OperationName': { + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'name': 'OperationName', + 'input': {'shape': 'OperationRequest'}, + 'output': {'shape': 'OperationResponse'}, + } + }, + 'shapes': { + 'NormalStructure': { + 'type': 'structure', + 'members': {'Input': {'shape': 'StringType'}}, + }, + 'OperationRequest': { + 'type': 'structure', + 'members': { + 'String': {'shape': 'StringType'}, + "Body": {'shape': 'EventStreamStructure'}, + }, + 'payload': 'Body', + }, + 'OperationResponse': { + 'type': 'structure', + 'members': { + 'String': {'shape': 'StringType'}, + "Body": {'shape': 'EventStreamStructure'}, + }, + 'payload': 'Body', + }, + 'StringType': {'type': 'string'}, + 'BlobType': {'type': 'blob'}, + 'EventStreamStructure': { + 'eventstream': True, + 'type': 'structure', + 'members': { + 'EventA': {'shape': 'EventAStructure'}, + 'EventB': {'shape': 'EventBStructure'}, + }, + }, + 'EventAStructure': { + 'event': True, + 'type': 'structure', + 'members': { + 'Payload': {'shape': 'BlobType', 'eventpayload': True}, + 'Header': {'shape': 'StringType', 'eventheader': True}, + }, + }, + 'EventBStructure': { + 'event': True, + 'type': 'structure', + 'members': {'Records': {'shape': 'StringType'}}, + }, + }, + } + + def update_operation(self, **kwargs): + operation = self.model['operations']['OperationName'] + operation.update(kwargs) + + def test_event_stream_input_for_operation(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertTrue(operation.has_event_stream_input) + event_stream_input = operation.get_event_stream_input() + self.assertEqual(event_stream_input.name, 'EventStreamStructure') + + def test_no_event_stream_input_for_operation(self): + self.update_operation(input={'shape': 'NormalStructure'}) + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertFalse(operation.has_event_stream_input) + self.assertEqual(operation.get_event_stream_input(), None) + + def test_event_stream_output_for_operation(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertTrue(operation.has_event_stream_output) + output = operation.get_event_stream_output() + self.assertEqual(output.name, 'EventStreamStructure') + + def test_no_event_stream_output_for_operation(self): + self.update_operation(output={'shape': 'NormalStructure'}) + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertFalse(operation.has_event_stream_output) + self.assertEqual(operation.get_event_stream_output(), None) + + def test_no_output_shape(self): + self.update_operation(output=None) + del self.model['operations']['OperationName']['output'] + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertFalse(operation.has_event_stream_output) + self.assertEqual(operation.get_event_stream_output(), None) + + +class TestOperationModelStreamingTypes(unittest.TestCase): + def setUp(self): + super().setUp() + self.model = { + 'metadata': {'protocol': 'query', 'endpointPrefix': 'foo'}, + 'documentation': '', + 'operations': { + 'OperationName': { + 'name': 'OperationName', + 'input': { + 'shape': 'OperationRequest', + }, + 'output': { + 'shape': 'OperationResponse', + }, + } + }, + 'shapes': { + 'OperationRequest': { + 'type': 'structure', + 'members': { + 'String': { + 'shape': 'stringType', + }, + "Body": { + 'shape': 'blobType', + }, + }, + 'payload': 'Body', + }, + 'OperationResponse': { + 'type': 'structure', + 'members': { + 'String': { + 'shape': 'stringType', + }, + "Body": { + 'shape': 'blobType', + }, + }, + 'payload': 'Body', + }, + 'stringType': { + 'type': 'string', + }, + 'blobType': {'type': 'blob'}, + }, + } + + def remove_payload(self, type): + self.model['shapes']['Operation' + type].pop('payload') + + def test_streaming_input_for_operation(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertTrue(operation.has_streaming_input) + self.assertEqual(operation.get_streaming_input().name, 'blobType') + + def test_not_streaming_input_for_operation(self): + self.remove_payload('Request') + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertFalse(operation.has_streaming_input) + self.assertEqual(operation.get_streaming_input(), None) + + def test_streaming_output_for_operation(self): + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertTrue(operation.has_streaming_output) + self.assertEqual(operation.get_streaming_output().name, 'blobType') + + def test_not_streaming_output_for_operation(self): + self.remove_payload('Response') + service_model = model.ServiceModel(self.model) + operation = service_model.operation_model('OperationName') + self.assertFalse(operation.has_streaming_output) + self.assertEqual(operation.get_streaming_output(), None) + + +class TestDeepMerge(unittest.TestCase): + def setUp(self): + self.shapes = { + 'SetQueueAttributes': { + 'type': 'structure', + 'members': { + 'MapExample': { + 'shape': 'StrToStrMap', + 'locationName': 'Attribute', + }, + }, + }, + 'SetQueueAttributes2': { + 'type': 'structure', + 'members': { + 'MapExample': { + 'shape': 'StrToStrMap', + 'locationName': 'Attribute2', + }, + }, + }, + 'StrToStrMap': { + 'type': 'map', + 'key': {'shape': 'StringType', 'locationName': 'Name'}, + 'value': {'shape': 'StringType', 'locationName': 'Value'}, + 'flattened': True, + 'name': 'NotAttribute', + }, + 'StringType': {'type': 'string'}, + } + self.shape_resolver = model.ShapeResolver(self.shapes) + + def test_deep_merge(self): + shape = self.shape_resolver.get_shape_by_name('SetQueueAttributes') + map_merged = shape.members['MapExample'] + # map_merged has a serialization as a member trait as well as + # in the StrToStrMap. + # The member trait should have precedence. + self.assertEqual( + map_merged.serialization, + # member beats the definition. + { + 'name': 'Attribute', + # From the definition. + 'flattened': True, + }, + ) + # Ensure we don't merge/mutate the original dicts. + self.assertEqual(map_merged.key.serialization['name'], 'Name') + self.assertEqual(map_merged.value.serialization['name'], 'Value') + self.assertEqual(map_merged.key.serialization['name'], 'Name') + + def test_merges_copy_dict(self): + shape = self.shape_resolver.get_shape_by_name('SetQueueAttributes') + map_merged = shape.members['MapExample'] + self.assertEqual(map_merged.serialization.get('name'), 'Attribute') + + shape2 = self.shape_resolver.get_shape_by_name('SetQueueAttributes2') + map_merged2 = shape2.members['MapExample'] + self.assertEqual(map_merged2.serialization.get('name'), 'Attribute2') + + +class TestShapeResolver(unittest.TestCase): + def test_get_shape_by_name(self): + shape_map = { + 'Foo': { + 'type': 'structure', + 'members': { + 'Bar': {'shape': 'StringType'}, + 'Baz': {'shape': 'StringType'}, + }, + }, + "StringType": {"type": "string"}, + } + resolver = model.ShapeResolver(shape_map) + shape = resolver.get_shape_by_name('Foo') + self.assertEqual(shape.name, 'Foo') + self.assertEqual(shape.type_name, 'structure') + + def test_resolve_shape_reference(self): + shape_map = { + 'Foo': { + 'type': 'structure', + 'members': { + 'Bar': {'shape': 'StringType'}, + 'Baz': {'shape': 'StringType'}, + }, + }, + "StringType": {"type": "string"}, + } + resolver = model.ShapeResolver(shape_map) + shape = resolver.resolve_shape_ref({'shape': 'StringType'}) + self.assertEqual(shape.name, 'StringType') + self.assertEqual(shape.type_name, 'string') + + def test_resolve_shape_references_with_member_traits(self): + shape_map = { + 'Foo': { + 'type': 'structure', + 'members': { + 'Bar': {'shape': 'StringType'}, + 'Baz': {'shape': 'StringType', 'locationName': 'other'}, + }, + }, + "StringType": {"type": "string"}, + } + resolver = model.ShapeResolver(shape_map) + shape = resolver.resolve_shape_ref( + {'shape': 'StringType', 'locationName': 'other'} + ) + self.assertEqual(shape.serialization['name'], 'other') + self.assertEqual(shape.name, 'StringType') + + def test_serialization_cache(self): + shape_map = { + 'Foo': { + 'type': 'structure', + 'members': { + 'Baz': {'shape': 'StringType', 'locationName': 'other'}, + }, + }, + "StringType": {"type": "string"}, + } + resolver = model.ShapeResolver(shape_map) + shape = resolver.resolve_shape_ref( + {'shape': 'StringType', 'locationName': 'other'} + ) + self.assertEqual(shape.serialization['name'], 'other') + # serialization is computed on demand, and a cache is kept. + # This is just verifying that trying to access serialization again + # gives the same result. We don't actually care that it's cached, + # we just care that the cache doesn't mess with correctness. + self.assertEqual(shape.serialization['name'], 'other') + + def test_shape_overrides(self): + shape_map = { + "StringType": { + "type": "string", + "documentation": "Original documentation", + } + } + resolver = model.ShapeResolver(shape_map) + shape = resolver.get_shape_by_name('StringType') + self.assertEqual(shape.documentation, 'Original documentation') + + shape = resolver.resolve_shape_ref( + {'shape': 'StringType', 'documentation': 'override'} + ) + self.assertEqual(shape.documentation, 'override') + + def test_shape_type_structure(self): + shapes = { + 'ChangePasswordRequest': { + 'type': 'structure', + 'members': { + 'OldPassword': {'shape': 'passwordType'}, + 'NewPassword': {'shape': 'passwordType'}, + }, + }, + 'passwordType': { + "type": "string", + }, + } + resolver = model.ShapeResolver(shapes) + shape = resolver.get_shape_by_name('ChangePasswordRequest') + self.assertEqual(shape.type_name, 'structure') + self.assertEqual(shape.name, 'ChangePasswordRequest') + self.assertEqual( + list(sorted(shape.members)), ['NewPassword', 'OldPassword'] + ) + self.assertEqual(shape.members['OldPassword'].name, 'passwordType') + self.assertEqual(shape.members['OldPassword'].type_name, 'string') + self.assertEqual(shape.error_code, None) + + def test_exception_error_code(self): + shapes = { + 'FooException': { + 'exception': True, + 'type': 'structure', + 'members': {}, + } + } + # Test without explicit error code + resolver = model.ShapeResolver(shapes) + shape = resolver.get_shape_by_name('FooException') + self.assertTrue(shape.metadata['exception']) + self.assertEqual(shape.error_code, 'FooException') + # Test with explicit error code + shapes['FooException']['error'] = {'code': 'ExceptionCode'} + resolver = model.ShapeResolver(shapes) + shape = resolver.get_shape_by_name('FooException') + self.assertTrue(shape.metadata['exception']) + self.assertEqual(shape.error_code, 'ExceptionCode') + + def test_shape_metadata(self): + shapes = { + 'ChangePasswordRequest': { + 'type': 'structure', + 'required': ['OldPassword', 'NewPassword'], + 'members': { + 'OldPassword': {'shape': 'passwordType'}, + 'NewPassword': {'shape': 'passwordType'}, + }, + }, + 'passwordType': { + "type": "string", + "min": 1, + "max": 128, + "pattern": ".*", + "sensitive": True, + }, + } + resolver = model.ShapeResolver(shapes) + shape = resolver.get_shape_by_name('ChangePasswordRequest') + self.assertEqual( + shape.metadata['required'], ['OldPassword', 'NewPassword'] + ) + member = shape.members['OldPassword'] + self.assertEqual(member.metadata['min'], 1) + self.assertEqual(member.metadata['max'], 128) + self.assertEqual(member.metadata['pattern'], '.*') + self.assertEqual(member.metadata['sensitive'], True) + + def test_error_shape_metadata(self): + shapes = { + 'ResourceNotFoundException': { + 'type': 'structure', + 'members': { + 'message': { + 'shape': 'ErrorMessage', + } + }, + 'exception': True, + 'retryable': {'throttling': True}, + } + } + resolver = model.ShapeResolver(shapes) + shape = resolver.get_shape_by_name('ResourceNotFoundException') + self.assertEqual( + shape.metadata, + {'exception': True, 'retryable': {'throttling': True}}, + ) + + def test_shape_list(self): + shapes = { + 'mfaDeviceListType': { + "type": "list", + "member": {"shape": "MFADevice"}, + }, + 'MFADevice': { + 'type': 'structure', + 'members': {'UserName': {'shape': 'userNameType'}}, + }, + 'userNameType': {'type': 'string'}, + } + resolver = model.ShapeResolver(shapes) + shape = resolver.get_shape_by_name('mfaDeviceListType') + self.assertEqual(shape.member.type_name, 'structure') + self.assertEqual(shape.member.name, 'MFADevice') + self.assertEqual(list(shape.member.members), ['UserName']) + + def test_shape_does_not_exist(self): + resolver = model.ShapeResolver({}) + with self.assertRaises(model.NoShapeFoundError): + resolver.get_shape_by_name('NoExistShape') + + def test_missing_type_key(self): + shapes = {'UnknownType': {'NotTheTypeKey': 'someUnknownType'}} + resolver = model.ShapeResolver(shapes) + with self.assertRaises(model.InvalidShapeError): + resolver.get_shape_by_name('UnknownType') + + def test_bad_shape_ref(self): + # This is an example of a denormalized model, + # which should raise an exception. + shapes = { + 'Struct': { + 'type': 'structure', + 'members': { + 'A': {'type': 'string'}, + 'B': {'type': 'string'}, + }, + } + } + resolver = model.ShapeResolver(shapes) + with self.assertRaises(model.InvalidShapeReferenceError): + struct = resolver.get_shape_by_name('Struct') + # Resolving the members will fail because + # the 'A' and 'B' members are not shape refs. + struct.members + + def test_shape_name_in_repr(self): + shapes = { + 'StringType': { + 'type': 'string', + } + } + resolver = model.ShapeResolver(shapes) + self.assertIn( + 'StringType', repr(resolver.get_shape_by_name('StringType')) + ) + + +class TestBuilders(unittest.TestCase): + def test_structure_shape_builder_with_scalar_types(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': {'type': 'string'}, + 'B': {'type': 'integer'}, + } + ).build_model() + self.assertIsInstance(shape, model.StructureShape) + self.assertEqual(sorted(list(shape.members)), ['A', 'B']) + self.assertEqual(shape.members['A'].type_name, 'string') + self.assertEqual(shape.members['B'].type_name, 'integer') + + def test_structure_shape_with_structure_type(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': { + 'type': 'structure', + 'members': { + 'A-1': {'type': 'string'}, + }, + }, + } + ).build_model() + self.assertIsInstance(shape, model.StructureShape) + self.assertEqual(list(shape.members), ['A']) + self.assertEqual(shape.members['A'].type_name, 'structure') + self.assertEqual(list(shape.members['A'].members), ['A-1']) + + def test_structure_shape_with_list(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': {'type': 'list', 'member': {'type': 'string'}}, + } + ).build_model() + self.assertIsInstance(shape.members['A'], model.ListShape) + self.assertEqual(shape.members['A'].member.type_name, 'string') + + def test_structure_shape_with_map_type(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': { + 'type': 'map', + 'key': {'type': 'string'}, + 'value': {'type': 'string'}, + } + } + ).build_model() + self.assertIsInstance(shape.members['A'], model.MapShape) + map_shape = shape.members['A'] + self.assertEqual(map_shape.key.type_name, 'string') + self.assertEqual(map_shape.value.type_name, 'string') + + def test_nested_structure(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': { + 'type': 'structure', + 'members': { + 'B': { + 'type': 'structure', + 'members': { + 'C': { + 'type': 'string', + } + }, + } + }, + } + } + ).build_model() + self.assertEqual( + shape.members['A'].members['B'].members['C'].type_name, 'string' + ) + + def test_enum_values_on_string_used(self): + b = model.DenormalizedStructureBuilder() + enum_values = ['foo', 'bar', 'baz'] + shape = b.with_members( + { + 'A': { + 'type': 'string', + 'enum': enum_values, + }, + } + ).build_model() + self.assertIsInstance(shape, model.StructureShape) + string_shape = shape.members['A'] + self.assertIsInstance(string_shape, model.StringShape) + self.assertEqual(string_shape.metadata['enum'], enum_values) + self.assertEqual(string_shape.enum, enum_values) + + def test_documentation_on_shape_used(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': { + 'type': 'string', + 'documentation': 'MyDocs', + }, + } + ).build_model() + self.assertEqual(shape.members['A'].documentation, 'MyDocs') + + def test_min_max_used_in_metadata(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': { + 'type': 'string', + 'documentation': 'MyDocs', + 'min': 2, + 'max': 3, + }, + } + ).build_model() + metadata = shape.members['A'].metadata + self.assertEqual(metadata.get('min'), 2) + self.assertEqual(metadata.get('max'), 3) + + def test_use_shape_name_when_provided(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + { + 'A': { + 'type': 'string', + 'shape_name': 'MyStringShape', + }, + } + ).build_model() + self.assertEqual(shape.members['A'].name, 'MyStringShape') + + def test_unknown_shape_type(self): + b = model.DenormalizedStructureBuilder() + with self.assertRaises(model.InvalidShapeError): + b.with_members( + { + 'A': { + 'type': 'brand-new-shape-type', + }, + } + ).build_model() + + def test_ordered_shape_builder(self): + b = model.DenormalizedStructureBuilder() + shape = b.with_members( + OrderedDict( + [ + ('A', {'type': 'string'}), + ( + 'B', + { + 'type': 'structure', + 'members': OrderedDict( + [ + ('C', {'type': 'string'}), + ('D', {'type': 'string'}), + ] + ), + }, + ), + ] + ) + ).build_model() + + # Members should be in order + self.assertEqual(['A', 'B'], list(shape.members.keys())) + + # Nested structure members should *also* stay ordered + self.assertEqual(['C', 'D'], list(shape.members['B'].members.keys())) + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/boto__botocore/tests/unit/test_monitoring.py b/testbed/boto__botocore/tests/unit/test_monitoring.py new file mode 100644 index 0000000000000000000000000000000000000000..7efea5babab4eabec6f2e94c24d7ecace21fb3bc --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_monitoring.py @@ -0,0 +1,992 @@ +# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import json +import re +import socket +import time + +from botocore.awsrequest import AWSRequest +from botocore.exceptions import ConnectionError +from botocore.hooks import HierarchicalEmitter +from botocore.model import OperationModel, ServiceModel +from botocore.monitoring import ( + APICallAttemptEvent, + APICallEvent, + BaseMonitorEvent, + CSMSerializer, + Monitor, + MonitorEventAdapter, + SocketPublisher, +) +from tests import mock, unittest + + +class PublishingException(Exception): + pass + + +class TestMonitor(unittest.TestCase): + def setUp(self): + self.adapter = mock.Mock(MonitorEventAdapter) + self.publisher = mock.Mock(SocketPublisher) + self.handler = Monitor(self.adapter, self.publisher) + + def test_register(self): + event_emitter = mock.Mock(HierarchicalEmitter) + self.handler.register(event_emitter) + self.assertEqual( + event_emitter.register_last.call_args_list, + [ + mock.call('before-parameter-build', self.handler.capture), + mock.call('request-created', self.handler.capture), + mock.call('response-received', self.handler.capture), + mock.call('after-call', self.handler.capture), + mock.call('after-call-error', self.handler.capture), + ], + ) + + def test_handle(self): + event = object() + self.adapter.feed.return_value = event + self.handler.capture('event-name', event_parameter='event-value') + self.adapter.feed.assert_called_with( + 'event-name', {'event_parameter': 'event-value'} + ) + self.publisher.publish.assert_called_with(event) + + def test_handle_no_publish(self): + self.adapter.feed.return_value = None + self.handler.capture('event-name', event_parameter='event-value') + self.publisher.publish.assert_not_called() + + def test_handle_catches_exceptions(self): + self.publisher.publish.side_effect = PublishingException() + try: + self.handler.capture('event-name', event_parameter='event-value') + except PublishingException: + self.fail( + 'The publishing exception should have been caught ' + 'in the handler' + ) + + +class TestMonitorEventAdapter(unittest.TestCase): + def setUp(self): + self.mock_time = mock.Mock(time.time) + self.mock_time.return_value = 0 + self.adapter = MonitorEventAdapter(self.mock_time) + + self.context = {} + self.wire_name = 'MyOperation' + self.operation_model = mock.Mock(OperationModel) + self.operation_model.wire_name = self.wire_name + self.service_id = 'MyService' + self.service_model = mock.Mock(ServiceModel) + self.service_model.service_id = self.service_id + self.operation_model.service_model = self.service_model + + self.url = 'https://us-east-1.myservice.amazonaws.com' + self.request_headers = {} + self.request = mock.Mock(AWSRequest) + self.request.url = self.url + self.request.headers = self.request_headers + self.request.context = self.context + + self.http_status_code = 200 + self.response_headers = {} + + def feed_before_parameter_build_event(self, current_time=0): + self.mock_time.return_value = current_time + self.adapter.feed( + 'before-parameter-build', + {'model': self.operation_model, 'context': self.context}, + ) + + def feed_request_created_event(self, current_time=0): + self.mock_time.return_value = current_time + self.adapter.feed( + 'request-created', + { + 'request': self.request, + }, + ) + + def test_feed_before_parameter_build_returns_no_event(self): + self.assertIsNone( + self.adapter.feed( + 'before-parameter-build', + {'model': self.operation_model, 'context': self.context}, + ) + ) + + def test_feed_request_created_returns_no_event(self): + self.adapter.feed( + 'before-parameter-build', + {'model': self.operation_model, 'context': self.context}, + ) + self.assertIsNone( + self.adapter.feed( + 'request-created', + { + 'request': self.request, + }, + ) + ) + + def test_feed_with_successful_response(self): + self.feed_before_parameter_build_event(current_time=1) + self.feed_request_created_event(current_time=2) + + self.mock_time.return_value = 3 + attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': { + 'ResponseMetadata': { + 'HTTPStatusCode': self.http_status_code, + 'HTTPHeaders': self.response_headers, + } + }, + 'context': self.context, + 'exception': None, + }, + ) + self.assertEqual( + attempt_event, + APICallAttemptEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=2000, + latency=1000, + url=self.url, + request_headers=self.request_headers, + http_status_code=self.http_status_code, + response_headers=self.response_headers, + ), + ) + + self.mock_time.return_value = 4 + call_event = self.adapter.feed( + 'after-call', + { + 'parsed': { + 'ResponseMetadata': { + 'HTTPStatusCode': self.http_status_code, + 'HTTPHeaders': self.response_headers, + } + }, + 'context': self.context, + }, + ) + self.assertEqual( + call_event, + APICallEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=1000, + latency=3000, + attempts=[attempt_event], + ), + ) + + def test_feed_with_retries(self): + self.feed_before_parameter_build_event(current_time=1) + self.feed_request_created_event(current_time=2) + + self.mock_time.return_value = 3 + first_attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': { + 'ResponseMetadata': { + 'HTTPStatusCode': 500, + 'HTTPHeaders': self.response_headers, + } + }, + 'context': self.context, + 'exception': None, + }, + ) + self.assertEqual( + first_attempt_event, + APICallAttemptEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=2000, + latency=1000, + url=self.url, + request_headers=self.request_headers, + http_status_code=500, + response_headers=self.response_headers, + ), + ) + + self.feed_request_created_event(current_time=5) + self.mock_time.return_value = 6 + second_attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': { + 'ResponseMetadata': { + 'HTTPStatusCode': 200, + 'HTTPHeaders': self.response_headers, + } + }, + 'context': self.context, + 'exception': None, + }, + ) + self.assertEqual( + second_attempt_event, + APICallAttemptEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=5000, + latency=1000, + url=self.url, + request_headers=self.request_headers, + http_status_code=200, + response_headers=self.response_headers, + ), + ) + + self.mock_time.return_value = 7 + call_event = self.adapter.feed( + 'after-call', + { + 'parsed': { + 'ResponseMetadata': { + 'HTTPStatusCode': 200, + 'HTTPHeaders': self.response_headers, + } + }, + 'context': self.context, + }, + ) + self.assertEqual( + call_event, + APICallEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=1000, + latency=6000, + attempts=[first_attempt_event, second_attempt_event], + ), + ) + + def test_feed_with_retries_exceeded(self): + self.feed_before_parameter_build_event(current_time=1) + self.feed_request_created_event(current_time=2) + + self.mock_time.return_value = 3 + first_attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': { + 'ResponseMetadata': { + 'HTTPStatusCode': 500, + 'HTTPHeaders': self.response_headers, + } + }, + 'context': self.context, + 'exception': None, + }, + ) + self.feed_request_created_event(current_time=5) + self.mock_time.return_value = 6 + second_attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': { + 'ResponseMetadata': { + 'HTTPStatusCode': 200, + 'HTTPHeaders': self.response_headers, + 'MaxAttemptsReached': True, + } + }, + 'context': self.context, + 'exception': None, + }, + ) + self.mock_time.return_value = 7 + call_event = self.adapter.feed( + 'after-call', + { + 'parsed': { + 'ResponseMetadata': { + 'HTTPStatusCode': 200, + 'HTTPHeaders': self.response_headers, + 'MaxAttemptsReached': True, + } + }, + 'context': self.context, + }, + ) + self.assertEqual( + call_event, + APICallEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=1000, + latency=6000, + attempts=[first_attempt_event, second_attempt_event], + retries_exceeded=True, + ), + ) + + def test_feed_with_parsed_error(self): + self.feed_before_parameter_build_event(current_time=1) + self.feed_request_created_event(current_time=2) + + self.mock_time.return_value = 3 + parsed_error = {'Code': 'MyErrorCode', 'Message': 'MyMessage'} + parsed_response = { + 'Error': parsed_error, + 'ResponseMetadata': { + 'HTTPStatusCode': 400, + 'HTTPHeaders': self.response_headers, + }, + } + attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': parsed_response, + 'context': self.context, + 'exception': None, + }, + ) + self.assertEqual( + attempt_event, + APICallAttemptEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=2000, + latency=1000, + url=self.url, + request_headers=self.request_headers, + http_status_code=400, + response_headers=self.response_headers, + parsed_error=parsed_error, + ), + ) + + self.mock_time.return_value = 4 + call_event = self.adapter.feed( + 'after-call', {'parsed': parsed_response, 'context': self.context} + ) + self.assertEqual( + call_event, + APICallEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=1000, + latency=3000, + attempts=[attempt_event], + ), + ) + + def test_feed_with_wire_exception(self): + self.feed_before_parameter_build_event(current_time=1) + self.feed_request_created_event(current_time=2) + + self.mock_time.return_value = 3 + wire_exception = Exception('Some wire exception') + attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': None, + 'context': self.context, + 'exception': wire_exception, + }, + ) + self.assertEqual( + attempt_event, + APICallAttemptEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=2000, + latency=1000, + url=self.url, + request_headers=self.request_headers, + wire_exception=wire_exception, + ), + ) + + self.mock_time.return_value = 4 + call_event = self.adapter.feed( + 'after-call-error', + {'exception': wire_exception, 'context': self.context}, + ) + self.assertEqual( + call_event, + APICallEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=1000, + latency=3000, + attempts=[attempt_event], + ), + ) + + def test_feed_with_wire_exception_retries_exceeded(self): + self.feed_before_parameter_build_event(current_time=1) + self.feed_request_created_event(current_time=2) + + self.mock_time.return_value = 3 + # Connection errors are retryable + wire_exception = ConnectionError(error='connection issue') + attempt_event = self.adapter.feed( + 'response-received', + { + 'parsed_response': None, + 'context': self.context, + 'exception': wire_exception, + }, + ) + self.mock_time.return_value = 4 + call_event = self.adapter.feed( + 'after-call-error', + {'exception': wire_exception, 'context': self.context}, + ) + self.assertEqual( + call_event, + APICallEvent( + service=self.service_id, + operation=self.wire_name, + timestamp=1000, + latency=3000, + attempts=[attempt_event], + retries_exceeded=True, + ), + ) + + +class TestBaseMonitorEvent(unittest.TestCase): + def test_init_self(self): + event = BaseMonitorEvent( + service='MyService', operation='MyOperation', timestamp=1000 + ) + self.assertEqual(event.service, 'MyService') + self.assertEqual(event.operation, 'MyOperation') + self.assertEqual(event.timestamp, 1000) + + def test_eq(self): + self.assertEqual( + BaseMonitorEvent( + service='MyService', operation='MyOperation', timestamp=1000 + ), + BaseMonitorEvent( + service='MyService', operation='MyOperation', timestamp=1000 + ), + ) + + def test_not_eq_different_classes(self): + self.assertNotEqual( + BaseMonitorEvent( + service='MyService', operation='MyOperation', timestamp=1000 + ), + object(), + ) + + def test_not_eq_different_attrs(self): + self.assertNotEqual( + BaseMonitorEvent( + service='MyService', operation='MyOperation', timestamp=1000 + ), + BaseMonitorEvent( + service='DifferentService', + operation='DifferentOperation', + timestamp=0, + ), + ) + + +class TestAPICallEvent(unittest.TestCase): + def test_init(self): + event = APICallEvent( + service='MyService', + operation='MyOperation', + timestamp=1000, + latency=2000, + attempts=[], + ) + self.assertEqual(event.service, 'MyService') + self.assertEqual(event.operation, 'MyOperation') + self.assertEqual(event.timestamp, 1000) + self.assertEqual(event.latency, 2000) + self.assertEqual(event.attempts, []) + + def test_new_api_call_attempt_event(self): + event = APICallEvent( + service='MyService', + operation='MyOperation', + timestamp=1000, + latency=2000, + attempts=[], + ) + attempt_event = event.new_api_call_attempt(timestamp=2000) + self.assertEqual( + attempt_event, + APICallAttemptEvent( + service='MyService', operation='MyOperation', timestamp=2000 + ), + ) + self.assertEqual(event.attempts, [attempt_event]) + + +class TestAPICallAttemptEvent(unittest.TestCase): + def test_init(self): + url = 'https://us-east-1.myservice.amazonaws.com' + parsed_error = {'Code': 'ErrorCode', 'Message': 'ErrorMessage'} + wire_exception = Exception('Some wire exception') + event = APICallAttemptEvent( + service='MyService', + operation='MyOperation', + timestamp=1000, + latency=2000, + url=url, + http_status_code=200, + request_headers={}, + response_headers={}, + parsed_error=parsed_error, + wire_exception=wire_exception, + ) + self.assertEqual(event.service, 'MyService') + self.assertEqual(event.operation, 'MyOperation') + self.assertEqual(event.timestamp, 1000) + self.assertEqual(event.latency, 2000) + self.assertEqual(event.url, url) + self.assertEqual(event.http_status_code, 200) + self.assertEqual(event.request_headers, {}) + self.assertEqual(event.response_headers, {}) + self.assertEqual(event.parsed_error, parsed_error) + self.assertEqual(event.wire_exception, wire_exception) + + +class TestCSMSerializer(unittest.TestCase): + def setUp(self): + self.csm_client_id = 'MyId' + self.serializer = CSMSerializer(self.csm_client_id) + self.service = 'MyService' + self.operation = 'MyOperation' + self.user_agent = 'my-user-agent' + self.fqdn = 'us-east-1.myservice.amazonaws.com' + self.url = 'https://' + self.fqdn + self.timestamp = 1000 + self.latency = 2000 + self.request_headers = {'User-Agent': self.user_agent} + + def get_serialized_event_dict(self, event): + serialized_event = self.serializer.serialize(event) + return json.loads(serialized_event.decode('utf-8')) + + def test_validates_csm_client_id(self): + max_client_id_len = 255 + with self.assertRaises(ValueError): + CSMSerializer('a' * (max_client_id_len + 1)) + + def test_serialize_produces_bytes(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + serialized_event = self.serializer.serialize(event) + self.assertIsInstance(serialized_event, bytes) + + def test_serialize_does_not_add_whitespace(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + serialized_event = self.serializer.serialize(event) + self.assertIsNone(re.match(r'\s', serialized_event.decode('utf-8'))) + + def test_serialize_api_call_event(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict, + { + 'Version': 1, + 'Type': 'ApiCall', + 'Service': self.service, + 'Api': self.operation, + 'ClientId': self.csm_client_id, + 'MaxRetriesExceeded': 0, + 'Timestamp': 1000, + 'AttemptCount': 0, + }, + ) + + def test_serialize_api_call_event_with_latency(self): + event = APICallEvent( + service=self.service, + operation=self.operation, + timestamp=1000, + latency=2000, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['Latency'], self.latency) + + def test_serialize_api_call_event_with_attempts(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + event.new_api_call_attempt(2000) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['AttemptCount'], 1) + + def test_serialize_api_call_event_region(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + attempt = event.new_api_call_attempt(2000) + auth_value = ( + 'AWS4-HMAC-SHA256 ' + 'Credential=myaccesskey/20180523/my-region-1/ec2/aws4_request,' + 'SignedHeaders=content-type;host;x-amz-date, ' + 'Signature=somesignature' + ) + self.request_headers['Authorization'] = auth_value + attempt.request_headers = self.request_headers + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['Region'], 'my-region-1') + + def test_serialize_api_call_event_user_agent(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + attempt = event.new_api_call_attempt(2000) + attempt.request_headers = {'User-Agent': self.user_agent} + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['UserAgent'], self.user_agent) + + def test_serialize_api_call_event_http_status_code(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + attempt = event.new_api_call_attempt(2000) + attempt.http_status_code = 200 + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['FinalHttpStatusCode'], 200) + + def test_serialize_api_call_event_parsed_error(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + attempt = event.new_api_call_attempt(2000) + attempt.parsed_error = { + 'Code': 'MyErrorCode', + 'Message': 'My error message', + } + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict['FinalAwsException'], 'MyErrorCode' + ) + self.assertEqual( + serialized_event_dict['FinalAwsExceptionMessage'], + 'My error message', + ) + + def test_serialize_api_call_event_wire_exception(self): + event = APICallEvent( + service=self.service, operation=self.operation, timestamp=1000 + ) + attempt = event.new_api_call_attempt(2000) + attempt.wire_exception = Exception('Error on the wire') + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict['FinalSdkException'], 'Exception' + ) + self.assertEqual( + serialized_event_dict['FinalSdkExceptionMessage'], + 'Error on the wire', + ) + + def test_serialize_api_call_event_with_retries_exceeded(self): + event = APICallEvent( + service=self.service, + operation=self.operation, + timestamp=1000, + retries_exceeded=True, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['MaxRetriesExceeded'], 1) + + def test_serialize_api_call_attempt_event(self): + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict, + { + 'Version': 1, + 'Type': 'ApiCallAttempt', + 'Service': self.service, + 'Api': self.operation, + 'ClientId': self.csm_client_id, + 'Timestamp': self.timestamp, + }, + ) + + def test_serialize_api_call_attempt_event_with_latency(self): + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + latency=self.latency, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['AttemptLatency'], self.latency) + + def test_serialize_with_user_agent(self): + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + request_headers={'User-Agent': self.user_agent}, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['UserAgent'], self.user_agent) + + def test_serialize_with_url(self): + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + url=self.url, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['Fqdn'], self.fqdn) + + def test_serialize_with_s3_signing(self): + auth_value = 'AWS myaccesskey:somesignature' + self.request_headers['Authorization'] = auth_value + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + request_headers=self.request_headers, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['AccessKey'], 'myaccesskey') + + def test_serialize_with_sigv4_sigining(self): + auth_value = ( + 'AWS4-HMAC-SHA256 ' + 'Credential=myaccesskey/20180523/my-region-1/ec2/aws4_request,' + 'SignedHeaders=content-type;host;x-amz-date, ' + 'Signature=somesignature' + ) + self.request_headers['Authorization'] = auth_value + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + request_headers=self.request_headers, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['AccessKey'], 'myaccesskey') + + def test_serialize_with_session_token(self): + self.request_headers['X-Amz-Security-Token'] = 'my-security-token' + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + request_headers=self.request_headers, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict['SessionToken'], 'my-security-token' + ) + + def test_serialize_with_path_parameters_in_url(self): + self.url = 'https://' + self.fqdn + '/resource' + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + url=self.url, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['Fqdn'], self.fqdn) + + def test_serialize_with_request_id_headers(self): + response_headers = { + 'x-amzn-requestid': 'id1', + 'x-amz-request-id': 'id2', + 'x-amz-id-2': 'id3', + } + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + response_headers=response_headers, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['XAmznRequestId'], 'id1') + self.assertEqual(serialized_event_dict['XAmzRequestId'], 'id2') + self.assertEqual(serialized_event_dict['XAmzId2'], 'id3') + + def test_serialize_filters_unwanted_response_headers(self): + response_headers = {'filter-out': 'do-not-include-this'} + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + response_headers=response_headers, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict, + { + 'Version': 1, + 'Type': 'ApiCallAttempt', + 'Service': self.service, + 'Api': self.operation, + 'ClientId': self.csm_client_id, + 'Timestamp': self.timestamp, + }, + ) + + def test_serialize_with_status_code(self): + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + http_status_code=200, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['HttpStatusCode'], 200) + + def test_serialize_with_service_error(self): + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + parsed_error={ + 'Code': 'MyErrorCode', + 'Message': 'My error message', + }, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['AwsException'], 'MyErrorCode') + self.assertEqual( + serialized_event_dict['AwsExceptionMessage'], 'My error message' + ) + + def test_serialize_with_wire_exception(self): + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + wire_exception=Exception('Error on the wire'), + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual(serialized_event_dict['SdkException'], 'Exception') + self.assertEqual( + serialized_event_dict['SdkExceptionMessage'], 'Error on the wire' + ) + + def test_serialize_truncates_long_user_agent(self): + max_user_agent_length = 256 + user_agent = 'a' * (max_user_agent_length + 1) + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + request_headers={'User-Agent': user_agent}, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict['UserAgent'], + user_agent[:max_user_agent_length], + ) + + def test_serialize_truncates_long_service_error(self): + max_error_code_length = 128 + max_error_message_length = 512 + long_error_code = 'c' * (max_error_code_length + 1) + long_error_message = 'm' * (max_error_message_length + 1) + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + parsed_error={ + 'Code': long_error_code, + 'Message': long_error_message, + }, + ) + serialized_event_dict = self.get_serialized_event_dict(event) + self.assertEqual( + serialized_event_dict['AwsException'], + long_error_code[:max_error_code_length], + ) + self.assertEqual( + serialized_event_dict['AwsExceptionMessage'], + long_error_message[:max_error_message_length], + ) + + def test_serialize_truncates_long_wire_exception(self): + max_class_name_length = 128 + max_error_message_length = 512 + long_class_name = 'W' * (max_class_name_length + 1) + wire_class = type(long_class_name, (Exception,), {}) + long_error_message = 'm' * (max_error_message_length + 1) + event = APICallAttemptEvent( + service=self.service, + operation=self.operation, + timestamp=self.timestamp, + wire_exception=wire_class(long_error_message), + ) + serialized_event_dict = self.get_serialized_event_dict(event) + + self.assertEqual( + serialized_event_dict['SdkException'], + long_class_name[:max_class_name_length], + ) + self.assertEqual( + serialized_event_dict['SdkExceptionMessage'], + long_error_message[:max_error_message_length], + ) + + +class TestSocketPublisher(unittest.TestCase): + def setUp(self): + self.socket = mock.Mock(socket.socket) + self.host = '127.0.0.1' + self.port = 31000 + self.serializer = mock.Mock(CSMSerializer) + self.publisher = SocketPublisher( + self.socket, self.host, self.port, self.serializer + ) + + def test_publish(self): + event = object() + self.serializer.serialize.return_value = b'serialized event' + self.publisher.publish(event) + self.serializer.serialize.assert_called_with(event) + self.socket.sendto.assert_called_with( + b'serialized event', (self.host, self.port) + ) + + def test_skips_publishing_over_max_size(self): + event = mock.Mock(APICallAttemptEvent) + max_event_size = 8 * 1024 + self.serializer.serialize.return_value = b'a' * (max_event_size + 1) + self.publisher.publish(event) + self.socket.sendto.assert_not_called() diff --git a/testbed/boto__botocore/tests/unit/test_paginate.py b/testbed/boto__botocore/tests/unit/test_paginate.py new file mode 100644 index 0000000000000000000000000000000000000000..b0271386aec72d3c5688fcb6e259473652848d83 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_paginate.py @@ -0,0 +1,1624 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +from botocore import model +from botocore.exceptions import PaginationError +from botocore.paginate import ( + Paginator, + PaginatorModel, + TokenDecoder, + TokenEncoder, +) +from tests import mock, unittest + + +def encode_token(token): + return TokenEncoder().encode(token) + + +class TestTokenDecoder(unittest.TestCase): + def setUp(self): + self.decoder = TokenDecoder() + + def test_decode(self): + token = 'eyJmb28iOiAiYmFyIn0=' + expected = {'foo': 'bar'} + self.assertEqual(self.decoder.decode(token), expected) + + def test_decode_with_bytes(self): + token = ( + 'eyJib3RvX2VuY29kZWRfa2V5cyI6IFtbImZvbyJdXSwgImZvbyI6ICJZbUZ5In0=' + ) + expected = {'foo': b'bar'} + self.assertEqual(self.decoder.decode(token), expected) + + def test_decode_with_nested_bytes(self): + token = ( + 'eyJmb28iOiB7ImJhciI6ICJZbUY2In0sICJib3RvX2VuY29kZWRfa2V5cyI6' + 'IFtbImZvbyIsICJiYXIiXV19' + ) + expected = {'foo': {'bar': b'baz'}} + self.assertEqual(self.decoder.decode(token), expected) + + def test_decode_with_listed_bytes(self): + token = ( + 'eyJib3RvX2VuY29kZWRfa2V5cyI6IFtbImZvbyIsICJiYXIiLCAxXV0sICJmb28i' + 'OiB7ImJhciI6IFsiYmF6IiwgIlltbHUiXX19' + ) + expected = {'foo': {'bar': ['baz', b'bin']}} + self.assertEqual(self.decoder.decode(token), expected) + + def test_decode_with_multiple_bytes_values(self): + token = ( + 'eyJib3RvX2VuY29kZWRfa2V5cyI6IFtbImZvbyIsICJiaW4iXSwgWyJmb28iLCAi' + 'YmFyIl1dLCAiZm9vIjogeyJiaW4iOiAiWW1GdCIsICJiYXIiOiAiWW1GNiJ9fQ==' + ) + expected = {'foo': {'bar': b'baz', 'bin': b'bam'}} + self.assertEqual(self.decoder.decode(token), expected) + + +class TestPaginatorModel(unittest.TestCase): + def setUp(self): + self.paginator_config = {} + self.paginator_config['pagination'] = { + 'ListFoos': { + 'output_token': 'NextToken', + 'input_token': 'NextToken', + 'result_key': 'Foo', + } + } + self.paginator_model = PaginatorModel(self.paginator_config) + + def test_get_paginator(self): + paginator_config = self.paginator_model.get_paginator('ListFoos') + self.assertEqual( + paginator_config, + { + 'output_token': 'NextToken', + 'input_token': 'NextToken', + 'result_key': 'Foo', + }, + ) + + def test_get_paginator_no_exists(self): + with self.assertRaises(ValueError): + self.paginator_model.get_paginator('ListBars') + + +class TestPagination(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + self.paginate_config = { + 'output_token': 'NextToken', + 'input_token': 'NextToken', + 'result_key': 'Foo', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_result_key_available(self): + self.assertEqual( + [rk.expression for rk in self.paginator.result_keys], ['Foo'] + ) + + def test_no_next_token(self): + response = {'not_the_next_token': 'foobar'} + self.method.return_value = response + actual = list(self.paginator.paginate()) + self.assertEqual(actual, [{'not_the_next_token': 'foobar'}]) + + def test_next_token_in_response(self): + responses = [ + {'NextToken': 'token1'}, + {'NextToken': 'token2'}, + {'not_next_token': 'foo'}, + ] + self.method.side_effect = responses + actual = list(self.paginator.paginate()) + self.assertEqual(actual, responses) + # The first call has no next token, the second and third call should + # have 'token1' and 'token2' respectively. + self.assertEqual( + self.method.call_args_list, + [ + mock.call(), + mock.call(NextToken='token1'), + mock.call(NextToken='token2'), + ], + ) + + def test_next_token_is_string(self): + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": "Users", + "limit_key": "MaxKeys", + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + result = self.paginator.paginate(PaginationConfig={'MaxItems': 1}) + result = result.build_full_result() + token = result.get('NextToken') + self.assertIsInstance(token, (str,)) + + def test_any_passed_in_args_are_unmodified(self): + responses = [ + {'NextToken': 'token1'}, + {'NextToken': 'token2'}, + {'not_next_token': 'foo'}, + ] + self.method.side_effect = responses + actual = list(self.paginator.paginate(Foo='foo', Bar='bar')) + self.assertEqual(actual, responses) + self.assertEqual( + self.method.call_args_list, + [ + mock.call(Foo='foo', Bar='bar'), + mock.call(Foo='foo', Bar='bar', NextToken='token1'), + mock.call(Foo='foo', Bar='bar', NextToken='token2'), + ], + ) + + def test_exception_raised_if_same_next_token(self): + responses = [ + {'NextToken': 'token1'}, + {'NextToken': 'token2'}, + {'NextToken': 'token2'}, + ] + self.method.side_effect = responses + with self.assertRaises(PaginationError): + list(self.paginator.paginate()) + + def test_next_token_with_or_expression(self): + self.pagination_config = { + 'output_token': 'NextToken || NextToken2', + 'input_token': 'NextToken', + 'result_key': 'Foo', + } + self.paginator = Paginator( + self.method, self.pagination_config, self.model + ) + # Verify that despite varying between NextToken and NextToken2 + # we still can extract the right next tokens. + responses = [ + {'NextToken': 'token1'}, + {'NextToken2': 'token2'}, + # The first match found wins, so because NextToken is + # listed before NextToken2 in the 'output_tokens' config, + # 'token3' is chosen over 'token4'. + {'NextToken': 'token3', 'NextToken2': 'token4'}, + {'not_next_token': 'foo'}, + ] + self.method.side_effect = responses + list(self.paginator.paginate()) + self.assertEqual( + self.method.call_args_list, + [ + mock.call(), + mock.call(NextToken='token1'), + mock.call(NextToken='token2'), + mock.call(NextToken='token3'), + ], + ) + + def test_more_tokens(self): + # Some pagination configs have a 'more_token' key that + # indicate whether or not the results are being paginated. + self.paginate_config = { + 'more_results': 'IsTruncated', + 'output_token': 'NextToken', + 'input_token': 'NextToken', + 'result_key': 'Foo', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + responses = [ + {'Foo': [1], 'IsTruncated': True, 'NextToken': 'token1'}, + {'Foo': [2], 'IsTruncated': True, 'NextToken': 'token2'}, + {'Foo': [3], 'IsTruncated': False, 'NextToken': 'token3'}, + {'Foo': [4], 'not_next_token': 'foo'}, + ] + self.method.side_effect = responses + list(self.paginator.paginate()) + self.assertEqual( + self.method.call_args_list, + [ + mock.call(), + mock.call(NextToken='token1'), + mock.call(NextToken='token2'), + ], + ) + + def test_more_tokens_is_path_expression(self): + self.paginate_config = { + 'more_results': 'Foo.IsTruncated', + 'output_token': 'NextToken', + 'input_token': 'NextToken', + 'result_key': 'Bar', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + responses = [ + {'Foo': {'IsTruncated': True}, 'NextToken': 'token1'}, + {'Foo': {'IsTruncated': False}, 'NextToken': 'token2'}, + ] + self.method.side_effect = responses + list(self.paginator.paginate()) + self.assertEqual( + self.method.call_args_list, + [mock.call(), mock.call(NextToken='token1')], + ) + + def test_page_size(self): + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": "Users", + "limit_key": "MaxKeys", + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + users = [] + for page in self.paginator.paginate(PaginationConfig={'PageSize': 1}): + users += page['Users'] + self.assertEqual( + self.method.call_args_list, + [ + mock.call(MaxKeys=1), + mock.call(Marker='m1', MaxKeys=1), + mock.call(Marker='m2', MaxKeys=1), + ], + ) + + def test_with_empty_markers(self): + responses = [ + {"Users": ["User1"], "Marker": ""}, + {"Users": ["User1"], "Marker": ""}, + {"Users": ["User1"], "Marker": ""}, + ] + self.method.side_effect = responses + users = [] + for page in self.paginator.paginate(): + users += page['Users'] + # We want to stop paginating if the next token is empty. + self.assertEqual(self.method.call_args_list, [mock.call()]) + self.assertEqual(users, ['User1']) + + def test_build_full_result_with_single_key(self): + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": "Users", + "limit_key": "MaxKeys", + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate() + complete = pages.build_full_result() + self.assertEqual(complete, {'Users': ['User1', 'User2', 'User3']}) + + def test_build_multiple_results(self): + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": "Users", + "limit_key": "MaxKeys", + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + max_items = 3 + page_size = 2 + + responses = [ + {"Users": ["User1", "User2"], "Marker": "m1"}, + {"Users": ["User3", "User4"], "Marker": "m2"}, + {"Users": ["User3", "User4"], "Marker": "m2"}, + {"Users": ["User5", "User6", "User7"], "Marker": "m3"}, + ] + self.method.side_effect = responses + + pages = self.paginator.paginate( + PaginationConfig={'PageSize': page_size, 'MaxItems': max_items} + ) + result = pages.build_full_result() + + pages = self.paginator.paginate( + PaginationConfig={ + 'MaxItems': max_items, + 'PageSize': page_size, + 'StartingToken': result['NextToken'], + } + ) + result = pages.build_full_result() + + expected_token = encode_token( + { + 'Marker': 'm2', + 'boto_truncate_amount': 2, + } + ) + self.assertEqual(expected_token, result['NextToken']) + + +class TestPaginatorPageSize(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": ["Users", "Groups"], + 'limit_key': 'MaxKeys', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + self.endpoint = mock.Mock() + + def test_no_page_size(self): + kwargs = {'arg1': 'foo', 'arg2': 'bar'} + ref_kwargs = {'arg1': 'foo', 'arg2': 'bar'} + pages = self.paginator.paginate(**kwargs) + pages._inject_starting_params(kwargs) + self.assertEqual(kwargs, ref_kwargs) + + def test_page_size(self): + kwargs = { + 'arg1': 'foo', + 'arg2': 'bar', + 'PaginationConfig': {'PageSize': 5}, + } + extracted_kwargs = {'arg1': 'foo', 'arg2': 'bar'} + # Note that ``MaxKeys`` in ``setUp()`` is the parameter used for + # the page size for pagination. + ref_kwargs = {'arg1': 'foo', 'arg2': 'bar', 'MaxKeys': 5} + pages = self.paginator.paginate(**kwargs) + pages._inject_starting_params(extracted_kwargs) + self.assertEqual(extracted_kwargs, ref_kwargs) + + def test_page_size_incorrectly_provided(self): + kwargs = { + 'arg1': 'foo', + 'arg2': 'bar', + 'PaginationConfig': {'PageSize': 5}, + } + del self.paginate_config['limit_key'] + paginator = Paginator(self.method, self.paginate_config, self.model) + + with self.assertRaises(PaginationError): + paginator.paginate(**kwargs) + + +class TestPaginatorWithPathExpressions(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + # This is something we'd see in s3 pagination. + self.paginate_config = { + 'output_token': [ + 'NextMarker || ListBucketResult.Contents[-1].Key' + ], + 'input_token': 'next_marker', + 'result_key': 'Contents', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_s3_list_objects(self): + responses = [ + {'NextMarker': 'token1'}, + {'NextMarker': 'token2'}, + {'not_next_token': 'foo'}, + ] + self.method.side_effect = responses + list(self.paginator.paginate()) + self.assertEqual( + self.method.call_args_list, + [ + mock.call(), + mock.call(next_marker='token1'), + mock.call(next_marker='token2'), + ], + ) + + def test_s3_list_object_complex(self): + responses = [ + {'NextMarker': 'token1'}, + { + 'ListBucketResult': { + 'Contents': [{"Key": "first"}, {"Key": "Last"}] + } + }, + {'not_next_token': 'foo'}, + ] + self.method.side_effect = responses + list(self.paginator.paginate()) + self.assertEqual( + self.method.call_args_list, + [ + mock.call(), + mock.call(next_marker='token1'), + mock.call(next_marker='Last'), + ], + ) + + +class TestBinaryTokens(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": "Users", + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_build_full_result_with_bytes(self): + responses = [ + {"Users": ["User1", "User2"], "Marker": b'\xff'}, + {"Users": ["User3", "User4"], "Marker": b'\xfe'}, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate(PaginationConfig={'MaxItems': 3}) + complete = pages.build_full_result() + expected_token = encode_token( + { + "Marker": b'\xff', + "boto_truncate_amount": 1, + } + ) + expected_response = { + "Users": ["User1", "User2", "User3"], + "NextToken": expected_token, + } + self.assertEqual(complete, expected_response) + + def test_build_full_result_with_nested_bytes(self): + responses = [ + {"Users": ["User1", "User2"], "Marker": {'key': b'\xff'}}, + {"Users": ["User3", "User4"], "Marker": {'key': b'\xfe'}}, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate(PaginationConfig={'MaxItems': 3}) + complete = pages.build_full_result() + expected_token = encode_token( + { + "Marker": {'key': b'\xff'}, + "boto_truncate_amount": 1, + } + ) + expected_response = { + "Users": ["User1", "User2", "User3"], + "NextToken": expected_token, + } + self.assertEqual(complete, expected_response) + + def test_build_full_result_with_listed_bytes(self): + responses = [ + {"Users": ["User1", "User2"], "Marker": {'key': ['foo', b'\xff']}}, + {"Users": ["User3", "User4"], "Marker": {'key': ['foo', b'\xfe']}}, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate(PaginationConfig={'MaxItems': 3}) + complete = pages.build_full_result() + expected_token = encode_token( + { + "Marker": {'key': ['foo', b'\xff']}, + "boto_truncate_amount": 1, + } + ) + expected_response = { + "Users": ["User1", "User2", "User3"], + "NextToken": expected_token, + } + self.assertEqual(complete, expected_response) + + def test_build_full_result_with_multiple_bytes_values(self): + responses = [ + { + "Users": ["User1", "User2"], + "Marker": {'key': b'\xff', 'key2': b'\xef'}, + }, + { + "Users": ["User3", "User4"], + "Marker": {'key': b'\xfe', 'key2': b'\xee'}, + }, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate(PaginationConfig={'MaxItems': 3}) + complete = pages.build_full_result() + expected_token = encode_token( + { + "Marker": {'key': b'\xff', 'key2': b'\xef'}, + "boto_truncate_amount": 1, + } + ) + expected_response = { + "Users": ["User1", "User2", "User3"], + "NextToken": expected_token, + } + self.assertEqual(complete, expected_response) + + def test_resume_with_bytes(self): + responses = [ + {"Users": ["User3", "User4"], "Marker": b'\xfe'}, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + starting_token = encode_token( + { + "Marker": b'\xff', + "boto_truncate_amount": 1, + } + ) + pages = self.paginator.paginate( + PaginationConfig={'StartingToken': starting_token} + ) + complete = pages.build_full_result() + expected_response = {"Users": ["User4", "User5"]} + self.assertEqual(complete, expected_response) + self.method.assert_any_call(Marker=b'\xff') + + def test_resume_with_nested_bytes(self): + responses = [ + {"Users": ["User3", "User4"], "Marker": {'key': b'\xfe'}}, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + starting_token = encode_token( + { + "Marker": {'key': b'\xff'}, + "boto_truncate_amount": 1, + } + ) + pages = self.paginator.paginate( + PaginationConfig={'StartingToken': starting_token} + ) + complete = pages.build_full_result() + expected_response = {"Users": ["User4", "User5"]} + self.assertEqual(complete, expected_response) + self.method.assert_any_call(Marker={'key': b'\xff'}) + + def test_resume_with_listed_bytes(self): + responses = [ + {"Users": ["User3", "User4"], "Marker": {'key': ['bar', b'\xfe']}}, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + starting_token = encode_token( + { + "Marker": {'key': ['foo', b'\xff']}, + "boto_truncate_amount": 1, + } + ) + pages = self.paginator.paginate( + PaginationConfig={'StartingToken': starting_token} + ) + complete = pages.build_full_result() + expected_response = {"Users": ["User4", "User5"]} + self.assertEqual(complete, expected_response) + self.method.assert_any_call(Marker={'key': ['foo', b'\xff']}) + + def test_resume_with_multiple_bytes_values(self): + responses = [ + { + "Users": ["User3", "User4"], + "Marker": {'key': b'\xfe', 'key2': b'\xee'}, + }, + {"Users": ["User5"]}, + ] + self.method.side_effect = responses + starting_token = encode_token( + { + "Marker": {'key': b'\xff', 'key2': b'\xef'}, + "boto_truncate_amount": 1, + } + ) + pages = self.paginator.paginate( + PaginationConfig={'StartingToken': starting_token} + ) + complete = pages.build_full_result() + expected_response = {"Users": ["User4", "User5"]} + self.assertEqual(complete, expected_response) + self.method.assert_any_call(Marker={'key': b'\xfe', 'key2': b'\xee'}) + + +class TestMultipleTokens(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + # This is something we'd see in s3 pagination. + self.paginate_config = { + "output_token": [ + "ListBucketResults.NextKeyMarker", + "ListBucketResults.NextUploadIdMarker", + ], + "input_token": ["key_marker", "upload_id_marker"], + "result_key": 'Foo', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_s3_list_multipart_uploads(self): + responses = [ + { + "Foo": [1], + "ListBucketResults": { + "NextKeyMarker": "key1", + "NextUploadIdMarker": "up1", + }, + }, + { + "Foo": [2], + "ListBucketResults": { + "NextKeyMarker": "key2", + "NextUploadIdMarker": "up2", + }, + }, + { + "Foo": [3], + "ListBucketResults": { + "NextKeyMarker": "key3", + "NextUploadIdMarker": "up3", + }, + }, + {}, + ] + self.method.side_effect = responses + list(self.paginator.paginate()) + self.assertEqual( + self.method.call_args_list, + [ + mock.call(), + mock.call(key_marker='key1', upload_id_marker='up1'), + mock.call(key_marker='key2', upload_id_marker='up2'), + mock.call(key_marker='key3', upload_id_marker='up3'), + ], + ) + + +class TestOptionalTokens(unittest.TestCase): + """ + Tests a paginator with an optional output token. + + The Route53 ListResourceRecordSets paginator includes three output tokens, + one of which only appears in certain records. If this gets left in the + request params from a previous page, the API will skip over a record. + + """ + + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + # This is based on Route53 pagination. + self.paginate_config = { + "output_token": [ + "NextRecordName", + "NextRecordType", + "NextRecordIdentifier", + ], + "input_token": [ + "StartRecordName", + "StartRecordType", + "StartRecordIdentifier", + ], + "result_key": 'Foo', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_clean_token(self): + responses = [ + { + "Foo": [1], + "IsTruncated": True, + "NextRecordName": "aaa.example.com", + "NextRecordType": "A", + "NextRecordIdentifier": "id", + }, + { + "Foo": [2], + "IsTruncated": True, + "NextRecordName": "bbb.example.com", + "NextRecordType": "A", + }, + {"Foo": [3], "IsTruncated": False}, + ] + self.method.side_effect = responses + list(self.paginator.paginate()) + self.assertEqual( + self.method.call_args_list, + [ + mock.call(), + mock.call( + StartRecordName='aaa.example.com', + StartRecordType='A', + StartRecordIdentifier='id', + ), + mock.call( + StartRecordName='bbb.example.com', StartRecordType='A' + ), + ], + ) + + +class TestKeyIterators(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + # This is something we'd see in s3 pagination. + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": "Users", + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_result_key_iters(self): + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate() + iterators = pages.result_key_iters() + self.assertEqual(len(iterators), 1) + self.assertEqual(list(iterators[0]), ["User1", "User2", "User3"]) + + def test_build_full_result_with_single_key(self): + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate() + complete = pages.build_full_result() + self.assertEqual(complete, {'Users': ['User1', 'User2', 'User3']}) + + def test_max_items_can_be_specified(self): + paginator = Paginator(self.method, self.paginate_config, self.model) + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + expected_token = encode_token({"Marker": "m1"}) + self.assertEqual( + paginator.paginate( + PaginationConfig={'MaxItems': 1} + ).build_full_result(), + {'Users': ['User1'], 'NextToken': expected_token}, + ) + + def test_max_items_as_strings(self): + # Some services (route53) model MaxItems as a string type. + # We need to be able to handle this case. + paginator = Paginator(self.method, self.paginate_config, self.model) + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + expected_token = encode_token({"Marker": "m1"}) + self.assertEqual( + # Note MaxItems is a string here. + paginator.paginate( + PaginationConfig={'MaxItems': '1'} + ).build_full_result(), + {'Users': ['User1'], 'NextToken': expected_token}, + ) + + def test_next_token_on_page_boundary(self): + paginator = Paginator(self.method, self.paginate_config, self.model) + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + expected_token = encode_token({"Marker": "m2"}) + self.assertEqual( + paginator.paginate( + PaginationConfig={'MaxItems': 2} + ).build_full_result(), + {'Users': ['User1', 'User2'], 'NextToken': expected_token}, + ) + + def test_max_items_can_be_specified_truncates_response(self): + # We're saying we only want 4 items, but notice that the second + # page of results returns users 4-6 so we have to truncated + # part of that second page. + paginator = Paginator(self.method, self.paginate_config, self.model) + responses = [ + {"Users": ["User1", "User2", "User3"], "Marker": "m1"}, + {"Users": ["User4", "User5", "User6"], "Marker": "m2"}, + {"Users": ["User7"]}, + ] + self.method.side_effect = responses + expected_token = encode_token( + {"Marker": "m1", "boto_truncate_amount": 1} + ) + self.assertEqual( + paginator.paginate( + PaginationConfig={'MaxItems': 4} + ).build_full_result(), + { + 'Users': ['User1', 'User2', 'User3', 'User4'], + 'NextToken': expected_token, + }, + ) + + def test_resume_next_marker_mid_page(self): + # This is a simulation of picking up from the response + # from test_MaxItems_can_be_specified_truncates_response + # We got the first 4 users, when we pick up we should get + # User5 - User7. + paginator = Paginator(self.method, self.paginate_config, self.model) + responses = [ + {"Users": ["User4", "User5", "User6"], "Marker": "m2"}, + {"Users": ["User7"]}, + ] + self.method.side_effect = responses + starting_token = encode_token( + {"Marker": "m1", "boto_truncate_amount": 1} + ) + pagination_config = {'StartingToken': starting_token} + self.assertEqual( + paginator.paginate( + PaginationConfig=pagination_config + ).build_full_result(), + {'Users': ['User5', 'User6', 'User7']}, + ) + self.assertEqual( + self.method.call_args_list, + [mock.call(Marker='m1'), mock.call(Marker='m2')], + ) + + def test_max_items_exceeds_actual_amount(self): + # Because MaxItems=10 > number of users (3), we should just return + # all of the users. + paginator = Paginator(self.method, self.paginate_config, self.model) + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + self.assertEqual( + paginator.paginate( + PaginationConfig={'MaxItems': 10} + ).build_full_result(), + {'Users': ['User1', 'User2', 'User3']}, + ) + + def test_bad_input_tokens(self): + responses = [ + {"Users": ["User1"], "Marker": "m1"}, + {"Users": ["User2"], "Marker": "m2"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + with self.assertRaisesRegex(ValueError, 'Bad starting token'): + pagination_config = {'StartingToken': 'does___not___work'} + self.paginator.paginate( + PaginationConfig=pagination_config + ).build_full_result() + + +class TestMultipleResultKeys(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + # This is something we'd see in s3 pagination. + self.paginate_config = { + "output_token": "Marker", + "input_token": "Marker", + "result_key": ["Users", "Groups"], + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_build_full_result_with_multiple_result_keys(self): + responses = [ + {"Users": ["User1"], "Groups": ["Group1"], "Marker": "m1"}, + {"Users": ["User2"], "Groups": ["Group2"], "Marker": "m2"}, + {"Users": ["User3"], "Groups": ["Group3"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate() + complete = pages.build_full_result() + self.assertEqual( + complete, + { + "Users": ['User1', 'User2', 'User3'], + "Groups": ['Group1', 'Group2', 'Group3'], + }, + ) + + def test_build_full_result_with_different_length_result_keys(self): + responses = [ + {"Users": ["User1"], "Groups": ["Group1"], "Marker": "m1"}, + # Then we stop getting "Users" output, but we get more "Groups" + {"Users": [], "Groups": ["Group2"], "Marker": "m2"}, + {"Users": [], "Groups": ["Group3"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate() + complete = pages.build_full_result() + self.assertEqual( + complete, + {"Users": ['User1'], "Groups": ['Group1', 'Group2', 'Group3']}, + ) + + def test_build_full_result_with_zero_length_result_key(self): + responses = [ + # In this case the 'Users' key is always empty but we should + # have a 'Users' key in the output, it should just have an + # empty list for a value. + {"Users": [], "Groups": ["Group1"], "Marker": "m1"}, + {"Users": [], "Groups": ["Group2"], "Marker": "m2"}, + {"Users": [], "Groups": ["Group3"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate() + complete = pages.build_full_result() + self.assertEqual( + complete, {"Users": [], "Groups": ['Group1', 'Group2', 'Group3']} + ) + + def test_build_result_with_secondary_keys(self): + responses = [ + { + "Users": ["User1", "User2"], + "Groups": ["Group1", "Group2"], + "Marker": "m1", + }, + {"Users": ["User3"], "Groups": ["Group3"], "Marker": "m2"}, + {"Users": ["User4"], "Groups": ["Group4"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate(PaginationConfig={'MaxItems': 1}) + complete = pages.build_full_result() + expected_token = encode_token( + {"Marker": None, "boto_truncate_amount": 1} + ) + self.assertEqual( + complete, + { + "Users": ["User1"], + "Groups": ["Group1", "Group2"], + "NextToken": expected_token, + }, + ) + + def test_resume_with_secondary_keys(self): + # This is simulating a continutation of the previous test, + # test_build_result_with_secondary_keys. We use the + # token specified in the response "None___1" to continue where we + # left off. + responses = [ + { + "Users": ["User1", "User2"], + "Groups": ["Group1", "Group2"], + "Marker": "m1", + }, + {"Users": ["User3"], "Groups": ["Group3"], "Marker": "m2"}, + {"Users": ["User4"], "Groups": ["Group4"]}, + ] + self.method.side_effect = responses + starting_token = encode_token( + {"Marker": None, "boto_truncate_amount": 1} + ) + pages = self.paginator.paginate( + PaginationConfig={'MaxItems': 1, 'StartingToken': starting_token} + ) + complete = pages.build_full_result() + # Note that the secondary keys ("Groups") are all truncated because + # they were in the original (first) response. + expected_token = encode_token({"Marker": "m1"}) + self.assertEqual( + complete, + {"Users": ["User2"], "Groups": [], "NextToken": expected_token}, + ) + + def test_resume_with_secondary_result_as_string(self): + self.method.return_value = {"Users": ["User1", "User2"], "Groups": "a"} + starting_token = encode_token( + {"Marker": None, "boto_truncate_amount": 1} + ) + pages = self.paginator.paginate( + PaginationConfig={'MaxItems': 1, 'StartingToken': starting_token} + ) + complete = pages.build_full_result() + # Note that the secondary keys ("Groups") becomes empty string because + # they were in the original (first) response. + self.assertEqual(complete, {"Users": ["User2"], "Groups": ""}) + + def test_resume_with_secondary_result_as_integer(self): + self.method.return_value = {"Users": ["User1", "User2"], "Groups": 123} + starting_token = encode_token( + {"Marker": None, "boto_truncate_amount": 1} + ) + pages = self.paginator.paginate( + PaginationConfig={'MaxItems': 1, 'StartingToken': starting_token} + ) + complete = pages.build_full_result() + # Note that the secondary keys ("Groups") becomes zero because + # they were in the original (first) response. + self.assertEqual(complete, {"Users": ["User2"], "Groups": 0}) + + +class TestMultipleInputKeys(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + # Probably the most complicated example we'll see: + # multiple input/output/result keys. + self.paginate_config = { + "output_token": ["Marker1", "Marker2"], + "input_token": ["InMarker1", "InMarker2"], + "result_key": ["Users", "Groups"], + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_build_full_result_with_multiple_input_keys(self): + responses = [ + { + "Users": ["User1", "User2"], + "Groups": ["Group1"], + "Marker1": "m1", + "Marker2": "m2", + }, + { + "Users": ["User3", "User4"], + "Groups": ["Group2"], + "Marker1": "m3", + "Marker2": "m4", + }, + {"Users": ["User5"], "Groups": ["Group3"]}, + ] + self.method.side_effect = responses + pages = self.paginator.paginate(PaginationConfig={'MaxItems': 3}) + complete = pages.build_full_result() + expected_token = encode_token( + {"InMarker1": "m1", "InMarker2": "m2", "boto_truncate_amount": 1} + ) + self.assertEqual( + complete, + { + "Users": ['User1', 'User2', 'User3'], + "Groups": ['Group1', 'Group2'], + "NextToken": expected_token, + }, + ) + + def test_resume_with_multiple_input_keys(self): + responses = [ + { + "Users": ["User3", "User4"], + "Groups": ["Group2"], + "Marker1": "m3", + "Marker2": "m4", + }, + {"Users": ["User5"], "Groups": ["Group3"]}, + ] + self.method.side_effect = responses + starting_token = encode_token( + {"InMarker1": "m1", "InMarker2": "m2", "boto_truncate_amount": 1} + ) + pages = self.paginator.paginate( + PaginationConfig={'MaxItems': 1, 'StartingToken': starting_token} + ) + complete = pages.build_full_result() + expected_token = encode_token({"InMarker1": "m3", "InMarker2": "m4"}) + self.assertEqual( + complete, + {"Users": ['User4'], "Groups": [], "NextToken": expected_token}, + ) + self.assertEqual( + self.method.call_args_list, + [mock.call(InMarker1='m1', InMarker2='m2')], + ) + + def test_resume_encounters_an_empty_payload(self): + response = {"not_a_result_key": "it happens in some service"} + self.method.return_value = response + starting_token = encode_token( + {"Marker": None, "boto_truncate_amount": 1} + ) + complete = self.paginator.paginate( + PaginationConfig={'StartingToken': starting_token} + ).build_full_result() + self.assertEqual(complete, {}) + + def test_result_key_exposed_on_paginator(self): + self.assertEqual( + [rk.expression for rk in self.paginator.result_keys], + ['Users', 'Groups'], + ) + + def test_result_key_exposed_on_page_iterator(self): + pages = self.paginator.paginate(MaxItems=3) + self.assertEqual( + [rk.expression for rk in pages.result_keys], ['Users', 'Groups'] + ) + + +class TestExpressionKeyIterators(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + # This is something like what we'd see in RDS. + self.paginate_config = { + "input_token": "Marker", + "output_token": "Marker", + "limit_key": "MaxRecords", + "result_key": "EngineDefaults.Parameters", + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + self.responses = [ + {"EngineDefaults": {"Parameters": ["One", "Two"]}, "Marker": "m1"}, + { + "EngineDefaults": {"Parameters": ["Three", "Four"]}, + "Marker": "m2", + }, + {"EngineDefaults": {"Parameters": ["Five"]}}, + ] + + def test_result_key_iters(self): + self.method.side_effect = self.responses + pages = self.paginator.paginate() + iterators = pages.result_key_iters() + self.assertEqual(len(iterators), 1) + self.assertEqual( + list(iterators[0]), ['One', 'Two', 'Three', 'Four', 'Five'] + ) + + def test_build_full_result_with_single_key(self): + self.method.side_effect = self.responses + pages = self.paginator.paginate() + complete = pages.build_full_result() + self.assertEqual( + complete, + { + 'EngineDefaults': { + 'Parameters': ['One', 'Two', 'Three', 'Four', 'Five'] + }, + }, + ) + + +class TestIncludeResultKeys(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + self.paginate_config = { + 'output_token': 'Marker', + 'input_token': 'Marker', + 'result_key': ['ResultKey', 'Count', 'Log'], + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_different_kinds_of_result_key(self): + self.method.side_effect = [ + {'ResultKey': ['a'], 'Count': 1, 'Log': 'x', 'Marker': 'a'}, + {'not_a_result_key': 'this page will be ignored', 'Marker': '_'}, + {'ResultKey': ['b', 'c'], 'Count': 2, 'Log': 'y', 'Marker': 'b'}, + {'ResultKey': ['d', 'e', 'f'], 'Count': 3, 'Log': 'z'}, + ] + pages = self.paginator.paginate() + expected = { + 'ResultKey': ['a', 'b', 'c', 'd', 'e', 'f'], + 'Count': 6, + 'Log': 'xyz', + } + self.assertEqual(pages.build_full_result(), expected) + + def test_result_key_is_missing(self): + self.method.side_effect = [ + {'not_a_result_key': 'this page will be ignored', 'Marker': '_'}, + {'neither_this_one': 'this page will be ignored, too'}, + ] + pages = self.paginator.paginate() + expected = {} + self.assertEqual(pages.build_full_result(), expected) + + +class TestIncludeNonResultKeys(unittest.TestCase): + maxDiff = None + + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + self.paginate_config = { + 'output_token': 'NextToken', + 'input_token': 'NextToken', + 'result_key': 'ResultKey', + 'non_aggregate_keys': ['NotResultKey'], + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_include_non_aggregate_keys(self): + self.method.side_effect = [ + {'ResultKey': ['foo'], 'NotResultKey': 'a', 'NextToken': 't1'}, + {'ResultKey': ['bar'], 'NotResultKey': 'a', 'NextToken': 't2'}, + {'ResultKey': ['baz'], 'NotResultKey': 'a'}, + ] + pages = self.paginator.paginate() + actual = pages.build_full_result() + self.assertEqual(pages.non_aggregate_part, {'NotResultKey': 'a'}) + expected = { + 'ResultKey': ['foo', 'bar', 'baz'], + 'NotResultKey': 'a', + } + self.assertEqual(actual, expected) + + def test_include_with_multiple_result_keys(self): + self.paginate_config['result_key'] = ['ResultKey1', 'ResultKey2'] + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + self.method.side_effect = [ + { + 'ResultKey1': ['a', 'b'], + 'ResultKey2': ['u', 'v'], + 'NotResultKey': 'a', + 'NextToken': 'token1', + }, + { + 'ResultKey1': ['c', 'd'], + 'ResultKey2': ['w', 'x'], + 'NotResultKey': 'a', + 'NextToken': 'token2', + }, + { + 'ResultKey1': ['e', 'f'], + 'ResultKey2': ['y', 'z'], + 'NotResultKey': 'a', + }, + ] + pages = self.paginator.paginate() + actual = pages.build_full_result() + expected = { + 'ResultKey1': ['a', 'b', 'c', 'd', 'e', 'f'], + 'ResultKey2': ['u', 'v', 'w', 'x', 'y', 'z'], + 'NotResultKey': 'a', + } + self.assertEqual(actual, expected) + + def test_include_with_nested_result_keys(self): + self.paginate_config['result_key'] = 'Result.Key' + self.paginate_config['non_aggregate_keys'] = [ + 'Outer', + 'Result.Inner', + ] + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + self.method.side_effect = [ + # The non result keys shows hypothetical + # example. This doesn't actually happen, + # but in the case where the non result keys + # are different across pages, we use the values + # from the first page. + { + 'Result': {'Key': ['foo'], 'Inner': 'v1'}, + 'Outer': 'v2', + 'NextToken': 't1', + }, + { + 'Result': {'Key': ['bar', 'baz'], 'Inner': 'v3'}, + 'Outer': 'v4', + 'NextToken': 't2', + }, + {'Result': {'Key': ['qux'], 'Inner': 'v5'}, 'Outer': 'v6'}, + ] + pages = self.paginator.paginate() + actual = pages.build_full_result() + self.assertEqual( + pages.non_aggregate_part, + {'Outer': 'v2', 'Result': {'Inner': 'v1'}}, + ) + expected = { + 'Result': {'Key': ['foo', 'bar', 'baz', 'qux'], 'Inner': 'v1'}, + 'Outer': 'v2', + } + self.assertEqual(actual, expected) + + +class TestSearchOverResults(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + self.paginate_config = { + 'more_results': 'IsTruncated', + 'output_token': 'NextToken', + 'input_token': 'NextToken', + 'result_key': 'Foo', + } + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + responses = [ + { + 'Foo': [{'a': 1}, {'b': 2}], + 'IsTruncated': True, + 'NextToken': '1', + }, + { + 'Foo': [{'a': 3}, {'b': 4}], + 'IsTruncated': True, + 'NextToken': '2', + }, + {'Foo': [{'a': 5}], 'IsTruncated': False, 'NextToken': '3'}, + ] + self.method.side_effect = responses + + def test_yields_non_list_values(self): + result = list(self.paginator.paginate().search('Foo[0].a')) + self.assertEqual([1, 3, 5], result) + + def test_yields_individual_list_values(self): + result = list(self.paginator.paginate().search('Foo[].*[]')) + self.assertEqual([1, 2, 3, 4, 5], result) + + def test_empty_when_no_match(self): + result = list(self.paginator.paginate().search('Foo[].qux')) + self.assertEqual([], result) + + def test_no_yield_when_no_match_on_page(self): + result = list(self.paginator.paginate().search('Foo[].b')) + self.assertEqual([2, 4], result) + + +class TestDeprecatedStartingToken(unittest.TestCase): + def setUp(self): + self.method = mock.Mock() + self.model = mock.Mock() + + def create_paginator(self, multiple_tokens=False): + if multiple_tokens: + paginator_config = { + "output_token": ["Marker1", "Marker2"], + "input_token": ["InMarker1", "InMarker2"], + "result_key": ["Users", "Groups"], + } + else: + paginator_config = { + 'output_token': 'Marker', + 'input_token': 'Marker', + 'result_key': 'Users', + } + return Paginator(self.method, paginator_config, self.model) + + def assert_pagination_result( + self, expected, pagination_config, multiple_tokens=False + ): + paginator = self.create_paginator(multiple_tokens) + try: + actual = paginator.paginate( + PaginationConfig=pagination_config + ).build_full_result() + self.assertEqual(actual, expected) + except ValueError: + self.fail("Deprecated paginator failed.") + + def test_deprecated_starting_token(self): + responses = [ + {"Users": ["User1"], "Marker": "m2"}, + {"Users": ["User2"], "Marker": "m3"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + pagination_config = {'StartingToken': 'm1___0'} + expected = {'Users': ['User1', 'User2', 'User3']} + self.assert_pagination_result(expected, pagination_config) + + def test_deprecated_multiple_starting_token(self): + responses = [ + { + "Users": ["User1", "User2"], + "Groups": ["Group1"], + "Marker1": "m1", + "Marker2": "m2", + }, + { + "Users": ["User3", "User4"], + "Groups": ["Group2"], + "Marker1": "m3", + "Marker2": "m4", + }, + {"Users": ["User5"], "Groups": ["Group3"]}, + ] + self.method.side_effect = responses + pagination_config = {'StartingToken': 'm0___m0___1'} + expected = { + 'Groups': ['Group2', 'Group3'], + 'Users': ['User2', 'User3', 'User4', 'User5'], + } + self.assert_pagination_result( + expected, pagination_config, multiple_tokens=True + ) + + def test_deprecated_starting_token_returns_new_style_next_token(self): + responses = [ + {"Users": ["User1"], "Marker": "m2"}, + {"Users": ["User2"], "Marker": "m3"}, + {"Users": ["User3"], "Marker": "m4"}, + ] + self.method.side_effect = responses + pagination_config = {'StartingToken': 'm1___0', 'MaxItems': 3} + expected = { + 'Users': ['User1', 'User2', 'User3'], + 'NextToken': encode_token({'Marker': 'm4'}), + } + self.assert_pagination_result(expected, pagination_config) + + def test_deprecated_starting_token_without_all_input_set_to_none(self): + responses = [ + { + "Users": ["User1", "User2"], + "Groups": ["Group1"], + "Marker1": "m1", + "Marker2": "m2", + }, + { + "Users": ["User3", "User4"], + "Groups": ["Group2"], + "Marker1": "m3", + "Marker2": "m4", + }, + {"Users": ["User5"], "Groups": ["Group3"]}, + ] + self.method.side_effect = responses + pagination_config = {'StartingToken': 'm0'} + expected = { + 'Groups': ['Group2', 'Group3'], + 'Users': ['User1', 'User2', 'User3', 'User4', 'User5'], + } + self.assert_pagination_result( + expected, pagination_config, multiple_tokens=True + ) + + def test_deprecated_starting_token_rejects_too_many_input_tokens(self): + responses = [ + {"Users": ["User1"], "Marker": "m2"}, + {"Users": ["User2"], "Marker": "m3"}, + {"Users": ["User3"]}, + ] + self.method.side_effect = responses + pagination_config = {'StartingToken': 'm1___m4___0'} + expected = {'Users': ['User1', 'User2', 'User3']} + + paginator = self.create_paginator() + with self.assertRaises(ValueError): + actual = paginator.paginate( + PaginationConfig=pagination_config + ).build_full_result() + self.assertEqual(actual, expected) + + +class TestStringPageSize(unittest.TestCase): + def setUp(self): + self.service_model = { + 'metadata': {'protocol': 'query', 'endpointPrefix': 'prefix'}, + 'documentation': 'best service ever', + 'operations': { + 'ListStuff': { + 'name': 'ListStuff', + 'http': {'method': 'GET', 'requestUri': '/things'}, + 'input': {'shape': 'ListStuffInputShape'}, + 'output': {'shape': 'ListStuffOutputShape'}, + 'errors': [], + 'documentation': 'Lists stuff', + } + }, + 'shapes': { + 'String': {'type': 'string'}, + 'ListOfStuff': {'type': 'list', 'member': {'type': 'string'}}, + 'ListStuffInputShape': { + 'type': 'structure', + 'required': [], + 'members': { + 'NextToken': {'shape': 'String'}, + 'MaxItems': {'shape': 'String'}, + }, + }, + 'ListStuffOutputShape': { + 'type': 'structure', + 'required': [], + 'members': { + 'NextToken': {'shape': 'String'}, + 'Stuff': {'shape': 'ListOfStuff'}, + 'IsTruncated': {'type': 'boolean'}, + }, + }, + }, + } + self.paginate_config = { + 'input_token': 'NextToken', + 'output_token': 'NextToken', + 'limit_key': 'MaxItems', + 'result_key': 'Stuff', + } + self.service = model.ServiceModel(self.service_model) + self.model = self.service.operation_model('ListStuff') + self.method = mock.Mock() + self.method.side_effect = [{}] + self.paginator = Paginator( + self.method, self.paginate_config, self.model + ) + + def test_int_page_size(self): + list(self.paginator.paginate(PaginationConfig={'PageSize': 1})) + self.method.assert_called_with(MaxItems='1') + + def test_str_page_size(self): + list(self.paginator.paginate(PaginationConfig={'PageSize': '1'})) + self.method.assert_called_with(MaxItems='1') + + +if __name__ == '__main__': + unittest.main() diff --git a/testbed/boto__botocore/tests/unit/test_parsers.py b/testbed/boto__botocore/tests/unit/test_parsers.py new file mode 100644 index 0000000000000000000000000000000000000000..979a542f34f4cf2e03ccaaee10beade393dcaabf --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_parsers.py @@ -0,0 +1,1648 @@ +# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import datetime +import itertools + +import pytest +from dateutil.tz import tzutc + +from botocore import model, parsers +from botocore.compat import MutableMapping, json +from tests import RawResponse, unittest + + +# HTTP responses will typically return a custom HTTP +# dict. We want to ensure we're able to work with any +# kind of mutable mapping implementation. +class CustomHeaderDict(MutableMapping): + def __init__(self, original_dict): + self._d = original_dict + + def __getitem__(self, item): + return self._d[item] + + def __setitem__(self, item, value): + self._d[item] = value + + def __delitem__(self, item): + del self._d[item] + + def __iter__(self): + return iter(self._d) + + def __len__(self): + return len(self._d) + + +# These tests contain botocore specific tests that either +# don't make sense in the protocol tests or haven't been added +# yet. +class TestResponseMetadataParsed(unittest.TestCase): + def test_response_metadata_parsed_for_query_service(self): + parser = parsers.QueryParser() + response = ( + b'' + b' myname' + b' ' + b' request-id' + b' ' + b'' + ) + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'resultWrapper': 'OperationNameResult', + 'members': { + 'Str': { + 'shape': 'StringType', + }, + 'Num': { + 'shape': 'IntegerType', + }, + }, + }, + model.ShapeResolver( + { + 'StringType': { + 'type': 'string', + }, + 'IntegerType': { + 'type': 'integer', + }, + } + ), + ) + parsed = parser.parse( + {'body': response, 'headers': {}, 'status_code': 200}, output_shape + ) + self.assertEqual( + parsed, + { + 'Str': 'myname', + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': {}, + }, + }, + ) + + def test_metadata_always_exists_for_query(self): + # ResponseMetadata is used for more than just the request id. It + # should always get populated, even if the request doesn't seem to + # have an id. + parser = parsers.QueryParser() + response = ( + b'' + b' myname' + b'' + ) + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'resultWrapper': 'OperationNameResult', + 'members': { + 'Str': { + 'shape': 'StringType', + }, + 'Num': { + 'shape': 'IntegerType', + }, + }, + }, + model.ShapeResolver( + { + 'StringType': { + 'type': 'string', + }, + 'IntegerType': { + 'type': 'integer', + }, + } + ), + ) + parsed = parser.parse( + {'body': response, 'headers': {}, 'status_code': 200}, output_shape + ) + expected = { + 'Str': 'myname', + 'ResponseMetadata': {'HTTPStatusCode': 200, 'HTTPHeaders': {}}, + } + self.assertEqual(parsed, expected) + + def test_response_metadata_parsed_for_ec2(self): + parser = parsers.EC2QueryParser() + response = ( + b'' + b' myname' + b' request-id' + b'' + ) + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + parsed = parser.parse( + {'headers': {}, 'body': response, 'status_code': 200}, output_shape + ) + # Note that the response metadata is normalized to match the query + # protocol, even though this is not how it appears in the output. + self.assertEqual( + parsed, + { + 'Str': 'myname', + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': {}, + }, + }, + ) + + def test_metadata_always_exists_for_ec2(self): + # ResponseMetadata is used for more than just the request id. It + # should always get populated, even if the request doesn't seem to + # have an id. + parser = parsers.EC2QueryParser() + response = ( + b'' + b' myname' + b'' + ) + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + parsed = parser.parse( + {'headers': {}, 'body': response, 'status_code': 200}, output_shape + ) + expected = { + 'Str': 'myname', + 'ResponseMetadata': {'HTTPStatusCode': 200, 'HTTPHeaders': {}}, + } + self.assertEqual(parsed, expected) + + def test_response_metadata_on_json_request(self): + parser = parsers.JSONParser() + response = b'{"Str": "mystring"}' + headers = {'x-amzn-requestid': 'request-id'} + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + parsed = parser.parse( + {'body': response, 'headers': headers, 'status_code': 200}, + output_shape, + ) + # Note that the response metadata is normalized to match the query + # protocol, even though this is not how it appears in the output. + self.assertEqual( + parsed, + { + 'Str': 'mystring', + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + }, + }, + ) + + def test_response_no_initial_event_stream(self): + parser = parsers.JSONParser() + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': {'Payload': {'shape': 'Payload'}}, + }, + model.ShapeResolver( + { + 'Payload': { + 'type': 'structure', + 'members': [], + 'eventstream': True, + } + } + ), + ) + with self.assertRaises(parsers.ResponseParserError): + response_dict = { + 'status_code': 200, + 'headers': {}, + 'body': RawResponse(b''), + 'context': {'operation_name': 'TestOperation'}, + } + parser.parse(response_dict, output_shape) + + def test_metadata_always_exists_for_json(self): + # ResponseMetadata is used for more than just the request id. It + # should always get populated, even if the request doesn't seem to + # have an id. + parser = parsers.JSONParser() + response = b'{"Str": "mystring"}' + headers = {} + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + parsed = parser.parse( + {'body': response, 'headers': headers, 'status_code': 200}, + output_shape, + ) + expected = { + 'Str': 'mystring', + 'ResponseMetadata': { + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + }, + } + self.assertEqual(parsed, expected) + + def test_response_metadata_on_rest_json_response(self): + parser = parsers.RestJSONParser() + response = b'{"Str": "mystring"}' + headers = {'x-amzn-requestid': 'request-id'} + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + parsed = parser.parse( + {'body': response, 'headers': headers, 'status_code': 200}, + output_shape, + ) + # Note that the response metadata is normalized to match the query + # protocol, even though this is not how it appears in the output. + self.assertEqual( + parsed, + { + 'Str': 'mystring', + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + }, + }, + ) + + def test_metadata_always_exists_on_rest_json_response(self): + # ResponseMetadata is used for more than just the request id. It + # should always get populated, even if the request doesn't seem to + # have an id. + parser = parsers.RestJSONParser() + response = b'{"Str": "mystring"}' + headers = {} + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + parsed = parser.parse( + {'body': response, 'headers': headers, 'status_code': 200}, + output_shape, + ) + expected = { + 'Str': 'mystring', + 'ResponseMetadata': { + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + }, + } + self.assertEqual(parsed, expected) + + def test_response_metadata_from_s3_response(self): + # Even though s3 is a rest-xml service, it's response metadata + # is slightly different. It has two request ids, both come from + # the response headers, are both are named differently from other + # rest-xml responses. + headers = {'x-amz-id-2': 'second-id', 'x-amz-request-id': 'request-id'} + parser = parsers.RestXMLParser() + parsed = parser.parse( + {'body': '', 'headers': headers, 'status_code': 200}, None + ) + self.assertEqual( + parsed, + { + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HostId': 'second-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + } + }, + ) + + def test_metadata_always_exists_on_rest_xml_response(self): + # ResponseMetadata is used for more than just the request id. It + # should always get populated, even if the request doesn't seem to + # have an id. + headers = {} + parser = parsers.RestXMLParser() + parsed = parser.parse( + {'body': '', 'headers': headers, 'status_code': 200}, None + ) + expected = { + 'ResponseMetadata': {'HTTPStatusCode': 200, 'HTTPHeaders': headers} + } + self.assertEqual(parsed, expected) + + def test_checksum_metadata_parsed_from_response_context(self): + headers = {} + response_dict = { + 'status_code': 200, + 'headers': headers, + 'body': b'', + 'context': {'checksum': {'response_algorithm': 'crc32'}}, + } + parser = parsers.RestXMLParser() + parsed = parser.parse(response_dict, None) + expected_algorithm = 'crc32' + actual_algorithm = parsed['ResponseMetadata']['ChecksumAlgorithm'] + self.assertEqual(actual_algorithm, expected_algorithm) + + +class TestTaggedUnions(unittest.TestCase): + def assert_tagged_union_response_with_unknown_member( + self, + parser, + response, + output_shape, + expected_parsed_response, + expected_log, + ): + with self.assertLogs() as captured_log: + parsed = parser.parse(response, output_shape) + self.assertEqual(parsed, expected_parsed_response) + self.assertEqual(len(captured_log.records), 1) + self.assertIn( + ( + 'Received a tagged union response with member ' + 'unknown to client' + ), + captured_log.records[0].getMessage(), + ) + + def test_base_json_parser_handles_unknown_member(self): + parser = parsers.JSONParser() + response = b'{"Foo": "mystring"}' + headers = {'x-amzn-requestid': 'request-id'} + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'union': True, + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + response = {'body': response, 'headers': headers, 'status_code': 200} + # Parsed response omits data from service since it is not + # modeled in the client + expected_parsed_response = { + 'SDK_UNKNOWN_MEMBER': {'name': 'Foo'}, + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': {'x-amzn-requestid': 'request-id'}, + }, + } + expected_log = "Received a response with an unknown member Foo set" + self.assert_tagged_union_response_with_unknown_member( + parser, + response, + output_shape, + expected_parsed_response, + expected_log, + ) + + def test_base_xml_parser_handles_unknown_member(self): + parser = parsers.QueryParser() + response = ( + b'' + b' mystring' + b' ' + b' request-id' + b' ' + b'' + ) + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'union': True, + 'resultWrapper': 'OperationNameResult', + 'members': { + 'Str': { + 'shape': 'StringType', + }, + }, + }, + model.ShapeResolver( + { + 'StringType': { + 'type': 'string', + }, + } + ), + ) + response = {'body': response, 'headers': {}, 'status_code': 200} + # Parsed response omits data from service since it is not + # modeled in the client + expected_parsed_response = { + 'SDK_UNKNOWN_MEMBER': {'name': 'Foo'}, + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': {}, + }, + } + expected_log = "Received a response with an unknown member Foo set" + self.assert_tagged_union_response_with_unknown_member( + parser, + response, + output_shape, + expected_parsed_response, + expected_log, + ) + + def test_parser_errors_out_when_multiple_members_set(self): + parser = parsers.JSONParser() + response = b'{"Foo": "mystring", "Bar": "mystring2"}' + headers = {'x-amzn-requestid': 'request-id'} + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'union': True, + 'members': { + 'Foo': { + 'shape': 'StringType', + }, + 'Bar': { + 'shape': 'StringType', + }, + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + + response = {'body': response, 'headers': headers, 'status_code': 200} + with self.assertRaises(parsers.ResponseParserError): + parser.parse(response, output_shape) + + def test_parser_accepts_type_metadata_with_union(self): + parser = parsers.JSONParser() + response = b'{"Foo": "mystring", "__type": "mytype"}' + headers = {'x-amzn-requestid': 'request-id'} + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'union': True, + 'members': { + 'Foo': { + 'shape': 'StringType', + }, + 'Bar': { + 'shape': 'StringType', + }, + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + + response = { + 'body': response, + 'headers': headers, + 'status_code': 200, + } + parsed = parser.parse(response, output_shape) + self.assertEqual(parsed['Foo'], 'mystring') + + +class TestHeaderResponseInclusion(unittest.TestCase): + def create_parser(self): + return parsers.JSONParser() + + def create_arbitary_output_shape(self): + output_shape = model.StructureShape( + 'OutputShape', + { + 'type': 'structure', + 'members': { + 'Str': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + return output_shape + + def test_can_add_errors_into_response(self): + parser = self.create_parser() + headers = { + 'x-amzn-requestid': 'request-id', + 'Header1': 'foo', + 'Header2': 'bar', + } + output_shape = self.create_arbitary_output_shape() + parsed = parser.parse( + {'body': b'{}', 'headers': headers, 'status_code': 200}, + output_shape, + ) + # The mapped header's keys should all be lower cased + parsed_headers = { + 'x-amzn-requestid': 'request-id', + 'header1': 'foo', + 'header2': 'bar', + } + # Response headers should be mapped as HTTPHeaders. + self.assertEqual( + parsed['ResponseMetadata']['HTTPHeaders'], parsed_headers + ) + + def test_can_always_json_serialize_headers(self): + parser = self.create_parser() + original_headers = { + 'x-amzn-requestid': 'request-id', + 'Header1': 'foo', + } + headers = CustomHeaderDict(original_headers) + output_shape = self.create_arbitary_output_shape() + parsed = parser.parse( + {'body': b'{}', 'headers': headers, 'status_code': 200}, + output_shape, + ) + metadata = parsed['ResponseMetadata'] + # We've had the contract that you can json serialize a + # response. So we want to ensure that despite using a CustomHeaderDict + # we can always JSON dumps the response metadata. + self.assertEqual( + json.loads(json.dumps(metadata))['HTTPHeaders']['header1'], 'foo' + ) + + +class TestResponseParsingDatetimes(unittest.TestCase): + def test_can_parse_float_timestamps(self): + # The type "timestamp" can come back as both an integer or as a float. + # We need to make sure we handle the case where the timestamp comes + # back as a float. It might make sense to move this to protocol tests. + output_shape = model.Shape( + shape_name='datetime', shape_model={'type': 'timestamp'} + ) + parser = parsers.JSONParser() + timestamp_as_float = b'1407538750.49' + expected_parsed = datetime.datetime( + 2014, 8, 8, 22, 59, 10, 490000, tzinfo=tzutc() + ) + parsed = parser.parse( + {'body': timestamp_as_float, 'headers': [], 'status_code': 200}, + output_shape, + ) + self.assertEqual(parsed, expected_parsed) + + +class TestResponseParserFactory(unittest.TestCase): + def setUp(self): + self.factory = parsers.ResponseParserFactory() + + def test_rest_parser(self): + parser = self.factory.create_parser('rest-xml') + self.assertTrue(isinstance(parser, parsers.BaseRestParser)) + self.assertTrue(isinstance(parser, parsers.BaseXMLResponseParser)) + + def test_json_parser(self): + parser = self.factory.create_parser('json') + self.assertTrue(isinstance(parser, parsers.BaseJSONParser)) + + +class TestCanDecorateResponseParsing(unittest.TestCase): + def setUp(self): + self.factory = parsers.ResponseParserFactory() + + def create_request_dict(self, with_body): + return {'body': with_body, 'headers': [], 'status_code': 200} + + def test_normal_blob_parsing(self): + output_shape = model.Shape( + shape_name='BlobType', shape_model={'type': 'blob'} + ) + parser = self.factory.create_parser('json') + + hello_world_b64 = b'"aGVsbG8gd29ybGQ="' + expected_parsed = b'hello world' + parsed = parser.parse( + self.create_request_dict(with_body=hello_world_b64), output_shape + ) + self.assertEqual(parsed, expected_parsed) + + def test_can_decorate_scalar_parsing(self): + output_shape = model.Shape( + shape_name='BlobType', shape_model={'type': 'blob'} + ) + # Here we're overriding the blob parser so that + # we can change it to a noop parser. + self.factory.set_parser_defaults(blob_parser=lambda x: x) + parser = self.factory.create_parser('json') + + hello_world_b64 = b'"aGVsbG8gd29ybGQ="' + expected_parsed = "aGVsbG8gd29ybGQ=" + parsed = parser.parse( + self.create_request_dict(with_body=hello_world_b64), output_shape + ) + self.assertEqual(parsed, expected_parsed) + + def test_can_decorate_timestamp_parser(self): + output_shape = model.Shape( + shape_name='datetime', shape_model={'type': 'timestamp'} + ) + # Here we're overriding the timestamp parser so that + # we can change it to just convert a string to an integer + # instead of converting to a datetime. + self.factory.set_parser_defaults(timestamp_parser=lambda x: int(x)) + parser = self.factory.create_parser('json') + + timestamp_as_int = b'1407538750' + expected_parsed = int(timestamp_as_int) + parsed = parser.parse( + self.create_request_dict(with_body=timestamp_as_int), output_shape + ) + self.assertEqual(parsed, expected_parsed) + + +class TestHandlesNoOutputShape(unittest.TestCase): + """Verify that each protocol handles no output shape properly.""" + + def test_empty_rest_json_response(self): + headers = {'x-amzn-requestid': 'request-id'} + parser = parsers.RestJSONParser() + output_shape = None + parsed = parser.parse( + {'body': b'', 'headers': headers, 'status_code': 200}, output_shape + ) + self.assertEqual( + parsed, + { + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + } + }, + ) + + def test_empty_rest_xml_response(self): + # This is the format used by cloudfront, route53. + headers = {'x-amzn-requestid': 'request-id'} + parser = parsers.RestXMLParser() + output_shape = None + parsed = parser.parse( + {'body': b'', 'headers': headers, 'status_code': 200}, output_shape + ) + self.assertEqual( + parsed, + { + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + } + }, + ) + + def test_empty_query_response(self): + body = ( + b'' + b' ' + b' request-id' + b' ' + b'' + ) + parser = parsers.QueryParser() + output_shape = None + parsed = parser.parse( + {'body': body, 'headers': {}, 'status_code': 200}, output_shape + ) + self.assertEqual( + parsed, + { + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': {}, + } + }, + ) + + def test_empty_json_response(self): + headers = {'x-amzn-requestid': 'request-id'} + # Output shape of None represents no output shape in the model. + output_shape = None + parser = parsers.JSONParser() + parsed = parser.parse( + {'body': b'', 'headers': headers, 'status_code': 200}, output_shape + ) + self.assertEqual( + parsed, + { + 'ResponseMetadata': { + 'RequestId': 'request-id', + 'HTTPStatusCode': 200, + 'HTTPHeaders': headers, + } + }, + ) + + +class TestHandlesInvalidXMLResponses(unittest.TestCase): + def test_invalid_xml_shown_in_error_message(self): + # Missing the closing XML tags. + invalid_xml = ( + b'' + b' ' + ) + parser = parsers.QueryParser() + output_shape = None + # The XML body should be in the error message. + with self.assertRaisesRegex( + parsers.ResponseParserError, '' + '' + ' first_value' + ' middle_value' + ' last_value' + '' + ) + builder = model.DenormalizedStructureBuilder() + output_shape = builder.with_members( + { + 'Foo': { + 'type': 'structure', + 'members': { + 'Bar': { + 'type': 'string', + } + }, + } + } + ).build_model() + parsed = parser.parse( + {'body': body, 'headers': headers, 'status_code': 200}, + output_shape, + ) + # Ensure the first element is used out of the list. + self.assertEqual(parsed['Foo'], {'Bar': 'first_value'}) + + +class TestEventStreamParsers(unittest.TestCase): + def setUp(self): + self.parser = parsers.EventStreamXMLParser() + self.output_shape = model.StructureShape( + 'EventStream', + { + 'eventstream': True, + 'type': 'structure', + 'members': { + 'EventA': {'shape': 'EventAStructure'}, + 'EventB': {'shape': 'EventBStructure'}, + 'EventC': {'shape': 'EventCStructure'}, + 'EventD': {'shape': 'EventDStructure'}, + 'EventException': {'shape': 'ExceptionShape'}, + }, + }, + model.ShapeResolver( + { + 'EventAStructure': { + 'event': True, + 'type': 'structure', + 'members': { + 'Stats': { + 'shape': 'StatsStructure', + 'eventpayload': True, + }, + 'Header': { + 'shape': 'IntShape', + 'eventheader': True, + }, + }, + }, + 'EventBStructure': { + 'event': True, + 'type': 'structure', + 'members': { + 'Body': { + 'shape': 'BlobShape', + 'eventpayload': True, + } + }, + }, + 'EventCStructure': { + 'event': True, + 'type': 'structure', + 'members': { + 'Body': { + 'shape': 'StringShape', + 'eventpayload': True, + } + }, + }, + 'EventDStructure': { + 'event': True, + 'type': 'structure', + 'members': { + 'StringField': {'shape': 'StringShape'}, + 'IntField': {'shape': 'IntShape'}, + 'Header': { + 'shape': 'IntShape', + 'eventheader': True, + }, + }, + }, + 'StatsStructure': { + 'type': 'structure', + 'members': { + 'StringField': {'shape': 'StringShape'}, + 'IntField': {'shape': 'IntShape'}, + }, + }, + 'BlobShape': {'type': 'blob'}, + 'StringShape': {'type': 'string'}, + 'IntShape': {'type': 'integer'}, + 'ExceptionShape': { + 'exception': True, + 'type': 'structure', + 'members': {'message': {'shape': 'StringShape'}}, + }, + } + ), + ) + + def parse_event(self, headers=None, body=None, status_code=200): + response_dict = { + 'body': body, + 'headers': headers, + 'status_code': status_code, + } + return self.parser.parse(response_dict, self.output_shape) + + def test_parses_event_xml(self): + headers = {'Header': 123, ':event-type': 'EventA'} + body = ( + b'' + b' abcde' + b' 1234' + b'' + ) + parsed = self.parse_event(headers, body) + expected = { + 'EventA': { + 'Header': 123, + 'Stats': {'StringField': 'abcde', 'IntField': 1234}, + } + } + self.assertEqual(parsed, expected) + + def test_parses_event_bad_xml(self): + headers = {'Header': 123, ':event-type': 'EventA'} + parsed = self.parse_event(headers, b'') + expected = {'EventA': {'Header': 123, 'Stats': {}}} + self.assertEqual(parsed, expected) + + def test_parses_event_blob(self): + headers = {':event-type': 'EventB'} + parsed = self.parse_event(headers, b'blob') + expected = {'EventB': {'Body': b'blob'}} + self.assertEqual(parsed, expected) + + def test_parses_event_string(self): + headers = {':event-type': 'EventC'} + parsed = self.parse_event(headers, b'blob') + expected = {'EventC': {'Body': 'blob'}} + self.assertEqual(parsed, expected) + + def test_parses_payload_implicit(self): + headers = {'Header': 123, ':event-type': 'EventD'} + body = ( + b'' + b' abcde' + b' 1234' + b'' + ) + parsed = self.parse_event(headers, body) + expected = { + 'EventD': {'Header': 123, 'StringField': 'abcde', 'IntField': 1234} + } + self.assertEqual(parsed, expected) + + def test_parses_error_event(self): + error_code = 'client/SomeError' + error_message = 'You did something wrong' + headers = { + ':message-type': 'error', + ':error-code': error_code, + ':error-message': error_message, + } + body = b'' + parsed = self.parse_event(headers, body, status_code=400) + expected = {'Error': {'Code': error_code, 'Message': error_message}} + self.assertEqual(parsed, expected) + + def test_parses_exception_event(self): + self.parser = parsers.EventStreamJSONParser() + error_code = 'EventException' + headers = { + ':message-type': 'exception', + ':exception-type': error_code, + } + body = b'{"message": "You did something wrong"}' + parsed = self.parse_event(headers, body, status_code=400) + expected = { + 'Error': {'Code': error_code, 'Message': 'You did something wrong'} + } + self.assertEqual(parsed, expected) + + def test_parses_event_json(self): + self.parser = parsers.EventStreamJSONParser() + headers = {':event-type': 'EventD'} + body = b'{' b' "StringField": "abcde",' b' "IntField": 1234' b'}' + parsed = self.parse_event(headers, body) + expected = {'EventD': {'StringField': 'abcde', 'IntField': 1234}} + self.assertEqual(parsed, expected) + + +class TestParseErrorResponses(unittest.TestCase): + # This class consolidates all the error parsing tests + # across all the protocols. We may potentially pull + # this into the shared protocol tests in the future, + # so consolidating them into a single class will make + # this easier. + def setUp(self): + self.error_shape = model.StructureShape( + 'ErrorShape', + { + 'type': 'structure', + 'exception': True, + 'members': { + 'ModeledField': { + 'shape': 'StringType', + } + }, + }, + model.ShapeResolver({'StringType': {'type': 'string'}}), + ) + + def test_response_metadata_errors_for_json_protocol(self): + parser = parsers.JSONParser() + response = { + "body": b""" + {"__type":"amazon.foo.validate#ValidationException", + "message":"this is a message"} + """, + "status_code": 400, + "headers": {"x-amzn-requestid": "request-id"}, + } + parsed = parser.parse(response, None) + # Even (especially) on an error condition, the + # ResponseMetadata should be populated. + self.assertIn('ResponseMetadata', parsed) + self.assertEqual(parsed['ResponseMetadata']['RequestId'], 'request-id') + + self.assertIn('Error', parsed) + self.assertEqual(parsed['Error']['Message'], 'this is a message') + self.assertEqual(parsed['Error']['Code'], 'ValidationException') + + def test_response_metadata_errors_alternate_form_json_protocol(self): + # Sometimes there is no '#' in the __type. We need to be + # able to parse this error message as well. + parser = parsers.JSONParser() + response = { + "body": b""" + {"__type":"ValidationException", + "message":"this is a message"} + """, + "status_code": 400, + "headers": {"x-amzn-requestid": "request-id"}, + } + parsed = parser.parse(response, None) + self.assertIn('Error', parsed) + self.assertEqual(parsed['Error']['Message'], 'this is a message') + self.assertEqual(parsed['Error']['Code'], 'ValidationException') + + def test_response_with_query_error_for_json_protocol(self): + parser = parsers.JSONParser() + response = { + "body": b""" + {"__type":"amazon.foo.validate#ValidationException", + "message":"this is a message"} + """, + "status_code": 400, + "headers": { + "x-amzn-requestid": "request-id", + "x-amzn-query-error": "AWS.SimpleQueueService.NonExistentQueue;Sender", + }, + } + parsed = parser.parse(response, None) + # ResponseMetadata should always be populated. + self.assertIn('ResponseMetadata', parsed) + self.assertEqual(parsed['ResponseMetadata']['RequestId'], 'request-id') + + self.assertIn('Error', parsed) + self.assertEqual(parsed['Error']['Message'], 'this is a message') + self.assertEqual( + parsed['Error']['Code'], 'AWS.SimpleQueueService.NonExistentQueue' + ) + self.assertEqual( + parsed['Error']['QueryErrorCode'], "ValidationException" + ) + self.assertEqual(parsed['Error']['Type'], 'Sender') + + def test_response_with_invalid_query_error_for_json_protocol(self): + parser = parsers.JSONParser() + response = { + "body": b""" + {"__type":"amazon.foo.validate#ValidationException", + "message":"this is a message"} + """, + "status_code": 400, + "headers": { + "x-amzn-requestid": "request-id", + "x-amzn-query-error": "AWS.SimpleQueueService.NonExistentQueue;sender;400", + }, + } + parsed = parser.parse(response, None) + self.assertIn('ResponseMetadata', parsed) + self.assertEqual(parsed['ResponseMetadata']['RequestId'], 'request-id') + + self.assertIn('Error', parsed) + self.assertEqual(parsed['Error']['Message'], 'this is a message') + self.assertEqual(parsed['Error']['Code'], 'ValidationException') + self.assertNotIn('QueryErrorCode', parsed['Error']) + self.assertNotIn('Type', parsed['Error']) + + def test_response_with_incomplete_query_error_for_json_protocol(self): + parser = parsers.JSONParser() + response = { + "body": b""" + {"__type":"amazon.foo.validate#ValidationException", + "message":"this is a message"} + """, + "status_code": 400, + "headers": { + "x-amzn-requestid": "request-id", + "x-amzn-query-error": ";sender", + }, + } + parsed = parser.parse(response, None) + self.assertIn('ResponseMetadata', parsed) + self.assertEqual(parsed['ResponseMetadata']['RequestId'], 'request-id') + + self.assertIn('Error', parsed) + self.assertEqual(parsed['Error']['Message'], 'this is a message') + self.assertEqual(parsed['Error']['Code'], 'ValidationException') + self.assertNotIn('QueryErrorCode', parsed['Error']) + self.assertNotIn('Type', parsed['Error']) + + def test_response_with_empty_query_errors_for_json_protocol(self): + parser = parsers.JSONParser() + response = { + "body": b""" + {"__type":"amazon.foo.validate#ValidationException", + "message":"this is a message"} + """, + "status_code": 400, + "headers": { + "x-amzn-requestid": "request-id", + "x-amzn-query-error": "", + }, + } + parsed = parser.parse(response, None) + self.assertIn('ResponseMetadata', parsed) + self.assertEqual(parsed['ResponseMetadata']['RequestId'], 'request-id') + + self.assertIn('Error', parsed) + self.assertEqual(parsed['Error']['Message'], 'this is a message') + self.assertEqual(parsed['Error']['Code'], 'ValidationException') + self.assertNotIn('QueryErrorCode', parsed['Error']) + self.assertNotIn('Type', parsed['Error']) + + def test_parse_error_response_for_query_protocol(self): + body = ( + b'' + b' ' + b' Sender' + b' InvalidInput' + b' ARN asdf is not valid.' + b' ' + b' request-id' + b'' + ) + parser = parsers.QueryParser() + parsed = parser.parse( + {'body': body, 'headers': {}, 'status_code': 400}, None + ) + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + { + 'Code': 'InvalidInput', + 'Message': 'ARN asdf is not valid.', + 'Type': 'Sender', + }, + ) + + def test_can_parse_sdb_error_response_query_protocol(self): + body = ( + b'' + b' ' + b' ' + b' 1' + b' msg' + b' ' + b' ' + b' abc-123' + b'' + ) + parser = parsers.QueryParser() + parsed = parser.parse( + {'body': body, 'headers': {}, 'status_code': 500}, None + ) + self.assertIn('Error', parsed) + self.assertEqual(parsed['Error'], {'Code': '1', 'Message': 'msg'}) + self.assertEqual( + parsed['ResponseMetadata'], + {'RequestId': 'abc-123', 'HTTPStatusCode': 500, 'HTTPHeaders': {}}, + ) + + def test_can_parser_ec2_errors(self): + body = ( + b'' + b' ' + b' ' + b' InvalidInstanceID.NotFound' + b' The instance ID i-12345 does not exist' + b' ' + b' ' + b' 06f382b0-d521-4bb6-988c-ca49d5ae6070' + b'' + ) + parser = parsers.EC2QueryParser() + parsed = parser.parse( + {'body': body, 'headers': {}, 'status_code': 400}, None + ) + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + { + 'Code': 'InvalidInstanceID.NotFound', + 'Message': 'The instance ID i-12345 does not exist', + }, + ) + + def test_can_parse_rest_xml_errors(self): + body = ( + b'' + b' ' + b' Sender' + b' NoSuchHostedZone' + b' No hosted zone found with ID: foobar' + b' ' + b' bc269cf3-d44f-11e5-8779-2d21c30eb3f1' + b'' + ) + parser = parsers.RestXMLParser() + parsed = parser.parse( + {'body': body, 'headers': {}, 'status_code': 400}, None + ) + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + { + 'Code': 'NoSuchHostedZone', + 'Message': 'No hosted zone found with ID: foobar', + 'Type': 'Sender', + }, + ) + + def test_can_parse_rest_json_errors(self): + body = b'{"Message":"Function not found: foo","Type":"User"}' + headers = { + 'x-amzn-requestid': 'request-id', + 'x-amzn-errortype': 'ResourceNotFoundException:http://url/', + } + parser = parsers.RestJSONParser() + parsed = parser.parse( + {'body': body, 'headers': headers, 'status_code': 400}, None + ) + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + { + 'Code': 'ResourceNotFoundException', + 'Message': 'Function not found: foo', + }, + ) + + def test_error_response_with_no_body_rest_json(self): + parser = parsers.RestJSONParser() + response = b'' + headers = {'content-length': '0', 'connection': 'keep-alive'} + output_shape = None + parsed = parser.parse( + {'body': response, 'headers': headers, 'status_code': 504}, + output_shape, + ) + + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], {'Code': '504', 'Message': 'Gateway Timeout'} + ) + self.assertEqual( + parsed['ResponseMetadata'], + {'HTTPStatusCode': 504, 'HTTPHeaders': headers}, + ) + + def test_error_response_with_string_body_rest_json(self): + parser = parsers.RestJSONParser() + response = b'HTTP content length exceeded 1049600 bytes.' + headers = {'content-length': '0', 'connection': 'keep-alive'} + output_shape = None + parsed = parser.parse( + {'body': response, 'headers': headers, 'status_code': 413}, + output_shape, + ) + + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + {'Code': '413', 'Message': response.decode('utf-8')}, + ) + self.assertEqual( + parsed['ResponseMetadata'], + {'HTTPStatusCode': 413, 'HTTPHeaders': headers}, + ) + + def test_error_response_with_xml_body_rest_json(self): + parser = parsers.RestJSONParser() + response = ( + b'' + b' Unable to determine service/operation name to be authorized' + b'' + ) + headers = {'content-length': '0', 'connection': 'keep-alive'} + output_shape = None + parsed = parser.parse( + {'body': response, 'headers': headers, 'status_code': 403}, + output_shape, + ) + + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + {'Code': '403', 'Message': response.decode('utf-8')}, + ) + self.assertEqual( + parsed['ResponseMetadata'], + {'HTTPStatusCode': 403, 'HTTPHeaders': headers}, + ) + + def test_s3_error_response(self): + body = ( + b'' + b' NoSuchBucket' + b' error message' + b' asdf' + b' EF1EF43A74415102' + b' hostid' + b'' + ) + headers = {'x-amz-id-2': 'second-id', 'x-amz-request-id': 'request-id'} + parser = parsers.RestXMLParser() + parsed = parser.parse( + {'body': body, 'headers': headers, 'status_code': 400}, None + ) + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + { + 'Code': 'NoSuchBucket', + 'Message': 'error message', + 'BucketName': 'asdf', + # We don't want the RequestId/HostId because they're already + # present in the ResponseMetadata key. + }, + ) + self.assertEqual( + parsed['ResponseMetadata'], + { + 'RequestId': 'request-id', + 'HostId': 'second-id', + 'HTTPStatusCode': 400, + 'HTTPHeaders': headers, + }, + ) + + def test_s3_error_response_with_no_body(self): + # If you try to HeadObject a key that does not exist, + # you will get an empty body. When this happens + # we expect that we will use Code/Message from the + # HTTP status code. + body = '' + headers = {'x-amz-id-2': 'second-id', 'x-amz-request-id': 'request-id'} + parser = parsers.RestXMLParser() + parsed = parser.parse( + {'body': body, 'headers': headers, 'status_code': 404}, None + ) + self.assertIn('Error', parsed) + self.assertEqual( + parsed['Error'], + { + 'Code': '404', + 'Message': 'Not Found', + }, + ) + self.assertEqual( + parsed['ResponseMetadata'], + { + 'RequestId': 'request-id', + 'HostId': 'second-id', + 'HTTPStatusCode': 404, + 'HTTPHeaders': headers, + }, + ) + + def test_can_parse_glacier_error_response(self): + body = ( + b'{"code":"AccessDeniedException","type":"Client","message":' + b'"Access denied"}' + ) + headers = {'x-amzn-requestid': 'request-id'} + parser = parsers.RestJSONParser() + parsed = parser.parse( + {'body': body, 'headers': headers, 'status_code': 400}, None + ) + self.assertEqual( + parsed['Error'], + {'Message': 'Access denied', 'Code': 'AccessDeniedException'}, + ) + + def test_can_parse_restjson_error_code(self): + body = b'''{ + "status": "error", + "errors": [{"message": "[*Deprecated*: blah"}], + "adds": 0, + "__type": "#WasUnableToParseThis", + "message": "blah", + "deletes": 0}''' + headers = {'x-amzn-requestid': 'request-id'} + parser = parsers.RestJSONParser() + parsed = parser.parse( + {'body': body, 'headers': headers, 'status_code': 400}, None + ) + self.assertEqual( + parsed['Error'], + {'Message': 'blah', 'Code': 'WasUnableToParseThis'}, + ) + + def test_can_parse_with_case_insensitive_keys(self): + body = ( + b'{"Code":"AccessDeniedException","type":"Client","Message":' + b'"Access denied"}' + ) + headers = {'x-amzn-requestid': 'request-id'} + parser = parsers.RestJSONParser() + parsed = parser.parse( + {'body': body, 'headers': headers, 'status_code': 400}, None + ) + self.assertEqual( + parsed['Error'], + {'Message': 'Access denied', 'Code': 'AccessDeniedException'}, + ) + + def test_can_parse_rest_json_modeled_fields(self): + body = ( + b'{"ModeledField":"Some modeled field",' + b'"Message":"Some message"}' + ) + parser = parsers.RestJSONParser() + response_dict = { + 'status_code': 400, + 'headers': {}, + 'body': body, + } + parsed = parser.parse(response_dict, self.error_shape) + expected_parsed = { + 'ModeledField': 'Some modeled field', + } + self.assertEqual(parsed, expected_parsed) + + def test_can_parse_rest_xml_modeled_fields(self): + parser = parsers.RestXMLParser() + body = ( + b'\n' + b'SenderNoSuchDistribution' + b'The specified distribution does not exist.' + b'Some modeled field' + b'' + b'' + ) + response_dict = { + 'status_code': 400, + 'headers': {}, + 'body': body, + } + parsed = parser.parse(response_dict, self.error_shape) + expected_parsed = { + 'ModeledField': 'Some modeled field', + } + self.assertEqual(parsed, expected_parsed) + + def test_can_parse_ec2_modeled_fields(self): + body = ( + b'' + b'ExceptionShape' + b'Foo message' + b'Some modeled field' + b'' + ) + parser = parsers.EC2QueryParser() + response_dict = { + 'status_code': 400, + 'headers': {}, + 'body': body, + } + parsed = parser.parse(response_dict, self.error_shape) + expected_parsed = { + 'ModeledField': 'Some modeled field', + } + self.assertEqual(parsed, expected_parsed) + + def test_can_parse_query_modeled_fields(self): + parser = parsers.QueryParser() + body = ( + b'\n' + b'SenderSomeCode' + b'A message' + b'Some modeled field' + b'' + b'' + ) + response_dict = { + 'status_code': 400, + 'headers': {}, + 'body': body, + } + parsed = parser.parse(response_dict, self.error_shape) + expected_parsed = { + 'ModeledField': 'Some modeled field', + } + self.assertEqual(parsed, expected_parsed) + + def test_can_parse_json_modeled_fields(self): + body = ( + b'{"ModeledField":"Some modeled field",' + b'"Message":"Some message",' + b'"__type": "Prefix#SomeError"}' + ) + parser = parsers.JSONParser() + response_dict = { + 'status_code': 400, + 'headers': {}, + 'body': body, + } + parsed = parser.parse(response_dict, self.error_shape) + expected_parsed = { + 'ModeledField': 'Some modeled field', + } + self.assertEqual(parsed, expected_parsed) + + def test_can_parse_route53_with_missing_message(self): + # The message isn't always in the XML response (or even the headers). + # We should be able to handle this gracefully and still at least + # populate a "Message" key so that consumers don't have to + # conditionally check for this. + body = ( + b'' + b' ' + b' Sender' + b' InvalidInput' + b' ' + b' id' + b'' + ) + parser = parsers.RestXMLParser() + parsed = parser.parse( + {'body': body, 'headers': {}, 'status_code': 400}, None + ) + error = parsed['Error'] + self.assertEqual(error['Code'], 'InvalidInput') + # Even though there's no we should + # still populate an empty string. + self.assertEqual(error['Message'], '') + + +def _generic_test_bodies(): + generic_html_body = ( + b'Http/1.1 Service Unavailable' + ) + empty_body = b'' + none_body = None + + return [generic_html_body, empty_body, none_body] + + +@pytest.mark.parametrize( + "parser, body", + itertools.product( + parsers.PROTOCOL_PARSERS.values(), _generic_test_bodies() + ), +) +def test_can_handle_generic_error_message(parser, body): + # There are times when you can get a service to respond with a generic + # html error page. We should be able to handle this case. + parsed = parser().parse( + {'body': body, 'headers': {}, 'status_code': 503}, None + ) + assert parsed['Error'] == {'Code': '503', 'Message': 'Service Unavailable'} + assert parsed['ResponseMetadata']['HTTPStatusCode'] == 503 diff --git a/testbed/boto__botocore/tests/unit/test_protocols.py b/testbed/boto__botocore/tests/unit/test_protocols.py new file mode 100644 index 0000000000000000000000000000000000000000..253ec5f7a55505e7772bcd8b67e74c85b79fad13 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_protocols.py @@ -0,0 +1,473 @@ +#!/usr/bin/env python +# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +"""Test runner for the JSON models compliance tests + +This is a test runner for all the JSON tests defined in +``tests/unit/protocols/``, including both the input/output tests. + +You can use the normal ``python -m pytest tests/unit/test_protocols.py`` +to run this test. In addition, there are several env vars you can use during +development. + +Tests are broken down by filename, test suite, testcase. When a test fails +you'll see the protocol (filename), test suite, and test case number of the +failed test. + +:: + + Description : Scalar members (0:0) <--- (suite_id:test_id) + Protocol: : ec2 <--- test file (ec2.json) + Given : ... + Response : ... + Expected serialization: ... + Actual serialization : ... + Assertion message : ... + +To run tests from only a single file, you can set the +BOTOCORE_TEST env var:: + + BOTOCORE_TEST=tests/unit/compliance/input/json.json pytest tests/unit/test_protocols.py + +To run a single test suite you can set the BOTOCORE_TEST_ID env var: + + BOTOCORE_TEST=tests/unit/compliance/input/json.json BOTOCORE_TEST_ID=5 \ + pytest tests/unit/test_protocols.py + +To run a single test case in a suite (useful when debugging a single test), you +can set the BOTOCORE_TEST_ID env var with the ``suite_id:test_id`` syntax. + + BOTOCORE_TEST_ID=5:1 pytest test/unit/test_protocols.py + +""" + +import copy +import os +from base64 import b64decode +from calendar import timegm +from enum import Enum + +import pytest +from dateutil.tz import tzutc + +from botocore.awsrequest import HeadersDict, prepare_request_dict +from botocore.compat import OrderedDict, json, urlsplit +from botocore.eventstream import EventStream +from botocore.model import NoShapeFoundError, OperationModel, ServiceModel +from botocore.parsers import ( + EC2QueryParser, + JSONParser, + QueryParser, + RestJSONParser, + RestXMLParser, +) +from botocore.serialize import ( + EC2Serializer, + JSONSerializer, + QuerySerializer, + RestJSONSerializer, + RestXMLSerializer, +) +from botocore.utils import parse_timestamp, percent_encode_sequence + +TEST_DIR = os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'protocols' +) +NOT_SPECIFIED = object() +PROTOCOL_SERIALIZERS = { + 'ec2': EC2Serializer, + 'query': QuerySerializer, + 'json': JSONSerializer, + 'rest-json': RestJSONSerializer, + 'rest-xml': RestXMLSerializer, +} +PROTOCOL_PARSERS = { + 'ec2': EC2QueryParser, + 'query': QueryParser, + 'json': JSONParser, + 'rest-json': RestJSONParser, + 'rest-xml': RestXMLParser, +} +PROTOCOL_TEST_BLACKLIST = ['Idempotency token auto fill'] + + +class TestType(Enum): + # Tell test runner to ignore this class + __test__ = False + + INPUT = "input" + OUTPUT = "output" + + +def _compliance_tests(test_type=None): + inp = test_type is None or test_type is TestType.INPUT + out = test_type is None or test_type is TestType.OUTPUT + + for full_path in _walk_files(): + if full_path.endswith('.json'): + for model, case, basename in _load_cases(full_path): + if model.get('description') in PROTOCOL_TEST_BLACKLIST: + continue + if 'params' in case and inp: + yield model, case, basename + elif 'response' in case and out: + yield model, case, basename + + +@pytest.mark.parametrize( + "json_description, case, basename", _compliance_tests(TestType.INPUT) +) +def test_input_compliance(json_description, case, basename): + service_description = copy.deepcopy(json_description) + service_description['operations'] = { + case.get('name', 'OperationName'): case, + } + model = ServiceModel(service_description) + protocol_type = model.metadata['protocol'] + try: + protocol_serializer = PROTOCOL_SERIALIZERS[protocol_type] + except KeyError: + raise RuntimeError(f"Unknown protocol: {protocol_type}") + serializer = protocol_serializer() + serializer.MAP_TYPE = OrderedDict + operation_model = OperationModel(case['given'], model) + request = serializer.serialize_to_request(case['params'], operation_model) + _serialize_request_description(request) + client_endpoint = service_description.get('clientEndpoint') + try: + _assert_request_body_is_bytes(request['body']) + _assert_requests_equal(request, case['serialized']) + _assert_endpoints_equal(request, case['serialized'], client_endpoint) + except AssertionError as e: + _input_failure_message(protocol_type, case, request, e) + + +def _assert_request_body_is_bytes(body): + if not isinstance(body, bytes): + raise AssertionError( + "Expected body to be serialized as type " + f"bytes(), instead got: {type(body)}" + ) + + +def _assert_endpoints_equal(actual, expected, endpoint): + if 'host' not in expected: + return + prepare_request_dict(actual, endpoint) + actual_host = urlsplit(actual['url']).netloc + assert_equal(actual_host, expected['host'], 'Host') + + +class MockRawResponse: + def __init__(self, data): + self._data = b64decode(data) + + def stream(self): + yield self._data + + +@pytest.mark.parametrize( + "json_description, case, basename", _compliance_tests(TestType.OUTPUT) +) +def test_output_compliance(json_description, case, basename): + service_description = copy.deepcopy(json_description) + operation_name = case.get('name', 'OperationName') + service_description['operations'] = { + operation_name: case, + } + case['response']['context'] = {'operation_name': operation_name} + try: + model = ServiceModel(service_description) + operation_model = OperationModel(case['given'], model) + parser = PROTOCOL_PARSERS[model.metadata['protocol']]( + timestamp_parser=_compliance_timestamp_parser + ) + # We load the json as utf-8, but the response parser is at the + # botocore boundary, so it expects to work with bytes. + body_bytes = case['response']['body'].encode('utf-8') + case['response']['body'] = body_bytes + # We need the headers to be case insensitive + headers = HeadersDict(case['response']['headers']) + case['response']['headers'] = headers + # If this is an event stream fake the raw streamed response + if operation_model.has_event_stream_output: + case['response']['body'] = MockRawResponse(body_bytes) + if 'error' in case: + output_shape = operation_model.output_shape + parsed = parser.parse(case['response'], output_shape) + try: + error_shape = model.shape_for(parsed['Error']['Code']) + except NoShapeFoundError: + error_shape = None + if error_shape is not None: + error_parse = parser.parse(case['response'], error_shape) + parsed.update(error_parse) + else: + output_shape = operation_model.output_shape + parsed = parser.parse(case['response'], output_shape) + parsed = _fixup_parsed_result(parsed) + except Exception as e: + msg = ( + "\nFailed to run test : {}\n" + "Protocol : {}\n" + "Description : {} ({}:{})\n".format( + e, + model.metadata['protocol'], + case['description'], + case['suite_id'], + case['test_id'], + ) + ) + raise AssertionError(msg) + try: + if 'error' in case: + expected_result = { + 'Error': { + 'Code': case.get('errorCode', ''), + 'Message': case.get('errorMessage', ''), + } + } + expected_result.update(case['error']) + else: + expected_result = case['result'] + assert_equal(parsed, expected_result, "Body") + except Exception as e: + _output_failure_message( + model.metadata['protocol'], case, parsed, expected_result, e + ) + + +def _fixup_parsed_result(parsed): + # This function contains all the transformation we need + # to do from the response _our_ response parsers give + # vs. the expected responses in the protocol tests. + # These are implementation specific changes, not any + # "we're not following the spec"-type changes. + + # 1. RequestMetadata. We parse this onto the returned dict, but compliance + # tests don't have any specs for how to deal with request metadata. + if 'ResponseMetadata' in parsed: + del parsed['ResponseMetadata'] + # 2. Binary blob types. In the protocol test, blob types, when base64 + # decoded, always decode to something that can be expressed via utf-8. + # This is not always the case. In python3, the blob type is designed to + # return a bytes (not str) object. However, for these tests we'll work for + # any bytes type, and decode it as utf-8 because we know that's safe for + # the compliance tests. + parsed = _convert_bytes_to_str(parsed) + # 3. We need to expand the event stream object into the list of events + for key, value in parsed.items(): + if isinstance(value, EventStream): + parsed[key] = _convert_bytes_to_str(list(value)) + break + # 4. We parse the entire error body into the "Error" field for rest-xml + # which causes some modeled fields in the response to be placed under the + # error key. We don't have enough information in the test suite to assert + # these properly, and they probably shouldn't be there in the first place. + if 'Error' in parsed: + error_keys = list(parsed['Error'].keys()) + for key in error_keys: + if key not in ['Code', 'Message']: + del parsed['Error'][key] + return parsed + + +def _convert_bytes_to_str(parsed): + if isinstance(parsed, dict): + new_dict = {} + for key, value in parsed.items(): + new_dict[key] = _convert_bytes_to_str(value) + return new_dict + elif isinstance(parsed, bytes): + return parsed.decode('utf-8') + elif isinstance(parsed, list): + new_list = [] + for item in parsed: + new_list.append(_convert_bytes_to_str(item)) + return new_list + else: + return parsed + + +def _compliance_timestamp_parser(value): + datetime = parse_timestamp(value) + # Convert from our time zone to UTC + datetime = datetime.astimezone(tzutc()) + # Convert to epoch. + return int(timegm(datetime.timetuple())) + + +def _output_failure_message( + protocol_type, case, actual_parsed, expected_result, error +): + j = _try_json_dump + error_message = ( + "\nDescription : {} ({}:{})\n" + "Protocol: : {}\n" + "Given : {}\n" + "Response : {}\n" + "Expected serialization: {}\n" + "Actual serialization : {}\n" + "Assertion message : {}\n".format( + case['description'], + case['suite_id'], + case['test_id'], + protocol_type, + j(case['given']), + j(case['response']), + j(expected_result), + j(actual_parsed), + error, + ) + ) + raise AssertionError(error_message) + + +def _input_failure_message(protocol_type, case, actual_request, error): + j = _try_json_dump + error_message = ( + "\nDescription : {} ({}:{})\n" + "Protocol: : {}\n" + "Given : {}\n" + "Params : {}\n" + "Expected serialization: {}\n" + "Actual serialization : {}\n" + "Assertion message : {}\n".format( + case['description'], + case['suite_id'], + case['test_id'], + protocol_type, + j(case['given']), + j(case['params']), + j(case['serialized']), + j(actual_request), + error, + ) + ) + raise AssertionError(error_message) + + +def _try_json_dump(obj): + try: + return json.dumps(obj) + except (ValueError, TypeError): + return str(obj) + + +def assert_equal(first, second, prefix): + # A better assert equals. It allows you to just provide + # prefix instead of the entire message. + try: + assert first == second + except Exception: + try: + better = f"{prefix} (actual != expected)\n{json.dumps(first, indent=2)} !=\n{json.dumps(second, indent=2)}" + except (ValueError, TypeError): + better = f"{prefix} (actual != expected)\n{first} !=\n{second}" + raise AssertionError(better) + + +def _serialize_request_description(request_dict): + if isinstance(request_dict.get('body'), dict): + # urlencode the request body. + encoded = percent_encode_sequence(request_dict['body']).encode('utf-8') + request_dict['body'] = encoded + if isinstance(request_dict.get('query_string'), dict): + encoded = percent_encode_sequence(request_dict.get('query_string')) + if encoded: + # 'requests' automatically handle this, but we in the + # test runner we need to handle the case where the url_path + # already has query params. + if '?' not in request_dict['url_path']: + request_dict['url_path'] += f'?{encoded}' + else: + request_dict['url_path'] += f'&{encoded}' + + +def _assert_requests_equal(actual, expected): + assert_equal( + actual['body'], expected.get('body', '').encode('utf-8'), 'Body value' + ) + actual_headers = HeadersDict(actual['headers']) + expected_headers = HeadersDict(expected.get('headers', {})) + excluded_headers = expected.get('forbidHeaders', []) + _assert_expected_headers_in_request( + actual_headers, expected_headers, excluded_headers + ) + assert_equal(actual['url_path'], expected.get('uri', ''), "URI") + if 'method' in expected: + assert_equal(actual['method'], expected['method'], "Method") + + +def _assert_expected_headers_in_request(actual, expected, excluded_headers): + for header, value in expected.items(): + assert header in actual + assert actual[header] == value + for header in excluded_headers: + assert header not in actual + + +def _walk_files(): + # Check for a shortcut when running the tests interactively. + # If a BOTOCORE_TEST env var is defined, that file is used as the + # only test to run. Useful when doing feature development. + single_file = os.environ.get('BOTOCORE_TEST') + if single_file is not None: + yield os.path.abspath(single_file) + else: + for root, _, filenames in os.walk(TEST_DIR): + for filename in filenames: + yield os.path.join(root, filename) + + +def _load_cases(full_path): + # During developement, you can set the BOTOCORE_TEST_ID + # to run a specific test suite or even a specific test case. + # The format is BOTOCORE_TEST_ID=suite_id:test_id or + # BOTOCORE_TEST_ID=suite_id + suite_id, test_id = _get_suite_test_id() + all_test_data = json.load(open(full_path), object_pairs_hook=OrderedDict) + basename = os.path.basename(full_path) + for i, test_data in enumerate(all_test_data): + if suite_id is not None and i != suite_id: + continue + cases = test_data.pop('cases') + description = test_data['description'] + for j, case in enumerate(cases): + if test_id is not None and j != test_id: + continue + case['description'] = description + case['suite_id'] = i + case['test_id'] = j + yield (test_data, case, basename) + + +def _get_suite_test_id(): + if 'BOTOCORE_TEST_ID' not in os.environ: + return None, None + test_id = None + suite_id = None + split = os.environ['BOTOCORE_TEST_ID'].split(':') + try: + if len(split) == 2: + suite_id, test_id = int(split[0]), int(split[1]) + else: + suite_id = int(split([0])) + except TypeError: + # Same exception, just give a better error message. + raise TypeError( + "Invalid format for BOTOCORE_TEST_ID, should be " + "suite_id[:test_id], and both values should be " + "integers." + ) + return suite_id, test_id diff --git a/testbed/boto__botocore/tests/unit/test_regions.py b/testbed/boto__botocore/tests/unit/test_regions.py new file mode 100644 index 0000000000000000000000000000000000000000..b4763dd4be1046aecc82fe384ca77b0569646128 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_regions.py @@ -0,0 +1,1214 @@ +# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import pytest + +from botocore import regions +from botocore.exceptions import EndpointVariantError, NoRegionError +from tests import unittest + + +class TestEndpointResolver(unittest.TestCase): + def _template(self): + return { + 'partitions': [ + { + 'partition': 'aws', + 'dnsSuffix': 'amazonaws.com', + 'regionRegex': r'^(us|eu)\-\w+$', + 'defaults': { + 'hostname': '{service}.{region}.{dnsSuffix}', + 'variants': [ + { + 'hostname': '{service}-fips.{region}.{dnsSuffix}', + 'tags': ['fips'], + }, + { + 'dnsSuffix': 'api.aws', + 'hostname': '{service}.{region}.{dnsSuffix}', + 'tags': ['dualstack'], + }, + { + 'dnsSuffix': 'api.aws', + 'hostname': '{service}-fips.{region}.{dnsSuffix}', + 'tags': ['dualstack', 'fips'], + }, + ], + }, + 'regions': { + 'us-foo': {'regionName': 'a'}, + 'us-bar': {'regionName': 'b'}, + 'eu-baz': {'regionName': 'd'}, + }, + 'services': { + 'ec2': { + 'defaults': { + 'protocols': ['http', 'https'], + 'variants': [ + { + 'dnsSuffix': 'api.aws', + 'hostname': 'api.ec2.{region}.{dnsSuffix}', + 'tags': ['dualstack'], + } + ], + }, + 'endpoints': { + 'us-foo': { + 'hostname': 'ec2.us-foo.amazonaws.com', + 'variants': [ + { + 'dnsSuffix': 'api.aws', + 'hostname': 'ec2.foo.{dnsSuffix}', + 'tags': ['dualstack'], + }, + { + 'hostname': 'ec2-fips.foo.amazonaws.com', + 'tags': ['fips'], + }, + { + 'hostname': 'ec2-fips.foo.api.aws', + 'tags': ['fips', 'dualstack'], + }, + ], + }, + 'us-bar': {}, + 'us-dep': { + 'deprecated': True, + }, + 'us-fizz': { + 'credentialScope': {'region': 'us-fizz'}, + 'hostname': 'ec2.us-fizz.amazonaws.com', + 'variants': [ + { + 'hostname': 'ec2.fizz.api.aws', + 'tags': ['dualstack'], + } + ], + }, + 'eu-baz': {}, + 'd': {}, + }, + }, + 's3': { + 'defaults': { + 'sslCommonName': '{service}.{region}.{dnsSuffix}', + 'variants': [ + { + 'hostname': 's3.dualstack.{region}.{dnsSuffix}', + 'tags': ['dualstack'], + }, + { + 'hostname': 's3-fips.{region}.{dnsSuffix}', + 'tags': ['fips'], + }, + { + 'hostname': 's3-fips.dualstack.{region}.{dnsSuffix}', + 'tags': ['dualstack', 'fips'], + }, + ], + }, + 'endpoints': { + 'us-foo': { + 'sslCommonName': '{region}.{service}.{dnsSuffix}' + }, + 'us-bar': {}, + 'us-fizz': { + 'hostname': 's3.api.us-fizz.amazonaws.com', + 'variants': [ + {'tags': ['dualstack']}, + {'tags': ['fips']}, + ], + }, + 'eu-baz': {'hostname': 'foo'}, + }, + }, + 'not-regionalized': { + 'isRegionalized': False, + 'partitionEndpoint': 'aws', + 'endpoints': { + 'aws': {'hostname': 'not-regionalized'}, + 'us-foo': {}, + 'eu-baz': {}, + }, + }, + 'non-partition': { + 'partitionEndpoint': 'aws', + 'endpoints': { + 'aws': {'hostname': 'host'}, + 'us-foo': {}, + }, + }, + 'merge': { + 'defaults': { + 'signatureVersions': ['v2'], + 'protocols': ['http'], + }, + 'endpoints': { + 'us-foo': {'signatureVersions': ['v4']}, + 'us-bar': {'protocols': ['https']}, + }, + }, + }, + }, + { + 'partition': 'foo', + 'dnsSuffix': 'foo.com', + 'regionRegex': r'^(foo)\-\w+$', + 'defaults': { + 'hostname': '{service}.{region}.{dnsSuffix}', + 'protocols': ['http'], + 'foo': 'bar', + }, + 'regions': { + 'foo-1': {'regionName': '1'}, + 'foo-2': {'regionName': '2'}, + 'foo-3': {'regionName': '3'}, + }, + 'services': { + 'ec2': { + 'endpoints': { + 'foo-1': {'foo': 'baz'}, + 'foo-2': {}, + 'foo-3': {}, + } + } + }, + }, + { + 'partition': 'aws-iso', + 'dnsSuffix': 'amazonaws.com', + 'defaults': { + 'hostname': '{service}.{region}.{dnsSuffix}', + 'protocols': ['http'], + }, + 'regions': { + 'foo-1': {'regionName': '1'}, + 'foo-2': {'regionName': '2'}, + 'foo-3': {'regionName': '3'}, + }, + 'services': { + 'ec2': { + 'endpoints': { + 'foo-1': {'foo': 'baz'}, + 'foo-2': {}, + 'foo-3': {}, + } + } + }, + }, + ] + } + + def test_ensures_region_is_not_none(self): + with self.assertRaises(NoRegionError): + resolver = regions.EndpointResolver(self._template()) + resolver.construct_endpoint('foo', None) + + def test_ensures_required_keys_present(self): + with self.assertRaises(ValueError): + regions.EndpointResolver({}) + + def test_returns_empty_list_when_listing_for_different_partition(self): + resolver = regions.EndpointResolver(self._template()) + self.assertEqual([], resolver.get_available_endpoints('ec2', 'bar')) + + def test_returns_empty_list_when_no_service_found(self): + resolver = regions.EndpointResolver(self._template()) + self.assertEqual([], resolver.get_available_endpoints('what?')) + + def test_gets_endpoint_names(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.get_available_endpoints( + 'ec2', allow_non_regional=True + ) + self.assertEqual( + ['d', 'eu-baz', 'us-bar', 'us-dep', 'us-fizz', 'us-foo'], + sorted(result), + ) + + def test_gets_endpoint_names_for_partition(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.get_available_endpoints( + 'ec2', allow_non_regional=True, partition_name='foo' + ) + self.assertEqual(['foo-1', 'foo-2', 'foo-3'], sorted(result)) + + def test_list_regional_endpoints_only(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.get_available_endpoints( + 'ec2', allow_non_regional=False + ) + self.assertEqual(['eu-baz', 'us-bar', 'us-foo'], sorted(result)) + + def test_returns_none_when_no_match(self): + resolver = regions.EndpointResolver(self._template()) + self.assertIsNone(resolver.construct_endpoint('foo', 'baz')) + + def test_constructs_regionalized_endpoints_for_exact_matches(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('not-regionalized', 'eu-baz') + self.assertEqual( + 'not-regionalized.eu-baz.amazonaws.com', result['hostname'] + ) + self.assertEqual('aws', result['partition']) + self.assertEqual('eu-baz', result['endpointName']) + + def test_constructs_partition_endpoints_for_real_partition_region(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('not-regionalized', 'us-bar') + self.assertEqual('not-regionalized', result['hostname']) + self.assertEqual('aws', result['partition']) + self.assertEqual('aws', result['endpointName']) + + def test_constructs_partition_endpoints_for_regex_match(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('not-regionalized', 'us-abc') + self.assertEqual('not-regionalized', result['hostname']) + + def test_constructs_endpoints_for_regionalized_regex_match(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('s3', 'us-abc') + self.assertEqual('s3.us-abc.amazonaws.com', result['hostname']) + + def test_constructs_endpoints_for_unknown_service_but_known_region(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('unknown', 'us-foo') + self.assertEqual('unknown.us-foo.amazonaws.com', result['hostname']) + + def test_merges_service_keys(self): + resolver = regions.EndpointResolver(self._template()) + us_foo = resolver.construct_endpoint('merge', 'us-foo') + us_bar = resolver.construct_endpoint('merge', 'us-bar') + self.assertEqual(['http'], us_foo['protocols']) + self.assertEqual(['v4'], us_foo['signatureVersions']) + self.assertEqual(['https'], us_bar['protocols']) + self.assertEqual(['v2'], us_bar['signatureVersions']) + + def test_merges_partition_default_keys_with_no_overwrite(self): + resolver = regions.EndpointResolver(self._template()) + resolved = resolver.construct_endpoint('ec2', 'foo-1') + self.assertEqual('baz', resolved['foo']) + self.assertEqual(['http'], resolved['protocols']) + + def test_merges_partition_default_keys_with_overwrite(self): + resolver = regions.EndpointResolver(self._template()) + resolved = resolver.construct_endpoint('ec2', 'foo-2') + self.assertEqual('bar', resolved['foo']) + self.assertEqual(['http'], resolved['protocols']) + + def test_gives_hostname_and_common_name_unaltered(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('s3', 'eu-baz') + self.assertEqual('s3.eu-baz.amazonaws.com', result['sslCommonName']) + self.assertEqual('foo', result['hostname']) + + def tests_uses_partition_endpoint_when_no_region_provided(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('not-regionalized') + self.assertEqual('not-regionalized', result['hostname']) + self.assertEqual('aws', result['endpointName']) + + def test_returns_dns_suffix_if_available(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint('not-regionalized') + self.assertEqual(result['dnsSuffix'], 'amazonaws.com') + + def test_construct_dualstack_from_endpoint_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'ec2', 'us-foo', use_dualstack_endpoint=True + ) + self.assertEqual(result['hostname'], 'ec2.foo.api.aws') + self.assertEqual(result['dnsSuffix'], 'api.aws') + + def test_construct_dualstack_endpoint_from_service_default_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'ec2', 'us-bar', use_dualstack_endpoint=True + ) + self.assertEqual(result['hostname'], 'api.ec2.us-bar.api.aws') + self.assertEqual(result['dnsSuffix'], 'api.aws') + + def test_construct_dualstack_endpoint_from_partition_default_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'dynamodb', 'us-bar', use_dualstack_endpoint=True + ) + self.assertEqual(result['hostname'], 'dynamodb.us-bar.api.aws') + self.assertEqual(result['dnsSuffix'], 'api.aws') + + def test_constructs_dualstack_endpoint_no_hostname_in_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 's3', 'us-fizz', use_dualstack_endpoint=True + ) + self.assertEqual('s3.dualstack.us-fizz.api.aws', result['hostname']) + + def test_constructs_endpoint_dualstack_no_variant_dns_suffix(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 's3', 'us-bar', use_dualstack_endpoint=True + ) + self.assertEqual('s3.dualstack.us-bar.api.aws', result['hostname']) + + def test_construct_dualstack_endpoint_iso_partition_raise_exception(self): + with self.assertRaises(EndpointVariantError): + resolver = regions.EndpointResolver(self._template()) + resolver.construct_endpoint( + 'foo', 'foo-1', 'aws-iso', use_dualstack_endpoint=True + ) + + def test_get_partition_dns_suffix_no_tags(self): + resolver = regions.EndpointResolver(self._template()) + self.assertEqual( + resolver.get_partition_dns_suffix('aws'), 'amazonaws.com' + ) + + def test_get_partition_dualstack_dns_suffix(self): + resolver = regions.EndpointResolver(self._template()) + self.assertEqual( + resolver.get_partition_dns_suffix('aws', ['dualstack']), 'api.aws' + ) + + def test_get_partition_dualstack_dns_suffix_does_not_exist(self): + resolver = regions.EndpointResolver(self._template()) + self.assertIsNone( + resolver.get_partition_dns_suffix('foo', ['dualstack']) + ) + + def test_get_available_fips_endpoints(self): + resolver = regions.EndpointResolver(self._template()) + fips_endpoints = resolver.get_available_endpoints( + 'ec2', endpoint_variant_tags=['fips'] + ) + self.assertEqual(fips_endpoints, ['us-foo']) + + def test_get_available_dualstack_endpoints(self): + resolver = regions.EndpointResolver(self._template()) + dualstack_endpoints = resolver.get_available_endpoints( + 'ec2', endpoint_variant_tags=['dualstack'] + ) + self.assertEqual(dualstack_endpoints, ['us-foo']) + + def test_get_available_fips_and_dualstack_endpoints(self): + resolver = regions.EndpointResolver(self._template()) + fips_and_dualstack_endpoints = resolver.get_available_endpoints( + 'ec2', endpoint_variant_tags=['fips', 'dualstack'] + ) + self.assertEqual(fips_and_dualstack_endpoints, ['us-foo']) + + def test_get_available_fips_endpoints_none(self): + resolver = regions.EndpointResolver(self._template()) + fips_endpoints = resolver.get_available_endpoints( + 'ec2', 'foo', endpoint_variant_tags=['fips'] + ) + self.assertEqual(fips_endpoints, []) + + def test_get_available_dualstack_endpoints_none(self): + resolver = regions.EndpointResolver(self._template()) + dualstack_endpoints = resolver.get_available_endpoints( + 'ec2', 'foo', endpoint_variant_tags=['dualstack'] + ) + self.assertEqual(dualstack_endpoints, []) + + def test_get_available_fips_and_dualstack_endpoints_none(self): + resolver = regions.EndpointResolver(self._template()) + fips_and_dualstack_endpoints = resolver.get_available_endpoints( + 'ec2', 'foo', endpoint_variant_tags=['fips', 'dualstack'] + ) + self.assertEqual(fips_and_dualstack_endpoints, []) + + def test_construct_deprecated_endpoint_raises_warning(self): + resolver = regions.EndpointResolver(self._template()) + with self.assertLogs('botocore.regions', level='WARNING') as log: + result = resolver.construct_endpoint( + 'ec2', + 'us-dep', + use_fips_endpoint=True, + ) + self.assertIn('deprecated endpoint', log.output[0]) + self.assertEqual( + result['hostname'], 'ec2-fips.us-dep.amazonaws.com' + ) + self.assertEqual(result['dnsSuffix'], 'amazonaws.com') + + def test_construct_fips_from_endpoint_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'ec2', 'us-foo', use_fips_endpoint=True + ) + self.assertEqual(result['hostname'], 'ec2-fips.foo.amazonaws.com') + self.assertEqual(result['dnsSuffix'], 'amazonaws.com') + + def test_construct_fips_endpoint_from_service_default_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'ec2', 'us-bar', use_fips_endpoint=True + ) + self.assertEqual(result['hostname'], 'ec2-fips.us-bar.amazonaws.com') + self.assertEqual(result['dnsSuffix'], 'amazonaws.com') + + def test_construct_fips_endpoint_from_partition_default_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'dynamodb', 'us-bar', use_fips_endpoint=True + ) + self.assertEqual( + result['hostname'], 'dynamodb-fips.us-bar.amazonaws.com' + ) + self.assertEqual(result['dnsSuffix'], 'amazonaws.com') + + def test_constructs_fips_endpoint_no_hostname_in_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 's3', 'us-fizz', use_fips_endpoint=True + ) + self.assertEqual('s3-fips.us-fizz.amazonaws.com', result['hostname']) + + def test_construct_dualstack_and_fips_from_endpoint_variant(self): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'ec2', + 'us-foo', + use_dualstack_endpoint=True, + use_fips_endpoint=True, + ) + self.assertEqual(result['hostname'], 'ec2-fips.foo.api.aws') + self.assertEqual(result['dnsSuffix'], 'api.aws') + + def test_construct_dualstack_and_fips_endpoint_from_service_default_variant( + self, + ): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'ec2', + 'us-bar', + use_dualstack_endpoint=True, + use_fips_endpoint=True, + ) + self.assertEqual(result['hostname'], 'ec2-fips.us-bar.api.aws') + self.assertEqual(result['dnsSuffix'], 'api.aws') + + def test_construct_dualstack_and_fips_endpoint_from_partition_default_variant( + self, + ): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 'dynamodb', + 'us-bar', + use_dualstack_endpoint=True, + use_fips_endpoint=True, + ) + self.assertEqual(result['hostname'], 'dynamodb-fips.us-bar.api.aws') + self.assertEqual(result['dnsSuffix'], 'api.aws') + + def test_constructs_dualstack_and_fips_endpoint_no_hostname_in_variant( + self, + ): + resolver = regions.EndpointResolver(self._template()) + result = resolver.construct_endpoint( + 's3', + 'us-fizz', + use_dualstack_endpoint=True, + use_fips_endpoint=True, + ) + self.assertEqual( + 's3-fips.dualstack.us-fizz.api.aws', result['hostname'] + ) + + def test_construct_fips_endpoint_no_variant_raise_exception(self): + with self.assertRaises(EndpointVariantError): + resolver = regions.EndpointResolver(self._template()) + resolver.construct_endpoint( + 'ec2', 'foo-1', 'foo', use_fips_endpoint=True + ) + + def test_construct_dualstack_endpoint_no_variant_raise_exception(self): + with self.assertRaises(EndpointVariantError): + resolver = regions.EndpointResolver(self._template()) + resolver.construct_endpoint( + 'ec2', 'foo-1', 'foo', use_dualstack_endpoint=True + ) + + def test_construct_dualstack_and_fips_endpoint_no_variant_raise_exception( + self, + ): + with self.assertRaises(EndpointVariantError): + resolver = regions.EndpointResolver(self._template()) + resolver.construct_endpoint( + 'ec2', + 'foo-1', + 'foo', + use_dualstack_endpoint=True, + use_fips_endpoint=True, + ) + + +def _variant_test_definitions(): + return [ + { + "service": "default-pattern-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "default-pattern-service.us-west-2.amazonaws.com", + }, + { + "service": "default-pattern-service", + "region": "us-west-2", + "fips": True, + "dualstack": False, + "endpoint": "default-pattern-service-fips.us-west-2.amazonaws.com", + }, + { + "service": "default-pattern-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "default-pattern-service.af-south-1.amazonaws.com", + }, + { + "service": "default-pattern-service", + "region": "af-south-1", + "fips": True, + "dualstack": False, + "endpoint": "default-pattern-service-fips.af-south-1.amazonaws.com", + }, + { + "service": "global-service", + "region": "aws-global", + "fips": False, + "dualstack": False, + "endpoint": "global-service.amazonaws.com", + }, + { + "service": "global-service", + "region": "aws-global", + "fips": True, + "dualstack": False, + "endpoint": "global-service-fips.amazonaws.com", + }, + { + "service": "global-service", + "region": "foo", + "fips": False, + "dualstack": False, + "endpoint": "global-service.amazonaws.com", + }, + { + "service": "global-service", + "region": "foo", + "fips": True, + "dualstack": False, + "endpoint": "global-service-fips.amazonaws.com", + }, + { + "service": "override-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-service.us-west-2.amazonaws.com", + }, + { + "service": "override-variant-service", + "region": "us-west-2", + "fips": True, + "dualstack": False, + "endpoint": "fips.override-variant-service.us-west-2.new.dns.suffix", + }, + { + "service": "override-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-service.af-south-1.amazonaws.com", + }, + { + "service": "override-variant-service", + "region": "af-south-1", + "fips": True, + "dualstack": False, + "endpoint": "fips.override-variant-service.af-south-1.new.dns.suffix", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-dns-suffix-service.us-west-2.amazonaws.com", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "us-west-2", + "fips": True, + "dualstack": False, + "endpoint": "override-variant-dns-suffix-service-fips.us-west-2.new.dns.suffix", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-dns-suffix-service.af-south-1.amazonaws.com", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "af-south-1", + "fips": True, + "dualstack": False, + "endpoint": "override-variant-dns-suffix-service-fips.af-south-1.new.dns.suffix", + }, + { + "service": "override-variant-hostname-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-hostname-service.us-west-2.amazonaws.com", + }, + { + "service": "override-variant-hostname-service", + "region": "us-west-2", + "fips": True, + "dualstack": False, + "endpoint": "fips.override-variant-hostname-service.us-west-2.amazonaws.com", + }, + { + "service": "override-variant-hostname-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-hostname-service.af-south-1.amazonaws.com", + }, + { + "service": "override-variant-hostname-service", + "region": "af-south-1", + "fips": True, + "dualstack": False, + "endpoint": "fips.override-variant-hostname-service.af-south-1.amazonaws.com", + }, + { + "service": "override-endpoint-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-endpoint-variant-service.us-west-2.amazonaws.com", + }, + { + "service": "override-endpoint-variant-service", + "region": "us-west-2", + "fips": True, + "dualstack": False, + "endpoint": "fips.override-endpoint-variant-service.us-west-2.amazonaws.com", + }, + { + "service": "override-endpoint-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-endpoint-variant-service.af-south-1.amazonaws.com", + }, + { + "service": "override-endpoint-variant-service", + "region": "af-south-1", + "fips": True, + "dualstack": False, + "endpoint": "override-endpoint-variant-service-fips.af-south-1.amazonaws.com", + }, + { + "service": "default-pattern-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "default-pattern-service.us-west-2.amazonaws.com", + }, + { + "service": "default-pattern-service", + "region": "us-west-2", + "fips": False, + "dualstack": True, + "endpoint": "default-pattern-service.us-west-2.api.aws", + }, + { + "service": "default-pattern-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "default-pattern-service.af-south-1.amazonaws.com", + }, + { + "service": "default-pattern-service", + "region": "af-south-1", + "fips": False, + "dualstack": True, + "endpoint": "default-pattern-service.af-south-1.api.aws", + }, + { + "service": "global-service", + "region": "aws-global", + "fips": False, + "dualstack": False, + "endpoint": "global-service.amazonaws.com", + }, + { + "service": "global-service", + "region": "aws-global", + "fips": False, + "dualstack": True, + "endpoint": "global-service.api.aws", + }, + { + "service": "global-service", + "region": "foo", + "fips": False, + "dualstack": False, + "endpoint": "global-service.amazonaws.com", + }, + { + "service": "global-service", + "region": "foo", + "fips": False, + "dualstack": True, + "endpoint": "global-service.api.aws", + }, + { + "service": "override-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-service.us-west-2.amazonaws.com", + }, + { + "service": "override-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": True, + "endpoint": "override-variant-service.dualstack.us-west-2.new.dns.suffix", + }, + { + "service": "override-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-service.af-south-1.amazonaws.com", + }, + { + "service": "override-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": True, + "endpoint": "override-variant-service.dualstack.af-south-1.new.dns.suffix", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-dns-suffix-service.us-west-2.amazonaws.com", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "us-west-2", + "fips": False, + "dualstack": True, + "endpoint": "override-variant-dns-suffix-service.us-west-2.new.dns.suffix", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-dns-suffix-service.af-south-1.amazonaws.com", + }, + { + "service": "override-variant-dns-suffix-service", + "region": "af-south-1", + "fips": False, + "dualstack": True, + "endpoint": "override-variant-dns-suffix-service.af-south-1.new.dns.suffix", + }, + { + "service": "override-variant-hostname-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-hostname-service.us-west-2.amazonaws.com", + }, + { + "service": "override-variant-hostname-service", + "region": "us-west-2", + "fips": False, + "dualstack": True, + "endpoint": "override-variant-hostname-service.dualstack.us-west-2.api.aws", + }, + { + "service": "override-variant-hostname-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-variant-hostname-service.af-south-1.amazonaws.com", + }, + { + "service": "override-variant-hostname-service", + "region": "af-south-1", + "fips": False, + "dualstack": True, + "endpoint": "override-variant-hostname-service.dualstack.af-south-1.api.aws", + }, + { + "service": "override-endpoint-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "override-endpoint-variant-service.us-west-2.amazonaws.com", + }, + { + "service": "override-endpoint-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": True, + "endpoint": "override-endpoint-variant-service.dualstack.us-west-2.amazonaws.com", + }, + { + "service": "override-endpoint-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "override-endpoint-variant-service.af-south-1.amazonaws.com", + }, + { + "service": "override-endpoint-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": True, + "endpoint": "override-endpoint-variant-service.af-south-1.api.aws", + }, + { + "service": "multi-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": False, + "endpoint": "multi-variant-service.us-west-2.amazonaws.com", + }, + { + "service": "multi-variant-service", + "region": "us-west-2", + "fips": False, + "dualstack": True, + "endpoint": "multi-variant-service.dualstack.us-west-2.api.aws", + }, + { + "service": "multi-variant-service", + "region": "us-west-2", + "fips": True, + "dualstack": False, + "endpoint": "fips.multi-variant-service.us-west-2.amazonaws.com", + }, + { + "service": "multi-variant-service", + "region": "us-west-2", + "fips": True, + "dualstack": True, + "endpoint": "fips.multi-variant-service.dualstack.us-west-2.new.dns.suffix", + }, + { + "service": "multi-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": False, + "endpoint": "multi-variant-service.af-south-1.amazonaws.com", + }, + { + "service": "multi-variant-service", + "region": "af-south-1", + "fips": False, + "dualstack": True, + "endpoint": "multi-variant-service.dualstack.af-south-1.api.aws", + }, + { + "service": "multi-variant-service", + "region": "af-south-1", + "fips": True, + "dualstack": False, + "endpoint": "fips.multi-variant-service.af-south-1.amazonaws.com", + }, + { + "service": "multi-variant-service", + "region": "af-south-1", + "fips": True, + "dualstack": True, + "endpoint": "fips.multi-variant-service.dualstack.af-south-1.new.dns.suffix", + }, + ] + + +def _modeled_variants_template(): + return { + "partitions": [ + { + "defaults": { + "hostname": "{service}.{region}.{dnsSuffix}", + "protocols": ["https"], + "signatureVersions": ["v4"], + "variants": [ + { + "dnsSuffix": "amazonaws.com", + "hostname": "{service}-fips.{region}.{dnsSuffix}", + "tags": ["fips"], + }, + { + "dnsSuffix": "api.aws", + "hostname": "{service}.{region}.{dnsSuffix}", + "tags": ["dualstack"], + }, + { + "dnsSuffix": "api.aws", + "hostname": "{service}-fips.{region}.{dnsSuffix}", + "tags": ["dualstack", "fips"], + }, + ], + }, + "dnsSuffix": "amazonaws.com", + "partition": "aws", + "regionRegex": "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$", + "regions": { + "af-south-1": {"description": "Africa (Cape Town)"}, + "us-west-2": {"description": "US West (Oregon)"}, + }, + "services": { + "default-pattern-service": { + "endpoints": { + "af-south-1": {}, + "us-west-2": { + "variants": [ + { + "hostname": "default-pattern-service-fips.us-west-2.amazonaws.com", + "tags": ["fips"], + }, + { + "hostname": "default-pattern-service.us-west-2.api.aws", + "tags": ["dualstack"], + }, + ] + }, + } + }, + "global-service": { + "endpoints": { + "aws-global": { + "credentialScope": {"region": "us-east-1"}, + "hostname": "global-service.amazonaws.com", + "variants": [ + { + "hostname": "global-service-fips.amazonaws.com", + "tags": ["fips"], + }, + { + "hostname": "global-service.api.aws", + "tags": ["dualstack"], + }, + ], + } + }, + "isRegionalized": False, + "partitionEndpoint": "aws-global", + }, + "override-variant-service": { + "defaults": { + "variants": [ + { + "hostname": "fips.{service}.{region}.{dnsSuffix}", + "dnsSuffix": "new.dns.suffix", + "tags": ["fips"], + }, + { + "hostname": "{service}.dualstack.{region}.{dnsSuffix}", + "dnsSuffix": "new.dns.suffix", + "tags": ["dualstack"], + }, + ] + }, + "endpoints": { + "af-south-1": {}, + "us-west-2": { + "variants": [ + { + "hostname": "fips.override-variant-service.us-west-2.new.dns.suffix", + "tags": ["fips"], + }, + { + "hostname": "override-variant-service.dualstack.us-west-2.new.dns.suffix", + "tags": ["dualstack"], + }, + ] + }, + }, + }, + "override-variant-dns-suffix-service": { + "defaults": { + "variants": [ + { + "dnsSuffix": "new.dns.suffix", + "tags": ["fips"], + }, + { + "dnsSuffix": "new.dns.suffix", + "tags": ["dualstack"], + }, + ] + }, + "endpoints": { + "af-south-1": {}, + "us-west-2": { + "variants": [ + { + "hostname": "override-variant-dns-suffix-service-fips.us-west-2.new.dns.suffix", + "tags": ["fips"], + }, + { + "hostname": "override-variant-dns-suffix-service.us-west-2.new.dns.suffix", + "tags": ["dualstack"], + }, + ] + }, + }, + }, + "override-variant-hostname-service": { + "defaults": { + "variants": [ + { + "hostname": "fips.{service}.{region}.{dnsSuffix}", + "tags": ["fips"], + }, + { + "hostname": "{service}.dualstack.{region}.{dnsSuffix}", + "tags": ["dualstack"], + }, + ] + }, + "endpoints": { + "af-south-1": {}, + "us-west-2": { + "variants": [ + { + "hostname": "fips.override-variant-hostname-service.us-west-2.amazonaws.com", + "tags": ["fips"], + }, + { + "hostname": "override-variant-hostname-service.dualstack.us-west-2.api.aws", + "tags": ["dualstack"], + }, + ] + }, + }, + }, + "override-endpoint-variant-service": { + "endpoints": { + "af-south-1": {}, + "us-west-2": { + "variants": [ + { + "hostname": "fips.override-endpoint-variant-service.us-west-2.amazonaws.com", + "tags": ["fips"], + }, + { + "hostname": "override-endpoint-variant-service.dualstack.us-west-2.amazonaws.com", + "tags": ["dualstack"], + }, + ] + }, + } + }, + "multi-variant-service": { + "defaults": { + "variants": [ + { + "hostname": "fips.{service}.{region}.{dnsSuffix}", + "tags": ["fips"], + }, + { + "hostname": "{service}.dualstack.{region}.{dnsSuffix}", + "tags": ["dualstack"], + }, + { + "dnsSuffix": "new.dns.suffix", + "hostname": "fips.{service}.dualstack.{region}.{dnsSuffix}", + "tags": ["fips", "dualstack"], + }, + ] + }, + "endpoints": { + "af-south-1": {"deprecated": True}, + "us-west-2": { + "variants": [ + { + "hostname": "fips.multi-variant-service.dualstack.us-west-2.new.dns.suffix", + "tags": ["fips", "dualstack"], + } + ] + }, + }, + }, + }, + }, + { + "defaults": { + "hostname": "{service}.{region}.{dnsSuffix}", + "protocols": ["https"], + "signatureVersions": ["v4"], + }, + "dnsSuffix": "c2s.ic.gov", + "partition": "aws-iso", + "regionRegex": "^us\\-iso\\-\\w+\\-\\d+$", + "regions": {"us-iso-east-1": {"description": "US ISO East"}}, + "services": { + "some-service": {"endpoints": {"us-iso-east-1": {}}} + }, + }, + ], + "version": 3, + } + + +@pytest.mark.parametrize("test_case", _variant_test_definitions()) +def test_modeled_variants(test_case): + _verify_expected_endpoint(**test_case) + + +def _verify_expected_endpoint(service, region, fips, dualstack, endpoint): + resolver = regions.EndpointResolver(_modeled_variants_template()) + resolved = resolver.construct_endpoint( + service, + region, + use_dualstack_endpoint=dualstack, + use_fips_endpoint=fips, + ) + # If we can't resolve the region, we attempt to get a + # global endpoint. + if not resolved: + resolved = resolver.construct_endpoint( + service, + region, + partition_name='aws', + use_dualstack_endpoint=dualstack, + use_fips_endpoint=fips, + ) + assert resolved['hostname'] == endpoint + + +def test_additional_endpoint_data_exists_with_variants(): + resolver = regions.EndpointResolver(_modeled_variants_template()) + resolved = resolver.construct_endpoint( + 'global-service', + 'aws-global', + use_fips_endpoint=True, + ) + assert resolved['credentialScope'] == {'region': 'us-east-1'} diff --git a/testbed/boto__botocore/tests/unit/test_response.py b/testbed/boto__botocore/tests/unit/test_response.py new file mode 100644 index 0000000000000000000000000000000000000000..b000b63bb57b68caf6c0661e83fd82e845692ff0 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_response.py @@ -0,0 +1,377 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import datetime +from io import BytesIO + +from dateutil.tz import tzutc +from urllib3.exceptions import ProtocolError as URLLib3ProtocolError +from urllib3.exceptions import ReadTimeoutError as URLLib3ReadTimeoutError + +import botocore +from botocore import response +from botocore.awsrequest import AWSResponse +from botocore.exceptions import ( + IncompleteReadError, + ReadTimeoutError, + ResponseStreamingError, +) +from tests import unittest +from tests.unit import BaseResponseTest + +XMLBODY1 = ( + b'' + b'AccessDenied' + b'Access Denied' + b'XXXXXXXXXXXXXXXX' + b'AAAAAAAAAAAAAAAAAAA' + b'' +) + +XMLBODY2 = ( + b'' + b'' + b'mybucket' + b'1000false' + b'test.png2014-03-01T17:06:40.000Z' + b'"00000000000000000000000000000000"6702' + b'AAAAAAAAAAAAAAAAAAA' + b'dummy' + b'STANDARD' +) + + +class TestStreamWrapper(unittest.TestCase): + def assert_lines(self, line_iterator, expected_lines): + for expected_line in expected_lines: + self.assertEqual( + next(line_iterator), + expected_line, + ) + # We should have exhausted the iterator. + with self.assertRaises(StopIteration): + next(line_iterator) + + def test_streaming_wrapper_validates_content_length(self): + body = BytesIO(b'1234567890') + stream = response.StreamingBody(body, content_length=10) + self.assertEqual(stream.read(), b'1234567890') + + def test_streaming_body_with_invalid_length(self): + body = BytesIO(b'123456789') + stream = response.StreamingBody(body, content_length=10) + with self.assertRaises(IncompleteReadError): + self.assertEqual(stream.read(9), b'123456789') + # The next read will have nothing returned and raise + # an IncompleteReadError because we were expectd 10 bytes, not 9. + stream.read() + + def test_streaming_body_readable(self): + body = BytesIO(b'1234567890') + stream = response.StreamingBody(body, content_length=10) + self.assertTrue(stream.readable()) + stream.close() + with self.assertRaises(ValueError): + stream.readable() + + def test_streaming_body_with_zero_read(self): + body = BytesIO(b'1234567890') + stream = response.StreamingBody(body, content_length=10) + chunk = stream.read(0) + self.assertEqual(chunk, b'') + self.assertEqual(stream.read(), b'1234567890') + + def test_streaming_body_with_single_read(self): + body = BytesIO(b'123456789') + stream = response.StreamingBody(body, content_length=10) + with self.assertRaises(IncompleteReadError): + stream.read() + + def test_streaming_body_readline(self): + body = BytesIO(b'1234567890\n1234567\n12345\n') + stream = response.StreamingBody(body, content_length=25) + chunk = stream.readline() + self.assertEqual(chunk, b'1234567890\n') + chunk = stream.readline() + self.assertEqual(chunk, b'1234567\n') + + def test_streaming_body_readlines(self): + body = BytesIO(b'1234567890\n1234567890\n12345') + stream = response.StreamingBody(body, content_length=27) + chunks = [b'1234567890\n', b'1234567890\n', b'12345'] + self.assertEqual(stream.readlines(), chunks) + + def test_streaming_body_tell(self): + body = BytesIO(b'1234567890') + stream = response.StreamingBody(body, content_length=10) + self.assertEqual(stream.tell(), 0) + stream.read(5) + self.assertEqual(stream.tell(), 5) + + def test_streaming_body_closes(self): + body = BytesIO(b'1234567890') + stream = response.StreamingBody(body, content_length=10) + self.assertFalse(body.closed) + stream.close() + self.assertTrue(body.closed) + + def test_default_iter_behavior(self): + body = BytesIO(b'a' * 2048) + stream = response.StreamingBody(body, content_length=2048) + chunks = list(stream) + self.assertEqual(len(chunks), 2) + self.assertEqual(chunks, [b'a' * 1024, b'a' * 1024]) + + def test_streaming_body_is_an_iterator(self): + body = BytesIO(b'a' * 1024 + b'b' * 1024 + b'c' * 2) + stream = response.StreamingBody(body, content_length=2050) + self.assertEqual(b'a' * 1024, next(stream)) + self.assertEqual(b'b' * 1024, next(stream)) + self.assertEqual(b'c' * 2, next(stream)) + with self.assertRaises(StopIteration): + next(stream) + + def test_iter_chunks_single_byte(self): + body = BytesIO(b'abcde') + stream = response.StreamingBody(body, content_length=5) + chunks = list(stream.iter_chunks(chunk_size=1)) + self.assertEqual(chunks, [b'a', b'b', b'c', b'd', b'e']) + + def test_iter_chunks_with_leftover(self): + body = BytesIO(b'abcde') + stream = response.StreamingBody(body, content_length=5) + chunks = list(stream.iter_chunks(chunk_size=2)) + self.assertEqual(chunks, [b'ab', b'cd', b'e']) + + def test_iter_chunks_single_chunk(self): + body = BytesIO(b'abcde') + stream = response.StreamingBody(body, content_length=5) + chunks = list(stream.iter_chunks(chunk_size=1024)) + self.assertEqual(chunks, [b'abcde']) + + def test_streaming_line_iterator(self): + body = BytesIO(b'1234567890\n1234567890\n12345') + stream = response.StreamingBody(body, content_length=27) + self.assert_lines( + stream.iter_lines(), + [b'1234567890', b'1234567890', b'12345'], + ) + + def test_streaming_line_iterator_ends_newline(self): + body = BytesIO(b'1234567890\n1234567890\n12345\n') + stream = response.StreamingBody(body, content_length=28) + self.assert_lines( + stream.iter_lines(), + [b'1234567890', b'1234567890', b'12345'], + ) + + def test_streaming_line_iter_chunk_sizes(self): + for chunk_size in range(1, 30): + body = BytesIO(b'1234567890\n1234567890\n12345') + stream = response.StreamingBody(body, content_length=27) + self.assert_lines( + stream.iter_lines(chunk_size), + [b'1234567890', b'1234567890', b'12345'], + ) + + def test_streaming_line_iterator_keepends(self): + body = BytesIO(b'1234567890\n1234567890\n12345') + stream = response.StreamingBody(body, content_length=27) + self.assert_lines( + stream.iter_lines(keepends=True), + [b'1234567890\n', b'1234567890\n', b'12345'], + ) + + def test_catches_urllib3_read_timeout(self): + class TimeoutBody: + def read(*args, **kwargs): + raise URLLib3ReadTimeoutError(None, None, None) + + def geturl(*args, **kwargs): + return 'http://example.com' + + stream = response.StreamingBody(TimeoutBody(), content_length=None) + with self.assertRaises(ReadTimeoutError): + stream.read() + + def test_catches_urllib3_protocol_error(self): + class ProtocolErrorBody: + def read(*args, **kwargs): + raise URLLib3ProtocolError(None, None, None) + + def geturl(*args, **kwargs): + return 'http://example.com' + + stream = response.StreamingBody( + ProtocolErrorBody(), content_length=None + ) + with self.assertRaises(ResponseStreamingError): + stream.read() + + def test_streaming_line_abstruse_newline_standard(self): + for chunk_size in range(1, 30): + body = BytesIO(b'1234567890\r\n1234567890\r\n12345\r\n') + stream = response.StreamingBody(body, content_length=31) + self.assert_lines( + stream.iter_lines(chunk_size), + [b'1234567890', b'1234567890', b'12345'], + ) + + def test_streaming_line_empty_body(self): + stream = response.StreamingBody( + BytesIO(b''), + content_length=0, + ) + self.assert_lines(stream.iter_lines(), []) + + def test_streaming_body_as_context_manager(self): + body = BytesIO(b'1234567890') + with response.StreamingBody(body, content_length=10) as stream: + self.assertEqual(stream.read(), b'1234567890') + self.assertFalse(body.closed) + self.assertTrue(body.closed) + + +class FakeRawResponse(BytesIO): + def stream(self, amt=1024, decode_content=None): + while True: + chunk = self.read(amt) + if not chunk: + break + yield chunk + + +class TestGetResponse(BaseResponseTest): + maxDiff = None + + def test_get_response_streaming_ok(self): + headers = { + 'content-type': 'image/png', + 'server': 'AmazonS3', + 'AcceptRanges': 'bytes', + 'transfer-encoding': 'chunked', + 'ETag': '"00000000000000000000000000000000"', + } + raw = FakeRawResponse(b'\x89PNG\r\n\x1a\n\x00\x00') + + http_response = AWSResponse(None, 200, headers, raw) + + session = botocore.session.get_session() + service_model = session.get_service_model('s3') + operation_model = service_model.operation_model('GetObject') + + res = response.get_response(operation_model, http_response) + self.assertTrue(isinstance(res[1]['Body'], response.StreamingBody)) + self.assertEqual(res[1]['ETag'], '"00000000000000000000000000000000"') + + def test_get_response_streaming_ng(self): + headers = { + 'content-type': 'application/xml', + 'date': 'Sat, 08 Mar 2014 12:05:44 GMT', + 'server': 'AmazonS3', + 'transfer-encoding': 'chunked', + 'x-amz-id-2': 'AAAAAAAAAAAAAAAAAAA', + 'x-amz-request-id': 'XXXXXXXXXXXXXXXX', + } + raw = FakeRawResponse(XMLBODY1) + http_response = AWSResponse(None, 403, headers, raw) + + session = botocore.session.get_session() + service_model = session.get_service_model('s3') + operation_model = service_model.operation_model('GetObject') + + self.assert_response_with_subset_metadata( + response.get_response(operation_model, http_response)[1], + { + 'Error': {'Message': 'Access Denied', 'Code': 'AccessDenied'}, + 'ResponseMetadata': { + 'HostId': 'AAAAAAAAAAAAAAAAAAA', + 'RequestId': 'XXXXXXXXXXXXXXXX', + 'HTTPStatusCode': 403, + }, + }, + ) + + def test_get_response_nonstreaming_ok(self): + headers = { + 'content-type': 'application/xml', + 'date': 'Sun, 09 Mar 2014 02:55:43 GMT', + 'server': 'AmazonS3', + 'transfer-encoding': 'chunked', + 'x-amz-id-2': 'AAAAAAAAAAAAAAAAAAA', + 'x-amz-request-id': 'XXXXXXXXXXXXXXXX', + } + raw = FakeRawResponse(XMLBODY1) + http_response = AWSResponse(None, 403, headers, raw) + + session = botocore.session.get_session() + service_model = session.get_service_model('s3') + operation_model = service_model.operation_model('ListObjects') + + self.assert_response_with_subset_metadata( + response.get_response(operation_model, http_response)[1], + { + 'ResponseMetadata': { + 'RequestId': 'XXXXXXXXXXXXXXXX', + 'HostId': 'AAAAAAAAAAAAAAAAAAA', + 'HTTPStatusCode': 403, + }, + 'Error': {'Message': 'Access Denied', 'Code': 'AccessDenied'}, + }, + ) + + def test_get_response_nonstreaming_ng(self): + headers = { + 'content-type': 'application/xml', + 'date': 'Sat, 08 Mar 2014 12:05:44 GMT', + 'server': 'AmazonS3', + 'transfer-encoding': 'chunked', + 'x-amz-id-2': 'AAAAAAAAAAAAAAAAAAA', + 'x-amz-request-id': 'XXXXXXXXXXXXXXXX', + } + raw = FakeRawResponse(XMLBODY2) + http_response = AWSResponse(None, 200, headers, raw) + + session = botocore.session.get_session() + service_model = session.get_service_model('s3') + operation_model = service_model.operation_model('ListObjects') + + self.assert_response_with_subset_metadata( + response.get_response(operation_model, http_response)[1], + { + 'Contents': [ + { + 'ETag': '"00000000000000000000000000000000"', + 'Key': 'test.png', + 'LastModified': datetime.datetime( + 2014, 3, 1, 17, 6, 40, tzinfo=tzutc() + ), + 'Owner': { + 'DisplayName': 'dummy', + 'ID': 'AAAAAAAAAAAAAAAAAAA', + }, + 'Size': 6702, + 'StorageClass': 'STANDARD', + } + ], + 'IsTruncated': False, + 'Marker': "", + 'MaxKeys': 1000, + 'Name': 'mybucket', + 'Prefix': "", + 'ResponseMetadata': { + 'RequestId': 'XXXXXXXXXXXXXXXX', + 'HostId': 'AAAAAAAAAAAAAAAAAAA', + 'HTTPStatusCode': 200, + }, + }, + ) diff --git a/testbed/boto__botocore/tests/unit/test_retryhandler.py b/testbed/boto__botocore/tests/unit/test_retryhandler.py new file mode 100644 index 0000000000000000000000000000000000000000..339e806d7cc1d76216127721345daef9349df2f6 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_retryhandler.py @@ -0,0 +1,424 @@ +#!/usr/bin/env +# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +from botocore import retryhandler +from botocore.exceptions import ( + ChecksumError, + EndpointConnectionError, + ReadTimeoutError, +) +from tests import mock, unittest + +HTTP_500_RESPONSE = mock.Mock() +HTTP_500_RESPONSE.status_code = 500 + +HTTP_400_RESPONSE = mock.Mock() +HTTP_400_RESPONSE.status_code = 400 + +HTTP_200_RESPONSE = mock.Mock() +HTTP_200_RESPONSE.status_code = 200 + +REQUEST_DICT = {'context': {}} + + +class TestRetryCheckers(unittest.TestCase): + def construct_checker_kwargs( + self, response, attempt_number, caught_exception + ): + checker_kwargs = { + 'attempt_number': attempt_number, + 'response': response, + 'caught_exception': caught_exception, + } + if isinstance(self.checker, retryhandler.MaxAttemptsDecorator): + checker_kwargs.update({'retries_context': REQUEST_DICT['context']}) + + return checker_kwargs + + def assert_should_be_retried( + self, response, attempt_number=1, caught_exception=None + ): + checker_kwargs = self.construct_checker_kwargs( + response, attempt_number, caught_exception + ) + + self.assertTrue(self.checker(**checker_kwargs)) + + def assert_should_not_be_retried( + self, response, attempt_number=1, caught_exception=None + ): + checker_kwargs = self.construct_checker_kwargs( + response, attempt_number, caught_exception + ) + + self.assertFalse(self.checker(**checker_kwargs)) + + def test_status_code_checker(self): + self.checker = retryhandler.HTTPStatusCodeChecker(500) + self.assert_should_be_retried(response=(HTTP_500_RESPONSE, {})) + + def test_max_attempts(self): + self.checker = retryhandler.MaxAttemptsDecorator( + retryhandler.HTTPStatusCodeChecker(500), max_attempts=3 + ) + response = {'ResponseMetadata': {}} + + # Retry up to three times. + self.assert_should_be_retried( + (HTTP_500_RESPONSE, response), attempt_number=1 + ) + self.assert_should_be_retried( + (HTTP_500_RESPONSE, {}), attempt_number=2 + ) + # On the third failed response, we've reached the + # max attempts so we should return False. + self.assert_should_not_be_retried( + (HTTP_500_RESPONSE, response), attempt_number=3 + ) + self.assertTrue(response['ResponseMetadata']['MaxAttemptsReached']) + + def test_max_attempts_successful(self): + self.checker = retryhandler.MaxAttemptsDecorator( + retryhandler.HTTPStatusCodeChecker(500), max_attempts=3 + ) + + self.assert_should_be_retried( + (HTTP_500_RESPONSE, {}), attempt_number=1 + ) + # The second retry is successful. + self.assert_should_not_be_retried( + (HTTP_200_RESPONSE, {}), attempt_number=2 + ) + + # But now we can reuse this object. + self.assert_should_be_retried( + (HTTP_500_RESPONSE, {}), attempt_number=1 + ) + self.assert_should_be_retried( + (HTTP_500_RESPONSE, {}), attempt_number=2 + ) + self.assert_should_not_be_retried( + (HTTP_500_RESPONSE, {}), attempt_number=3 + ) + + def test_error_code_checker(self): + self.checker = retryhandler.ServiceErrorCodeChecker( + status_code=400, error_code='Throttled' + ) + response = (HTTP_400_RESPONSE, {'Error': {'Code': 'Throttled'}}) + self.assert_should_be_retried(response) + + def test_error_code_checker_does_not_match(self): + self.checker = retryhandler.ServiceErrorCodeChecker( + status_code=400, error_code='Throttled' + ) + response = (HTTP_400_RESPONSE, {'Error': {'Code': 'NotThrottled'}}) + self.assert_should_not_be_retried(response) + + def test_error_code_checker_ignore_caught_exception(self): + self.checker = retryhandler.ServiceErrorCodeChecker( + status_code=400, error_code='Throttled' + ) + self.assert_should_not_be_retried( + response=None, caught_exception=RuntimeError() + ) + + def test_multi_checker(self): + checker = retryhandler.ServiceErrorCodeChecker( + status_code=400, error_code='Throttled' + ) + checker2 = retryhandler.HTTPStatusCodeChecker(500) + self.checker = retryhandler.MultiChecker([checker, checker2]) + self.assert_should_be_retried((HTTP_500_RESPONSE, {})) + self.assert_should_be_retried( + response=(HTTP_400_RESPONSE, {'Error': {'Code': 'Throttled'}}) + ) + self.assert_should_not_be_retried(response=(HTTP_200_RESPONSE, {})) + + def test_exception_checker_ignores_response(self): + self.checker = retryhandler.ExceptionRaiser() + self.assert_should_not_be_retried( + response=(HTTP_200_RESPONSE, {}), caught_exception=None + ) + + def test_value_error_raised_when_missing_response_and_exception(self): + self.checker = retryhandler.ExceptionRaiser() + with self.assertRaises(ValueError): + self.checker(1, response=None, caught_exception=None) + + +class TestCreateRetryConfiguration(unittest.TestCase): + def setUp(self): + self.retry_config = { + '__default__': { + 'max_attempts': 5, + 'delay': { + 'type': 'exponential', + 'base': 1, + 'growth_factor': 2, + }, + 'policies': { + 'throttling': { + 'applies_when': { + 'response': { + 'service_error_code': 'Throttling', + 'http_status_code': 400, + } + } + } + }, + }, + 'OperationFoo': { + 'policies': { + 'crc32check': { + 'applies_when': { + 'response': { + 'crc32body': 'x-amz-crc32', + } + } + } + } + }, + 'OperationBar': { + 'policies': { + 'socket_errors': { + 'applies_when': { + 'socket_errors': ["GENERAL_CONNECTION_ERROR"], + } + } + } + }, + } + + def test_create_retry_single_checker_service_level(self): + checker = retryhandler.create_checker_from_retry_config( + self.retry_config, operation_name=None + ) + self.assertIsInstance(checker, retryhandler.MaxAttemptsDecorator) + # We're reaching into internal fields here, but only to check + # that the object is created properly. + self.assertEqual(checker._max_attempts, 5) + self.assertIsInstance( + checker._checker, retryhandler.ServiceErrorCodeChecker + ) + self.assertEqual(checker._checker._error_code, 'Throttling') + self.assertEqual(checker._checker._status_code, 400) + + def test_create_retry_for_operation(self): + checker = retryhandler.create_checker_from_retry_config( + self.retry_config, operation_name='OperationFoo' + ) + self.assertIsInstance(checker, retryhandler.MaxAttemptsDecorator) + self.assertEqual(checker._max_attempts, 5) + self.assertIsInstance(checker._checker, retryhandler.MultiChecker) + + def test_retry_with_socket_errors(self): + checker = retryhandler.create_checker_from_retry_config( + self.retry_config, operation_name='OperationBar' + ) + self.assertIsInstance(checker, retryhandler.BaseChecker) + all_checkers = checker._checker._checkers + self.assertIsInstance( + all_checkers[0], retryhandler.ServiceErrorCodeChecker + ) + self.assertIsInstance(all_checkers[1], retryhandler.ExceptionRaiser) + + def test_create_retry_handler_with_socket_errors(self): + handler = retryhandler.create_retry_handler( + self.retry_config, operation_name='OperationBar' + ) + exception = EndpointConnectionError(endpoint_url='') + with self.assertRaises(EndpointConnectionError): + handler( + response=None, + attempts=10, + caught_exception=exception, + request_dict=REQUEST_DICT, + ) + # No connection error raised because attempts < max_attempts. + sleep_time = handler( + response=None, + attempts=1, + caught_exception=exception, + request_dict=REQUEST_DICT, + ) + self.assertEqual(sleep_time, 1) + # But any other exception should be raised even if + # attempts < max_attempts. + with self.assertRaises(ValueError): + sleep_time = handler( + response=None, + attempts=1, + caught_exception=ValueError(), + request_dict=REQUEST_DICT, + ) + + def test_connection_timeouts_are_retried(self): + # If a connection times out, we get a Timout exception + # from requests. We should be retrying those. + handler = retryhandler.create_retry_handler( + self.retry_config, operation_name='OperationBar' + ) + sleep_time = handler( + response=None, + attempts=1, + caught_exception=ReadTimeoutError(endpoint_url=''), + request_dict=REQUEST_DICT, + ) + self.assertEqual(sleep_time, 1) + + def test_create_retry_handler_with_no_operation(self): + handler = retryhandler.create_retry_handler( + self.retry_config, operation_name=None + ) + self.assertIsInstance(handler, retryhandler.RetryHandler) + # No good way to test for the delay function as the action + # other than to just invoke it. + self.assertEqual(handler._action(attempts=2), 2) + self.assertEqual(handler._action(attempts=3), 4) + + def test_crc32_check_propogates_error(self): + handler = retryhandler.create_retry_handler( + self.retry_config, operation_name='OperationFoo' + ) + http_response = mock.Mock() + http_response.status_code = 200 + # This is not the crc32 of b'foo', so this should + # fail the crc32 check. + http_response.headers = {'x-amz-crc32': 2356372768} + http_response.content = b'foo' + # The first 10 attempts we get a retry. + self.assertEqual( + handler( + response=(http_response, {}), + attempts=1, + caught_exception=None, + request_dict=REQUEST_DICT, + ), + 1, + ) + with self.assertRaises(ChecksumError): + handler( + response=(http_response, {}), + attempts=10, + caught_exception=None, + request_dict=REQUEST_DICT, + ) + + +class TestRetryHandler(unittest.TestCase): + def test_action_tied_to_policy(self): + # When a retry rule matches we should return the + # amount of time to sleep, otherwise we should return None. + delay_function = retryhandler.create_exponential_delay_function(1, 2) + checker = retryhandler.HTTPStatusCodeChecker(500) + handler = retryhandler.RetryHandler(checker, delay_function) + response = (HTTP_500_RESPONSE, {}) + + self.assertEqual( + handler(response=response, attempts=1, caught_exception=None), 1 + ) + self.assertEqual( + handler(response=response, attempts=2, caught_exception=None), 2 + ) + self.assertEqual( + handler(response=response, attempts=3, caught_exception=None), 4 + ) + self.assertEqual( + handler(response=response, attempts=4, caught_exception=None), 8 + ) + + def test_none_response_when_no_matches(self): + delay_function = retryhandler.create_exponential_delay_function(1, 2) + checker = retryhandler.HTTPStatusCodeChecker(500) + handler = retryhandler.RetryHandler(checker, delay_function) + response = (HTTP_200_RESPONSE, {}) + + self.assertIsNone( + handler(response=response, attempts=1, caught_exception=None) + ) + + +class TestCRC32Checker(unittest.TestCase): + def setUp(self): + self.checker = retryhandler.CRC32Checker('x-amz-crc32') + + def test_crc32_matches(self): + http_response = mock.Mock() + http_response.status_code = 200 + # This is the crc32 of b'foo', so this should + # pass the crc32 check. + http_response.headers = {'x-amz-crc32': 2356372769} + http_response.content = b'foo' + self.assertIsNone( + self.checker( + response=(http_response, {}), + attempt_number=1, + caught_exception=None, + ) + ) + + def test_crc32_missing(self): + # It's not an error is the crc32 header is missing. + http_response = mock.Mock() + http_response.status_code = 200 + http_response.headers = {} + self.assertIsNone( + self.checker( + response=(http_response, {}), + attempt_number=1, + caught_exception=None, + ) + ) + + def test_crc32_check_fails(self): + http_response = mock.Mock() + http_response.status_code = 200 + # This is not the crc32 of b'foo', so this should + # fail the crc32 check. + http_response.headers = {'x-amz-crc32': 2356372768} + http_response.content = b'foo' + with self.assertRaises(ChecksumError): + self.checker( + response=(http_response, {}), + attempt_number=1, + caught_exception=None, + ) + + +class TestDelayExponential(unittest.TestCase): + def test_delay_with_numeric_base(self): + self.assertEqual( + retryhandler.delay_exponential( + base=3, growth_factor=2, attempts=3 + ), + 12, + ) + + def test_delay_with_rand_string(self): + delay = retryhandler.delay_exponential( + base='rand', growth_factor=2, attempts=3 + ) + # 2 ** (3 - 1) == 4, so the retry is between 0, 4. + self.assertTrue(0 <= delay <= 4) + + def test_value_error_raised_with_non_positive_number(self): + with self.assertRaises(ValueError): + retryhandler.delay_exponential( + base=-1, growth_factor=2, attempts=3 + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/testbed/boto__botocore/tests/unit/test_s3_addressing.py b/testbed/boto__botocore/tests/unit/test_s3_addressing.py new file mode 100644 index 0000000000000000000000000000000000000000..7150d5b4ce29349e9001b60dd8e8f85adc8d241a --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_s3_addressing.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python +# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +import os + +from botocore.compat import OrderedDict +from botocore.handlers import set_list_objects_encoding_type_url +from tests import BaseSessionTest, ClientHTTPStubber + + +class TestS3Addressing(BaseSessionTest): + def setUp(self): + super().setUp() + self.region_name = 'us-east-1' + self.signature_version = 's3' + + self.session.unregister( + 'before-parameter-build.s3.ListObjects', + set_list_objects_encoding_type_url, + ) + + def get_prepared_request(self, operation, params, force_hmacv1=False): + if force_hmacv1: + self.session.register('choose-signer', self.enable_hmacv1) + client = self.session.create_client('s3', self.region_name) + with ClientHTTPStubber(client) as http_stubber: + http_stubber.add_response() + getattr(client, operation)(**params) + # Return the request that was sent over the wire. + return http_stubber.requests[0] + + def enable_hmacv1(self, **kwargs): + return 's3' + + def test_list_objects_dns_name(self): + params = {'Bucket': 'safename'} + prepared_request = self.get_prepared_request( + 'list_objects', params, force_hmacv1=True + ) + self.assertEqual( + prepared_request.url, 'https://safename.s3.amazonaws.com/' + ) + + def test_list_objects_non_dns_name(self): + params = {'Bucket': 'un_safe_name'} + prepared_request = self.get_prepared_request( + 'list_objects', params, force_hmacv1=True + ) + self.assertEqual( + prepared_request.url, 'https://s3.amazonaws.com/un_safe_name' + ) + + def test_list_objects_dns_name_non_classic(self): + self.region_name = 'us-west-2' + params = {'Bucket': 'safename'} + prepared_request = self.get_prepared_request( + 'list_objects', params, force_hmacv1=True + ) + self.assertEqual( + prepared_request.url, + 'https://safename.s3.us-west-2.amazonaws.com/', + ) + + def test_list_objects_unicode_query_string_eu_central_1(self): + self.region_name = 'eu-central-1' + params = OrderedDict( + [('Bucket', 'safename'), ('Marker', '\xe4\xf6\xfc-01.txt')] + ) + prepared_request = self.get_prepared_request('list_objects', params) + self.assertEqual( + prepared_request.url, + ( + 'https://safename.s3.eu-central-1.amazonaws.com/' + '?marker=%C3%A4%C3%B6%C3%BC-01.txt' + ), + ) + + def test_list_objects_in_restricted_regions(self): + self.region_name = 'us-gov-west-1' + params = {'Bucket': 'safename'} + prepared_request = self.get_prepared_request('list_objects', params) + # Note how we keep the region specific endpoint here. + self.assertEqual( + prepared_request.url, + 'https://safename.s3.us-gov-west-1.amazonaws.com/', + ) + + def test_list_objects_in_fips(self): + self.region_name = 'fips-us-gov-west-1' + params = {'Bucket': 'safename'} + prepared_request = self.get_prepared_request('list_objects', params) + # Note how we keep the region specific endpoint here. + self.assertEqual( + prepared_request.url, + 'https://safename.s3-fips.us-gov-west-1.amazonaws.com/', + ) + + def test_list_objects_non_dns_name_non_classic(self): + self.region_name = 'us-west-2' + params = {'Bucket': 'un_safe_name'} + prepared_request = self.get_prepared_request('list_objects', params) + self.assertEqual( + prepared_request.url, + 'https://s3.us-west-2.amazonaws.com/un_safe_name', + ) + + def test_put_object_dns_name_non_classic(self): + self.region_name = 'us-west-2' + file_path = os.path.join(os.path.dirname(__file__), 'put_object_data') + with open(file_path, 'rb') as fp: + params = { + 'Bucket': 'my.valid.name', + 'Key': 'mykeyname', + 'Body': fp, + 'ACL': 'public-read', + 'ContentLanguage': 'piglatin', + 'ContentType': 'text/plain', + } + prepared_request = self.get_prepared_request('put_object', params) + self.assertEqual( + prepared_request.url, + 'https://s3.us-west-2.amazonaws.com/my.valid.name/mykeyname', + ) + + def test_put_object_dns_name_classic(self): + self.region_name = 'us-east-1' + file_path = os.path.join(os.path.dirname(__file__), 'put_object_data') + with open(file_path, 'rb') as fp: + params = { + 'Bucket': 'my.valid.name', + 'Key': 'mykeyname', + 'Body': fp, + 'ACL': 'public-read', + 'ContentLanguage': 'piglatin', + 'ContentType': 'text/plain', + } + prepared_request = self.get_prepared_request('put_object', params) + self.assertEqual( + prepared_request.url, + 'https://s3.amazonaws.com/my.valid.name/mykeyname', + ) + + def test_put_object_dns_name_single_letter_non_classic(self): + self.region_name = 'us-west-2' + file_path = os.path.join(os.path.dirname(__file__), 'put_object_data') + with open(file_path, 'rb') as fp: + params = { + 'Bucket': 'a.valid.name', + 'Key': 'mykeyname', + 'Body': fp, + 'ACL': 'public-read', + 'ContentLanguage': 'piglatin', + 'ContentType': 'text/plain', + } + prepared_request = self.get_prepared_request('put_object', params) + self.assertEqual( + prepared_request.url, + 'https://s3.us-west-2.amazonaws.com/a.valid.name/mykeyname', + ) + + def test_get_object_non_dns_name_non_classic(self): + self.region_name = 'us-west-2' + params = {'Bucket': 'AnInvalidName', 'Key': 'mykeyname'} + prepared_request = self.get_prepared_request('get_object', params) + self.assertEqual( + prepared_request.url, + 'https://s3.us-west-2.amazonaws.com/AnInvalidName/mykeyname', + ) + + def test_get_object_non_dns_name_classic(self): + self.region_name = 'us-east-1' + params = {'Bucket': 'AnInvalidName', 'Key': 'mykeyname'} + prepared_request = self.get_prepared_request('get_object', params) + self.assertEqual( + prepared_request.url, + 'https://s3.amazonaws.com/AnInvalidName/mykeyname', + ) + + def test_get_object_ip_address_name_non_classic(self): + self.region_name = 'us-west-2' + params = {'Bucket': '192.168.5.4', 'Key': 'mykeyname'} + prepared_request = self.get_prepared_request('get_object', params) + self.assertEqual( + prepared_request.url, + 'https://s3.us-west-2.amazonaws.com/192.168.5.4/mykeyname', + ) + + def test_get_object_almost_an_ip_address_name_non_classic(self): + self.region_name = 'us-west-2' + params = {'Bucket': '192.168.5.256', 'Key': 'mykeyname'} + prepared_request = self.get_prepared_request('get_object', params) + self.assertEqual( + prepared_request.url, + 'https://s3.us-west-2.amazonaws.com/192.168.5.256/mykeyname', + ) + + def test_invalid_endpoint_raises_exception(self): + with self.assertRaisesRegex(ValueError, 'Invalid region'): + self.session.create_client('s3', 'Invalid region') + + def test_non_existent_region(self): + # If I ask for a region that does not + # exist on a global endpoint, such as: + client = self.session.create_client('s3', 'us-west-111') + # Then the default endpoint heuristic will apply and we'll + # get the region name as specified. + self.assertEqual(client.meta.region_name, 'us-west-111') + # Why not fixed this? Well backwards compatibility for one thing. + # The other reason is because it was intended to accommodate this + # use case. Let's say I have us-west-2 set as my default region, + # possibly through an env var or config variable. Well, by default, + # we'd make a call like: + client = self.session.create_client('iam', 'us-west-2') + # Instead of giving the user an error, we should instead give + # them the partition-global endpoint. + self.assertEqual(client.meta.region_name, 'aws-global') + # But if they request an endpoint that we *do* know about, we use + # that specific endpoint. + client = self.session.create_client('iam', 'aws-us-gov-global') + self.assertEqual(client.meta.region_name, 'aws-us-gov-global') diff --git a/testbed/boto__botocore/tests/unit/test_serialize.py b/testbed/boto__botocore/tests/unit/test_serialize.py new file mode 100644 index 0000000000000000000000000000000000000000..639523fd59fc2e975033ab017928cb3fad90714d --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_serialize.py @@ -0,0 +1,544 @@ +"""Additional tests for request serialization. + +While there are compliance tests in tests/unit/protocols where +the majority of the request serialization/response parsing is tested, +this test module contains additional tests that go above and beyond the +spec. This can happen for a number of reasons: + +* We are testing python specific behavior that doesn't make sense as a + compliance test. +* We are testing behavior that is not strictly part of the spec. These + may result in a a coverage gap that would otherwise be untested. + +""" + +import base64 +import datetime +import io +import json + +import dateutil.tz + +from botocore import serialize +from botocore.exceptions import ParamValidationError +from botocore.model import ServiceModel +from tests import unittest + + +class BaseModelWithBlob(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': {'protocol': 'query', 'apiVersion': '2014-01-01'}, + 'documentation': '', + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'InputShape'}, + } + }, + 'shapes': { + 'InputShape': { + 'type': 'structure', + 'members': { + 'Blob': {'shape': 'BlobType'}, + }, + }, + 'BlobType': { + 'type': 'blob', + }, + }, + } + + def serialize_to_request(self, input_params): + service_model = ServiceModel(self.model) + request_serializer = serialize.create_serializer( + service_model.metadata['protocol'] + ) + return request_serializer.serialize_to_request( + input_params, service_model.operation_model('TestOperation') + ) + + def assert_serialized_blob_equals(self, request, blob_bytes): + # This method handles all the details of the base64 decoding. + encoded = base64.b64encode(blob_bytes) + # Now the serializers actually have the base64 encoded contents + # as str types so we need to decode back. We know that this is + # ascii so it's safe to use the ascii encoding. + expected = encoded.decode('ascii') + self.assertEqual(request['body']['Blob'], expected) + + +class TestBinaryTypes(BaseModelWithBlob): + def test_blob_accepts_bytes_type(self): + body = b'bytes body' + request = self.serialize_to_request(input_params={'Blob': body}) + self.assert_serialized_blob_equals(request, blob_bytes=body) + + def test_blob_accepts_str_type(self): + body = 'ascii text' + request = self.serialize_to_request(input_params={'Blob': body}) + self.assert_serialized_blob_equals( + request, blob_bytes=body.encode('ascii') + ) + + def test_blob_handles_unicode_chars(self): + body = '\u2713' + request = self.serialize_to_request(input_params={'Blob': body}) + self.assert_serialized_blob_equals( + request, blob_bytes=body.encode('utf-8') + ) + + +class TestBinaryTypesJSON(BaseModelWithBlob): + def setUp(self): + super().setUp() + self.model['metadata'] = { + 'protocol': 'json', + 'apiVersion': '2014-01-01', + 'jsonVersion': '1.1', + 'targetPrefix': 'foo', + } + + def test_blob_accepts_bytes_type(self): + body = b'bytes body' + request = self.serialize_to_request(input_params={'Blob': body}) + serialized_blob = json.loads(request['body'].decode('utf-8'))['Blob'] + self.assertEqual( + base64.b64encode(body).decode('ascii'), serialized_blob + ) + + +class TestBinaryTypesWithRestXML(BaseModelWithBlob): + def setUp(self): + super().setUp() + self.model['metadata'] = { + 'protocol': 'rest-xml', + 'apiVersion': '2014-01-01', + } + self.model['operations']['TestOperation']['input'] = { + 'shape': 'InputShape', + 'locationName': 'OperationRequest', + 'payload': 'Blob', + } + + def test_blob_serialization_with_file_like_object(self): + body = io.BytesIO(b'foobar') + request = self.serialize_to_request(input_params={'Blob': body}) + self.assertEqual(request['body'], body) + + def test_blob_serialization_when_payload_is_unicode(self): + # When the body is a text type, we should encode the + # text to bytes. + body = '\u2713' + request = self.serialize_to_request(input_params={'Blob': body}) + self.assertEqual(request['body'], body.encode('utf-8')) + + def test_blob_serialization_when_payload_is_bytes(self): + body = b'bytes body' + request = self.serialize_to_request(input_params={'Blob': body}) + self.assertEqual(request['body'], body) + + +class TestTimestampHeadersWithRestXML(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': {'protocol': 'rest-xml', 'apiVersion': '2014-01-01'}, + 'documentation': '', + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'InputShape'}, + } + }, + 'shapes': { + 'InputShape': { + 'type': 'structure', + 'members': { + 'TimestampHeader': { + 'shape': 'TimestampType', + 'location': 'header', + 'locationName': 'x-timestamp', + }, + }, + }, + 'TimestampType': { + 'type': 'timestamp', + }, + }, + } + self.service_model = ServiceModel(self.model) + + def serialize_to_request(self, input_params): + request_serializer = serialize.create_serializer( + self.service_model.metadata['protocol'] + ) + return request_serializer.serialize_to_request( + input_params, self.service_model.operation_model('TestOperation') + ) + + def test_accepts_datetime_object(self): + request = self.serialize_to_request( + { + 'TimestampHeader': datetime.datetime( + 2014, 1, 1, 12, 12, 12, tzinfo=dateutil.tz.tzutc() + ) + } + ) + self.assertEqual( + request['headers']['x-timestamp'], 'Wed, 01 Jan 2014 12:12:12 GMT' + ) + + def test_accepts_iso_8601_format(self): + request = self.serialize_to_request( + {'TimestampHeader': '2014-01-01T12:12:12+00:00'} + ) + self.assertEqual( + request['headers']['x-timestamp'], 'Wed, 01 Jan 2014 12:12:12 GMT' + ) + + def test_accepts_iso_8601_format_non_utc(self): + request = self.serialize_to_request( + {'TimestampHeader': '2014-01-01T07:12:12-05:00'} + ) + self.assertEqual( + request['headers']['x-timestamp'], 'Wed, 01 Jan 2014 12:12:12 GMT' + ) + + def test_accepts_rfc_822_format(self): + request = self.serialize_to_request( + {'TimestampHeader': 'Wed, 01 Jan 2014 12:12:12 GMT'} + ) + self.assertEqual( + request['headers']['x-timestamp'], 'Wed, 01 Jan 2014 12:12:12 GMT' + ) + + def test_accepts_unix_timestamp_integer(self): + request = self.serialize_to_request({'TimestampHeader': 1388578332}) + self.assertEqual( + request['headers']['x-timestamp'], 'Wed, 01 Jan 2014 12:12:12 GMT' + ) + + +class TestTimestamps(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': {'protocol': 'query', 'apiVersion': '2014-01-01'}, + 'documentation': '', + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'InputShape'}, + } + }, + 'shapes': { + 'InputShape': { + 'type': 'structure', + 'members': { + 'Timestamp': {'shape': 'TimestampType'}, + }, + }, + 'TimestampType': { + 'type': 'timestamp', + }, + }, + } + self.service_model = ServiceModel(self.model) + + def serialize_to_request(self, input_params): + request_serializer = serialize.create_serializer( + self.service_model.metadata['protocol'] + ) + return request_serializer.serialize_to_request( + input_params, self.service_model.operation_model('TestOperation') + ) + + def test_accepts_datetime_object(self): + request = self.serialize_to_request( + { + 'Timestamp': datetime.datetime( + 2014, 1, 1, 12, 12, 12, tzinfo=dateutil.tz.tzutc() + ) + } + ) + self.assertEqual(request['body']['Timestamp'], '2014-01-01T12:12:12Z') + + def test_accepts_naive_datetime_object(self): + request = self.serialize_to_request( + {'Timestamp': datetime.datetime(2014, 1, 1, 12, 12, 12)} + ) + self.assertEqual(request['body']['Timestamp'], '2014-01-01T12:12:12Z') + + def test_accepts_iso_8601_format(self): + request = self.serialize_to_request( + {'Timestamp': '2014-01-01T12:12:12Z'} + ) + self.assertEqual(request['body']['Timestamp'], '2014-01-01T12:12:12Z') + + def test_accepts_timestamp_without_tz_info(self): + # If a timezone/utc is not specified, assume they meant + # UTC. This is also the previous behavior from older versions + # of botocore so we want to make sure we preserve this behavior. + request = self.serialize_to_request( + {'Timestamp': '2014-01-01T12:12:12'} + ) + self.assertEqual(request['body']['Timestamp'], '2014-01-01T12:12:12Z') + + def test_microsecond_timestamp_without_tz_info(self): + request = self.serialize_to_request( + {'Timestamp': '2014-01-01T12:12:12.123456'} + ) + self.assertEqual( + request['body']['Timestamp'], '2014-01-01T12:12:12.123456Z' + ) + + +class TestJSONTimestampSerialization(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': { + 'protocol': 'json', + 'apiVersion': '2014-01-01', + 'jsonVersion': '1.1', + 'targetPrefix': 'foo', + }, + 'documentation': '', + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'InputShape'}, + } + }, + 'shapes': { + 'InputShape': { + 'type': 'structure', + 'members': { + 'Timestamp': {'shape': 'TimestampType'}, + }, + }, + 'TimestampType': { + 'type': 'timestamp', + }, + }, + } + self.service_model = ServiceModel(self.model) + + def serialize_to_request(self, input_params): + request_serializer = serialize.create_serializer( + self.service_model.metadata['protocol'] + ) + return request_serializer.serialize_to_request( + input_params, self.service_model.operation_model('TestOperation') + ) + + def test_accepts_iso_8601_format(self): + body = json.loads( + self.serialize_to_request({'Timestamp': '1970-01-01T00:00:00'})[ + 'body' + ].decode('utf-8') + ) + self.assertEqual(body['Timestamp'], 0) + + def test_accepts_epoch(self): + body = json.loads( + self.serialize_to_request({'Timestamp': '0'})['body'].decode( + 'utf-8' + ) + ) + self.assertEqual(body['Timestamp'], 0) + # Can also be an integer 0. + body = json.loads( + self.serialize_to_request({'Timestamp': 0})['body'].decode('utf-8') + ) + self.assertEqual(body['Timestamp'], 0) + + def test_accepts_partial_iso_format(self): + body = json.loads( + self.serialize_to_request({'Timestamp': '1970-01-01'})[ + 'body' + ].decode('utf-8') + ) + self.assertEqual(body['Timestamp'], 0) + + +class TestInstanceCreation(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': {'protocol': 'query', 'apiVersion': '2014-01-01'}, + 'documentation': '', + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'InputShape'}, + } + }, + 'shapes': { + 'InputShape': { + 'type': 'structure', + 'members': { + 'Timestamp': {'shape': 'StringTestType'}, + }, + }, + 'StringTestType': {'type': 'string', 'min': 15}, + }, + } + self.service_model = ServiceModel(self.model) + + def assert_serialize_valid_parameter(self, request_serializer): + valid_string = 'valid_string_with_min_15_chars' + request = request_serializer.serialize_to_request( + {'Timestamp': valid_string}, + self.service_model.operation_model('TestOperation'), + ) + + self.assertEqual(request['body']['Timestamp'], valid_string) + + def assert_serialize_invalid_parameter(self, request_serializer): + invalid_string = 'short string' + request = request_serializer.serialize_to_request( + {'Timestamp': invalid_string}, + self.service_model.operation_model('TestOperation'), + ) + + self.assertEqual(request['body']['Timestamp'], invalid_string) + + def test_instantiate_without_validation(self): + request_serializer = serialize.create_serializer( + self.service_model.metadata['protocol'], False + ) + + try: + self.assert_serialize_valid_parameter(request_serializer) + except ParamValidationError as e: + self.fail( + "Shouldn't fail serializing valid parameter without " + f"validation: {e}" + ) + + try: + self.assert_serialize_invalid_parameter(request_serializer) + except ParamValidationError as e: + self.fail( + "Shouldn't fail serializing invalid parameter without " + f"validation: {e}" + ) + + def test_instantiate_with_validation(self): + request_serializer = serialize.create_serializer( + self.service_model.metadata['protocol'], True + ) + try: + self.assert_serialize_valid_parameter(request_serializer) + except ParamValidationError as e: + self.fail( + "Shouldn't fail serializing invalid parameter without " + f"validation: {e}" + ) + + with self.assertRaises(ParamValidationError): + self.assert_serialize_invalid_parameter(request_serializer) + + +class TestHeaderSerialization(BaseModelWithBlob): + def setUp(self): + self.model = { + 'metadata': {'protocol': 'rest-xml', 'apiVersion': '2014-01-01'}, + 'documentation': '', + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'InputShape'}, + } + }, + 'shapes': { + 'InputShape': { + 'type': 'structure', + 'members': { + 'ContentLength': { + 'shape': 'Integer', + 'location': 'header', + 'locationName': 'Content-Length', + }, + }, + }, + 'Integer': {'type': 'integer'}, + }, + } + self.service_model = ServiceModel(self.model) + + def test_always_serialized_as_str(self): + request = self.serialize_to_request({'ContentLength': 100}) + self.assertEqual(request['headers']['Content-Length'], '100') + + +class TestRestXMLUnicodeSerialization(unittest.TestCase): + def setUp(self): + self.model = { + 'metadata': {'protocol': 'rest-xml', 'apiVersion': '2014-01-01'}, + 'documentation': '', + 'operations': { + 'TestOperation': { + 'name': 'TestOperation', + 'http': { + 'method': 'POST', + 'requestUri': '/', + }, + 'input': {'shape': 'InputShape'}, + } + }, + 'shapes': { + 'InputShape': { + 'type': 'structure', + 'members': { + 'Foo': {'shape': 'FooShape', 'locationName': 'Foo'}, + }, + 'payload': 'Foo', + }, + 'FooShape': { + 'type': 'list', + 'member': {'shape': 'StringShape'}, + }, + 'StringShape': { + 'type': 'string', + }, + }, + } + self.service_model = ServiceModel(self.model) + + def serialize_to_request(self, input_params): + request_serializer = serialize.create_serializer( + self.service_model.metadata['protocol'] + ) + return request_serializer.serialize_to_request( + input_params, self.service_model.operation_model('TestOperation') + ) + + def test_restxml_serializes_unicode(self): + params = {'Foo': ['\u65e5\u672c\u8a9e\u3067\u304a\uff4b']} + try: + self.serialize_to_request(params) + except UnicodeEncodeError: + self.fail("RestXML serializer failed to serialize unicode text.") diff --git a/testbed/boto__botocore/tests/unit/test_session.py b/testbed/boto__botocore/tests/unit/test_session.py new file mode 100644 index 0000000000000000000000000000000000000000..d3eabbdf084ed789a17f973494e6a48e8905f8b0 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_session.py @@ -0,0 +1,1021 @@ +#!/usr/bin/env +# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import logging +import os +import shutil +import tempfile + +import pytest + +import botocore.config +import botocore.exceptions +import botocore.loaders +import botocore.session +from botocore import ( + UNSIGNED, + client, + register_initializer, + unregister_initializer, +) +from botocore.configprovider import ConfigChainFactory +from botocore.hooks import HierarchicalEmitter +from botocore.model import ServiceModel +from botocore.paginate import PaginatorModel +from botocore.waiter import WaiterModel +from tests import create_session, mock, requires_crt, temporary_file, unittest + + +class BaseSessionTest(unittest.TestCase): + def setUp(self): + self.environ = {} + self.environ_patch = mock.patch('os.environ', self.environ) + self.environ_patch.start() + self.environ['FOO_PROFILE'] = 'foo' + self.environ['FOO_REGION'] = 'us-west-11' + data_path = os.path.join(os.path.dirname(__file__), 'data') + self.environ['FOO_DATA_PATH'] = data_path + config_path = os.path.join( + os.path.dirname(__file__), 'cfg', 'foo_config' + ) + self.environ['FOO_CONFIG_FILE'] = config_path + self.session = create_session() + config_chain_builder = ConfigChainFactory( + session=self.session, + environ=self.environ, + ) + config_store = self.session.get_component('config_store') + config_updates = { + 'profile': config_chain_builder.create_config_chain( + instance_name='profile', + env_var_names='FOO_PROFILE', + ), + 'region': config_chain_builder.create_config_chain( + instance_name='region', + env_var_names='FOO_REGION', + config_property_names='foo_region', + ), + 'data_path': config_chain_builder.create_config_chain( + instance_name='data_path', + env_var_names='FOO_DATA_PATH', + config_property_names='data_path', + ), + 'config_file': config_chain_builder.create_config_chain( + instance_name='config_file', + env_var_names='FOO_CONFIG_FILE', + ), + 'credentials_file': config_chain_builder.create_config_chain( + instance_name='credentials_file', + default='/tmp/nowhere', + ), + 'ca_bundle': config_chain_builder.create_config_chain( + instance_name='ca_bundle', + env_var_names='FOO_AWS_CA_BUNDLE', + config_property_names='foo_ca_bundle', + ), + 'api_versions': config_chain_builder.create_config_chain( + instance_name='api_versions', + config_property_names='foo_api_versions', + default={}, + ), + } + for name, provider in config_updates.items(): + config_store.set_config_provider(name, provider) + + def update_session_config_mapping(self, logical_name, **kwargs): + config_chain_builder = ConfigChainFactory( + session=self.session, + environ=self.environ, + ) + self.session.get_component('config_store').set_config_provider( + logical_name, + config_chain_builder.create_config_chain(**kwargs), + ) + + def tearDown(self): + self.environ_patch.stop() + + +class SessionTest(BaseSessionTest): + def close_log_file_handler(self, tempdir, filename): + logger = logging.getLogger('botocore') + handlers = logger.handlers + for handler in handlers[:]: + if hasattr(handler, 'stream') and handler.stream.name == filename: + handler.stream.close() + logger.removeHandler(handler) + os.remove(filename) + # logging has an atexit handler that will try to flush/close + # the file. By setting this flag to False, we'll prevent it + # from raising an exception, which is fine because we're + # handling the closing of the file ourself. + logging.raiseExceptions = False + shutil.rmtree(tempdir) + + def test_supports_multiple_env_vars_for_single_logical_name(self): + self.update_session_config_mapping( + 'profile', env_var_names=['BAR_DEFAULT_PROFILE', 'BAR_PROFILE'] + ) + self.environ['BAR_DEFAULT_PROFILE'] = 'first' + self.environ['BAR_PROFILE'] = 'second' + self.assertEqual(self.session.get_config_variable('profile'), 'first') + + def test_profile_when_set_explicitly(self): + session = create_session(profile='asdf') + self.assertEqual(session.profile, 'asdf') + + def test_profile_when_pulled_from_env(self): + self.environ['FOO_PROFILE'] = 'bar' + # Even though we didn't explicitly pass in a profile, the + # profile property will still look this up for us. + self.assertEqual(self.session.profile, 'bar') + + def test_multiple_env_vars_uses_second_var(self): + self.update_session_config_mapping( + 'profile', env_var_names=['BAR_DEFAULT_PROFILE', 'BAR_PROFILE'] + ) + self.environ.pop('BAR_DEFAULT_PROFILE', None) + self.environ['BAR_PROFILE'] = 'second' + self.assertEqual(self.session.get_config_variable('profile'), 'second') + + def test_profile_does_not_exist_raises_exception(self): + # Given we have no profile: + self.environ['FOO_PROFILE'] = 'profile_that_does_not_exist' + with self.assertRaises(botocore.exceptions.ProfileNotFound): + self.session.get_scoped_config() + + def test_variable_does_not_exist(self): + self.assertIsNone(self.session.get_config_variable('foo/bar')) + + def test_get_aws_services_in_alphabetical_order(self): + services = self.session.get_available_services() + self.assertEqual(sorted(services), services) + + def test_profile_does_not_exist_with_default_profile(self): + config = self.session.get_scoped_config() + # We should have loaded this properly, and we'll check + # that foo_access_key which is defined in the config + # file should be present in the loaded config dict. + self.assertIn('aws_access_key_id', config) + + def test_type_conversions_occur_when_specified(self): + # Specify that we can retrieve the var from the + # FOO_TIMEOUT env var, with a conversion function + # of int(). + self.update_session_config_mapping( + 'metadata_service_timeout', + env_var_names='FOO_TIMEOUT', + conversion_func=int, + ) + # Environment variables are always strings. + self.environ['FOO_TIMEOUT'] = '10' + # But we should type convert this to a string. + self.assertEqual( + self.session.get_config_variable('metadata_service_timeout'), 10 + ) + + def test_default_profile_specified_raises_exception(self): + # If you explicity set the default profile and you don't + # have that in your config file, an exception is raised. + config_path = os.path.join( + os.path.dirname(__file__), 'cfg', 'boto_config_empty' + ) + self.environ['FOO_CONFIG_FILE'] = config_path + self.environ['FOO_PROFILE'] = 'default' + # In this case, even though we specified default, because + # the boto_config_empty config file does not have a default + # profile, we should be raising an exception. + with self.assertRaises(botocore.exceptions.ProfileNotFound): + self.session.get_scoped_config() + + def test_file_logger(self): + tempdir = tempfile.mkdtemp() + temp_file = os.path.join(tempdir, 'file_logger') + self.session.set_file_logger(logging.DEBUG, temp_file) + self.addCleanup(self.close_log_file_handler, tempdir, temp_file) + self.session.get_credentials() + self.assertTrue(os.path.isfile(temp_file)) + with open(temp_file) as logfile: + s = logfile.read() + self.assertTrue('Looking for credentials' in s) + + def test_full_config_property(self): + full_config = self.session.full_config + self.assertTrue('foo' in full_config['profiles']) + self.assertTrue('default' in full_config['profiles']) + + def test_full_config_merges_creds_file_data(self): + with temporary_file('w') as f: + self.session.set_config_variable('credentials_file', f.name) + f.write('[newprofile]\n') + f.write('aws_access_key_id=FROM_CREDS_FILE_1\n') + f.write('aws_secret_access_key=FROM_CREDS_FILE_2\n') + f.flush() + + full_config = self.session.full_config + self.assertEqual( + full_config['profiles']['newprofile'], + { + 'aws_access_key_id': 'FROM_CREDS_FILE_1', + 'aws_secret_access_key': 'FROM_CREDS_FILE_2', + }, + ) + + def test_path_not_in_available_profiles(self): + with temporary_file('w') as f: + self.session.set_config_variable('credentials_file', f.name) + f.write('[newprofile]\n') + f.write('aws_access_key_id=FROM_CREDS_FILE_1\n') + f.write('aws_secret_access_key=FROM_CREDS_FILE_2\n') + f.flush() + + profiles = self.session.available_profiles + self.assertEqual(set(profiles), {'foo', 'default', 'newprofile'}) + + def test_emit_delegates_to_emitter(self): + calls = [] + + def handler(**kwargs): + return calls.append(kwargs) + + self.session.register('foo', handler) + self.session.emit('foo') + self.assertEqual(len(calls), 1) + self.assertEqual(calls[0]['event_name'], 'foo') + + def test_emitter_can_be_passed_in(self): + events = HierarchicalEmitter() + session = create_session(event_hooks=events) + calls = [] + + def handler(**kwargs): + return calls.append(kwargs) + + events.register('foo', handler) + + session.emit('foo') + self.assertEqual(len(calls), 1) + + def test_emit_first_non_none(self): + self.session.register('foo', lambda **kwargs: None) + self.session.register('foo', lambda **kwargs: 'first') + self.session.register('foo', lambda **kwargs: 'second') + response = self.session.emit_first_non_none_response('foo') + self.assertEqual(response, 'first') + + @mock.patch('logging.getLogger') + @mock.patch('logging.FileHandler') + def test_logger_name_can_be_passed_in(self, file_handler, get_logger): + self.session.set_debug_logger('botocore.hooks') + get_logger.assert_called_with('botocore.hooks') + + self.session.set_file_logger('DEBUG', 'debuglog', 'botocore.service') + get_logger.assert_called_with('botocore.service') + file_handler.assert_called_with('debuglog') + + @mock.patch('logging.getLogger') + @mock.patch('logging.StreamHandler') + @mock.patch('logging.Formatter') + def test_general_purpose_logger(self, formatter, file_handler, get_logger): + self.session.set_stream_logger('foo.bar', 'ERROR', format_string='foo') + get_logger.assert_called_with('foo.bar') + get_logger.return_value.setLevel.assert_called_with(logging.DEBUG) + formatter.assert_called_with('foo') + + def test_register_with_unique_id(self): + calls = [] + + def handler(**kwargs): + return calls.append(kwargs) + + self.session.register('foo', handler, unique_id='bar') + self.session.emit('foo') + self.assertEqual(calls[0]['event_name'], 'foo') + calls = [] + self.session.unregister('foo', unique_id='bar') + self.session.emit('foo') + self.assertEqual(calls, []) + + +class TestBuiltinEventHandlers(BaseSessionTest): + def setUp(self): + super().setUp() + self.builtin_handlers = [ + ('foo', self.on_foo), + ] + self.foo_called = False + self.handler_patch = mock.patch( + 'botocore.handlers.BUILTIN_HANDLERS', self.builtin_handlers + ) + self.handler_patch.start() + + def on_foo(self, **kwargs): + self.foo_called = True + + def tearDown(self): + super().tearDown() + self.handler_patch.stop() + + def test_registered_builtin_handlers(self): + session = create_session(include_builtin_handlers=True) + session.emit('foo') + self.assertTrue(self.foo_called) + + +class TestSessionConfigurationVars(BaseSessionTest): + def test_per_session_config_vars(self): + self.update_session_config_mapping( + 'foobar', + instance_name='foobar', + env_var_names='FOOBAR', + default='default', + ) + # Default value. + self.assertEqual(self.session.get_config_variable('foobar'), 'default') + # Retrieve from os environment variable. + self.environ['FOOBAR'] = 'fromenv' + self.assertEqual(self.session.get_config_variable('foobar'), 'fromenv') + + # Explicit override. + self.session.set_config_variable('foobar', 'session-instance') + self.assertEqual( + self.session.get_config_variable('foobar'), 'session-instance' + ) + + # Back to default value. + del self.environ['FOOBAR'] + self.session.set_config_variable('foobar', None) + self.assertEqual(self.session.get_config_variable('foobar'), 'default') + + def test_default_value_can_be_overriden(self): + self.update_session_config_mapping( + 'foobar', + instance_name='foobar', + env_var_names='FOOBAR', + default='default', + ) + self.assertEqual(self.session.get_config_variable('foobar'), 'default') + + def test_can_get_with_methods(self): + self.environ['AWS_DEFAULT_REGION'] = 'env-var' + self.session.set_config_variable('region', 'instance-var') + value = self.session.get_config_variable('region') + self.assertEqual(value, 'instance-var') + + value = self.session.get_config_variable('region', methods=('env',)) + self.assertEqual(value, 'env-var') + + +class TestSessionPartitionFiles(BaseSessionTest): + def test_lists_partitions_on_disk(self): + mock_resolver = mock.Mock() + mock_resolver.get_available_partitions.return_value = ['foo'] + self.session._register_internal_component( + 'endpoint_resolver', mock_resolver + ) + self.assertEqual(['foo'], self.session.get_available_partitions()) + + def test_proxies_list_endpoints_to_resolver(self): + resolver = mock.Mock() + resolver.get_available_endpoints.return_value = ['a', 'b'] + self.session._register_internal_component( + 'endpoint_resolver', resolver + ) + self.session.get_available_regions('foo', 'bar', True) + + def test_provides_empty_list_for_unknown_service_regions(self): + regions = self.session.get_available_regions('__foo__') + self.assertEqual([], regions) + + def test_provides_correct_partition_for_region(self): + partition = self.session.get_partition_for_region('us-west-2') + self.assertEqual(partition, 'aws') + + def test_provides_correct_partition_for_region_regex(self): + partition = self.session.get_partition_for_region('af-south-99') + self.assertEqual(partition, 'aws') + + def test_provides_correct_partition_for_region_non_default(self): + partition = self.session.get_partition_for_region('cn-north-1') + self.assertEqual(partition, 'aws-cn') + + def test_raises_exception_for_invalid_region(self): + with self.assertRaises(botocore.exceptions.UnknownRegionError): + self.session.get_partition_for_region('no-good-1') + + +class TestSessionUserAgent(BaseSessionTest): + def test_can_change_user_agent_name(self): + self.session.user_agent_name = 'something-else' + self.assertTrue(self.session.user_agent().startswith('something-else')) + + def test_can_change_user_agent_version(self): + self.session.user_agent_version = '24.0' + self.assertTrue(self.session.user_agent().startswith('Botocore/24.0')) + + def test_can_append_to_user_agent(self): + self.session.user_agent_extra = 'custom-thing/other' + self.assertTrue( + self.session.user_agent().endswith('custom-thing/other') + ) + + def test_execution_env_not_set(self): + self.assertFalse(self.session.user_agent().endswith('FooEnv')) + + def test_execution_env_set(self): + self.environ['AWS_EXECUTION_ENV'] = 'FooEnv' + self.assertTrue(self.session.user_agent().endswith(' exec-env/FooEnv')) + + def test_agent_extra_and_exec_env(self): + self.session.user_agent_extra = 'custom-thing/other' + self.environ['AWS_EXECUTION_ENV'] = 'FooEnv' + user_agent = self.session.user_agent() + self.assertTrue(user_agent.endswith('custom-thing/other')) + self.assertIn('exec-env/FooEnv', user_agent) + + @requires_crt() + def test_crt_user_agent_appended(self): + user_agent = self.session.user_agent() + self.assertIn(' awscrt/', user_agent) + self.assertNotIn('awscrt/Unknown', user_agent) + + @requires_crt() + def test_crt_and_extra_user_agent(self): + user_agent = self.session.user_agent() + self.assertIn(' awscrt/', user_agent) + self.assertNotIn('custom-thing/other', user_agent) + self.session.user_agent_extra = 'custom-thing/other' + user_agent_w_extra = self.session.user_agent() + self.assertIn(' awscrt/', user_agent) + self.assertTrue(user_agent_w_extra.endswith('custom-thing/other')) + + +class TestConfigLoaderObject(BaseSessionTest): + def test_config_loader_delegation(self): + session = create_session(profile='credfile-profile') + with temporary_file('w') as f: + f.write('[credfile-profile]\naws_access_key_id=a\n') + f.write('aws_secret_access_key=b\n') + f.flush() + session.set_config_variable('credentials_file', f.name) + # Now trying to retrieve the scoped config should pull in + # values from the shared credentials file. + self.assertEqual( + session.get_scoped_config(), + {'aws_access_key_id': 'a', 'aws_secret_access_key': 'b'}, + ) + + +class TestGetServiceModel(BaseSessionTest): + def test_get_service_model(self): + loader = mock.Mock() + loader.load_service_model.return_value = { + 'metadata': {'serviceId': 'foo'} + } + self.session.register_component('data_loader', loader) + model = self.session.get_service_model('made_up') + self.assertIsInstance(model, ServiceModel) + self.assertEqual(model.service_name, 'made_up') + + +class TestGetPaginatorModel(BaseSessionTest): + def test_get_paginator_model(self): + loader = mock.Mock() + loader.load_service_model.return_value = {"pagination": {}} + self.session.register_component('data_loader', loader) + + model = self.session.get_paginator_model('foo') + + # Verify we get a PaginatorModel back + self.assertIsInstance(model, PaginatorModel) + # Verify we called the loader correctly. + loader.load_service_model.assert_called_with( + 'foo', 'paginators-1', None + ) + + +class TestGetWaiterModel(BaseSessionTest): + def test_get_waiter_model(self): + loader = mock.Mock() + loader.load_service_model.return_value = {"version": 2, "waiters": {}} + self.session.register_component('data_loader', loader) + + model = self.session.get_waiter_model('foo') + + # Verify we (1) get the expected return data, + self.assertIsInstance(model, WaiterModel) + self.assertEqual(model.waiter_names, []) + # and (2) call the loader correctly. + loader.load_service_model.assert_called_with('foo', 'waiters-2', None) + + +class TestCreateClient(BaseSessionTest): + def test_can_create_client(self): + sts_client = self.session.create_client('sts', 'us-west-2') + self.assertIsInstance(sts_client, client.BaseClient) + + def test_credential_provider_not_called_when_creds_provided(self): + cred_provider = mock.Mock() + self.session.register_component('credential_provider', cred_provider) + self.session.create_client( + 'sts', + 'us-west-2', + aws_access_key_id='foo', + aws_secret_access_key='bar', + aws_session_token='baz', + ) + self.assertFalse( + cred_provider.load_credentials.called, + "Credential provider was called even though " + "explicit credentials were provided to the " + "create_client call.", + ) + + def test_cred_provider_called_when_partial_creds_provided(self): + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + self.session.create_client( + 'sts', + 'us-west-2', + aws_access_key_id='foo', + aws_secret_access_key=None, + ) + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + self.session.create_client( + 'sts', + 'us-west-2', + aws_access_key_id=None, + aws_secret_access_key='foo', + ) + + def test_cred_provider_not_called_on_unsigned_client(self): + cred_provider = mock.Mock() + self.session.register_component('credential_provider', cred_provider) + config = botocore.config.Config(signature_version=UNSIGNED) + self.session.create_client('sts', 'us-west-2', config=config) + self.assertFalse(cred_provider.load_credentials.called) + + @mock.patch('botocore.client.ClientCreator') + def test_config_passed_to_client_creator(self, client_creator): + # Make sure there is no default set + self.assertEqual(self.session.get_default_client_config(), None) + + # The config passed to the client should be the one that is used + # in creating the client. + config = botocore.config.Config(region_name='us-west-2') + self.session.create_client('sts', config=config) + client_creator.return_value.create_client.assert_called_with( + service_name=mock.ANY, + region_name=mock.ANY, + is_secure=mock.ANY, + endpoint_url=mock.ANY, + verify=mock.ANY, + credentials=mock.ANY, + scoped_config=mock.ANY, + client_config=config, + api_version=mock.ANY, + auth_token=mock.ANY, + ) + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_default_client_config(self, client_creator): + config = botocore.config.Config() + self.session.set_default_client_config(config) + self.session.create_client('sts') + + client_creator.return_value.create_client.assert_called_with( + service_name=mock.ANY, + region_name=mock.ANY, + is_secure=mock.ANY, + endpoint_url=mock.ANY, + verify=mock.ANY, + credentials=mock.ANY, + scoped_config=mock.ANY, + client_config=config, + api_version=mock.ANY, + auth_token=mock.ANY, + ) + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_merging_client_configs(self, client_creator): + config = botocore.config.Config(region_name='us-west-2') + other_config = botocore.config.Config(region_name='us-east-1') + self.session.set_default_client_config(config) + self.session.create_client('sts', config=other_config) + + # Grab the client config used in creating the client + used_client_config = ( + client_creator.return_value.create_client.call_args[1][ + 'client_config' + ] + ) + # Check that the client configs were merged + self.assertEqual(used_client_config.region_name, 'us-east-1') + # Make sure that the client config used is not the default client + # config or the one passed in. It should be a new config. + self.assertIsNot(used_client_config, config) + self.assertIsNot(used_client_config, other_config) + + def test_create_client_with_region(self): + ec2_client = self.session.create_client('ec2', 'us-west-2') + self.assertEqual(ec2_client.meta.region_name, 'us-west-2') + + def test_create_client_with_region_and_client_config(self): + config = botocore.config.Config() + # Use a client config with no region configured. + ec2_client = self.session.create_client( + 'ec2', region_name='us-west-2', config=config + ) + self.assertEqual(ec2_client.meta.region_name, 'us-west-2') + + # If the region name is changed, it should not change the + # region of the client + config.region_name = 'us-east-1' + self.assertEqual(ec2_client.meta.region_name, 'us-west-2') + + # Now make a new client with the updated client config. + ec2_client = self.session.create_client('ec2', config=config) + self.assertEqual(ec2_client.meta.region_name, 'us-east-1') + + def test_create_client_no_region_and_no_client_config(self): + ec2_client = self.session.create_client('ec2') + self.assertEqual(ec2_client.meta.region_name, 'us-west-11') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_ca_bundle_from_config(self, client_creator): + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + f.write('[default]\n') + f.write('foo_ca_bundle=config-certs.pem\n') + f.flush() + + self.session.create_client('ec2', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['verify'], 'config-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_ca_bundle_from_env_var(self, client_creator): + self.environ['FOO_AWS_CA_BUNDLE'] = 'env-certs.pem' + self.session.create_client('ec2', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[1] + self.assertEqual(call_kwargs['verify'], 'env-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_verify_param(self, client_creator): + self.session.create_client( + 'ec2', 'us-west-2', verify='verify-certs.pem' + ) + call_kwargs = client_creator.return_value.create_client.call_args[1] + self.assertEqual(call_kwargs['verify'], 'verify-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_verify_param_overrides_all(self, client_creator): + with temporary_file('w') as f: + # Set the ca cert using the config file + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + f.write('[default]\n') + f.write('foo_ca_bundle=config-certs.pem\n') + f.flush() + + # Set the ca cert with an environment variable + self.environ['FOO_AWS_CA_BUNDLE'] = 'env-certs.pem' + + # Set the ca cert using the verify parameter + self.session.create_client( + 'ec2', 'us-west-2', verify='verify-certs.pem' + ) + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + # The verify parameter should override all the other + # configurations + self.assertEqual(call_kwargs['verify'], 'verify-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_use_no_api_version_by_default(self, client_creator): + self.session.create_client('myservice', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[1] + self.assertEqual(call_kwargs['api_version'], None) + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_uses_api_version_from_config(self, client_creator): + config_api_version = '2012-01-01' + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + f.write('[default]\n') + f.write( + 'foo_api_versions =\n' + f' myservice = {config_api_version}\n' + ) + f.flush() + + self.session.create_client('myservice', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['api_version'], config_api_version) + + @mock.patch('botocore.client.ClientCreator') + def test_can_specify_multiple_versions_from_config(self, client_creator): + config_api_version = '2012-01-01' + second_config_api_version = '2013-01-01' + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + f.write('[default]\n') + f.write( + f'foo_api_versions =\n' + f' myservice = {config_api_version}\n' + f' myservice2 = {second_config_api_version}\n' + ) + f.flush() + + self.session.create_client('myservice', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['api_version'], config_api_version) + + self.session.create_client('myservice2', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual( + call_kwargs['api_version'], second_config_api_version + ) + + @mock.patch('botocore.client.ClientCreator') + def test_param_api_version_overrides_config_value(self, client_creator): + config_api_version = '2012-01-01' + override_api_version = '2014-01-01' + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + f.write('[default]\n') + f.write( + 'foo_api_versions =\n' + f' myservice = {config_api_version}\n' + ) + f.flush() + + self.session.create_client( + 'myservice', 'us-west-2', api_version=override_api_version + ) + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['api_version'], override_api_version) + + +class TestSessionComponent(BaseSessionTest): + def test_internal_component(self): + component = object() + self.session._register_internal_component('internal', component) + self.assertIs( + self.session._get_internal_component('internal'), component + ) + with self.assertRaises(ValueError): + self.session.get_component('internal') + + def test_internal_endpoint_resolver_is_same_as_deprecated_public(self): + endpoint_resolver = self.session._get_internal_component( + 'endpoint_resolver' + ) + # get_component has been deprecated to the public + with pytest.warns(DeprecationWarning): + self.assertIs( + self.session.get_component('endpoint_resolver'), + endpoint_resolver, + ) + + def test_internal_exceptions_factory_is_same_as_deprecated_public(self): + exceptions_factory = self.session._get_internal_component( + 'exceptions_factory' + ) + # get_component has been deprecated to the public + with pytest.warns(DeprecationWarning): + self.assertIs( + self.session.get_component('exceptions_factory'), + exceptions_factory, + ) + + +class TestClientMonitoring(BaseSessionTest): + def assert_created_client_is_monitored(self, session): + with mock.patch( + 'botocore.monitoring.Monitor', spec=True + ) as mock_monitor: + client = session.create_client('ec2', 'us-west-2') + mock_monitor.return_value.register.assert_called_with( + client.meta.events + ) + + def assert_monitoring_host_and_port(self, session, host, port): + with mock.patch( + 'botocore.monitoring.SocketPublisher', spec=True + ) as mock_publisher: + session.create_client('ec2', 'us-west-2') + self.assertEqual(mock_publisher.call_count, 1) + _, args, kwargs = mock_publisher.mock_calls[0] + self.assertEqual(kwargs.get('host'), host) + self.assertEqual(kwargs.get('port'), port) + + def assert_created_client_is_not_monitored(self, session): + with mock.patch( + 'botocore.session.monitoring.Monitor', spec=True + ) as mock_monitor: + session.create_client('ec2', 'us-west-2') + mock_monitor.return_value.register.assert_not_called() + + def test_with_csm_enabled_from_config(self): + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + f.write('[default]\n') + f.write('csm_enabled=true\n') + f.flush() + self.assert_created_client_is_monitored(self.session) + + def test_with_csm_enabled_from_env(self): + self.environ['AWS_CSM_ENABLED'] = 'true' + self.assert_created_client_is_monitored(self.session) + + def test_with_csm_host(self): + custom_host = '10.13.37.1' + self.environ['AWS_CSM_ENABLED'] = 'true' + self.environ['AWS_CSM_HOST'] = custom_host + self.assert_monitoring_host_and_port(self.session, custom_host, 31000) + + def test_with_csm_port(self): + custom_port = '1234' + self.environ['AWS_CSM_ENABLED'] = 'true' + self.environ['AWS_CSM_PORT'] = custom_port + self.assert_monitoring_host_and_port( + self.session, + '127.0.0.1', + int(custom_port), + ) + + def test_with_csm_disabled_from_config(self): + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + f.write('[default]\n') + f.write('csm_enabled=false\n') + f.flush() + self.assert_created_client_is_not_monitored(self.session) + + def test_with_csm_disabled_from_env(self): + self.environ['AWS_CSM_ENABLED'] = 'false' + self.assert_created_client_is_not_monitored(self.session) + + def test_csm_not_configured(self): + self.assert_created_client_is_not_monitored(self.session) + + +class TestComponentLocator(unittest.TestCase): + def setUp(self): + self.components = botocore.session.ComponentLocator() + + def test_unknown_component_raises_exception(self): + with self.assertRaises(ValueError): + self.components.get_component('unknown-component') + + def test_can_register_and_retrieve_component(self): + component = object() + self.components.register_component('foo', component) + self.assertIs(self.components.get_component('foo'), component) + + def test_last_registration_wins(self): + first = object() + second = object() + self.components.register_component('foo', first) + self.components.register_component('foo', second) + self.assertIs(self.components.get_component('foo'), second) + + def test_can_lazy_register_a_component(self): + component = object() + + def lazy(): + return component + + self.components.lazy_register_component('foo', lazy) + self.assertIs(self.components.get_component('foo'), component) + + def test_latest_registration_wins_even_if_lazy(self): + first = object() + second = object() + + def lazy_second(): + return second + + self.components.register_component('foo', first) + self.components.lazy_register_component('foo', lazy_second) + self.assertIs(self.components.get_component('foo'), second) + + def test_latest_registration_overrides_lazy(self): + first = object() + second = object() + + def lazy_first(): + return first + + self.components.lazy_register_component('foo', lazy_first) + self.components.register_component('foo', second) + self.assertIs(self.components.get_component('foo'), second) + + def test_lazy_registration_factory_does_not_remove_from_list_on_error( + self, + ): + class ArbitraryError(Exception): + pass + + def bad_factory(): + raise ArbitraryError("Factory raises an exception.") + + self.components.lazy_register_component('foo', bad_factory) + + with self.assertRaises(ArbitraryError): + self.components.get_component('foo') + + # Trying again should raise the same exception, + # not an ValueError("Unknown component") + with self.assertRaises(ArbitraryError): + self.components.get_component('foo') + + +class TestDefaultClientConfig(BaseSessionTest): + def test_new_session_has_no_default_client_config(self): + self.assertEqual(self.session.get_default_client_config(), None) + + def test_set_and_get_client_config(self): + client_config = botocore.config.Config() + self.session.set_default_client_config(client_config) + self.assertIs(self.session.get_default_client_config(), client_config) + + +class TestSessionRegionSetup(BaseSessionTest): + def test_new_session_with_valid_region(self): + s3_client = self.session.create_client('s3', 'us-west-2') + self.assertIsInstance(s3_client, client.BaseClient) + self.assertEqual(s3_client.meta.region_name, 'us-west-2') + + def test_new_session_with_unknown_region(self): + s3_client = self.session.create_client('s3', 'MyCustomRegion1') + self.assertIsInstance(s3_client, client.BaseClient) + self.assertEqual(s3_client.meta.region_name, 'MyCustomRegion1') + + def test_new_session_with_invalid_region(self): + with self.assertRaises(botocore.exceptions.InvalidRegionError): + self.session.create_client('s3', 'not.a.real#region') + + def test_new_session_with_none_region(self): + s3_client = self.session.create_client('s3', region_name=None) + self.assertIsInstance(s3_client, client.BaseClient) + self.assertTrue(s3_client.meta.region_name is not None) + + +class TestInitializationHooks(BaseSessionTest): + def test_can_register_init_hook(self): + call_args = [] + + def init_hook(session): + call_args.append(session) + + register_initializer(init_hook) + self.addCleanup(unregister_initializer, init_hook) + session = create_session() + self.assertEqual(call_args, [session]) + + def test_can_unregister_hook(self): + call_args = [] + + def init_hook(session): + call_args.append(session) + + register_initializer(init_hook) + unregister_initializer(init_hook) + create_session() + self.assertEqual(call_args, []) + + def test_unregister_hook_raises_value_error(self): + def not_registered(session): + return None + + with self.assertRaises(ValueError): + self.assertRaises(unregister_initializer(not_registered)) diff --git a/testbed/boto__botocore/tests/unit/test_session_legacy.py b/testbed/boto__botocore/tests/unit/test_session_legacy.py new file mode 100644 index 0000000000000000000000000000000000000000..4ace6c8905aa59eba4e675f37ac506fc34d8549f --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_session_legacy.py @@ -0,0 +1,910 @@ +#!/usr/bin/env +# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import logging +import os +import shutil +import tempfile + +import pytest + +import botocore.config +import botocore.exceptions +import botocore.loaders +import botocore.session +from botocore import client +from botocore.hooks import HierarchicalEmitter +from botocore.model import ServiceModel +from botocore.paginate import PaginatorModel +from botocore.waiter import WaiterModel +from tests import create_session, mock, temporary_file, unittest + + +# This is an old version of the session tests to ensure backwards compatibility +# there is a new unit/test_session.py set of tests for the new config interface +# which should be prefered. When backwards compatibility can be dropped then +# this test should be removed. +class BaseSessionTest(unittest.TestCase): + def setUp(self): + self.env_vars = { + 'profile': (None, 'FOO_PROFILE', None, None), + 'region': ('foo_region', 'FOO_REGION', None, None), + 'data_path': ('data_path', 'FOO_DATA_PATH', None, None), + 'config_file': (None, 'FOO_CONFIG_FILE', None, None), + 'credentials_file': (None, None, '/tmp/nowhere', None), + 'ca_bundle': ('foo_ca_bundle', 'FOO_AWS_CA_BUNDLE', None, None), + 'api_versions': ('foo_api_versions', None, {}, None), + } + self.environ = {} + self.environ_patch = mock.patch('os.environ', self.environ) + self.environ_patch.start() + self.environ['FOO_PROFILE'] = 'foo' + self.environ['FOO_REGION'] = 'us-west-11' + data_path = os.path.join(os.path.dirname(__file__), 'data') + self.environ['FOO_DATA_PATH'] = data_path + config_path = os.path.join( + os.path.dirname(__file__), 'cfg', 'foo_config' + ) + self.environ['FOO_CONFIG_FILE'] = config_path + self.session = create_session(session_vars=self.env_vars) + + def tearDown(self): + self.environ_patch.stop() + + +class SessionTest(BaseSessionTest): + def close_log_file_handler(self, tempdir, filename): + logger = logging.getLogger('botocore') + handlers = logger.handlers + for handler in handlers[:]: + if hasattr(handler, 'stream') and handler.stream.name == filename: + handler.stream.close() + logger.removeHandler(handler) + os.remove(filename) + # logging has an atexit handler that will try to flush/close + # the file. By setting this flag to False, we'll prevent it + # from raising an exception, which is fine because we're + # handling the closing of the file ourself. + logging.raiseExceptions = False + shutil.rmtree(tempdir) + + def test_supports_multiple_env_vars_for_single_logical_name(self): + env_vars = { + 'profile': ( + None, + ['BAR_DEFAULT_PROFILE', 'BAR_PROFILE'], + None, + None, + ), + } + session = create_session(session_vars=env_vars) + self.environ['BAR_DEFAULT_PROFILE'] = 'first' + self.environ['BAR_PROFILE'] = 'second' + self.assertEqual(session.get_config_variable('profile'), 'first') + + def test_profile_when_set_explicitly(self): + session = create_session(session_vars=self.env_vars, profile='asdf') + self.assertEqual(session.profile, 'asdf') + + def test_profile_when_pulled_from_env(self): + self.environ['FOO_PROFILE'] = 'bar' + # Even though we didn't explicitly pass in a profile, the + # profile property will still look this up for us. + self.assertEqual(self.session.profile, 'bar') + + def test_multiple_env_vars_uses_second_var(self): + env_vars = { + 'profile': ( + None, + ['BAR_DEFAULT_PROFILE', 'BAR_PROFILE'], + None, + None, + ), + } + session = create_session(session_vars=env_vars) + self.environ.pop('BAR_DEFAULT_PROFILE', None) + self.environ['BAR_PROFILE'] = 'second' + self.assertEqual(session.get_config_variable('profile'), 'second') + + def test_profile(self): + self.assertEqual(self.session.get_config_variable('profile'), 'foo') + self.assertEqual( + self.session.get_config_variable('region'), 'us-west-11' + ) + self.session.get_config_variable('profile') == 'default' + saved_region = self.environ['FOO_REGION'] + del self.environ['FOO_REGION'] + saved_profile = self.environ['FOO_PROFILE'] + del self.environ['FOO_PROFILE'] + session = create_session(session_vars=self.env_vars) + self.assertEqual(session.get_config_variable('profile'), None) + self.assertEqual(session.get_config_variable('region'), 'us-west-1') + self.environ['FOO_REGION'] = saved_region + self.environ['FOO_PROFILE'] = saved_profile + + def test_profile_does_not_exist_raises_exception(self): + # Given we have no profile: + self.environ['FOO_PROFILE'] = 'profile_that_does_not_exist' + session = create_session(session_vars=self.env_vars) + with self.assertRaises(botocore.exceptions.ProfileNotFound): + session.get_scoped_config() + + def test_variable_does_not_exist(self): + session = create_session(session_vars=self.env_vars) + self.assertIsNone(session.get_config_variable('foo/bar')) + + def test_get_aws_services_in_alphabetical_order(self): + session = create_session(session_vars=self.env_vars) + services = session.get_available_services() + self.assertEqual(sorted(services), services) + + def test_profile_does_not_exist_with_default_profile(self): + session = create_session(session_vars=self.env_vars) + config = session.get_scoped_config() + # We should have loaded this properly, and we'll check + # that foo_access_key which is defined in the config + # file should be present in the loaded config dict. + self.assertIn('aws_access_key_id', config) + + def test_type_conversions_occur_when_specified(self): + # Specify that we can retrieve the var from the + # FOO_TIMEOUT env var, with a conversion function + # of int(). + self.env_vars['metadata_service_timeout'] = ( + None, + 'FOO_TIMEOUT', + None, + int, + ) + # Environment variables are always strings. + self.environ['FOO_TIMEOUT'] = '10' + session = create_session(session_vars=self.env_vars) + # But we should type convert this to a string. + self.assertEqual( + session.get_config_variable('metadata_service_timeout'), 10 + ) + + def test_default_profile_specified_raises_exception(self): + # If you explicity set the default profile and you don't + # have that in your config file, an exception is raised. + config_path = os.path.join( + os.path.dirname(__file__), 'cfg', 'boto_config_empty' + ) + self.environ['FOO_CONFIG_FILE'] = config_path + self.environ['FOO_PROFILE'] = 'default' + session = create_session(session_vars=self.env_vars) + # In this case, even though we specified default, because + # the boto_config_empty config file does not have a default + # profile, we should be raising an exception. + with self.assertRaises(botocore.exceptions.ProfileNotFound): + session.get_scoped_config() + + def test_file_logger(self): + tempdir = tempfile.mkdtemp() + temp_file = os.path.join(tempdir, 'file_logger') + self.session.set_file_logger(logging.DEBUG, temp_file) + self.addCleanup(self.close_log_file_handler, tempdir, temp_file) + self.session.get_credentials() + self.assertTrue(os.path.isfile(temp_file)) + with open(temp_file) as logfile: + s = logfile.read() + self.assertTrue('Looking for credentials' in s) + + def test_full_config_property(self): + full_config = self.session.full_config + self.assertTrue('foo' in full_config['profiles']) + self.assertTrue('default' in full_config['profiles']) + + def test_full_config_merges_creds_file_data(self): + with temporary_file('w') as f: + self.session.set_config_variable('credentials_file', f.name) + f.write('[newprofile]\n') + f.write('aws_access_key_id=FROM_CREDS_FILE_1\n') + f.write('aws_secret_access_key=FROM_CREDS_FILE_2\n') + f.flush() + + full_config = self.session.full_config + self.assertEqual( + full_config['profiles']['newprofile'], + { + 'aws_access_key_id': 'FROM_CREDS_FILE_1', + 'aws_secret_access_key': 'FROM_CREDS_FILE_2', + }, + ) + + def test_path_not_in_available_profiles(self): + with temporary_file('w') as f: + self.session.set_config_variable('credentials_file', f.name) + f.write('[newprofile]\n') + f.write('aws_access_key_id=FROM_CREDS_FILE_1\n') + f.write('aws_secret_access_key=FROM_CREDS_FILE_2\n') + f.flush() + + profiles = self.session.available_profiles + self.assertEqual(set(profiles), {'foo', 'default', 'newprofile'}) + + def test_emit_delegates_to_emitter(self): + calls = [] + + def handler(**kwargs): + return calls.append(kwargs) + + self.session.register('foo', handler) + self.session.emit('foo') + self.assertEqual(len(calls), 1) + self.assertEqual(calls[0]['event_name'], 'foo') + + def test_emitter_can_be_passed_in(self): + events = HierarchicalEmitter() + session = create_session( + session_vars=self.env_vars, event_hooks=events + ) + calls = [] + + def handler(**kwargs): + return calls.append(kwargs) + + events.register('foo', handler) + + session.emit('foo') + self.assertEqual(len(calls), 1) + + def test_emit_first_non_none(self): + session = create_session(session_vars=self.env_vars) + session.register('foo', lambda **kwargs: None) + session.register('foo', lambda **kwargs: 'first') + session.register('foo', lambda **kwargs: 'second') + response = session.emit_first_non_none_response('foo') + self.assertEqual(response, 'first') + + @mock.patch('logging.getLogger') + @mock.patch('logging.FileHandler') + def test_logger_name_can_be_passed_in(self, file_handler, get_logger): + self.session.set_debug_logger('botocore.hooks') + get_logger.assert_called_with('botocore.hooks') + + self.session.set_file_logger('DEBUG', 'debuglog', 'botocore.service') + get_logger.assert_called_with('botocore.service') + file_handler.assert_called_with('debuglog') + + @mock.patch('logging.getLogger') + @mock.patch('logging.StreamHandler') + @mock.patch('logging.Formatter') + def test_general_purpose_logger(self, formatter, file_handler, get_logger): + self.session.set_stream_logger('foo.bar', 'ERROR', format_string='foo') + get_logger.assert_called_with('foo.bar') + get_logger.return_value.setLevel.assert_called_with(logging.DEBUG) + formatter.assert_called_with('foo') + + def test_register_with_unique_id(self): + calls = [] + + def handler(**kwargs): + return calls.append(kwargs) + + self.session.register('foo', handler, unique_id='bar') + self.session.emit('foo') + self.assertEqual(calls[0]['event_name'], 'foo') + calls = [] + self.session.unregister('foo', unique_id='bar') + self.session.emit('foo') + self.assertEqual(calls, []) + + +class TestBuiltinEventHandlers(BaseSessionTest): + def setUp(self): + super().setUp() + self.builtin_handlers = [ + ('foo', self.on_foo), + ] + self.foo_called = False + self.handler_patch = mock.patch( + 'botocore.handlers.BUILTIN_HANDLERS', self.builtin_handlers + ) + self.handler_patch.start() + + def on_foo(self, **kwargs): + self.foo_called = True + + def tearDown(self): + super().tearDown() + self.handler_patch.stop() + + def test_registered_builtin_handlers(self): + session = botocore.session.Session( + self.env_vars, None, include_builtin_handlers=True + ) + session.emit('foo') + self.assertTrue(self.foo_called) + + +class TestSessionConfigurationVars(BaseSessionTest): + def test_per_session_config_vars(self): + self.session.session_var_map['foobar'] = ( + None, + 'FOOBAR', + 'default', + None, + ) + # Default value. + self.assertEqual(self.session.get_config_variable('foobar'), 'default') + # Retrieve from os environment variable. + self.environ['FOOBAR'] = 'fromenv' + self.assertEqual(self.session.get_config_variable('foobar'), 'fromenv') + + # Explicit override. + self.session.set_config_variable('foobar', 'session-instance') + self.assertEqual( + self.session.get_config_variable('foobar'), 'session-instance' + ) + + # Can disable this check via the ``methods`` arg. + del self.environ['FOOBAR'] + self.assertEqual( + self.session.get_config_variable( + 'foobar', methods=('env', 'config') + ), + 'default', + ) + + def test_default_value_can_be_overriden(self): + self.session.session_var_map['foobar'] = ( + None, + 'FOOBAR', + 'default', + None, + ) + self.assertEqual(self.session.get_config_variable('foobar'), 'default') + + def test_can_get_session_vars_info_from_default_session(self): + # This test is to ensure that you can still reach the session_vars_map + # information from the session and that it has the expected value. + self.session = create_session() + self.assertEqual( + self.session.session_var_map['region'], + ('region', 'AWS_DEFAULT_REGION', None, None), + ) + self.assertEqual( + self.session.session_var_map['profile'], + (None, ['AWS_DEFAULT_PROFILE', 'AWS_PROFILE'], None, None), + ) + self.assertEqual( + self.session.session_var_map['data_path'], + ('data_path', 'AWS_DATA_PATH', None, None), + ) + self.assertEqual( + self.session.session_var_map['config_file'], + (None, 'AWS_CONFIG_FILE', '~/.aws/config', None), + ) + self.assertEqual( + self.session.session_var_map['ca_bundle'], + ('ca_bundle', 'AWS_CA_BUNDLE', None, None), + ) + self.assertEqual( + self.session.session_var_map['api_versions'], + ('api_versions', None, {}, None), + ) + self.assertEqual( + self.session.session_var_map['credentials_file'], + (None, 'AWS_SHARED_CREDENTIALS_FILE', '~/.aws/credentials', None), + ) + self.assertEqual( + self.session.session_var_map['metadata_service_timeout'], + ( + 'metadata_service_timeout', + 'AWS_METADATA_SERVICE_TIMEOUT', + 1, + int, + ), + ) + self.assertEqual( + self.session.session_var_map['metadata_service_num_attempts'], + ( + 'metadata_service_num_attempts', + 'AWS_METADATA_SERVICE_NUM_ATTEMPTS', + 1, + int, + ), + ) + self.assertEqual( + self.session.session_var_map['parameter_validation'], + ('parameter_validation', None, True, None), + ) + + +class TestSessionPartitionFiles(BaseSessionTest): + def test_lists_partitions_on_disk(self): + mock_resolver = mock.Mock() + mock_resolver.get_available_partitions.return_value = ['foo'] + self.session._register_internal_component( + 'endpoint_resolver', mock_resolver + ) + self.assertEqual(['foo'], self.session.get_available_partitions()) + + def test_proxies_list_endpoints_to_resolver(self): + resolver = mock.Mock() + resolver.get_available_endpoints.return_value = ['a', 'b'] + self.session._register_internal_component( + 'endpoint_resolver', resolver + ) + self.session.get_available_regions('foo', 'bar', True) + + def test_provides_empty_list_for_unknown_service_regions(self): + regions = self.session.get_available_regions('__foo__') + self.assertEqual([], regions) + + +class TestSessionUserAgent(BaseSessionTest): + def test_can_change_user_agent_name(self): + self.session.user_agent_name = 'something-else' + self.assertTrue(self.session.user_agent().startswith('something-else')) + + def test_can_change_user_agent_version(self): + self.session.user_agent_version = '24.0' + self.assertTrue(self.session.user_agent().startswith('Botocore/24.0')) + + def test_can_append_to_user_agent(self): + self.session.user_agent_extra = 'custom-thing/other' + self.assertTrue( + self.session.user_agent().endswith('custom-thing/other') + ) + + def test_execution_env_not_set(self): + self.assertFalse(self.session.user_agent().endswith('FooEnv')) + + def test_execution_env_set(self): + self.environ['AWS_EXECUTION_ENV'] = 'FooEnv' + self.assertTrue(self.session.user_agent().endswith(' exec-env/FooEnv')) + + def test_agent_extra_and_exec_env(self): + self.session.user_agent_extra = 'custom-thing/other' + self.environ['AWS_EXECUTION_ENV'] = 'FooEnv' + user_agent = self.session.user_agent() + self.assertTrue(user_agent.endswith('custom-thing/other')) + self.assertIn('exec-env/FooEnv', user_agent) + + +class TestConfigLoaderObject(BaseSessionTest): + def test_config_loader_delegation(self): + session = create_session( + session_vars=self.env_vars, profile='credfile-profile' + ) + with temporary_file('w') as f: + f.write('[credfile-profile]\naws_access_key_id=a\n') + f.write('aws_secret_access_key=b\n') + f.flush() + session.set_config_variable('credentials_file', f.name) + # Now trying to retrieve the scoped config should pull in + # values from the shared credentials file. + self.assertEqual( + session.get_scoped_config(), + {'aws_access_key_id': 'a', 'aws_secret_access_key': 'b'}, + ) + + +class TestGetServiceModel(BaseSessionTest): + def test_get_service_model(self): + loader = mock.Mock() + loader.load_service_model.return_value = { + 'metadata': {'serviceId': 'foo'} + } + self.session.register_component('data_loader', loader) + model = self.session.get_service_model('made_up') + self.assertIsInstance(model, ServiceModel) + self.assertEqual(model.service_name, 'made_up') + + +class TestGetPaginatorModel(BaseSessionTest): + def test_get_paginator_model(self): + loader = mock.Mock() + loader.load_service_model.return_value = {"pagination": {}} + self.session.register_component('data_loader', loader) + + model = self.session.get_paginator_model('foo') + + # Verify we get a PaginatorModel back + self.assertIsInstance(model, PaginatorModel) + # Verify we called the loader correctly. + loader.load_service_model.assert_called_with( + 'foo', 'paginators-1', None + ) + + +class TestGetWaiterModel(BaseSessionTest): + def test_get_waiter_model(self): + loader = mock.Mock() + loader.load_service_model.return_value = {"version": 2, "waiters": {}} + self.session.register_component('data_loader', loader) + + model = self.session.get_waiter_model('foo') + + # Verify we (1) get the expected return data, + self.assertIsInstance(model, WaiterModel) + self.assertEqual(model.waiter_names, []) + # and (2) call the loader correctly. + loader.load_service_model.assert_called_with('foo', 'waiters-2', None) + + +class TestCreateClient(BaseSessionTest): + def test_can_create_client(self): + sts_client = self.session.create_client('sts', 'us-west-2') + self.assertIsInstance(sts_client, client.BaseClient) + + def test_credential_provider_not_called_when_creds_provided(self): + cred_provider = mock.Mock() + self.session.register_component('credential_provider', cred_provider) + self.session.create_client( + 'sts', + 'us-west-2', + aws_access_key_id='foo', + aws_secret_access_key='bar', + aws_session_token='baz', + ) + self.assertFalse( + cred_provider.load_credentials.called, + "Credential provider was called even though " + "explicit credentials were provided to the " + "create_client call.", + ) + + def test_cred_provider_called_when_partial_creds_provided(self): + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + self.session.create_client( + 'sts', + 'us-west-2', + aws_access_key_id='foo', + aws_secret_access_key=None, + ) + with self.assertRaises(botocore.exceptions.PartialCredentialsError): + self.session.create_client( + 'sts', + 'us-west-2', + aws_access_key_id=None, + aws_secret_access_key='foo', + ) + + @mock.patch('botocore.client.ClientCreator') + def test_config_passed_to_client_creator(self, client_creator): + # Make sure there is no default set + self.assertEqual(self.session.get_default_client_config(), None) + + # The config passed to the client should be the one that is used + # in creating the client. + config = botocore.config.Config(region_name='us-west-2') + self.session.create_client('sts', config=config) + client_creator.return_value.create_client.assert_called_with( + service_name=mock.ANY, + region_name=mock.ANY, + is_secure=mock.ANY, + endpoint_url=mock.ANY, + verify=mock.ANY, + credentials=mock.ANY, + scoped_config=mock.ANY, + client_config=config, + api_version=mock.ANY, + auth_token=mock.ANY, + ) + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_default_client_config(self, client_creator): + config = botocore.config.Config() + self.session.set_default_client_config(config) + self.session.create_client('sts') + + client_creator.return_value.create_client.assert_called_with( + service_name=mock.ANY, + region_name=mock.ANY, + is_secure=mock.ANY, + endpoint_url=mock.ANY, + verify=mock.ANY, + credentials=mock.ANY, + scoped_config=mock.ANY, + client_config=config, + api_version=mock.ANY, + auth_token=mock.ANY, + ) + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_merging_client_configs(self, client_creator): + config = botocore.config.Config(region_name='us-west-2') + other_config = botocore.config.Config(region_name='us-east-1') + self.session.set_default_client_config(config) + self.session.create_client('sts', config=other_config) + + # Grab the client config used in creating the client + used_client_config = ( + client_creator.return_value.create_client.call_args[1][ + 'client_config' + ] + ) + # Check that the client configs were merged + self.assertEqual(used_client_config.region_name, 'us-east-1') + # Make sure that the client config used is not the default client + # config or the one passed in. It should be a new config. + self.assertIsNot(used_client_config, config) + self.assertIsNot(used_client_config, other_config) + + def test_create_client_with_region(self): + ec2_client = self.session.create_client('ec2', 'us-west-2') + self.assertEqual(ec2_client.meta.region_name, 'us-west-2') + + def test_create_client_with_region_and_client_config(self): + config = botocore.config.Config() + # Use a client config with no region configured. + ec2_client = self.session.create_client( + 'ec2', region_name='us-west-2', config=config + ) + self.assertEqual(ec2_client.meta.region_name, 'us-west-2') + + # If the region name is changed, it should not change the + # region of the client + config.region_name = 'us-east-1' + self.assertEqual(ec2_client.meta.region_name, 'us-west-2') + + # Now make a new client with the updated client config. + ec2_client = self.session.create_client('ec2', config=config) + self.assertEqual(ec2_client.meta.region_name, 'us-east-1') + + def test_create_client_no_region_and_no_client_config(self): + ec2_client = self.session.create_client('ec2') + self.assertEqual(ec2_client.meta.region_name, 'us-west-11') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_ca_bundle_from_config(self, client_creator): + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + self.session = create_session(session_vars=self.env_vars) + f.write('[default]\n') + f.write('foo_ca_bundle=config-certs.pem\n') + f.flush() + + self.session.create_client('ec2', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['verify'], 'config-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_ca_bundle_from_env_var(self, client_creator): + self.environ['FOO_AWS_CA_BUNDLE'] = 'env-certs.pem' + self.session.create_client('ec2', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[1] + self.assertEqual(call_kwargs['verify'], 'env-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_with_verify_param(self, client_creator): + self.session.create_client( + 'ec2', 'us-west-2', verify='verify-certs.pem' + ) + call_kwargs = client_creator.return_value.create_client.call_args[1] + self.assertEqual(call_kwargs['verify'], 'verify-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_verify_param_overrides_all(self, client_creator): + with temporary_file('w') as f: + # Set the ca cert using the config file + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + self.session = create_session(session_vars=self.env_vars) + f.write('[default]\n') + f.write('foo_ca_bundle=config-certs.pem\n') + f.flush() + + # Set the ca cert with an environment variable + self.environ['FOO_AWS_CA_BUNDLE'] = 'env-certs.pem' + + # Set the ca cert using the verify parameter + self.session.create_client( + 'ec2', 'us-west-2', verify='verify-certs.pem' + ) + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + # The verify parameter should override all the other + # configurations + self.assertEqual(call_kwargs['verify'], 'verify-certs.pem') + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_use_no_api_version_by_default(self, client_creator): + self.session.create_client('myservice', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[1] + self.assertEqual(call_kwargs['api_version'], None) + + @mock.patch('botocore.client.ClientCreator') + def test_create_client_uses_api_version_from_config(self, client_creator): + config_api_version = '2012-01-01' + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + self.session = create_session(session_vars=self.env_vars) + f.write('[default]\n') + f.write( + 'foo_api_versions =\n' + f' myservice = {config_api_version}\n' + ) + f.flush() + + self.session.create_client('myservice', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['api_version'], config_api_version) + + @mock.patch('botocore.client.ClientCreator') + def test_can_specify_multiple_versions_from_config(self, client_creator): + config_api_version = '2012-01-01' + second_config_api_version = '2013-01-01' + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + self.session = create_session(session_vars=self.env_vars) + f.write('[default]\n') + f.write( + f'foo_api_versions =\n' + f' myservice = {config_api_version}\n' + f' myservice2 = {second_config_api_version}\n' + ) + f.flush() + + self.session.create_client('myservice', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['api_version'], config_api_version) + + self.session.create_client('myservice2', 'us-west-2') + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual( + call_kwargs['api_version'], second_config_api_version + ) + + @mock.patch('botocore.client.ClientCreator') + def test_param_api_version_overrides_config_value(self, client_creator): + config_api_version = '2012-01-01' + override_api_version = '2014-01-01' + with temporary_file('w') as f: + del self.environ['FOO_PROFILE'] + self.environ['FOO_CONFIG_FILE'] = f.name + self.session = create_session(session_vars=self.env_vars) + f.write('[default]\n') + f.write( + 'foo_api_versions =\n' + f' myservice = {config_api_version}\n' + ) + f.flush() + + self.session.create_client( + 'myservice', 'us-west-2', api_version=override_api_version + ) + call_kwargs = client_creator.return_value.create_client.call_args[ + 1 + ] + self.assertEqual(call_kwargs['api_version'], override_api_version) + + +class TestSessionComponent(BaseSessionTest): + def test_internal_component(self): + component = object() + self.session._register_internal_component('internal', component) + self.assertIs( + self.session._get_internal_component('internal'), component + ) + with self.assertRaises(ValueError): + self.session.get_component('internal') + + def test_internal_endpoint_resolver_is_same_as_deprecated_public(self): + endpoint_resolver = self.session._get_internal_component( + 'endpoint_resolver' + ) + # get_component has been deprecated to the public + with pytest.warns(DeprecationWarning): + self.assertIs( + self.session.get_component('endpoint_resolver'), + endpoint_resolver, + ) + + def test_internal_exceptions_factory_is_same_as_deprecated_public(self): + exceptions_factory = self.session._get_internal_component( + 'exceptions_factory' + ) + # get_component has been deprecated to the public + with pytest.warns(DeprecationWarning): + self.assertIs( + self.session.get_component('exceptions_factory'), + exceptions_factory, + ) + + +class TestComponentLocator(unittest.TestCase): + def setUp(self): + self.components = botocore.session.ComponentLocator() + + def test_unknown_component_raises_exception(self): + with self.assertRaises(ValueError): + self.components.get_component('unknown-component') + + def test_can_register_and_retrieve_component(self): + component = object() + self.components.register_component('foo', component) + self.assertIs(self.components.get_component('foo'), component) + + def test_last_registration_wins(self): + first = object() + second = object() + self.components.register_component('foo', first) + self.components.register_component('foo', second) + self.assertIs(self.components.get_component('foo'), second) + + def test_can_lazy_register_a_component(self): + component = object() + + def lazy(): + return component + + self.components.lazy_register_component('foo', lazy) + self.assertIs(self.components.get_component('foo'), component) + + def test_latest_registration_wins_even_if_lazy(self): + first = object() + second = object() + + def lazy_second(): + return second + + self.components.register_component('foo', first) + self.components.lazy_register_component('foo', lazy_second) + self.assertIs(self.components.get_component('foo'), second) + + def test_latest_registration_overrides_lazy(self): + first = object() + second = object() + + def lazy_first(): + return first + + self.components.lazy_register_component('foo', lazy_first) + self.components.register_component('foo', second) + self.assertIs(self.components.get_component('foo'), second) + + def test_lazy_registration_factory_does_not_remove_from_list_on_error( + self, + ): + class ArbitraryError(Exception): + pass + + def bad_factory(): + raise ArbitraryError("Factory raises an exception.") + + self.components.lazy_register_component('foo', bad_factory) + + with self.assertRaises(ArbitraryError): + self.components.get_component('foo') + + # Trying again should raise the same exception, + # not an ValueError("Unknown component") + with self.assertRaises(ArbitraryError): + self.components.get_component('foo') + + +class TestDefaultClientConfig(BaseSessionTest): + def test_new_session_has_no_default_client_config(self): + self.assertEqual(self.session.get_default_client_config(), None) + + def test_set_and_get_client_config(self): + client_config = botocore.config.Config() + self.session.set_default_client_config(client_config) + self.assertIs(self.session.get_default_client_config(), client_config) diff --git a/testbed/boto__botocore/tests/unit/test_signers.py b/testbed/boto__botocore/tests/unit/test_signers.py new file mode 100644 index 0000000000000000000000000000000000000000..d5389345933307fcce423bff5b0e03422fad0e3d --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_signers.py @@ -0,0 +1,1198 @@ +# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import datetime +import json + +import pytest +from dateutil.tz import tzutc + +import botocore +import botocore.auth +import botocore.awsrequest +import botocore.session +from botocore.config import Config +from botocore.credentials import Credentials, ReadOnlyCredentials +from botocore.exceptions import ( + NoRegionError, + ParamValidationError, + UnknownClientMethodError, + UnknownSignatureVersionError, + UnsupportedSignatureVersionError, +) +from botocore.hooks import HierarchicalEmitter +from botocore.model import ServiceId +from botocore.signers import ( + CloudFrontSigner, + RequestSigner, + S3PostPresigner, + generate_db_auth_token, +) +from tests import assert_url_equal, mock, unittest + + +@pytest.fixture +def polly_client(): + session = botocore.session.get_session() + session.set_credentials('key', 'secret') + return session.create_client('polly', region_name='us-west-2') + + +class BaseSignerTest(unittest.TestCase): + def setUp(self): + self.credentials = Credentials('key', 'secret') + self.emitter = mock.Mock() + self.emitter.emit_until_response.return_value = (None, None) + self.signer = RequestSigner( + ServiceId('service_name'), + 'region_name', + 'signing_name', + 'v4', + self.credentials, + self.emitter, + ) + self.fixed_credentials = self.credentials.get_frozen_credentials() + self.request = botocore.awsrequest.AWSRequest() + + +class TestSigner(BaseSignerTest): + def test_region_name(self): + self.assertEqual(self.signer.region_name, 'region_name') + + def test_signature_version(self): + self.assertEqual(self.signer.signature_version, 'v4') + + def test_signing_name(self): + self.assertEqual(self.signer.signing_name, 'signing_name') + + def test_region_required_for_sigv4(self): + self.signer = RequestSigner( + ServiceId('service_name'), + None, + 'signing_name', + 'v4', + self.credentials, + self.emitter, + ) + + with self.assertRaises(NoRegionError): + self.signer.sign('operation_name', self.request) + + def test_get_auth(self): + auth_cls = mock.Mock() + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4': auth_cls}): + auth = self.signer.get_auth('service_name', 'region_name') + + self.assertEqual(auth, auth_cls.return_value) + auth_cls.assert_called_with( + credentials=self.fixed_credentials, + service_name='service_name', + region_name='region_name', + ) + + def test_get_auth_signature_override(self): + auth_cls = mock.Mock() + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'v4-custom': auth_cls} + ): + auth = self.signer.get_auth( + 'service_name', 'region_name', signature_version='v4-custom' + ) + + self.assertEqual(auth, auth_cls.return_value) + auth_cls.assert_called_with( + credentials=self.fixed_credentials, + service_name='service_name', + region_name='region_name', + ) + + def test_get_auth_bad_override(self): + with self.assertRaises(UnknownSignatureVersionError): + self.signer.get_auth( + 'service_name', 'region_name', signature_version='bad' + ) + + def test_emits_choose_signer(self): + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'v4': mock.Mock()} + ): + self.signer.sign('operation_name', self.request) + + self.emitter.emit_until_response.assert_called_with( + 'choose-signer.service_name.operation_name', + signing_name='signing_name', + region_name='region_name', + signature_version='v4', + context=mock.ANY, + ) + + def test_choose_signer_override(self): + auth = mock.Mock() + auth.REQUIRES_REGION = False + self.emitter.emit_until_response.return_value = (None, 'custom') + + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'custom': auth}): + self.signer.sign('operation_name', self.request) + + auth.assert_called_with(credentials=self.fixed_credentials) + auth.return_value.add_auth.assert_called_with(self.request) + + def test_emits_before_sign(self): + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'v4': mock.Mock()} + ): + self.signer.sign('operation_name', self.request) + + self.emitter.emit.assert_called_with( + 'before-sign.service_name.operation_name', + request=self.request, + signing_name='signing_name', + region_name='region_name', + signature_version='v4', + request_signer=self.signer, + operation_name='operation_name', + ) + + def test_disable_signing(self): + # Returning botocore.UNSIGNED from choose-signer disables signing! + auth = mock.Mock() + self.emitter.emit_until_response.return_value = ( + None, + botocore.UNSIGNED, + ) + + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4': auth}): + self.signer.sign('operation_name', self.request) + + auth.assert_not_called() + + def test_generate_url_emits_choose_signer(self): + request_dict = { + 'headers': {}, + 'url': 'https://foo.com', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'v4': mock.Mock()} + ): + self.signer.generate_presigned_url(request_dict, 'operation_name') + + self.emitter.emit_until_response.assert_called_with( + 'choose-signer.service_name.operation_name', + signing_name='signing_name', + region_name='region_name', + signature_version='v4-query', + context=mock.ANY, + ) + + def test_choose_signer_passes_context(self): + self.request.context = {'foo': 'bar'} + + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'v4': mock.Mock()} + ): + self.signer.sign('operation_name', self.request) + + self.emitter.emit_until_response.assert_called_with( + 'choose-signer.service_name.operation_name', + signing_name='signing_name', + region_name='region_name', + signature_version='v4', + context={'foo': 'bar'}, + ) + + def test_generate_url_choose_signer_override(self): + request_dict = { + 'headers': {}, + 'url': 'https://foo.com', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + auth = mock.Mock() + auth.REQUIRES_REGION = False + self.emitter.emit_until_response.return_value = (None, 'custom') + + auth_types_map = {'custom': mock.Mock(), 'custom-query': auth} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types_map): + self.signer.generate_presigned_url(request_dict, 'operation_name') + + auth.assert_called_with( + credentials=self.fixed_credentials, expires=3600 + ) + + def test_generate_url_unsigned(self): + request_dict = { + 'headers': {}, + 'url': 'https://foo.com', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + self.emitter.emit_until_response.return_value = ( + None, + botocore.UNSIGNED, + ) + + url = self.signer.generate_presigned_url( + request_dict, 'operation_name' + ) + + self.assertEqual(url, 'https://foo.com') + + def test_generate_presigned_url(self): + auth = mock.Mock() + auth.REQUIRES_REGION = True + + request_dict = { + 'headers': {}, + 'url': 'https://foo.com', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4-query': auth}): + presigned_url = self.signer.generate_presigned_url( + request_dict, operation_name='operation_name' + ) + auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='region_name', + service_name='signing_name', + expires=3600, + ) + self.assertEqual(presigned_url, 'https://foo.com') + + def test_generate_presigned_url_with_region_override(self): + auth = mock.Mock() + auth.REQUIRES_REGION = True + + request_dict = { + 'headers': {}, + 'url': 'https://foo.com', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4-query': auth}): + presigned_url = self.signer.generate_presigned_url( + request_dict, + operation_name='operation_name', + region_name='us-west-2', + ) + auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='us-west-2', + service_name='signing_name', + expires=3600, + ) + self.assertEqual(presigned_url, 'https://foo.com') + + def test_generate_presigned_url_with_exipres_in(self): + auth = mock.Mock() + auth.REQUIRES_REGION = True + + request_dict = { + 'headers': {}, + 'url': 'https://foo.com', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4-query': auth}): + presigned_url = self.signer.generate_presigned_url( + request_dict, operation_name='operation_name', expires_in=900 + ) + auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='region_name', + expires=900, + service_name='signing_name', + ) + self.assertEqual(presigned_url, 'https://foo.com') + + def test_presigned_url_throws_unsupported_signature_error(self): + request_dict = { + 'headers': {}, + 'url': 'https://s3.amazonaws.com/mybucket/myobject', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + self.signer = RequestSigner( + ServiceId('service_name'), + 'region_name', + 'signing_name', + 'foo', + self.credentials, + self.emitter, + ) + with self.assertRaises(UnsupportedSignatureVersionError): + self.signer.generate_presigned_url( + request_dict, operation_name='foo' + ) + + def test_signer_with_refreshable_credentials_gets_credential_set(self): + class FakeCredentials(Credentials): + def get_frozen_credentials(self): + return ReadOnlyCredentials('foo', 'bar', 'baz') + + self.credentials = FakeCredentials('a', 'b', 'c') + + self.signer = RequestSigner( + ServiceId('service_name'), + 'region_name', + 'signing_name', + 'v4', + self.credentials, + self.emitter, + ) + + auth_cls = mock.Mock() + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4': auth_cls}): + auth = self.signer.get_auth('service_name', 'region_name') + self.assertEqual(auth, auth_cls.return_value) + # Note we're called with 'foo', 'bar', 'baz', and *not* + # 'a', 'b', 'c'. + auth_cls.assert_called_with( + credentials=ReadOnlyCredentials('foo', 'bar', 'baz'), + service_name='service_name', + region_name='region_name', + ) + + def test_no_credentials_case_is_forwarded_to_signer(self): + # If no credentials are given to the RequestSigner, we should + # forward that fact on to the Auth class and let them handle + # the error (which they already do). + self.credentials = None + self.signer = RequestSigner( + ServiceId('service_name'), + 'region_name', + 'signing_name', + 'v4', + self.credentials, + self.emitter, + ) + auth_cls = mock.Mock() + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4': auth_cls}): + self.signer.get_auth_instance('service_name', 'region_name', 'v4') + auth_cls.assert_called_with( + service_name='service_name', + region_name='region_name', + credentials=None, + ) + + def test_sign_with_signing_type_standard(self): + auth = mock.Mock() + post_auth = mock.Mock() + query_auth = mock.Mock() + auth_types = { + 'v4-presign-post': post_auth, + 'v4-query': query_auth, + 'v4': auth, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign( + 'operation_name', self.request, signing_type='standard' + ) + self.assertFalse(post_auth.called) + self.assertFalse(query_auth.called) + auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='signing_name', + region_name='region_name', + ) + + def test_sign_with_signing_type_presign_url(self): + auth = mock.Mock() + post_auth = mock.Mock() + query_auth = mock.Mock() + auth_types = { + 'v4-presign-post': post_auth, + 'v4-query': query_auth, + 'v4': auth, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign( + 'operation_name', self.request, signing_type='presign-url' + ) + self.assertFalse(post_auth.called) + self.assertFalse(auth.called) + query_auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='signing_name', + region_name='region_name', + ) + + def test_sign_with_signing_type_presign_post(self): + auth = mock.Mock() + post_auth = mock.Mock() + query_auth = mock.Mock() + auth_types = { + 'v4-presign-post': post_auth, + 'v4-query': query_auth, + 'v4': auth, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign( + 'operation_name', self.request, signing_type='presign-post' + ) + self.assertFalse(auth.called) + self.assertFalse(query_auth.called) + post_auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='signing_name', + region_name='region_name', + ) + + def test_sign_with_region_name(self): + auth = mock.Mock() + auth_types = {'v4': auth} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign('operation_name', self.request, region_name='foo') + auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='signing_name', + region_name='foo', + ) + + def test_sign_override_region_from_context(self): + auth = mock.Mock() + auth_types = {'v4': auth} + self.request.context = {'signing': {'region': 'my-override-region'}} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign('operation_name', self.request) + auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='signing_name', + region_name='my-override-region', + ) + + def test_sign_with_region_name_overrides_context(self): + auth = mock.Mock() + auth_types = {'v4': auth} + self.request.context = {'signing': {'region': 'context-override'}} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign( + 'operation_name', self.request, region_name='param-override' + ) + auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='signing_name', + region_name='param-override', + ) + + def test_sign_override_signing_name_from_context(self): + auth = mock.Mock() + auth_types = {'v4': auth} + self.request.context = {'signing': {'signing_name': 'override_name'}} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign('operation_name', self.request) + auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='override_name', + region_name='region_name', + ) + + def test_sign_with_expires_in(self): + auth = mock.Mock() + auth_types = {'v4': auth} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign('operation_name', self.request, expires_in=2) + auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='signing_name', + region_name='region_name', + expires=2, + ) + + def test_sign_with_custom_signing_name(self): + auth = mock.Mock() + auth_types = {'v4': auth} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.sign( + 'operation_name', self.request, signing_name='foo' + ) + auth.assert_called_with( + credentials=ReadOnlyCredentials('key', 'secret', None), + service_name='foo', + region_name='region_name', + ) + + def test_presign_with_custom_signing_name(self): + auth = mock.Mock() + auth.REQUIRES_REGION = True + + request_dict = { + 'headers': {}, + 'url': 'https://foo.com', + 'body': b'', + 'url_path': '/', + 'method': 'GET', + 'context': {}, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, {'v4-query': auth}): + presigned_url = self.signer.generate_presigned_url( + request_dict, + operation_name='operation_name', + signing_name='foo', + ) + auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='region_name', + expires=3600, + service_name='foo', + ) + self.assertEqual(presigned_url, 'https://foo.com') + + def test_unknown_signer_raises_unknown_on_standard(self): + auth = mock.Mock() + auth_types = {'v4': auth} + self.emitter.emit_until_response.return_value = (None, 'custom') + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + with self.assertRaises(UnknownSignatureVersionError): + self.signer.sign( + 'operation_name', self.request, signing_type='standard' + ) + + def test_unknown_signer_raises_unsupported_when_not_standard(self): + auth = mock.Mock() + auth_types = {'v4': auth} + self.emitter.emit_until_response.return_value = (None, 'custom') + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + with self.assertRaises(UnsupportedSignatureVersionError): + self.signer.sign( + 'operation_name', self.request, signing_type='presign-url' + ) + + with self.assertRaises(UnsupportedSignatureVersionError): + self.signer.sign( + 'operation_name', self.request, signing_type='presign-post' + ) + + +class TestCloudfrontSigner(BaseSignerTest): + def setUp(self): + super().setUp() + self.signer = CloudFrontSigner("MY_KEY_ID", lambda message: b'signed') + # It helps but the long string diff will still be slightly different on + # Python 2.6/2.7/3.x. We won't soly rely on that anyway, so it's fine. + self.maxDiff = None + + def test_build_canned_policy(self): + policy = self.signer.build_policy('foo', datetime.datetime(2016, 1, 1)) + expected = ( + '{"Statement":[{"Resource":"foo",' + '"Condition":{"DateLessThan":{"AWS:EpochTime":1451606400}}}]}' + ) + self.assertEqual(json.loads(policy), json.loads(expected)) + self.assertEqual(policy, expected) # This is to ensure the right order + + def test_build_custom_policy(self): + policy = self.signer.build_policy( + 'foo', + datetime.datetime(2016, 1, 1), + date_greater_than=datetime.datetime(2015, 12, 1), + ip_address='12.34.56.78/9', + ) + expected = { + "Statement": [ + { + "Resource": "foo", + "Condition": { + "DateGreaterThan": {"AWS:EpochTime": 1448928000}, + "DateLessThan": {"AWS:EpochTime": 1451606400}, + "IpAddress": {"AWS:SourceIp": "12.34.56.78/9"}, + }, + } + ] + } + self.assertEqual(json.loads(policy), expected) + + def test_generate_presign_url_with_expire_time(self): + signed_url = self.signer.generate_presigned_url( + 'http://test.com/foo.txt', + date_less_than=datetime.datetime(2016, 1, 1), + ) + expected = ( + 'http://test.com/foo.txt?Expires=1451606400&Signature=c2lnbmVk' + '&Key-Pair-Id=MY_KEY_ID' + ) + assert_url_equal(signed_url, expected) + + def test_generate_presign_url_with_custom_policy(self): + policy = self.signer.build_policy( + 'foo', + datetime.datetime(2016, 1, 1), + date_greater_than=datetime.datetime(2015, 12, 1), + ip_address='12.34.56.78/9', + ) + signed_url = self.signer.generate_presigned_url( + 'http://test.com/index.html?foo=bar', policy=policy + ) + expected = ( + 'http://test.com/index.html?foo=bar' + '&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiZm9vIiwiQ29uZ' + 'Gl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIj' + 'oxNDUxNjA2NDAwfSwiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJcCI' + '6IjEyLjM0LjU2Ljc4LzkifSwiRGF0ZUdyZWF0ZXJUaGFuIjp7IkFX' + 'UzpFcG9jaFRpbWUiOjE0NDg5MjgwMDB9fX1dfQ__' + '&Signature=c2lnbmVk&Key-Pair-Id=MY_KEY_ID' + ) + assert_url_equal(signed_url, expected) + + +class TestS3PostPresigner(BaseSignerTest): + def setUp(self): + super().setUp() + self.request_signer = RequestSigner( + ServiceId('service_name'), + 'region_name', + 'signing_name', + 's3v4', + self.credentials, + self.emitter, + ) + self.signer = S3PostPresigner(self.request_signer) + self.request_dict = { + 'headers': {}, + 'url': 'https://s3.amazonaws.com/mybucket', + 'body': b'', + 'url_path': '/', + 'method': 'POST', + 'context': {}, + } + self.auth = mock.Mock() + self.auth.REQUIRES_REGION = True + self.add_auth = mock.Mock() + self.auth.return_value.add_auth = self.add_auth + self.fixed_credentials = self.credentials.get_frozen_credentials() + + self.datetime_patch = mock.patch('botocore.signers.datetime') + self.datetime_mock = self.datetime_patch.start() + self.fixed_date = datetime.datetime(2014, 3, 10, 17, 2, 55, 0) + self.fixed_delta = datetime.timedelta(seconds=3600) + self.datetime_mock.datetime.utcnow.return_value = self.fixed_date + self.datetime_mock.timedelta.return_value = self.fixed_delta + + def tearDown(self): + super().tearDown() + self.datetime_patch.stop() + + def test_generate_presigned_post(self): + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'s3v4-presign-post': self.auth} + ): + post_form_args = self.signer.generate_presigned_post( + self.request_dict + ) + self.auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='region_name', + service_name='signing_name', + ) + self.assertEqual(self.add_auth.call_count, 1) + ref_request = self.add_auth.call_args[0][0] + ref_policy = ref_request.context['s3-presign-post-policy'] + self.assertEqual(ref_policy['expiration'], '2014-03-10T18:02:55Z') + self.assertEqual(ref_policy['conditions'], []) + + self.assertEqual( + post_form_args['url'], 'https://s3.amazonaws.com/mybucket' + ) + self.assertEqual(post_form_args['fields'], {}) + + def test_generate_presigned_post_emits_choose_signer(self): + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'s3v4-presign-post': self.auth} + ): + self.signer.generate_presigned_post(self.request_dict) + self.emitter.emit_until_response.assert_called_with( + 'choose-signer.service_name.PutObject', + signing_name='signing_name', + region_name='region_name', + signature_version='s3v4-presign-post', + context=mock.ANY, + ) + + def test_generate_presigned_post_choose_signer_override(self): + auth = mock.Mock() + self.emitter.emit_until_response.return_value = (None, 'custom') + auth_types = { + 's3v4-presign-post': self.auth, + 'custom-presign-post': auth, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.generate_presigned_post(self.request_dict) + auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='region_name', + service_name='signing_name', + ) + + def test_generate_presigne_post_choose_signer_override_known(self): + auth = mock.Mock() + self.emitter.emit_until_response.return_value = ( + None, + 's3v4-presign-post', + ) + auth_types = { + 's3v4-presign-post': self.auth, + 'custom-presign-post': auth, + } + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + self.signer.generate_presigned_post(self.request_dict) + self.auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='region_name', + service_name='signing_name', + ) + + def test_generate_presigned_post_bad_signer_raises_error(self): + auth = mock.Mock() + self.emitter.emit_until_response.return_value = (None, 's3-query') + auth_types = {'s3v4-presign-post': self.auth, 's3-query': auth} + with mock.patch.dict(botocore.auth.AUTH_TYPE_MAPS, auth_types): + with self.assertRaises(UnsupportedSignatureVersionError): + self.signer.generate_presigned_post(self.request_dict) + + def test_generate_unsigned_post(self): + self.emitter.emit_until_response.return_value = ( + None, + botocore.UNSIGNED, + ) + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'s3v4-presign-post': self.auth} + ): + post_form_args = self.signer.generate_presigned_post( + self.request_dict + ) + expected = {'fields': {}, 'url': 'https://s3.amazonaws.com/mybucket'} + self.assertEqual(post_form_args, expected) + + def test_generate_presigned_post_with_conditions(self): + conditions = [{'bucket': 'mybucket'}, ['starts-with', '$key', 'bar']] + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'s3v4-presign-post': self.auth} + ): + self.signer.generate_presigned_post( + self.request_dict, conditions=conditions + ) + self.auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='region_name', + service_name='signing_name', + ) + self.assertEqual(self.add_auth.call_count, 1) + ref_request = self.add_auth.call_args[0][0] + ref_policy = ref_request.context['s3-presign-post-policy'] + self.assertEqual(ref_policy['conditions'], conditions) + + def test_generate_presigned_post_with_region_override(self): + with mock.patch.dict( + botocore.auth.AUTH_TYPE_MAPS, {'s3v4-presign-post': self.auth} + ): + self.signer.generate_presigned_post( + self.request_dict, region_name='foo' + ) + self.auth.assert_called_with( + credentials=self.fixed_credentials, + region_name='foo', + service_name='signing_name', + ) + + def test_presigned_post_throws_unsupported_signature_error(self): + request_dict = { + 'headers': {}, + 'url': 'https://s3.amazonaws.com/mybucket/myobject', + 'body': b'', + 'url_path': '/', + 'method': 'POST', + 'context': {}, + } + self.request_signer = RequestSigner( + ServiceId('service_name'), + 'region_name', + 'signing_name', + 'foo', + self.credentials, + self.emitter, + ) + self.signer = S3PostPresigner(self.request_signer) + with self.assertRaises(UnsupportedSignatureVersionError): + self.signer.generate_presigned_post(request_dict) + + +class TestGenerateUrl(unittest.TestCase): + def setUp(self): + self.session = botocore.session.get_session() + self.client = self.session.create_client('s3', region_name='us-east-1') + self.bucket = 'mybucket' + self.key = 'mykey' + self.client_kwargs = {'Bucket': self.bucket, 'Key': self.key} + self.generate_url_patch = mock.patch( + 'botocore.signers.RequestSigner.generate_presigned_url' + ) + self.generate_url_mock = self.generate_url_patch.start() + + def tearDown(self): + self.generate_url_patch.stop() + + def test_generate_presigned_url(self): + self.client.generate_presigned_url( + 'get_object', Params={'Bucket': self.bucket, 'Key': self.key} + ) + + ref_request_dict = { + 'body': b'', + 'url': 'https://mybucket.s3.amazonaws.com/mykey', + 'headers': {}, + 'auth_path': '/mybucket/mykey', + 'query_string': {}, + 'url_path': '/mykey', + 'method': 'GET', + # mock.ANY is used because client parameter related events + # inject values into the context. So using the context's exact + # value for these tests will be a maintenance burden if + # anymore customizations are added that inject into the context. + 'context': mock.ANY, + } + self.generate_url_mock.assert_called_with( + request_dict=ref_request_dict, + expires_in=3600, + operation_name='GetObject', + ) + + def test_generate_presigned_url_with_query_string(self): + disposition = 'attachment; filename="download.jpg"' + self.client.generate_presigned_url( + 'get_object', + Params={ + 'Bucket': self.bucket, + 'Key': self.key, + 'ResponseContentDisposition': disposition, + }, + ) + ref_request_dict = { + 'body': b'', + 'url': ( + 'https://mybucket.s3.amazonaws.com/mykey' + '?response-content-disposition=' + 'attachment%3B%20filename%3D%22download.jpg%22' + ), + 'auth_path': '/mybucket/mykey', + 'headers': {}, + 'query_string': {'response-content-disposition': disposition}, + 'url_path': '/mykey', + 'method': 'GET', + 'context': mock.ANY, + } + self.generate_url_mock.assert_called_with( + request_dict=ref_request_dict, + expires_in=3600, + operation_name='GetObject', + ) + + def test_generate_presigned_url_unknown_method_name(self): + with self.assertRaises(UnknownClientMethodError): + self.client.generate_presigned_url('getobject') + + def test_generate_presigned_url_missing_required_params(self): + with self.assertRaises(ParamValidationError): + self.client.generate_presigned_url('get_object') + + def test_generate_presigned_url_expires(self): + self.client.generate_presigned_url( + 'get_object', + Params={'Bucket': self.bucket, 'Key': self.key}, + ExpiresIn=20, + ) + ref_request_dict = { + 'body': b'', + 'url': 'https://mybucket.s3.amazonaws.com/mykey', + 'auth_path': '/mybucket/mykey', + 'headers': {}, + 'query_string': {}, + 'url_path': '/mykey', + 'method': 'GET', + 'context': mock.ANY, + } + self.generate_url_mock.assert_called_with( + request_dict=ref_request_dict, + expires_in=20, + operation_name='GetObject', + ) + + def test_generate_presigned_url_override_http_method(self): + self.client.generate_presigned_url( + 'get_object', + Params={'Bucket': self.bucket, 'Key': self.key}, + HttpMethod='PUT', + ) + ref_request_dict = { + 'body': b'', + 'url': 'https://mybucket.s3.amazonaws.com/mykey', + 'auth_path': '/mybucket/mykey', + 'headers': {}, + 'query_string': {}, + 'url_path': '/mykey', + 'method': 'PUT', + 'context': mock.ANY, + } + self.generate_url_mock.assert_called_with( + request_dict=ref_request_dict, + expires_in=3600, + operation_name='GetObject', + ) + + def test_generate_presigned_url_emits_param_events(self): + emitter = mock.Mock(HierarchicalEmitter) + emitter.emit.return_value = [] + self.client.meta.events = emitter + self.client.generate_presigned_url( + 'get_object', Params={'Bucket': self.bucket, 'Key': self.key} + ) + events_emitted = [ + emit_call[0][0] for emit_call in emitter.emit.call_args_list + ] + self.assertEqual( + events_emitted, + [ + 'provide-client-params.s3.GetObject', + 'before-parameter-build.s3.GetObject', + ], + ) + + def test_generate_presign_url_emits_is_presign_in_context(self): + emitter = mock.Mock(HierarchicalEmitter) + emitter.emit.return_value = [] + self.client.meta.events = emitter + self.client.generate_presigned_url( + 'get_object', Params={'Bucket': self.bucket, 'Key': self.key} + ) + kwargs_emitted = [ + emit_call[1] for emit_call in emitter.emit.call_args_list + ] + for kwargs in kwargs_emitted: + self.assertTrue( + kwargs.get('context', {}).get('is_presign_request'), + 'The context did not have is_presign_request set to True for ' + f'the following kwargs emitted: {kwargs}', + ) + + def test_context_param_from_event_handler_sent_to_endpoint_resolver(self): + def change_bucket_param(params, **kwargs): + params['Bucket'] = 'mybucket-bar' + + self.client.meta.events.register_last( + 'provide-client-params.s3.*', change_bucket_param + ) + + self.client.generate_presigned_url( + 'get_object', Params={'Bucket': 'mybucket-foo', 'Key': self.key} + ) + + ref_request_dict = { + 'body': b'', + # If the bucket name set in the provide-client-params event handler + # was correctly passed to the endpoint provider as a dynamic context + # parameter, it will appear in the URL and the auth_path: + 'url': 'https://mybucket-bar.s3.amazonaws.com/mykey', + 'headers': {}, + 'auth_path': '/mybucket-bar/mykey', + 'query_string': {}, + 'url_path': '/mykey', + 'method': 'GET', + 'context': mock.ANY, + } + self.generate_url_mock.assert_called_with( + request_dict=ref_request_dict, + expires_in=3600, + operation_name='GetObject', + ) + + +class TestGeneratePresignedPost(unittest.TestCase): + def setUp(self): + self.session = botocore.session.get_session() + self.client = self.session.create_client('s3', region_name='us-east-1') + self.bucket = 'mybucket' + self.key = 'mykey' + self.presign_post_patch = mock.patch( + 'botocore.signers.S3PostPresigner.generate_presigned_post' + ) + self.presign_post_mock = self.presign_post_patch.start() + + def tearDown(self): + self.presign_post_patch.stop() + + def test_generate_presigned_post(self): + self.client.generate_presigned_post(self.bucket, self.key) + + _, post_kwargs = self.presign_post_mock.call_args + request_dict = post_kwargs['request_dict'] + fields = post_kwargs['fields'] + conditions = post_kwargs['conditions'] + self.assertEqual( + request_dict['url'], 'https://mybucket.s3.amazonaws.com/' + ) + self.assertEqual(post_kwargs['expires_in'], 3600) + self.assertEqual( + conditions, [{'bucket': 'mybucket'}, {'key': 'mykey'}] + ) + self.assertEqual(fields, {'key': 'mykey'}) + + def test_generate_presigned_post_with_filename(self): + self.key = 'myprefix/${filename}' + self.client.generate_presigned_post(self.bucket, self.key) + + _, post_kwargs = self.presign_post_mock.call_args + request_dict = post_kwargs['request_dict'] + fields = post_kwargs['fields'] + conditions = post_kwargs['conditions'] + self.assertEqual( + request_dict['url'], 'https://mybucket.s3.amazonaws.com/' + ) + self.assertEqual(post_kwargs['expires_in'], 3600) + self.assertEqual( + conditions, + [{'bucket': 'mybucket'}, ['starts-with', '$key', 'myprefix/']], + ) + self.assertEqual(fields, {'key': 'myprefix/${filename}'}) + + def test_generate_presigned_post_expires(self): + self.client.generate_presigned_post( + self.bucket, self.key, ExpiresIn=50 + ) + _, post_kwargs = self.presign_post_mock.call_args + request_dict = post_kwargs['request_dict'] + fields = post_kwargs['fields'] + conditions = post_kwargs['conditions'] + self.assertEqual( + request_dict['url'], 'https://mybucket.s3.amazonaws.com/' + ) + self.assertEqual(post_kwargs['expires_in'], 50) + self.assertEqual( + conditions, [{'bucket': 'mybucket'}, {'key': 'mykey'}] + ) + self.assertEqual(fields, {'key': 'mykey'}) + + def test_generate_presigned_post_with_prefilled(self): + conditions = [{'acl': 'public-read'}] + fields = {'acl': 'public-read'} + + self.client.generate_presigned_post( + self.bucket, self.key, Fields=fields, Conditions=conditions + ) + + self.assertEqual(fields, {'acl': 'public-read'}) + + _, post_kwargs = self.presign_post_mock.call_args + request_dict = post_kwargs['request_dict'] + fields = post_kwargs['fields'] + conditions = post_kwargs['conditions'] + self.assertEqual( + request_dict['url'], 'https://mybucket.s3.amazonaws.com/' + ) + self.assertEqual( + conditions, + [{'acl': 'public-read'}, {'bucket': 'mybucket'}, {'key': 'mykey'}], + ) + self.assertEqual(fields['acl'], 'public-read') + self.assertEqual(fields, {'key': 'mykey', 'acl': 'public-read'}) + + def test_generate_presigned_post_non_s3_client(self): + self.client = self.session.create_client('ec2', 'us-west-2') + with self.assertRaises(AttributeError): + self.client.generate_presigned_post() + + +class TestGenerateDBAuthToken(BaseSignerTest): + maxDiff = None + + def setUp(self): + self.session = botocore.session.get_session() + self.client = self.session.create_client( + 'rds', + region_name='us-east-1', + aws_access_key_id='akid', + aws_secret_access_key='skid', + config=Config(signature_version='v4'), + ) + + def test_generate_db_auth_token(self): + hostname = 'prod-instance.us-east-1.rds.amazonaws.com' + port = 3306 + username = 'someusername' + clock = datetime.datetime(2016, 11, 7, 17, 39, 33, tzinfo=tzutc()) + + with mock.patch('datetime.datetime') as dt: + dt.utcnow.return_value = clock + result = generate_db_auth_token( + self.client, hostname, port, username + ) + + expected_result = ( + 'prod-instance.us-east-1.rds.amazonaws.com:3306/?Action=connect' + '&DBUser=someusername&X-Amz-Algorithm=AWS4-HMAC-SHA256' + '&X-Amz-Date=20161107T173933Z&X-Amz-SignedHeaders=host' + '&X-Amz-Expires=900&X-Amz-Credential=akid%2F20161107%2F' + 'us-east-1%2Frds-db%2Faws4_request&X-Amz-Signature' + '=d1138cdbc0ca63eec012ec0fc6c2267e03642168f5884a7795320d4c18374c61' + ) + + # A scheme needs to be appended to the beginning or urlsplit may fail + # on certain systems. + assert_url_equal('https://' + result, 'https://' + expected_result) + + def test_custom_region(self): + hostname = 'host.us-east-1.rds.amazonaws.com' + port = 3306 + username = 'mySQLUser' + region = 'us-west-2' + result = generate_db_auth_token( + self.client, hostname, port, username, Region=region + ) + + self.assertIn(region, result) + # The hostname won't be changed even if a different region is specified + self.assertIn(hostname, result) + + +@pytest.mark.parametrize( + 'request_method', + ['GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'DELETE', None], +) +def test_generate_presigned_url_content_type_removal_for_polly( + polly_client, + request_method, +): + url = polly_client.generate_presigned_url( + 'synthesize_speech', + Params={ + 'OutputFormat': 'mp3', + 'Text': 'Hello world!', + 'VoiceId': 'Joanna', + }, + HttpMethod=request_method, + ) + assert 'content-type' not in url.lower() diff --git a/testbed/boto__botocore/tests/unit/test_stub.py b/testbed/boto__botocore/tests/unit/test_stub.py new file mode 100644 index 0000000000000000000000000000000000000000..1b2223b5feb94a49b93d4861e45f33147d92bfb9 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_stub.py @@ -0,0 +1,230 @@ +# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +from botocore import hooks +from botocore.exceptions import ParamValidationError, UnStubbedResponseError +from botocore.model import ServiceModel +from botocore.stub import Stubber +from tests import mock, unittest + + +class TestStubber(unittest.TestCase): + def setUp(self): + self.event_emitter = hooks.HierarchicalEmitter() + self.client = mock.Mock() + self.client.meta.events = self.event_emitter + self.client.meta.method_to_api_mapping.get.return_value = 'foo' + self.stubber = Stubber(self.client) + self.validate_parameters_mock = mock.Mock() + self.validate_parameters_patch = mock.patch( + 'botocore.stub.validate_parameters', self.validate_parameters_mock + ) + self.validate_parameters_patch.start() + + def tearDown(self): + self.validate_parameters_patch.stop() + + def emit_get_response_event( + self, model=None, request_dict=None, signer=None, context=None + ): + if model is None: + model = mock.Mock() + model.name = 'foo' + + handler, response = self.event_emitter.emit_until_response( + event_name='before-call.myservice.foo', + model=model, + params=request_dict, + request_signer=signer, + context=context, + ) + + return response + + def test_stubber_registers_events(self): + self.event_emitter = mock.Mock() + self.client.meta.events = self.event_emitter + self.stubber.activate() + # This just ensures that we register at the correct event + # and nothing more + self.event_emitter.register_first.assert_called_with( + 'before-parameter-build.*.*', mock.ANY, unique_id=mock.ANY + ) + self.event_emitter.register.assert_called_with( + 'before-call.*.*', mock.ANY, unique_id=mock.ANY + ) + + def test_stubber_unregisters_events(self): + self.event_emitter = mock.Mock() + self.client.meta.events = self.event_emitter + self.stubber.activate() + self.stubber.deactivate() + self.event_emitter.unregister.assert_any_call( + 'before-parameter-build.*.*', mock.ANY, unique_id=mock.ANY + ) + self.event_emitter.unregister.assert_any_call( + 'before-call.*.*', mock.ANY, unique_id=mock.ANY + ) + + def test_context_manager(self): + self.event_emitter = mock.Mock() + self.client.meta.events = self.event_emitter + + with self.stubber: + # Ensure events are registered in context + self.event_emitter.register_first.assert_called_with( + 'before-parameter-build.*.*', mock.ANY, unique_id=mock.ANY + ) + self.event_emitter.register.assert_called_with( + 'before-call.*.*', mock.ANY, unique_id=mock.ANY + ) + + # Ensure events are no longer registered once we leave the context + self.event_emitter.unregister.assert_any_call( + 'before-parameter-build.*.*', mock.ANY, unique_id=mock.ANY + ) + self.event_emitter.unregister.assert_any_call( + 'before-call.*.*', mock.ANY, unique_id=mock.ANY + ) + + def test_add_response(self): + response = {'foo': 'bar'} + self.stubber.add_response('foo', response) + + with self.assertRaises(AssertionError): + self.stubber.assert_no_pending_responses() + + def test_add_response_fails_when_missing_client_method(self): + del self.client.foo + with self.assertRaises(ValueError): + self.stubber.add_response('foo', {}) + + def test_validates_service_response(self): + self.stubber.add_response('foo', {}) + self.assertTrue(self.validate_parameters_mock.called) + + def test_validate_ignores_response_metadata(self): + service_response = {'ResponseMetadata': {'foo': 'bar'}} + service_model = ServiceModel( + { + 'documentation': '', + 'operations': { + 'foo': { + 'name': 'foo', + 'input': {'shape': 'StringShape'}, + 'output': {'shape': 'StringShape'}, + } + }, + 'shapes': {'StringShape': {'type': 'string'}}, + } + ) + op_name = service_model.operation_names[0] + output_shape = service_model.operation_model(op_name).output_shape + + self.client.meta.service_model = service_model + self.stubber.add_response('TestOperation', service_response) + self.validate_parameters_mock.assert_called_with({}, output_shape) + + # Make sure service response hasn't been mutated + self.assertEqual( + service_response, {'ResponseMetadata': {'foo': 'bar'}} + ) + + def test_validates_on_empty_output_shape(self): + service_model = ServiceModel( + {'documentation': '', 'operations': {'foo': {'name': 'foo'}}} + ) + self.client.meta.service_model = service_model + + with self.assertRaises(ParamValidationError): + self.stubber.add_response('TestOperation', {'foo': 'bar'}) + + def test_get_response(self): + service_response = {'bar': 'baz'} + self.stubber.add_response('foo', service_response) + self.stubber.activate() + response = self.emit_get_response_event() + self.assertEqual(response[1], service_response) + self.assertEqual(response[0].status_code, 200) + + def test_get_client_error_response(self): + error_code = "foo" + service_message = "bar" + self.stubber.add_client_error('foo', error_code, service_message) + self.stubber.activate() + response = self.emit_get_response_event() + self.assertEqual(response[1]['Error']['Message'], service_message) + self.assertEqual(response[1]['Error']['Code'], error_code) + + def test_get_client_error_with_extra_error_meta(self): + error_code = "foo" + error_message = "bar" + error_meta = { + "Endpoint": "https://foo.bar.baz", + } + self.stubber.add_client_error( + 'foo', + error_code, + error_message, + http_status_code=301, + service_error_meta=error_meta, + ) + with self.stubber: + response = self.emit_get_response_event() + error = response[1]['Error'] + self.assertIn('Endpoint', error) + self.assertEqual(error['Endpoint'], "https://foo.bar.baz") + + def test_get_client_error_with_extra_response_meta(self): + error_code = "foo" + error_message = "bar" + stub_response_meta = { + "RequestId": "79104EXAMPLEB723", + } + self.stubber.add_client_error( + 'foo', + error_code, + error_message, + http_status_code=301, + response_meta=stub_response_meta, + ) + with self.stubber: + response = self.emit_get_response_event() + actual_response_meta = response[1]['ResponseMetadata'] + self.assertIn('RequestId', actual_response_meta) + self.assertEqual(actual_response_meta['RequestId'], "79104EXAMPLEB723") + + def test_get_client_error_with_modeled_fields(self): + error_code = 'foo' + error_message = 'bar' + modeled_fields = {'Extra': 'foobar'} + self.stubber.add_client_error( + 'foo', + error_code, + error_message, + http_status_code=301, + modeled_fields=modeled_fields, + ) + with self.stubber: + response = self.emit_get_response_event() + self.assertIn('Extra', response[1]) + self.assertEqual(response[1]['Extra'], 'foobar') + + def test_get_response_errors_with_no_stubs(self): + self.stubber.activate() + with self.assertRaises(UnStubbedResponseError): + self.emit_get_response_event() + + def test_assert_no_responses_remaining(self): + self.stubber.add_response('foo', {}) + with self.assertRaises(AssertionError): + self.stubber.assert_no_pending_responses() diff --git a/testbed/boto__botocore/tests/unit/test_tokens.py b/testbed/boto__botocore/tests/unit/test_tokens.py new file mode 100644 index 0000000000000000000000000000000000000000..4633674faa950fb1d6b6f64cbd3023ce108e3593 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_tokens.py @@ -0,0 +1,351 @@ +# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import dateutil.parser +import pytest + +from botocore.exceptions import ( + InvalidConfigError, + SSOTokenLoadError, + TokenRetrievalError, +) +from botocore.session import Session +from botocore.tokens import SSOTokenProvider +from tests import mock + + +def parametrize(cases): + return pytest.mark.parametrize( + "test_case", + cases, + ids=[c["documentation"] for c in cases], + ) + + +sso_provider_resolution_cases = [ + { + "documentation": "Full valid profile", + "config": { + "profiles": {"test": {"sso_session": "admin"}}, + "sso_sessions": { + "admin": { + "sso_region": "us-east-1", + "sso_start_url": "https://d-abc123.awsapps.com/start", + } + }, + }, + "resolves": True, + }, + { + "documentation": "Non-SSO profiles are skipped", + "config": {"profiles": {"test": {"region": "us-west-2"}}}, + "resolves": False, + }, + { + "documentation": "Only start URL is invalid", + "config": { + "profiles": {"test": {"sso_session": "admin"}}, + "sso_sessions": { + "admin": { + "sso_start_url": "https://d-abc123.awsapps.com/start" + } + }, + }, + "resolves": False, + "expectedException": InvalidConfigError, + }, + { + "documentation": "Only sso_region is invalid", + "config": { + "profiles": {"test": {"sso_session": "admin"}}, + "sso_sessions": {"admin": {"sso_region": "us-east-1"}}, + }, + "resolves": False, + "expectedException": InvalidConfigError, + }, + { + "documentation": "Specified sso-session must exist", + "config": { + "profiles": {"test": {"sso_session": "dev"}}, + "sso_sessions": {"admin": {"sso_region": "us-east-1"}}, + }, + "resolves": False, + "expectedException": InvalidConfigError, + }, + { + "documentation": "The sso_session must be specified", + "config": { + "profiles": {"test": {"region": "us-west-2"}}, + "sso_sessions": { + "admin": { + "sso_region": "us-east-1", + "sso_start_url": "https://d-abc123.awsapps.com/start", + } + }, + }, + "resolves": False, + }, +] + + +def _create_mock_session(config): + mock_session = mock.Mock(spec=Session) + mock_session.get_config_variable.return_value = "test" + mock_session.full_config = config + return mock_session + + +def _run_token_provider_test_case(provider, test_case): + expected_exception = test_case.get("expectedException") + if expected_exception is not None: + with pytest.raises(expected_exception): + auth_token = provider.load_token() + return + + auth_token = provider.load_token() + if test_case["resolves"]: + assert auth_token is not None + else: + assert auth_token is None + + +@parametrize(sso_provider_resolution_cases) +def test_sso_token_provider_resolution(test_case): + mock_session = _create_mock_session(test_case["config"]) + resolver = SSOTokenProvider(mock_session) + + _run_token_provider_test_case(resolver, test_case) + + +@parametrize(sso_provider_resolution_cases) +def test_sso_token_provider_profile_name_overrides_session_profile(test_case): + mock_session = _create_mock_session(test_case["config"]) + mock_session.get_config_variable.return_value = "default" + resolver = SSOTokenProvider(mock_session, profile_name='test') + + _run_token_provider_test_case(resolver, test_case) + + +sso_provider_refresh_cases = [ + { + "documentation": "Valid token with all fields", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": { + "startUrl": "https://d-123.awsapps.com/start", + "region": "us-west-2", + "accessToken": "cachedtoken", + "expiresAt": "2021-12-25T21:30:00Z", + "clientId": "clientid", + "clientSecret": "YSBzZWNyZXQ=", + "registrationExpiresAt": "2022-12-25T13:30:00Z", + "refreshToken": "cachedrefreshtoken", + }, + "expectedToken": { + "token": "cachedtoken", + "expiration": "2021-12-25T21:30:00Z", + }, + }, + { + "documentation": "Minimal valid cached token", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": { + "accessToken": "cachedtoken", + "expiresAt": "2021-12-25T21:30:00Z", + }, + "expectedToken": { + "token": "cachedtoken", + "expiration": "2021-12-25T21:30:00Z", + }, + }, + { + "documentation": "Minimal expired cached token", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": { + "accessToken": "cachedtoken", + "expiresAt": "2021-12-25T13:00:00Z", + }, + "expectedException": TokenRetrievalError, + }, + { + "documentation": "Token missing the expiresAt field", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": {"accessToken": "cachedtoken"}, + "expectedException": SSOTokenLoadError, + }, + { + "documentation": "Token missing the accessToken field", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": {"expiresAt": "2021-12-25T13:00:00Z"}, + "expectedException": SSOTokenLoadError, + }, + { + "documentation": "Expired token refresh with refresh token", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": { + "startUrl": "https://d-123.awsapps.com/start", + "region": "us-west-2", + "accessToken": "cachedtoken", + "expiresAt": "2021-12-25T13:00:00Z", + "clientId": "clientid", + "clientSecret": "YSBzZWNyZXQ=", + "registrationExpiresAt": "2022-12-25T13:30:00Z", + "refreshToken": "cachedrefreshtoken", + }, + "refreshResponse": { + "tokenType": "Bearer", + "accessToken": "newtoken", + "expiresIn": 28800, + "refreshToken": "newrefreshtoken", + }, + "expectedTokenWriteback": { + "startUrl": "https://d-123.awsapps.com/start", + "region": "us-west-2", + "accessToken": "newtoken", + "expiresAt": "2021-12-25T21:30:00Z", + "clientId": "clientid", + "clientSecret": "YSBzZWNyZXQ=", + "registrationExpiresAt": "2022-12-25T13:30:00Z", + "refreshToken": "newrefreshtoken", + }, + "expectedToken": { + "token": "newtoken", + "expiration": "2021-12-25T21:30:00Z", + }, + }, + { + "documentation": "Expired token refresh without new refresh token", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": { + "startUrl": "https://d-123.awsapps.com/start", + "region": "us-west-2", + "accessToken": "cachedtoken", + "expiresAt": "2021-12-25T13:00:00Z", + "clientId": "clientid", + "clientSecret": "YSBzZWNyZXQ=", + "registrationExpiresAt": "2022-12-25T13:30:00Z", + "refreshToken": "cachedrefreshtoken", + }, + "refreshResponse": { + "tokenType": "Bearer", + "accessToken": "newtoken", + "expiresIn": 28800, + }, + "expectedTokenWriteback": { + "startUrl": "https://d-123.awsapps.com/start", + "region": "us-west-2", + "accessToken": "newtoken", + "expiresAt": "2021-12-25T21:30:00Z", + "clientId": "clientid", + "clientSecret": "YSBzZWNyZXQ=", + "registrationExpiresAt": "2022-12-25T13:30:00Z", + }, + "expectedToken": { + "token": "newtoken", + "expiration": "2021-12-25T21:30:00Z", + }, + }, + { + "documentation": "Expired token and expired client registration", + "currentTime": "2021-12-25T13:30:00Z", + "cachedToken": { + "startUrl": "https://d-123.awsapps.com/start", + "region": "us-west-2", + "accessToken": "cachedtoken", + "expiresAt": "2021-10-25T13:00:00Z", + "clientId": "clientid", + "clientSecret": "YSBzZWNyZXQ=", + "registrationExpiresAt": "2021-11-25T13:30:00Z", + "refreshToken": "cachedrefreshtoken", + }, + "expectedException": TokenRetrievalError, + }, +] + + +@parametrize(sso_provider_refresh_cases) +def test_sso_token_provider_refresh(test_case): + config = { + "profiles": {"test": {"sso_session": "admin"}}, + "sso_sessions": { + "admin": { + "sso_region": "us-west-2", + "sso_start_url": "https://d-123.awsapps.com/start", + } + }, + } + cache_key = "d033e22ae348aeb5660fc2140aec35850c4da997" + token_cache = {} + + # Prepopulate the token cache + cached_token = test_case.pop("cachedToken", None) + if cached_token: + token_cache[cache_key] = cached_token + + mock_session = _create_mock_session(config) + mock_sso_oidc = mock.Mock() + mock_session.create_client.return_value = mock_sso_oidc + + refresh_response = test_case.pop("refreshResponse", None) + mock_sso_oidc.create_token.return_value = refresh_response + + current_time = dateutil.parser.parse(test_case.pop("currentTime")) + + def _time_fetcher(): + return current_time + + resolver = SSOTokenProvider( + mock_session, + token_cache, + time_fetcher=_time_fetcher, + ) + + auth_token = resolver.load_token() + + actual_exception = None + try: + actual_token = auth_token.get_frozen_token() + except Exception as e: + actual_exception = e + + expected_exception = test_case.pop("expectedException", None) + if expected_exception is not None: + assert isinstance(actual_exception, expected_exception) + elif actual_exception is not None: + raise actual_exception + + expected_token = test_case.pop("expectedToken", {}) + raw_token = expected_token.get("token") + if raw_token is not None: + assert actual_token.token == raw_token + + raw_expiration = expected_token.get("expiration") + if raw_expiration is not None: + expected_expiration = dateutil.parser.parse(raw_expiration) + assert actual_token.expiration == expected_expiration + + expected_token_write_back = test_case.pop("expectedTokenWriteback", None) + if expected_token_write_back: + mock_sso_oidc.create_token.assert_called_with( + grantType="refresh_token", + clientId=cached_token["clientId"], + clientSecret=cached_token["clientSecret"], + refreshToken=cached_token["refreshToken"], + ) + raw_expiration = expected_token_write_back["expiresAt"] + # The in-memory cache doesn't serialize to JSON so expect a datetime + expected_expiration = dateutil.parser.parse(raw_expiration) + expected_token_write_back["expiresAt"] = expected_expiration + assert expected_token_write_back == token_cache[cache_key] + + # Pop the documentation to ensure all test fields are handled + test_case.pop("documentation") + assert not test_case.keys(), "All fields of test case should be handled" diff --git a/testbed/boto__botocore/tests/unit/test_translate.py b/testbed/boto__botocore/tests/unit/test_translate.py new file mode 100644 index 0000000000000000000000000000000000000000..c1d3bd868449be3ce1e6e29c0d540debf42450b8 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_translate.py @@ -0,0 +1,121 @@ +# Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +from botocore import translate +from tests import unittest + + +class TestBuildRetryConfig(unittest.TestCase): + def setUp(self): + self.retry = { + "definitions": {"def_name": {"from": {"definition": "file"}}}, + "retry": { + "__default__": { + "max_attempts": 5, + "delay": "global_delay", + "policies": { + "global_one": "global", + "override_me": "global", + }, + }, + "sts": { + "__default__": { + "delay": "service_specific_delay", + "policies": { + "service_one": "service", + "override_me": "service", + }, + }, + "AssumeRole": { + "policies": { + "name": "policy", + "other": {"$ref": "def_name"}, + } + }, + }, + }, + } + + def test_inject_retry_config(self): + retry = translate.build_retry_config( + 'sts', self.retry['retry'], self.retry['definitions'] + ) + self.assertIn('__default__', retry) + self.assertEqual( + retry['__default__'], + { + "max_attempts": 5, + "delay": "service_specific_delay", + "policies": { + "global_one": "global", + "override_me": "service", + "service_one": "service", + }, + }, + ) + # Policies should be merged. + operation_config = retry['AssumeRole'] + self.assertEqual(operation_config['policies']['name'], 'policy') + + def test_resolve_reference(self): + retry = translate.build_retry_config( + 'sts', self.retry['retry'], self.retry['definitions'] + ) + operation_config = retry['AssumeRole'] + # And we should resolve references. + self.assertEqual( + operation_config['policies']['other'], + {"from": {"definition": "file"}}, + ) + + def test_service_specific_defaults_no_mutate_default_retry(self): + retry = translate.build_retry_config( + 'sts', self.retry['retry'], self.retry['definitions'] + ) + # sts has a specific policy + self.assertEqual( + retry['__default__'], + { + "max_attempts": 5, + "delay": "service_specific_delay", + "policies": { + "global_one": "global", + "override_me": "service", + "service_one": "service", + }, + }, + ) + + # The general defaults for the upstream model should not have been + # mutated from building the retry config + self.assertEqual( + self.retry['retry']['__default__'], + { + "max_attempts": 5, + "delay": "global_delay", + "policies": { + "global_one": "global", + "override_me": "global", + }, + }, + ) + + def test_client_override_max_attempts(self): + retry = translate.build_retry_config( + 'sts', + self.retry['retry'], + self.retry['definitions'], + client_retry_config={'max_attempts': 9}, + ) + self.assertEqual(retry['__default__']['max_attempts'], 10) + # But it should not mutate the original retry model + self.assertEqual(self.retry['retry']['__default__']['max_attempts'], 5) diff --git a/testbed/boto__botocore/tests/unit/test_useragent.py b/testbed/boto__botocore/tests/unit/test_useragent.py new file mode 100644 index 0000000000000000000000000000000000000000..a649dd9350ec784048c0c41fffd9f490333ccbe6 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_useragent.py @@ -0,0 +1,195 @@ +# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import platform + +import pytest + +import botocore.useragent +from botocore import __version__ as botocore_version +from botocore.config import Config +from botocore.useragent import ( + UserAgentString, + sanitize_user_agent_string_component, +) +from tests import mock + +from .. import requires_crt + + +# Returns a list of unmodified User-Agent components. +def unmodified_components(components): + return components + + +@pytest.mark.parametrize( + 'raw_str, allow_hash, expected_str', + [ + ('foo', False, 'foo'), + ('foo', True, 'foo'), + ('ExampleFramework (1.2.3)', False, 'ExampleFramework--1.2.3-'), + ('foo#1.2.3', False, 'foo-1.2.3'), + ('foo#1.2.3', True, 'foo#1.2.3'), + ('', False, ''), + ('', True, ''), + ('', False, ''), + ('#', False, '-'), + ('#', True, '#'), + (' ', False, '-'), + (' ', False, '--'), + ('@=[]{ }/\\øß©', True, '------------'), + ( + 'Java_HotSpot_(TM)_64-Bit_Server_VM/25.151-b12', + True, + 'Java_HotSpot_-TM-_64-Bit_Server_VM-25.151-b12', + ), + ], +) +def test_sanitize_ua_string_component(raw_str, allow_hash, expected_str): + actual_str = sanitize_user_agent_string_component(raw_str, allow_hash) + assert actual_str == expected_str + + +@mock.patch.object( + botocore.useragent, 'modify_components', unmodified_components +) +def test_basic_user_agent_string(): + ua = UserAgentString( + platform_name='linux', + platform_version='1.2.3-foo', + platform_machine='x86_64', + python_version='3.8.20', + python_implementation='Dpython', + execution_env='AWS_Lambda_python3.8', + crt_version='Unknown', + ).with_client_config( + Config(retries={'mode': 'legacy'}, user_agent_appid='fooapp') + ) + + actual = ua.to_string() + expected = ( + f'Botocore/{botocore_version} ' + 'md/awscrt#Unknown ' + 'ua/2.0 ' + 'os/linux#1.2.3-foo ' + 'md/arch#x86_64 ' + 'lang/python#3.8.20 ' + 'md/pyimpl#Dpython ' + 'exec-env/AWS_Lambda_python3.8 ' + 'cfg/retry-mode#legacy ' + 'app/fooapp' + ) + assert actual == expected + + +def test_shared_test_case(): + # This test case is shared across AWS SDKs. + + uas = UserAgentString( + platform_name="Linux", + platform_version="5.4.228-131.415.AMZN2.X86_64", + platform_machine="", + python_version="4.3.2", + python_implementation=None, + execution_env='lambda', + ).with_client_config( + Config(user_agent_appid='123456', retries={'mode': 'standard'}) + ) + actual = uas.to_string().split(' ') + expected_in_exact_order = [ + f"Botocore/{botocore_version}", + "ua/2.0", + "os/linux#5.4.228-131.415.AMZN2.X86_64", + "lang/python#4.3.2", + "exec-env/lambda", + ] + expected_in_any_order = [ + "cfg/retry-mode#standard", + "app/123456", + ] + for el in [*expected_in_exact_order, *expected_in_any_order]: + assert el in actual + + indices = [actual.index(el) for el in expected_in_exact_order] + assert indices == list(sorted(indices)), 'Elements were found out of order' + + +@mock.patch.object( + botocore.useragent, 'modify_components', unmodified_components +) +def test_user_agent_string_with_missing_information(): + # Even when collecting information from the environment fails completely, + # some minimal string should be generated. + uas = UserAgentString( + platform_name=None, + platform_version=None, + platform_machine=None, + python_version=None, + python_implementation=None, + execution_env=None, + crt_version=None, + ).with_client_config(Config()) + actual = uas.to_string() + assert actual == f'Botocore/{botocore_version} ua/2.0 os/other lang/python' + + +def test_from_environment(monkeypatch): + monkeypatch.setenv('AWS_EXECUTION_ENV', 'lambda') + monkeypatch.setattr(platform, 'system', lambda: 'Linux') + monkeypatch.setattr( + platform, 'release', lambda: '5.4.228-131.415.AMZN2.X86_64' + ) + monkeypatch.setattr(platform, 'python_version', lambda: '4.3.2') + monkeypatch.setattr(platform, 'python_implementation', lambda: 'Cpython') + + uas = UserAgentString.from_environment() + + assert uas._execution_env == 'lambda' + assert uas._platform_name == 'Linux' + assert uas._platform_version == '5.4.228-131.415.AMZN2.X86_64' + assert uas._python_version == '4.3.2' + assert uas._python_implementation == 'Cpython' + + +@requires_crt() +def test_from_environment_can_read_crt_version(monkeypatch): + import awscrt + + monkeypatch.setattr(awscrt, '__version__', 'a.b.c') + uas = UserAgentString.from_environment() + assert uas._crt_version == 'a.b.c' + + +def test_from_environment_with_most_values_not_available(monkeypatch): + # Asserts that ``None`` values are properly passed through to the + # UserAgentString class. There are separate tests to assert that + # ``UserAgentString.to_string()`` can handle ``None`` values. + monkeypatch.delenv('AWS_EXECUTION_ENV', raising=False) + monkeypatch.setattr(platform, 'system', lambda: None) + monkeypatch.setattr(platform, 'release', lambda: None) + monkeypatch.setattr(platform, 'python_version', lambda: None) + monkeypatch.setattr(platform, 'python_implementation', lambda: None) + + uas = UserAgentString.from_environment() + + assert uas._execution_env is None + assert uas._platform_name is None + assert uas._platform_version is None + assert uas._python_version is None + assert uas._python_implementation is None + + +def test_from_environment_unknown_platform(monkeypatch): + monkeypatch.setattr(platform, 'system', lambda: 'FooOS') + monkeypatch.setattr(platform, 'release', lambda: '0.0.1') + uas = UserAgentString.from_environment() + assert ' os/other md/FooOS#0.0.1 ' in uas.to_string() diff --git a/testbed/boto__botocore/tests/unit/test_utils.py b/testbed/boto__botocore/tests/unit/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..240dd6b535d813bff289ef4b1bff7d9fdd5fd3b1 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_utils.py @@ -0,0 +1,3499 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import copy +import datetime +import io +import operator +from contextlib import contextmanager +from sys import getrefcount + +import pytest +from dateutil.tz import tzoffset, tzutc + +import botocore +from botocore import xform_name +from botocore.awsrequest import AWSRequest, HeadersDict +from botocore.compat import json +from botocore.config import Config +from botocore.endpoint_provider import RuleSetEndpoint +from botocore.exceptions import ( + ClientError, + ConfigNotFound, + ConnectionClosedError, + ConnectTimeoutError, + InvalidDNSNameError, + InvalidExpressionError, + InvalidIMDSEndpointError, + InvalidIMDSEndpointModeError, + MetadataRetrievalError, + ReadTimeoutError, + SSOTokenLoadError, + UnsupportedOutpostResourceError, + UnsupportedS3AccesspointConfigurationError, + UnsupportedS3ArnError, +) +from botocore.model import ( + DenormalizedStructureBuilder, + OperationModel, + ServiceModel, + ShapeResolver, +) +from botocore.regions import EndpointRulesetResolver +from botocore.session import Session +from botocore.utils import ( + ArgumentGenerator, + ArnParser, + CachedProperty, + ContainerMetadataFetcher, + IMDSRegionProvider, + InstanceMetadataFetcher, + InstanceMetadataRegionFetcher, + InvalidArnException, + S3ArnParamHandler, + S3EndpointSetter, + S3RegionRedirectorv2, + SSOTokenLoader, + calculate_sha256, + calculate_tree_hash, + datetime2timestamp, + deep_merge, + determine_content_length, + ensure_boolean, + fix_s3_host, + get_encoding_from_headers, + get_service_module_name, + has_header, + instance_cache, + is_json_value_header, + is_s3_accelerate_url, + is_valid_endpoint_url, + is_valid_ipv6_endpoint_url, + is_valid_uri, + lowercase_dict, + lru_cache_weakref, + merge_dicts, + normalize_url_path, + parse_key_val_file, + parse_key_val_file_contents, + parse_timestamp, + parse_to_aware_datetime, + percent_encode, + percent_encode_sequence, + remove_dot_segments, + resolve_imds_endpoint_mode, + set_value_from_jmespath, + switch_host_s3_accelerate, + switch_to_virtual_host_style, + validate_jmespath_for_set, +) +from tests import FreezeTime, RawResponse, create_session, mock, unittest + +DATE = datetime.datetime(2021, 12, 10, 00, 00, 00) +DT_FORMAT = "%Y-%m-%dT%H:%M:%SZ" + + +class TestEnsureBoolean(unittest.TestCase): + def test_boolean_true(self): + self.assertEqual(ensure_boolean(True), True) + + def test_boolean_false(self): + self.assertEqual(ensure_boolean(False), False) + + def test_string_true(self): + self.assertEqual(ensure_boolean('True'), True) + + def test_string_false(self): + self.assertEqual(ensure_boolean('False'), False) + + def test_string_lowercase_true(self): + self.assertEqual(ensure_boolean('true'), True) + + def test_invalid_type_false(self): + self.assertEqual(ensure_boolean({'foo': 'bar'}), False) + + +class TestResolveIMDSEndpointMode(unittest.TestCase): + def create_session_with_config(self, endpoint_mode, imds_use_IPv6): + session = create_session() + session.set_config_variable( + 'ec2_metadata_service_endpoint_mode', endpoint_mode + ) + session.set_config_variable('imds_use_ipv6', imds_use_IPv6) + return session + + def test_resolve_endpoint_mode_no_config(self): + session = self.create_session_with_config(None, None) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv4') + + def test_resolve_endpoint_mode_IPv6(self): + session = self.create_session_with_config('IPv6', None) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv6') + + def test_resolve_endpoint_mode_IPv4(self): + session = self.create_session_with_config('IPv4', None) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv4') + + def test_resolve_endpoint_mode_none_use_IPv6_true(self): + session = self.create_session_with_config(None, True) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv6') + + def test_resolve_endpoint_mode_none_use_IPv6_false(self): + session = self.create_session_with_config(None, False) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv4') + + def test_resolve_endpoint_mode_IPv6_use_IPv6_false(self): + session = self.create_session_with_config('IPv6', False) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv6') + + def test_resolve_endpoint_mode_IPv4_use_IPv6_true(self): + session = self.create_session_with_config('IPv4', True) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv4') + + def test_resolve_endpoint_mode_IPv6_use_IPv6_true(self): + session = self.create_session_with_config('IPv6', True) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv6') + + def test_resolve_endpoint_mode_IPv6_mixed_casing_use_IPv6_true(self): + session = self.create_session_with_config('iPv6', None) + self.assertEqual(resolve_imds_endpoint_mode(session), 'ipv6') + + def test_resolve_endpoint_mode_invalid_input(self): + session = self.create_session_with_config('IPv3', True) + with self.assertRaises(InvalidIMDSEndpointModeError): + resolve_imds_endpoint_mode(session) + + +class TestIsJSONValueHeader(unittest.TestCase): + def test_no_serialization_section(self): + shape = mock.Mock() + shape.type_name = 'string' + self.assertFalse(is_json_value_header(shape)) + + def test_non_jsonvalue_shape(self): + shape = mock.Mock() + shape.serialization = {'location': 'header'} + shape.type_name = 'string' + self.assertFalse(is_json_value_header(shape)) + + def test_non_header_jsonvalue_shape(self): + shape = mock.Mock() + shape.serialization = {'jsonvalue': True} + shape.type_name = 'string' + self.assertFalse(is_json_value_header(shape)) + + def test_non_string_jsonvalue_shape(self): + shape = mock.Mock() + shape.serialization = {'location': 'header', 'jsonvalue': True} + shape.type_name = 'integer' + self.assertFalse(is_json_value_header(shape)) + + def test_json_value_header(self): + shape = mock.Mock() + shape.serialization = {'jsonvalue': True, 'location': 'header'} + shape.type_name = 'string' + self.assertTrue(is_json_value_header(shape)) + + +class TestURINormalization(unittest.TestCase): + def test_remove_dot_segments(self): + self.assertEqual(remove_dot_segments('../foo'), 'foo') + self.assertEqual(remove_dot_segments('../../foo'), 'foo') + self.assertEqual(remove_dot_segments('./foo'), 'foo') + self.assertEqual(remove_dot_segments('/./'), '/') + self.assertEqual(remove_dot_segments('/../'), '/') + self.assertEqual( + remove_dot_segments('/foo/bar/baz/../qux'), '/foo/bar/qux' + ) + self.assertEqual(remove_dot_segments('/foo/..'), '/') + self.assertEqual(remove_dot_segments('foo/bar/baz'), 'foo/bar/baz') + self.assertEqual(remove_dot_segments('..'), '') + self.assertEqual(remove_dot_segments('.'), '') + self.assertEqual(remove_dot_segments('/.'), '/') + self.assertEqual(remove_dot_segments('/.foo'), '/.foo') + self.assertEqual(remove_dot_segments('/..foo'), '/..foo') + self.assertEqual(remove_dot_segments(''), '') + self.assertEqual(remove_dot_segments('/a/b/c/./../../g'), '/a/g') + self.assertEqual(remove_dot_segments('mid/content=5/../6'), 'mid/6') + # I don't think this is RFC compliant... + self.assertEqual(remove_dot_segments('//foo//'), '/foo/') + + def test_empty_url_normalization(self): + self.assertEqual(normalize_url_path(''), '/') + + +class TestTransformName(unittest.TestCase): + def test_upper_camel_case(self): + self.assertEqual(xform_name('UpperCamelCase'), 'upper_camel_case') + self.assertEqual(xform_name('UpperCamelCase', '-'), 'upper-camel-case') + + def test_lower_camel_case(self): + self.assertEqual(xform_name('lowerCamelCase'), 'lower_camel_case') + self.assertEqual(xform_name('lowerCamelCase', '-'), 'lower-camel-case') + + def test_consecutive_upper_case(self): + self.assertEqual(xform_name('HTTPHeaders'), 'http_headers') + self.assertEqual(xform_name('HTTPHeaders', '-'), 'http-headers') + + def test_consecutive_upper_case_middle_string(self): + self.assertEqual(xform_name('MainHTTPHeaders'), 'main_http_headers') + self.assertEqual( + xform_name('MainHTTPHeaders', '-'), 'main-http-headers' + ) + + def test_s3_prefix(self): + self.assertEqual(xform_name('S3BucketName'), 's3_bucket_name') + + def test_already_snake_cased(self): + self.assertEqual(xform_name('leave_alone'), 'leave_alone') + self.assertEqual(xform_name('s3_bucket_name'), 's3_bucket_name') + self.assertEqual(xform_name('bucket_s3_name'), 'bucket_s3_name') + + def test_special_cases(self): + # Some patterns don't actually match the rules we expect. + self.assertEqual( + xform_name('SwapEnvironmentCNAMEs'), 'swap_environment_cnames' + ) + self.assertEqual( + xform_name('SwapEnvironmentCNAMEs', '-'), 'swap-environment-cnames' + ) + self.assertEqual( + xform_name('CreateCachediSCSIVolume', '-'), + 'create-cached-iscsi-volume', + ) + self.assertEqual( + xform_name('DescribeCachediSCSIVolumes', '-'), + 'describe-cached-iscsi-volumes', + ) + self.assertEqual( + xform_name('DescribeStorediSCSIVolumes', '-'), + 'describe-stored-iscsi-volumes', + ) + self.assertEqual( + xform_name('CreateStorediSCSIVolume', '-'), + 'create-stored-iscsi-volume', + ) + self.assertEqual( + xform_name('sourceServerIDs', '-'), 'source-server-ids' + ) + + def test_special_case_ends_with_s(self): + self.assertEqual(xform_name('GatewayARNs', '-'), 'gateway-arns') + + def test_partial_rename(self): + transformed = xform_name('IPV6', '-') + self.assertEqual(transformed, 'ipv6') + transformed = xform_name('IPV6', '_') + self.assertEqual(transformed, 'ipv6') + + def test_s3_partial_rename(self): + transformed = xform_name('s3Resources', '-') + self.assertEqual(transformed, 's3-resources') + transformed = xform_name('s3Resources', '_') + self.assertEqual(transformed, 's3_resources') + + +class TestValidateJMESPathForSet(unittest.TestCase): + def setUp(self): + super().setUp() + self.data = { + 'Response': { + 'Thing': { + 'Id': 1, + 'Name': 'Thing #1', + } + }, + 'Marker': 'some-token', + } + + def test_invalid_exp(self): + with self.assertRaises(InvalidExpressionError): + validate_jmespath_for_set('Response.*.Name') + + with self.assertRaises(InvalidExpressionError): + validate_jmespath_for_set('Response.Things[0]') + + with self.assertRaises(InvalidExpressionError): + validate_jmespath_for_set('') + + with self.assertRaises(InvalidExpressionError): + validate_jmespath_for_set('.') + + +class TestSetValueFromJMESPath(unittest.TestCase): + def setUp(self): + super().setUp() + self.data = { + 'Response': { + 'Thing': { + 'Id': 1, + 'Name': 'Thing #1', + } + }, + 'Marker': 'some-token', + } + + def test_single_depth_existing(self): + set_value_from_jmespath(self.data, 'Marker', 'new-token') + self.assertEqual(self.data['Marker'], 'new-token') + + def test_single_depth_new(self): + self.assertFalse('Limit' in self.data) + set_value_from_jmespath(self.data, 'Limit', 100) + self.assertEqual(self.data['Limit'], 100) + + def test_multiple_depth_existing(self): + set_value_from_jmespath(self.data, 'Response.Thing.Name', 'New Name') + self.assertEqual(self.data['Response']['Thing']['Name'], 'New Name') + + def test_multiple_depth_new(self): + self.assertFalse('Brand' in self.data) + set_value_from_jmespath(self.data, 'Brand.New', {'abc': 123}) + self.assertEqual(self.data['Brand']['New']['abc'], 123) + + +class TestParseEC2CredentialsFile(unittest.TestCase): + def test_parse_ec2_content(self): + contents = "AWSAccessKeyId=a\nAWSSecretKey=b\n" + self.assertEqual( + parse_key_val_file_contents(contents), + {'AWSAccessKeyId': 'a', 'AWSSecretKey': 'b'}, + ) + + def test_parse_ec2_content_empty(self): + contents = "" + self.assertEqual(parse_key_val_file_contents(contents), {}) + + def test_key_val_pair_with_blank_lines(self): + # The \n\n has an extra blank between the access/secret keys. + contents = "AWSAccessKeyId=a\n\nAWSSecretKey=b\n" + self.assertEqual( + parse_key_val_file_contents(contents), + {'AWSAccessKeyId': 'a', 'AWSSecretKey': 'b'}, + ) + + def test_key_val_parser_lenient(self): + # Ignore any line that does not have a '=' char in it. + contents = "AWSAccessKeyId=a\nNOTKEYVALLINE\nAWSSecretKey=b\n" + self.assertEqual( + parse_key_val_file_contents(contents), + {'AWSAccessKeyId': 'a', 'AWSSecretKey': 'b'}, + ) + + def test_multiple_equals_on_line(self): + contents = "AWSAccessKeyId=a\nAWSSecretKey=secret_key_with_equals=b\n" + self.assertEqual( + parse_key_val_file_contents(contents), + { + 'AWSAccessKeyId': 'a', + 'AWSSecretKey': 'secret_key_with_equals=b', + }, + ) + + def test_os_error_raises_config_not_found(self): + mock_open = mock.Mock() + mock_open.side_effect = OSError() + with self.assertRaises(ConfigNotFound): + parse_key_val_file('badfile', _open=mock_open) + + +class TestParseTimestamps(unittest.TestCase): + def test_parse_iso8601(self): + self.assertEqual( + parse_timestamp('1970-01-01T00:10:00.000Z'), + datetime.datetime(1970, 1, 1, 0, 10, tzinfo=tzutc()), + ) + + def test_parse_epoch(self): + self.assertEqual( + parse_timestamp(1222172800), + datetime.datetime(2008, 9, 23, 12, 26, 40, tzinfo=tzutc()), + ) + + def test_parse_epoch_zero_time(self): + self.assertEqual( + parse_timestamp(0), + datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=tzutc()), + ) + + def test_parse_epoch_negative_time(self): + self.assertEqual( + parse_timestamp(-2208988800), + datetime.datetime(1900, 1, 1, 0, 0, 0, tzinfo=tzutc()), + ) + + def test_parse_epoch_beyond_2038(self): + self.assertEqual( + parse_timestamp(2524608000), + datetime.datetime(2050, 1, 1, 0, 0, 0, tzinfo=tzutc()), + ) + + def test_parse_epoch_as_string(self): + self.assertEqual( + parse_timestamp('1222172800'), + datetime.datetime(2008, 9, 23, 12, 26, 40, tzinfo=tzutc()), + ) + + def test_parse_rfc822(self): + self.assertEqual( + parse_timestamp('Wed, 02 Oct 2002 13:00:00 GMT'), + datetime.datetime(2002, 10, 2, 13, 0, tzinfo=tzutc()), + ) + + def test_parse_gmt_in_uk_time(self): + # In the UK the time switches from GMT to BST and back as part of + # their daylight savings time. time.tzname will therefore report + # both time zones. dateutil sees that the time zone is a local time + # zone and so parses it as local time, but it ends up being BST + # instead of GMT. To remedy this issue we can provide a time zone + # context which will enforce GMT == UTC. + with mock.patch('time.tzname', ('GMT', 'BST')): + self.assertEqual( + parse_timestamp('Wed, 02 Oct 2002 13:00:00 GMT'), + datetime.datetime(2002, 10, 2, 13, 0, tzinfo=tzutc()), + ) + + def test_parse_invalid_timestamp(self): + with self.assertRaises(ValueError): + parse_timestamp('invalid date') + + def test_parse_timestamp_fails_with_bad_tzinfo(self): + mock_tzinfo = mock.Mock() + mock_tzinfo.__name__ = 'tzinfo' + mock_tzinfo.side_effect = OSError() + mock_get_tzinfo_options = mock.MagicMock(return_value=(mock_tzinfo,)) + + with mock.patch( + 'botocore.utils.get_tzinfo_options', mock_get_tzinfo_options + ): + with self.assertRaises(RuntimeError): + parse_timestamp(0) + + @contextmanager + def mocked_fromtimestamp_that_raises(self, exception_type): + class MockDatetime(datetime.datetime): + @classmethod + def fromtimestamp(cls, *args, **kwargs): + raise exception_type() + + mock_fromtimestamp = mock.Mock() + mock_fromtimestamp.side_effect = OverflowError() + + with mock.patch('datetime.datetime', MockDatetime): + yield + + def test_parse_timestamp_succeeds_with_fromtimestamp_overflowerror(self): + # ``datetime.fromtimestamp()`` fails with OverflowError on some systems + # for timestamps beyond 2038. See + # https://docs.python.org/3/library/datetime.html#datetime.datetime.fromtimestamp + # This test mocks fromtimestamp() to always raise an OverflowError and + # checks that the fallback method returns the same time and timezone + # as fromtimestamp. + wout_fallback = parse_timestamp(0) + with self.mocked_fromtimestamp_that_raises(OverflowError): + with_fallback = parse_timestamp(0) + self.assertEqual(with_fallback, wout_fallback) + self.assertEqual(with_fallback.tzinfo, wout_fallback.tzinfo) + + def test_parse_timestamp_succeeds_with_fromtimestamp_oserror(self): + # Same as test_parse_timestamp_succeeds_with_fromtimestamp_overflowerror + # but for systems where datetime.fromtimestamp() fails with OSerror for + # negative timestamps that represent times before 1970. + wout_fallback = parse_timestamp(0) + with self.mocked_fromtimestamp_that_raises(OSError): + with_fallback = parse_timestamp(0) + self.assertEqual(with_fallback, wout_fallback) + self.assertEqual(with_fallback.tzinfo, wout_fallback.tzinfo) + + +class TestDatetime2Timestamp(unittest.TestCase): + def test_datetime2timestamp_naive(self): + self.assertEqual( + datetime2timestamp(datetime.datetime(1970, 1, 2)), 86400 + ) + + def test_datetime2timestamp_aware(self): + tzinfo = tzoffset("BRST", -10800) + self.assertEqual( + datetime2timestamp(datetime.datetime(1970, 1, 2, tzinfo=tzinfo)), + 97200, + ) + + +class TestParseToUTCDatetime(unittest.TestCase): + def test_handles_utc_time(self): + original = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=tzutc()) + self.assertEqual(parse_to_aware_datetime(original), original) + + def test_handles_other_timezone(self): + tzinfo = tzoffset("BRST", -10800) + original = datetime.datetime(2014, 1, 1, 0, 0, 0, tzinfo=tzinfo) + self.assertEqual(parse_to_aware_datetime(original), original) + + def test_handles_naive_datetime(self): + original = datetime.datetime(1970, 1, 1, 0, 0, 0) + expected = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=tzutc()) + self.assertEqual(parse_to_aware_datetime(original), expected) + + def test_handles_string_epoch(self): + expected = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=tzutc()) + self.assertEqual(parse_to_aware_datetime('0'), expected) + + def test_handles_int_epoch(self): + expected = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=tzutc()) + self.assertEqual(parse_to_aware_datetime(0), expected) + + def test_handles_full_iso_8601(self): + expected = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=tzutc()) + self.assertEqual( + parse_to_aware_datetime('1970-01-01T00:00:00Z'), expected + ) + + def test_year_only_iso_8601(self): + expected = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=tzutc()) + self.assertEqual(parse_to_aware_datetime('1970-01-01'), expected) + + +class TestCachedProperty(unittest.TestCase): + def test_cached_property_same_value(self): + class CacheMe: + @CachedProperty + def foo(self): + return 'foo' + + c = CacheMe() + self.assertEqual(c.foo, 'foo') + self.assertEqual(c.foo, 'foo') + + def test_cached_property_only_called_once(self): + # Note: you would normally never want to cache + # a property that returns a new value each time, + # but this is done to demonstrate the caching behavior. + + class NoIncrement: + def __init__(self): + self.counter = 0 + + @CachedProperty + def current_value(self): + self.counter += 1 + return self.counter + + c = NoIncrement() + self.assertEqual(c.current_value, 1) + # If the property wasn't cached, the next value should be + # be 2, but because it's cached, we know the value will be 1. + self.assertEqual(c.current_value, 1) + + +class TestArgumentGenerator(unittest.TestCase): + def setUp(self): + self.arg_generator = ArgumentGenerator() + + def assert_skeleton_from_model_is(self, model, generated_skeleton): + shape = ( + DenormalizedStructureBuilder().with_members(model).build_model() + ) + actual = self.arg_generator.generate_skeleton(shape) + self.assertEqual(actual, generated_skeleton) + + def test_generate_string(self): + self.assert_skeleton_from_model_is( + model={'A': {'type': 'string'}}, generated_skeleton={'A': ''} + ) + + def test_generate_string_enum(self): + enum_values = ['A', 'B', 'C'] + model = {'A': {'type': 'string', 'enum': enum_values}} + shape = ( + DenormalizedStructureBuilder().with_members(model).build_model() + ) + actual = self.arg_generator.generate_skeleton(shape) + + self.assertIn(actual['A'], enum_values) + + def test_generate_scalars(self): + self.assert_skeleton_from_model_is( + model={ + 'A': {'type': 'string'}, + 'B': {'type': 'integer'}, + 'C': {'type': 'float'}, + 'D': {'type': 'boolean'}, + 'E': {'type': 'timestamp'}, + 'F': {'type': 'double'}, + }, + generated_skeleton={ + 'A': '', + 'B': 0, + 'C': 0.0, + 'D': True, + 'E': datetime.datetime(1970, 1, 1, 0, 0, 0), + 'F': 0.0, + }, + ) + + def test_will_use_member_names_for_string_values(self): + self.arg_generator = ArgumentGenerator(use_member_names=True) + self.assert_skeleton_from_model_is( + model={ + 'A': {'type': 'string'}, + 'B': {'type': 'integer'}, + 'C': {'type': 'float'}, + 'D': {'type': 'boolean'}, + }, + generated_skeleton={ + 'A': 'A', + 'B': 0, + 'C': 0.0, + 'D': True, + }, + ) + + def test_will_use_member_names_for_string_values_of_list(self): + self.arg_generator = ArgumentGenerator(use_member_names=True) + # We're not using assert_skeleton_from_model_is + # because we can't really control the name of strings shapes + # being used in the DenormalizedStructureBuilder. We can only + # control the name of structures and list shapes. + shape_map = ShapeResolver( + { + 'InputShape': { + 'type': 'structure', + 'members': { + 'StringList': {'shape': 'StringList'}, + }, + }, + 'StringList': { + 'type': 'list', + 'member': {'shape': 'StringType'}, + }, + 'StringType': { + 'type': 'string', + }, + } + ) + shape = shape_map.get_shape_by_name('InputShape') + actual = self.arg_generator.generate_skeleton(shape) + + expected = {'StringList': ['StringType']} + self.assertEqual(actual, expected) + + def test_generate_nested_structure(self): + self.assert_skeleton_from_model_is( + model={ + 'A': { + 'type': 'structure', + 'members': { + 'B': {'type': 'string'}, + }, + } + }, + generated_skeleton={'A': {'B': ''}}, + ) + + def test_generate_scalar_list(self): + self.assert_skeleton_from_model_is( + model={ + 'A': {'type': 'list', 'member': {'type': 'string'}}, + }, + generated_skeleton={ + 'A': [''], + }, + ) + + def test_generate_scalar_map(self): + self.assert_skeleton_from_model_is( + model={ + 'A': { + 'type': 'map', + 'key': {'type': 'string'}, + 'value': {'type': 'string'}, + } + }, + generated_skeleton={ + 'A': { + 'KeyName': '', + } + }, + ) + + def test_handles_recursive_shapes(self): + # We're not using assert_skeleton_from_model_is + # because we can't use a DenormalizedStructureBuilder, + # we need a normalized model to represent recursive + # shapes. + shape_map = ShapeResolver( + { + 'InputShape': { + 'type': 'structure', + 'members': { + 'A': {'shape': 'RecursiveStruct'}, + 'B': {'shape': 'StringType'}, + }, + }, + 'RecursiveStruct': { + 'type': 'structure', + 'members': { + 'C': {'shape': 'RecursiveStruct'}, + 'D': {'shape': 'StringType'}, + }, + }, + 'StringType': { + 'type': 'string', + }, + } + ) + shape = shape_map.get_shape_by_name('InputShape') + actual = self.arg_generator.generate_skeleton(shape) + expected = { + 'A': { + 'C': { + # For recurisve shapes, we'll just show + # an empty dict. + }, + 'D': '', + }, + 'B': '', + } + self.assertEqual(actual, expected) + + +class TestChecksums(unittest.TestCase): + def test_empty_hash(self): + self.assertEqual( + calculate_sha256(io.BytesIO(b''), as_hex=True), + 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', + ) + + def test_as_hex(self): + self.assertEqual( + calculate_sha256(io.BytesIO(b'hello world'), as_hex=True), + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9', + ) + + def test_as_binary(self): + self.assertEqual( + calculate_sha256(io.BytesIO(b'hello world'), as_hex=False), + ( + b"\xb9M'\xb9\x93M>\x08\xa5.R\xd7\xda}\xab\xfa\xc4\x84\xef" + b"\xe3zS\x80\xee\x90\x88\xf7\xac\xe2\xef\xcd\xe9" + ), + ) + + +class TestTreeHash(unittest.TestCase): + # Note that for these tests I've independently verified + # what the expected tree hashes should be from other + # SDK implementations. + + def test_empty_tree_hash(self): + self.assertEqual( + calculate_tree_hash(io.BytesIO(b'')), + 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', + ) + + def test_tree_hash_less_than_one_mb(self): + one_k = io.BytesIO(b'a' * 1024) + self.assertEqual( + calculate_tree_hash(one_k), + '2edc986847e209b4016e141a6dc8716d3207350f416969382d431539bf292e4a', + ) + + def test_tree_hash_exactly_one_mb(self): + one_meg_bytestring = b'a' * (1 * 1024 * 1024) + one_meg = io.BytesIO(one_meg_bytestring) + self.assertEqual( + calculate_tree_hash(one_meg), + '9bc1b2a288b26af7257a36277ae3816a7d4f16e89c1e7e77d0a5c48bad62b360', + ) + + def test_tree_hash_multiple_of_one_mb(self): + four_mb = io.BytesIO(b'a' * (4 * 1024 * 1024)) + self.assertEqual( + calculate_tree_hash(four_mb), + '9491cb2ed1d4e7cd53215f4017c23ec4ad21d7050a1e6bb636c4f67e8cddb844', + ) + + def test_tree_hash_offset_of_one_mb_multiple(self): + offset_four_mb = io.BytesIO(b'a' * (4 * 1024 * 1024) + b'a' * 20) + self.assertEqual( + calculate_tree_hash(offset_four_mb), + '12f3cbd6101b981cde074039f6f728071da8879d6f632de8afc7cdf00661b08f', + ) + + +class TestIsValidEndpointURL(unittest.TestCase): + def test_dns_name_is_valid(self): + self.assertTrue(is_valid_endpoint_url('https://s3.amazonaws.com/')) + + def test_ip_address_is_allowed(self): + self.assertTrue(is_valid_endpoint_url('https://10.10.10.10/')) + + def test_path_component_ignored(self): + self.assertTrue( + is_valid_endpoint_url('https://foo.bar.com/other/path/') + ) + + def test_can_have_port(self): + self.assertTrue(is_valid_endpoint_url('https://foo.bar.com:12345/')) + + def test_ip_can_have_port(self): + self.assertTrue(is_valid_endpoint_url('https://10.10.10.10:12345/')) + + def test_cannot_have_spaces(self): + self.assertFalse(is_valid_endpoint_url('https://my invalid name/')) + + def test_missing_scheme(self): + self.assertFalse(is_valid_endpoint_url('foo.bar.com')) + + def test_no_new_lines(self): + self.assertFalse(is_valid_endpoint_url('https://foo.bar.com\nbar/')) + + def test_long_hostname(self): + long_hostname = 'htps://%s.com' % ('a' * 256) + self.assertFalse(is_valid_endpoint_url(long_hostname)) + + def test_hostname_can_end_with_dot(self): + self.assertTrue(is_valid_endpoint_url('https://foo.bar.com./')) + + def test_hostname_no_dots(self): + self.assertTrue(is_valid_endpoint_url('https://foo/')) + + +class TestFixS3Host(unittest.TestCase): + def test_fix_s3_host_initial(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://s3-us-west-2.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + fix_s3_host( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + self.assertEqual( + request.url, 'https://bucket.s3-us-west-2.amazonaws.com/key.txt' + ) + self.assertEqual(request.auth_path, '/bucket/key.txt') + + def test_fix_s3_host_only_applied_once(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://s3.us-west-2.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + fix_s3_host( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + # Calling the handler again should not affect the end result: + fix_s3_host( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + self.assertEqual( + request.url, 'https://bucket.s3.us-west-2.amazonaws.com/key.txt' + ) + # This was a bug previously. We want to make sure that + # calling fix_s3_host() again does not alter the auth_path. + # Otherwise we'll get signature errors. + self.assertEqual(request.auth_path, '/bucket/key.txt') + + def test_dns_style_not_used_for_get_bucket_location(self): + original_url = 'https://s3-us-west-2.amazonaws.com/bucket?location' + request = AWSRequest( + method='GET', + headers={}, + url=original_url, + ) + signature_version = 's3' + region_name = 'us-west-2' + fix_s3_host( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + # The request url should not have been modified because this is + # a request for GetBucketLocation. + self.assertEqual(request.url, original_url) + + def test_can_provide_default_endpoint_url(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://s3-us-west-2.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + fix_s3_host( + request=request, + signature_version=signature_version, + region_name=region_name, + default_endpoint_url='foo.s3.amazonaws.com', + ) + self.assertEqual( + request.url, 'https://bucket.foo.s3.amazonaws.com/key.txt' + ) + + def test_no_endpoint_url_uses_request_url(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://s3-us-west-2.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + fix_s3_host( + request=request, + signature_version=signature_version, + region_name=region_name, + # A value of None means use the url in the current request. + default_endpoint_url=None, + ) + self.assertEqual( + request.url, 'https://bucket.s3-us-west-2.amazonaws.com/key.txt' + ) + + +class TestSwitchToVirtualHostStyle(unittest.TestCase): + def test_switch_to_virtual_host_style(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://foo.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + self.assertEqual( + request.url, 'https://bucket.foo.amazonaws.com/key.txt' + ) + self.assertEqual(request.auth_path, '/bucket/key.txt') + + def test_uses_default_endpoint(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://foo.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + default_endpoint_url='s3.amazonaws.com', + ) + self.assertEqual( + request.url, 'https://bucket.s3.amazonaws.com/key.txt' + ) + self.assertEqual(request.auth_path, '/bucket/key.txt') + + def test_throws_invalid_dns_name_error(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://foo.amazonaws.com/mybucket.foo/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + with self.assertRaises(InvalidDNSNameError): + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + + def test_fix_s3_host_only_applied_once(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://foo.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3' + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + # Calling the handler again should not affect the end result: + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + self.assertEqual( + request.url, 'https://bucket.foo.amazonaws.com/key.txt' + ) + # This was a bug previously. We want to make sure that + # calling fix_s3_host() again does not alter the auth_path. + # Otherwise we'll get signature errors. + self.assertEqual(request.auth_path, '/bucket/key.txt') + + def test_virtual_host_style_for_make_bucket(self): + request = AWSRequest( + method='PUT', headers={}, url='https://foo.amazonaws.com/bucket' + ) + region_name = 'us-west-2' + signature_version = 's3' + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + self.assertEqual(request.url, 'https://bucket.foo.amazonaws.com/') + + def test_virtual_host_style_not_used_for_get_bucket_location(self): + original_url = 'https://foo.amazonaws.com/bucket?location' + request = AWSRequest( + method='GET', + headers={}, + url=original_url, + ) + signature_version = 's3' + region_name = 'us-west-2' + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + # The request url should not have been modified because this is + # a request for GetBucketLocation. + self.assertEqual(request.url, original_url) + + def test_virtual_host_style_not_used_for_list_buckets(self): + original_url = 'https://foo.amazonaws.com/' + request = AWSRequest( + method='GET', + headers={}, + url=original_url, + ) + signature_version = 's3' + region_name = 'us-west-2' + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + ) + # The request url should not have been modified because this is + # a request for GetBucketLocation. + self.assertEqual(request.url, original_url) + + def test_is_unaffected_by_sigv4(self): + request = AWSRequest( + method='PUT', + headers={}, + url='https://foo.amazonaws.com/bucket/key.txt', + ) + region_name = 'us-west-2' + signature_version = 's3v4' + switch_to_virtual_host_style( + request=request, + signature_version=signature_version, + region_name=region_name, + default_endpoint_url='s3.amazonaws.com', + ) + self.assertEqual( + request.url, 'https://bucket.s3.amazonaws.com/key.txt' + ) + + +def test_chunked_encoding_used_for_stream_like_object(): + class BufferedStream(io.BufferedIOBase): + """Class to ensure seek/tell don't work, but read is implemented.""" + + def __init__(self, value): + self.value = io.BytesIO(value) + + def read(self, size=-1): + return self.value.read(size) + + request = AWSRequest( + method='POST', + headers={}, + data=BufferedStream(b"some initial binary data"), + url='https://foo.amazonaws.com/bucket/key.txt', + ) + prepared_request = request.prepare() + assert prepared_request.headers == {'Transfer-Encoding': 'chunked'} + + +class TestInstanceCache(unittest.TestCase): + class DummyClass: + def __init__(self, cache): + self._instance_cache = cache + + @instance_cache + def add(self, x, y): + return x + y + + @instance_cache + def sub(self, x, y): + return x - y + + def setUp(self): + self.cache = {} + + def test_cache_single_method_call(self): + adder = self.DummyClass(self.cache) + self.assertEqual(adder.add(2, 1), 3) + # This should result in one entry in the cache. + self.assertEqual(len(self.cache), 1) + # When we call the method with the same args, + # we should reuse the same entry in the cache. + self.assertEqual(adder.add(2, 1), 3) + self.assertEqual(len(self.cache), 1) + + def test_can_cache_multiple_methods(self): + adder = self.DummyClass(self.cache) + adder.add(2, 1) + + # A different method results in a new cache entry, + # so now there should be two elements in the cache. + self.assertEqual(adder.sub(2, 1), 1) + self.assertEqual(len(self.cache), 2) + self.assertEqual(adder.sub(2, 1), 1) + + def test_can_cache_kwargs(self): + adder = self.DummyClass(self.cache) + adder.add(x=2, y=1) + self.assertEqual(adder.add(x=2, y=1), 3) + self.assertEqual(len(self.cache), 1) + + +class TestMergeDicts(unittest.TestCase): + def test_merge_dicts_overrides(self): + first = { + 'foo': {'bar': {'baz': {'one': 'ORIGINAL', 'two': 'ORIGINAL'}}} + } + second = {'foo': {'bar': {'baz': {'one': 'UPDATE'}}}} + + merge_dicts(first, second) + # The value from the second dict wins. + self.assertEqual(first['foo']['bar']['baz']['one'], 'UPDATE') + # And we still preserve the other attributes. + self.assertEqual(first['foo']['bar']['baz']['two'], 'ORIGINAL') + + def test_merge_dicts_new_keys(self): + first = { + 'foo': {'bar': {'baz': {'one': 'ORIGINAL', 'two': 'ORIGINAL'}}} + } + second = {'foo': {'bar': {'baz': {'three': 'UPDATE'}}}} + + merge_dicts(first, second) + self.assertEqual(first['foo']['bar']['baz']['one'], 'ORIGINAL') + self.assertEqual(first['foo']['bar']['baz']['two'], 'ORIGINAL') + self.assertEqual(first['foo']['bar']['baz']['three'], 'UPDATE') + + def test_merge_empty_dict_does_nothing(self): + first = {'foo': {'bar': 'baz'}} + merge_dicts(first, {}) + self.assertEqual(first, {'foo': {'bar': 'baz'}}) + + def test_more_than_one_sub_dict(self): + first = { + 'one': {'inner': 'ORIGINAL', 'inner2': 'ORIGINAL'}, + 'two': {'inner': 'ORIGINAL', 'inner2': 'ORIGINAL'}, + } + second = {'one': {'inner': 'UPDATE'}, 'two': {'inner': 'UPDATE'}} + + merge_dicts(first, second) + self.assertEqual(first['one']['inner'], 'UPDATE') + self.assertEqual(first['one']['inner2'], 'ORIGINAL') + + self.assertEqual(first['two']['inner'], 'UPDATE') + self.assertEqual(first['two']['inner2'], 'ORIGINAL') + + def test_new_keys(self): + first = {'one': {'inner': 'ORIGINAL'}, 'two': {'inner': 'ORIGINAL'}} + second = {'three': {'foo': {'bar': 'baz'}}} + # In this case, second has no keys in common, but we'd still expect + # this to get merged. + merge_dicts(first, second) + self.assertEqual(first['three']['foo']['bar'], 'baz') + + def test_list_values_no_append(self): + dict1 = {'Foo': ['old_foo_value']} + dict2 = {'Foo': ['new_foo_value']} + merge_dicts(dict1, dict2) + self.assertEqual(dict1, {'Foo': ['new_foo_value']}) + + def test_list_values_append(self): + dict1 = {'Foo': ['old_foo_value']} + dict2 = {'Foo': ['new_foo_value']} + merge_dicts(dict1, dict2, append_lists=True) + self.assertEqual(dict1, {'Foo': ['old_foo_value', 'new_foo_value']}) + + def test_list_values_mismatching_types(self): + dict1 = {'Foo': 'old_foo_value'} + dict2 = {'Foo': ['new_foo_value']} + merge_dicts(dict1, dict2, append_lists=True) + self.assertEqual(dict1, {'Foo': ['new_foo_value']}) + + def test_list_values_missing_key(self): + dict1 = {} + dict2 = {'Foo': ['foo_value']} + merge_dicts(dict1, dict2, append_lists=True) + self.assertEqual(dict1, {'Foo': ['foo_value']}) + + +class TestLowercaseDict(unittest.TestCase): + def test_lowercase_dict_empty(self): + original = {} + copy = lowercase_dict(original) + self.assertEqual(original, copy) + + def test_lowercase_dict_original_keys_lower(self): + original = { + 'lower_key1': 1, + 'lower_key2': 2, + } + copy = lowercase_dict(original) + self.assertEqual(original, copy) + + def test_lowercase_dict_original_keys_mixed(self): + original = { + 'SOME_KEY': 'value', + 'AnOTher_OnE': 'anothervalue', + } + copy = lowercase_dict(original) + expected = { + 'some_key': 'value', + 'another_one': 'anothervalue', + } + self.assertEqual(expected, copy) + + +class TestGetServiceModuleName(unittest.TestCase): + def setUp(self): + self.service_description = { + 'metadata': { + 'serviceFullName': 'AWS MyService', + 'apiVersion': '2014-01-01', + 'endpointPrefix': 'myservice', + 'signatureVersion': 'v4', + 'protocol': 'query', + }, + 'operations': {}, + 'shapes': {}, + } + self.service_model = ServiceModel( + self.service_description, 'myservice' + ) + + def test_default(self): + self.assertEqual( + get_service_module_name(self.service_model), 'MyService' + ) + + def test_client_name_with_amazon(self): + self.service_description['metadata']['serviceFullName'] = ( + 'Amazon MyService' + ) + self.assertEqual( + get_service_module_name(self.service_model), 'MyService' + ) + + def test_client_name_using_abreviation(self): + self.service_description['metadata']['serviceAbbreviation'] = ( + 'Abbreviation' + ) + self.assertEqual( + get_service_module_name(self.service_model), 'Abbreviation' + ) + + def test_client_name_with_non_alphabet_characters(self): + self.service_description['metadata']['serviceFullName'] = ( + 'Amazon My-Service' + ) + self.assertEqual( + get_service_module_name(self.service_model), 'MyService' + ) + + def test_client_name_with_no_full_name_or_abbreviation(self): + del self.service_description['metadata']['serviceFullName'] + self.assertEqual( + get_service_module_name(self.service_model), 'myservice' + ) + + +class TestPercentEncodeSequence(unittest.TestCase): + def test_percent_encode_empty(self): + self.assertEqual(percent_encode_sequence({}), '') + + def test_percent_encode_special_chars(self): + self.assertEqual( + percent_encode_sequence({'k1': 'with spaces++/'}), + 'k1=with%20spaces%2B%2B%2F', + ) + + def test_percent_encode_string_string_tuples(self): + self.assertEqual( + percent_encode_sequence([('k1', 'v1'), ('k2', 'v2')]), + 'k1=v1&k2=v2', + ) + + def test_percent_encode_dict_single_pair(self): + self.assertEqual(percent_encode_sequence({'k1': 'v1'}), 'k1=v1') + + def test_percent_encode_dict_string_string(self): + self.assertEqual( + percent_encode_sequence({'k1': 'v1', 'k2': 'v2'}), 'k1=v1&k2=v2' + ) + + def test_percent_encode_single_list_of_values(self): + self.assertEqual( + percent_encode_sequence({'k1': ['a', 'b', 'c']}), 'k1=a&k1=b&k1=c' + ) + + def test_percent_encode_list_values_of_string(self): + self.assertEqual( + percent_encode_sequence( + {'k1': ['a', 'list'], 'k2': ['another', 'list']} + ), + 'k1=a&k1=list&k2=another&k2=list', + ) + + +class TestPercentEncode(unittest.TestCase): + def test_percent_encode_obj(self): + self.assertEqual(percent_encode(1), '1') + + def test_percent_encode_text(self): + self.assertEqual(percent_encode(''), '') + self.assertEqual(percent_encode('a'), 'a') + self.assertEqual(percent_encode('\u0000'), '%00') + # Codepoint > 0x7f + self.assertEqual(percent_encode('\u2603'), '%E2%98%83') + # Codepoint > 0xffff + self.assertEqual(percent_encode('\U0001f32e'), '%F0%9F%8C%AE') + + def test_percent_encode_bytes(self): + self.assertEqual(percent_encode(b''), '') + self.assertEqual(percent_encode(b'a'), 'a') + self.assertEqual(percent_encode(b'\x00'), '%00') + # UTF-8 Snowman + self.assertEqual(percent_encode(b'\xe2\x98\x83'), '%E2%98%83') + # Arbitrary bytes (not valid UTF-8). + self.assertEqual(percent_encode(b'\x80\x00'), '%80%00') + + +class TestSwitchHostS3Accelerate(unittest.TestCase): + def setUp(self): + self.original_url = 'https://s3.amazonaws.com/foo/key.txt' + self.request = AWSRequest( + method='PUT', headers={}, url=self.original_url + ) + self.client_config = Config() + self.request.context['client_config'] = self.client_config + + def test_switch_host(self): + switch_host_s3_accelerate(self.request, 'PutObject') + self.assertEqual( + self.request.url, 'https://s3-accelerate.amazonaws.com/foo/key.txt' + ) + + def test_do_not_switch_black_listed_operations(self): + # It should not get switched for ListBuckets, DeleteBucket, and + # CreateBucket + blacklist_ops = ['ListBuckets', 'DeleteBucket', 'CreateBucket'] + for op_name in blacklist_ops: + switch_host_s3_accelerate(self.request, op_name) + self.assertEqual(self.request.url, self.original_url) + + def test_uses_original_endpoint_scheme(self): + self.request.url = 'http://s3.amazonaws.com/foo/key.txt' + switch_host_s3_accelerate(self.request, 'PutObject') + self.assertEqual( + self.request.url, 'http://s3-accelerate.amazonaws.com/foo/key.txt' + ) + + def test_uses_dualstack(self): + self.client_config.s3 = {'use_dualstack_endpoint': True} + self.original_url = 'https://s3.dualstack.amazonaws.com/foo/key.txt' + self.request = AWSRequest( + method='PUT', headers={}, url=self.original_url + ) + self.request.context['client_config'] = self.client_config + switch_host_s3_accelerate(self.request, 'PutObject') + self.assertEqual( + self.request.url, + 'https://s3-accelerate.dualstack.amazonaws.com/foo/key.txt', + ) + + +class TestDeepMerge(unittest.TestCase): + def test_simple_merge(self): + a = {'key': 'value'} + b = {'otherkey': 'othervalue'} + deep_merge(a, b) + + expected = {'key': 'value', 'otherkey': 'othervalue'} + self.assertEqual(a, expected) + + def test_merge_list(self): + # Lists are treated as opaque data and so no effort should be made to + # combine them. + a = {'key': ['original']} + b = {'key': ['new']} + deep_merge(a, b) + self.assertEqual(a, {'key': ['new']}) + + def test_merge_number(self): + # The value from b is always taken + a = {'key': 10} + b = {'key': 45} + deep_merge(a, b) + self.assertEqual(a, {'key': 45}) + + a = {'key': 45} + b = {'key': 10} + deep_merge(a, b) + self.assertEqual(a, {'key': 10}) + + def test_merge_boolean(self): + # The value from b is always taken + a = {'key': False} + b = {'key': True} + deep_merge(a, b) + self.assertEqual(a, {'key': True}) + + a = {'key': True} + b = {'key': False} + deep_merge(a, b) + self.assertEqual(a, {'key': False}) + + def test_merge_string(self): + a = {'key': 'value'} + b = {'key': 'othervalue'} + deep_merge(a, b) + self.assertEqual(a, {'key': 'othervalue'}) + + def test_merge_overrides_value(self): + # The value from b is always taken, even when it's a different type + a = {'key': 'original'} + b = {'key': {'newkey': 'newvalue'}} + deep_merge(a, b) + self.assertEqual(a, {'key': {'newkey': 'newvalue'}}) + + a = {'key': {'anotherkey': 'value'}} + b = {'key': 'newvalue'} + deep_merge(a, b) + self.assertEqual(a, {'key': 'newvalue'}) + + def test_deep_merge(self): + a = { + 'first': { + 'second': {'key': 'value', 'otherkey': 'othervalue'}, + 'key': 'value', + } + } + b = { + 'first': { + 'second': { + 'otherkey': 'newvalue', + 'yetanotherkey': 'yetanothervalue', + } + } + } + deep_merge(a, b) + + expected = { + 'first': { + 'second': { + 'key': 'value', + 'otherkey': 'newvalue', + 'yetanotherkey': 'yetanothervalue', + }, + 'key': 'value', + } + } + self.assertEqual(a, expected) + + +class TestS3RegionRedirector(unittest.TestCase): + def setUp(self): + self.client = mock.Mock() + self.client._ruleset_resolver = EndpointRulesetResolver( + endpoint_ruleset_data={ + 'version': '1.0', + 'parameters': {}, + 'rules': [], + }, + partition_data={}, + service_model=None, + builtins={}, + client_context=None, + event_emitter=None, + use_ssl=True, + requested_auth_scheme=None, + ) + self.client._ruleset_resolver.construct_endpoint = mock.Mock( + return_value=RuleSetEndpoint( + url='https://new-endpoint.amazonaws.com', + properties={}, + headers={}, + ) + ) + self.cache = {} + self.redirector = S3RegionRedirectorv2(None, self.client) + self.set_client_response_headers({}) + self.operation = mock.Mock() + self.operation.name = 'foo' + + def set_client_response_headers(self, headers): + error_response = ClientError( + { + 'Error': {'Code': '', 'Message': ''}, + 'ResponseMetadata': {'HTTPHeaders': headers}, + }, + 'HeadBucket', + ) + success_response = {'ResponseMetadata': {'HTTPHeaders': headers}} + self.client.head_bucket.side_effect = [ + error_response, + success_response, + ] + + def test_set_request_url(self): + old_url = 'https://us-west-2.amazonaws.com/foo' + new_endpoint = 'https://eu-central-1.amazonaws.com' + new_url = self.redirector.set_request_url(old_url, new_endpoint) + self.assertEqual(new_url, 'https://eu-central-1.amazonaws.com/foo') + + def test_set_request_url_keeps_old_scheme(self): + old_url = 'http://us-west-2.amazonaws.com/foo' + new_endpoint = 'https://eu-central-1.amazonaws.com' + new_url = self.redirector.set_request_url(old_url, new_endpoint) + self.assertEqual(new_url, 'http://eu-central-1.amazonaws.com/foo') + + def test_sets_signing_context_from_cache(self): + self.cache['foo'] = 'new-region-1' + self.redirector = S3RegionRedirectorv2( + None, self.client, cache=self.cache + ) + params = {'Bucket': 'foo'} + builtins = {'AWS::Region': 'old-region-1'} + self.redirector.redirect_from_cache(builtins, params) + self.assertEqual(builtins.get('AWS::Region'), 'new-region-1') + + def test_only_changes_context_if_bucket_in_cache(self): + self.cache['foo'] = 'new-region-1' + self.redirector = S3RegionRedirectorv2( + None, self.client, cache=self.cache + ) + params = {'Bucket': 'bar'} + builtins = {'AWS::Region': 'old-region-1'} + self.redirector.redirect_from_cache(builtins, params) + self.assertEqual(builtins.get('AWS::Region'), 'old-region-1') + + def test_redirect_from_error(self): + request_dict = { + 'context': { + 's3_redirect': { + 'bucket': 'foo', + 'redirected': False, + 'params': {'Bucket': 'foo'}, + }, + 'signing': { + 'region': 'us-west-2', + }, + }, + 'url': 'https://us-west-2.amazonaws.com/foo', + } + response = ( + None, + { + 'Error': { + 'Code': 'PermanentRedirect', + 'Endpoint': 'foo.eu-central-1.amazonaws.com', + 'Bucket': 'foo', + }, + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'eu-central-1'} + }, + }, + ) + + self.client._ruleset_resolver.construct_endpoint.return_value = ( + RuleSetEndpoint( + url='https://eu-central-1.amazonaws.com/foo', + properties={ + 'authSchemes': [ + { + 'name': 'sigv4', + 'signingRegion': 'eu-central-1', + 'disableDoubleEncoding': True, + } + ] + }, + headers={}, + ) + ) + + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + + # The response needs to be 0 so that there is no retry delay + self.assertEqual(redirect_response, 0) + + self.assertEqual( + request_dict['url'], 'https://eu-central-1.amazonaws.com/foo' + ) + + expected_signing_context = { + 'region': 'eu-central-1', + 'disableDoubleEncoding': True, + } + signing_context = request_dict['context'].get('signing') + self.assertEqual(signing_context, expected_signing_context) + self.assertTrue( + request_dict['context']['s3_redirect'].get('redirected') + ) + + def test_does_not_redirect_if_previously_redirected(self): + request_dict = { + 'context': { + 'signing': {'bucket': 'foo', 'region': 'us-west-2'}, + 's3_redirected': True, + }, + 'url': 'https://us-west-2.amazonaws.com/foo', + } + response = ( + None, + { + 'Error': { + 'Code': '400', + 'Message': 'Bad Request', + }, + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'us-west-2'} + }, + }, + ) + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertIsNone(redirect_response) + + def test_does_not_redirect_unless_permanentredirect_recieved(self): + request_dict = {} + response = (None, {}) + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertIsNone(redirect_response) + self.assertEqual(request_dict, {}) + + def test_does_not_redirect_if_region_cannot_be_found(self): + request_dict = { + 'url': 'https://us-west-2.amazonaws.com/foo', + 'context': { + 's3_redirect': { + 'bucket': 'foo', + 'redirected': False, + 'params': {'Bucket': 'foo'}, + }, + 'signing': {}, + }, + } + response = ( + None, + { + 'Error': { + 'Code': 'PermanentRedirect', + 'Endpoint': 'foo.eu-central-1.amazonaws.com', + 'Bucket': 'foo', + }, + 'ResponseMetadata': {'HTTPHeaders': {}}, + }, + ) + + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + + self.assertIsNone(redirect_response) + + def test_redirects_301(self): + request_dict = { + 'url': 'https://us-west-2.amazonaws.com/foo', + 'context': { + 's3_redirect': { + 'bucket': 'foo', + 'redirected': False, + 'params': {'Bucket': 'foo'}, + }, + 'signing': {}, + }, + } + response = ( + None, + { + 'Error': {'Code': '301', 'Message': 'Moved Permanently'}, + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'eu-central-1'} + }, + }, + ) + + self.operation.name = 'HeadObject' + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertEqual(redirect_response, 0) + + self.operation.name = 'ListObjects' + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertIsNone(redirect_response) + + def test_redirects_400_head_bucket(self): + request_dict = { + 'url': 'https://us-west-2.amazonaws.com/foo', + 'context': { + 's3_redirect': { + 'bucket': 'foo', + 'redirected': False, + 'params': {'Bucket': 'foo'}, + }, + 'signing': {}, + }, + } + response = ( + None, + { + 'Error': {'Code': '400', 'Message': 'Bad Request'}, + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'eu-central-1'} + }, + }, + ) + + self.operation.name = 'HeadObject' + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertEqual(redirect_response, 0) + + self.operation.name = 'ListObjects' + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertIsNone(redirect_response) + + def test_does_not_redirect_400_head_bucket_no_region_header(self): + # We should not redirect a 400 Head* if the region header is not + # present as this will lead to infinitely calling HeadBucket. + request_dict = { + 'url': 'https://us-west-2.amazonaws.com/foo', + 'context': {'signing': {'bucket': 'foo'}}, + } + response = ( + None, + { + 'Error': {'Code': '400', 'Message': 'Bad Request'}, + 'ResponseMetadata': {'HTTPHeaders': {}}, + }, + ) + + self.operation.name = 'HeadBucket' + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + head_bucket_calls = self.client.head_bucket.call_count + self.assertIsNone(redirect_response) + # We should not have made an additional head bucket call + self.assertEqual(head_bucket_calls, 0) + + def test_does_not_redirect_if_None_response(self): + request_dict = { + 'url': 'https://us-west-2.amazonaws.com/foo', + 'context': {'signing': {'bucket': 'foo'}}, + } + response = None + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertIsNone(redirect_response) + + def test_get_region_from_response(self): + response = ( + None, + { + 'Error': { + 'Code': 'PermanentRedirect', + 'Endpoint': 'foo.eu-central-1.amazonaws.com', + 'Bucket': 'foo', + }, + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'eu-central-1'} + }, + }, + ) + region = self.redirector.get_bucket_region('foo', response) + self.assertEqual(region, 'eu-central-1') + + def test_get_region_from_response_error_body(self): + response = ( + None, + { + 'Error': { + 'Code': 'PermanentRedirect', + 'Endpoint': 'foo.eu-central-1.amazonaws.com', + 'Bucket': 'foo', + 'Region': 'eu-central-1', + }, + 'ResponseMetadata': {'HTTPHeaders': {}}, + }, + ) + region = self.redirector.get_bucket_region('foo', response) + self.assertEqual(region, 'eu-central-1') + + def test_get_region_from_head_bucket_error(self): + self.set_client_response_headers( + {'x-amz-bucket-region': 'eu-central-1'} + ) + response = ( + None, + { + 'Error': { + 'Code': 'PermanentRedirect', + 'Endpoint': 'foo.eu-central-1.amazonaws.com', + 'Bucket': 'foo', + }, + 'ResponseMetadata': {'HTTPHeaders': {}}, + }, + ) + region = self.redirector.get_bucket_region('foo', response) + self.assertEqual(region, 'eu-central-1') + + def test_get_region_from_head_bucket_success(self): + success_response = { + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'eu-central-1'} + } + } + self.client.head_bucket.side_effect = None + self.client.head_bucket.return_value = success_response + response = ( + None, + { + 'Error': { + 'Code': 'PermanentRedirect', + 'Endpoint': 'foo.eu-central-1.amazonaws.com', + 'Bucket': 'foo', + }, + 'ResponseMetadata': {'HTTPHeaders': {}}, + }, + ) + region = self.redirector.get_bucket_region('foo', response) + self.assertEqual(region, 'eu-central-1') + + def test_no_redirect_from_error_for_accesspoint(self): + request_dict = { + 'url': ( + 'https://myendpoint-123456789012.s3-accesspoint.' + 'us-west-2.amazonaws.com/key' + ), + 'context': { + 's3_redirect': { + 'redirected': False, + 'bucket': 'arn:aws:s3:us-west-2:123456789012:myendpoint', + 'params': {}, + } + }, + } + response = ( + None, + { + 'Error': {'Code': '400', 'Message': 'Bad Request'}, + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'eu-central-1'} + }, + }, + ) + + self.operation.name = 'HeadObject' + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertEqual(redirect_response, None) + + def test_no_redirect_from_error_for_mrap_accesspoint(self): + mrap_arn = 'arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap' + request_dict = { + 'url': ( + 'https://mfzwi23gnjvgw.mrap.accesspoint.' + 's3-global.amazonaws.com' + ), + 'context': { + 's3_redirect': { + 'redirected': False, + 'bucket': mrap_arn, + 'params': {}, + } + }, + } + response = ( + None, + { + 'Error': {'Code': '400', 'Message': 'Bad Request'}, + 'ResponseMetadata': { + 'HTTPHeaders': {'x-amz-bucket-region': 'eu-central-1'} + }, + }, + ) + + self.operation.name = 'HeadObject' + redirect_response = self.redirector.redirect_from_error( + request_dict, response, self.operation + ) + self.assertEqual(redirect_response, None) + + +class TestArnParser(unittest.TestCase): + def setUp(self): + self.parser = ArnParser() + + def test_parse(self): + arn = 'arn:aws:s3:us-west-2:1023456789012:myresource' + self.assertEqual( + self.parser.parse_arn(arn), + { + 'partition': 'aws', + 'service': 's3', + 'region': 'us-west-2', + 'account': '1023456789012', + 'resource': 'myresource', + }, + ) + + def test_parse_invalid_arn(self): + with self.assertRaises(InvalidArnException): + self.parser.parse_arn('arn:aws:s3') + + def test_parse_arn_with_resource_type(self): + arn = 'arn:aws:s3:us-west-2:1023456789012:bucket_name:mybucket' + self.assertEqual( + self.parser.parse_arn(arn), + { + 'partition': 'aws', + 'service': 's3', + 'region': 'us-west-2', + 'account': '1023456789012', + 'resource': 'bucket_name:mybucket', + }, + ) + + def test_parse_arn_with_empty_elements(self): + arn = 'arn:aws:s3:::mybucket' + self.assertEqual( + self.parser.parse_arn(arn), + { + 'partition': 'aws', + 'service': 's3', + 'region': '', + 'account': '', + 'resource': 'mybucket', + }, + ) + + +class TestS3ArnParamHandler(unittest.TestCase): + def setUp(self): + self.arn_handler = S3ArnParamHandler() + self.model = mock.Mock(OperationModel) + self.model.name = 'GetObject' + + def test_register(self): + event_emitter = mock.Mock() + self.arn_handler.register(event_emitter) + event_emitter.register.assert_called_with( + 'before-parameter-build.s3', self.arn_handler.handle_arn + ) + + def test_accesspoint_arn(self): + params = { + 'Bucket': 'arn:aws:s3:us-west-2:123456789012:accesspoint/endpoint' + } + context = {} + self.arn_handler.handle_arn(params, self.model, context) + self.assertEqual(params, {'Bucket': 'endpoint'}) + self.assertEqual( + context, + { + 's3_accesspoint': { + 'name': 'endpoint', + 'account': '123456789012', + 'region': 'us-west-2', + 'partition': 'aws', + 'service': 's3', + } + }, + ) + + def test_accesspoint_arn_with_colon(self): + params = { + 'Bucket': 'arn:aws:s3:us-west-2:123456789012:accesspoint:endpoint' + } + context = {} + self.arn_handler.handle_arn(params, self.model, context) + self.assertEqual(params, {'Bucket': 'endpoint'}) + self.assertEqual( + context, + { + 's3_accesspoint': { + 'name': 'endpoint', + 'account': '123456789012', + 'region': 'us-west-2', + 'partition': 'aws', + 'service': 's3', + } + }, + ) + + def test_errors_for_non_accesspoint_arn(self): + params = { + 'Bucket': 'arn:aws:s3:us-west-2:123456789012:unsupported:resource' + } + context = {} + with self.assertRaises(UnsupportedS3ArnError): + self.arn_handler.handle_arn(params, self.model, context) + + def test_outpost_arn_with_colon(self): + params = { + 'Bucket': ( + 'arn:aws:s3-outposts:us-west-2:123456789012:outpost:' + 'op-01234567890123456:accesspoint:myaccesspoint' + ) + } + context = {} + self.arn_handler.handle_arn(params, self.model, context) + self.assertEqual(params, {'Bucket': 'myaccesspoint'}) + self.assertEqual( + context, + { + 's3_accesspoint': { + 'name': 'myaccesspoint', + 'outpost_name': 'op-01234567890123456', + 'account': '123456789012', + 'region': 'us-west-2', + 'partition': 'aws', + 'service': 's3-outposts', + } + }, + ) + + def test_outpost_arn_with_slash(self): + params = { + 'Bucket': ( + 'arn:aws:s3-outposts:us-west-2:123456789012:outpost/' + 'op-01234567890123456/accesspoint/myaccesspoint' + ) + } + context = {} + self.arn_handler.handle_arn(params, self.model, context) + self.assertEqual(params, {'Bucket': 'myaccesspoint'}) + self.assertEqual( + context, + { + 's3_accesspoint': { + 'name': 'myaccesspoint', + 'outpost_name': 'op-01234567890123456', + 'account': '123456789012', + 'region': 'us-west-2', + 'partition': 'aws', + 'service': 's3-outposts', + } + }, + ) + + def test_outpost_arn_errors_for_missing_fields(self): + params = { + 'Bucket': 'arn:aws:s3-outposts:us-west-2:123456789012:outpost/' + 'op-01234567890123456/accesspoint' + } + with self.assertRaises(UnsupportedOutpostResourceError): + self.arn_handler.handle_arn(params, self.model, {}) + + def test_outpost_arn_errors_for_empty_fields(self): + params = { + 'Bucket': 'arn:aws:s3-outposts:us-west-2:123456789012:outpost/' + '/accesspoint/myaccesspoint' + } + with self.assertRaises(UnsupportedOutpostResourceError): + self.arn_handler.handle_arn(params, self.model, {}) + + def test_ignores_bucket_names(self): + params = {'Bucket': 'mybucket'} + context = {} + self.arn_handler.handle_arn(params, self.model, context) + self.assertEqual(params, {'Bucket': 'mybucket'}) + self.assertEqual(context, {}) + + def test_ignores_create_bucket(self): + arn = 'arn:aws:s3:us-west-2:123456789012:accesspoint/endpoint' + params = {'Bucket': arn} + context = {} + self.model.name = 'CreateBucket' + self.arn_handler.handle_arn(params, self.model, context) + self.assertEqual(params, {'Bucket': arn}) + self.assertEqual(context, {}) + + +class TestS3EndpointSetter(unittest.TestCase): + def setUp(self): + self.operation_name = 'GetObject' + self.signature_version = 's3v4' + self.region_name = 'us-west-2' + self.service = 's3' + self.account = '123456789012' + self.bucket = 'mybucket' + self.key = 'key.txt' + self.accesspoint_name = 'myaccesspoint' + self.outpost_name = 'op-123456789012' + self.partition = 'aws' + self.endpoint_resolver = mock.Mock() + self.dns_suffix = 'amazonaws.com' + self.endpoint_resolver.construct_endpoint.return_value = { + 'dnsSuffix': self.dns_suffix + } + self.endpoint_setter = self.get_endpoint_setter() + + def get_endpoint_setter(self, **kwargs): + setter_kwargs = { + 'endpoint_resolver': self.endpoint_resolver, + 'region': self.region_name, + } + setter_kwargs.update(kwargs) + return S3EndpointSetter(**setter_kwargs) + + def get_s3_request( + self, bucket=None, key=None, scheme='https://', querystring=None + ): + url = scheme + 's3.us-west-2.amazonaws.com/' + if bucket: + url += bucket + if key: + url += f'/{key}' + if querystring: + url += f'?{querystring}' + return AWSRequest(method='GET', headers={}, url=url) + + def get_s3_outpost_request(self, **s3_request_kwargs): + request = self.get_s3_request( + self.accesspoint_name, **s3_request_kwargs + ) + accesspoint_context = self.get_s3_accesspoint_context( + name=self.accesspoint_name, outpost_name=self.outpost_name + ) + request.context['s3_accesspoint'] = accesspoint_context + return request + + def get_s3_accesspoint_request( + self, + accesspoint_name=None, + accesspoint_context=None, + **s3_request_kwargs, + ): + if not accesspoint_name: + accesspoint_name = self.accesspoint_name + request = self.get_s3_request(accesspoint_name, **s3_request_kwargs) + if accesspoint_context is None: + accesspoint_context = self.get_s3_accesspoint_context( + name=accesspoint_name + ) + request.context['s3_accesspoint'] = accesspoint_context + return request + + def get_s3_accesspoint_context(self, **overrides): + accesspoint_context = { + 'name': self.accesspoint_name, + 'account': self.account, + 'region': self.region_name, + 'partition': self.partition, + 'service': self.service, + } + accesspoint_context.update(overrides) + return accesspoint_context + + def call_set_endpoint(self, endpoint_setter, request, **kwargs): + set_endpoint_kwargs = { + 'request': request, + 'operation_name': self.operation_name, + 'signature_version': self.signature_version, + 'region_name': self.region_name, + } + set_endpoint_kwargs.update(kwargs) + endpoint_setter.set_endpoint(**set_endpoint_kwargs) + + def test_register(self): + event_emitter = mock.Mock() + self.endpoint_setter.register(event_emitter) + event_emitter.register.assert_has_calls( + [ + mock.call('before-sign.s3', self.endpoint_setter.set_endpoint), + mock.call('choose-signer.s3', self.endpoint_setter.set_signer), + mock.call( + 'before-call.s3.WriteGetObjectResponse', + self.endpoint_setter.update_endpoint_to_s3_object_lambda, + ), + ] + ) + + def test_outpost_endpoint(self): + request = self.get_s3_outpost_request() + self.call_set_endpoint(self.endpoint_setter, request=request) + outpost_prefix = ( + f'{self.accesspoint_name}-{self.account}.{self.outpost_name}' + ) + dns_suffix = f'{self.region_name}.amazonaws.com' + expected_url = f'https://{outpost_prefix}.s3-outposts.{dns_suffix}/' + self.assertEqual(request.url, expected_url) + + def test_outpost_endpoint_preserves_key_in_path(self): + request = self.get_s3_outpost_request(key=self.key) + self.call_set_endpoint(self.endpoint_setter, request=request) + outpost_prefix = ( + f'{self.accesspoint_name}-{self.account}.{self.outpost_name}' + ) + dns_suffix = f'{self.region_name}.amazonaws.com' + expected_url = ( + f'https://{outpost_prefix}.s3-outposts.{dns_suffix}/{self.key}' + ) + self.assertEqual(request.url, expected_url) + + def test_accesspoint_endpoint(self): + request = self.get_s3_accesspoint_request() + self.call_set_endpoint(self.endpoint_setter, request=request) + accesspoint_prefix = f'{self.accesspoint_name}-{self.account}' + dns_suffix = f'{self.region_name}.amazonaws.com' + expected_url = ( + f'https://{accesspoint_prefix}.s3-accesspoint.{dns_suffix}/' + ) + self.assertEqual(request.url, expected_url) + + def test_accesspoint_preserves_key_in_path(self): + request = self.get_s3_accesspoint_request(key=self.key) + self.call_set_endpoint(self.endpoint_setter, request=request) + accesspoint_prefix = f'{self.accesspoint_name}-{self.account}' + dns_suffix = f'{self.region_name}.amazonaws.com' + expected_url = f'https://{accesspoint_prefix}.s3-accesspoint.{dns_suffix}/{self.key}' + self.assertEqual(request.url, expected_url) + + def test_accesspoint_preserves_scheme(self): + request = self.get_s3_accesspoint_request(scheme='http://') + self.call_set_endpoint(self.endpoint_setter, request=request) + accesspoint_prefix = f'{self.accesspoint_name}-{self.account}' + dns_suffix = f'{self.region_name}.amazonaws.com' + expected_url = ( + f'http://{accesspoint_prefix}.s3-accesspoint.{dns_suffix}/' + ) + self.assertEqual(request.url, expected_url) + + def test_accesspoint_preserves_query_string(self): + request = self.get_s3_accesspoint_request(querystring='acl') + self.call_set_endpoint(self.endpoint_setter, request=request) + accesspoint_prefix = f'{self.accesspoint_name}-{self.account}' + dns_suffix = f'{self.region_name}.amazonaws.com' + expected_url = ( + f'https://{accesspoint_prefix}.s3-accesspoint.{dns_suffix}/?acl' + ) + self.assertEqual(request.url, expected_url) + + def test_uses_resolved_dns_suffix(self): + self.endpoint_resolver.construct_endpoint.return_value = { + 'dnsSuffix': 'mysuffix.com' + } + request = self.get_s3_accesspoint_request() + self.call_set_endpoint(self.endpoint_setter, request=request) + accesspoint_prefix = f'{self.accesspoint_name}-{self.account}' + dns_suffix = f'{self.region_name}.mysuffix.com' + expected_url = ( + f'https://{accesspoint_prefix}.s3-accesspoint.{dns_suffix}/' + ) + self.assertEqual(request.url, expected_url) + + def test_uses_region_of_client_if_use_arn_disabled(self): + client_region = 'client-region' + self.endpoint_setter = self.get_endpoint_setter( + region=client_region, s3_config={'use_arn_region': False} + ) + request = self.get_s3_accesspoint_request() + self.call_set_endpoint(self.endpoint_setter, request=request) + accesspoint_prefix = f'{self.accesspoint_name}-{self.account}' + dns_suffix = f'{client_region}.amazonaws.com' + expected_url = ( + f'https://{accesspoint_prefix}.s3-accesspoint.{dns_suffix}/' + ) + self.assertEqual(request.url, expected_url) + + def test_accesspoint_supports_custom_endpoint(self): + endpoint_setter = self.get_endpoint_setter( + endpoint_url='https://custom.com' + ) + request = self.get_s3_accesspoint_request() + self.call_set_endpoint(endpoint_setter, request=request) + expected_url = ( + f'https://{self.accesspoint_name}-{self.account}.custom.com/' + ) + self.assertEqual(request.url, expected_url) + + def test_errors_for_mismatching_partition(self): + endpoint_setter = self.get_endpoint_setter(partition='aws-cn') + accesspoint_context = self.get_s3_accesspoint_context(partition='aws') + request = self.get_s3_accesspoint_request( + accesspoint_context=accesspoint_context + ) + with self.assertRaises(UnsupportedS3AccesspointConfigurationError): + self.call_set_endpoint(endpoint_setter, request=request) + + def test_errors_for_mismatching_partition_when_using_client_region(self): + endpoint_setter = self.get_endpoint_setter( + s3_config={'use_arn_region': False}, partition='aws-cn' + ) + accesspoint_context = self.get_s3_accesspoint_context(partition='aws') + request = self.get_s3_accesspoint_request( + accesspoint_context=accesspoint_context + ) + with self.assertRaises(UnsupportedS3AccesspointConfigurationError): + self.call_set_endpoint(endpoint_setter, request=request) + + def test_set_endpoint_for_auto(self): + endpoint_setter = self.get_endpoint_setter( + s3_config={'addressing_style': 'auto'} + ) + request = self.get_s3_request(self.bucket, self.key) + self.call_set_endpoint(endpoint_setter, request) + expected_url = ( + f'https://{self.bucket}.s3.us-west-2.amazonaws.com/{self.key}' + ) + self.assertEqual(request.url, expected_url) + + def test_set_endpoint_for_virtual(self): + endpoint_setter = self.get_endpoint_setter( + s3_config={'addressing_style': 'virtual'} + ) + request = self.get_s3_request(self.bucket, self.key) + self.call_set_endpoint(endpoint_setter, request) + expected_url = ( + f'https://{self.bucket}.s3.us-west-2.amazonaws.com/{self.key}' + ) + self.assertEqual(request.url, expected_url) + + def test_set_endpoint_for_path(self): + endpoint_setter = self.get_endpoint_setter( + s3_config={'addressing_style': 'path'} + ) + request = self.get_s3_request(self.bucket, self.key) + self.call_set_endpoint(endpoint_setter, request) + expected_url = ( + f'https://s3.us-west-2.amazonaws.com/{self.bucket}/{self.key}' + ) + self.assertEqual(request.url, expected_url) + + def test_set_endpoint_for_accelerate(self): + endpoint_setter = self.get_endpoint_setter( + s3_config={'use_accelerate_endpoint': True} + ) + request = self.get_s3_request(self.bucket, self.key) + self.call_set_endpoint(endpoint_setter, request) + expected_url = ( + f'https://{self.bucket}.s3-accelerate.amazonaws.com/{self.key}' + ) + self.assertEqual(request.url, expected_url) + + +class TestContainerMetadataFetcher(unittest.TestCase): + def setUp(self): + self.responses = [] + self.http = mock.Mock() + self.sleep = mock.Mock() + + def create_fetcher(self): + return ContainerMetadataFetcher(self.http, sleep=self.sleep) + + def fake_response(self, status_code, body): + response = mock.Mock() + response.status_code = status_code + response.content = body + return response + + def set_http_responses_to(self, *responses): + http_responses = [] + for response in responses: + if isinstance(response, Exception): + # Simulating an error condition. + http_response = response + elif hasattr(response, 'status_code'): + # It's a precreated fake_response. + http_response = response + else: + http_response = self.fake_response( + status_code=200, body=json.dumps(response).encode('utf-8') + ) + http_responses.append(http_response) + self.http.send.side_effect = http_responses + + def assert_request(self, method, url, headers): + request = self.http.send.call_args[0][0] + self.assertEqual(request.method, method) + self.assertEqual(request.url, url) + self.assertEqual(request.headers, headers) + + def assert_can_retrieve_metadata_from(self, full_uri): + response_body = {'foo': 'bar'} + self.set_http_responses_to(response_body) + fetcher = self.create_fetcher() + response = fetcher.retrieve_full_uri(full_uri) + self.assertEqual(response, response_body) + self.assert_request('GET', full_uri, {'Accept': 'application/json'}) + + def assert_host_is_not_allowed(self, full_uri): + response_body = {'foo': 'bar'} + self.set_http_responses_to(response_body) + fetcher = self.create_fetcher() + with self.assertRaisesRegex(ValueError, 'Unsupported host'): + fetcher.retrieve_full_uri(full_uri) + self.assertFalse(self.http.send.called) + + def test_can_specify_extra_headers_are_merged(self): + headers = { + # The 'Accept' header will override the + # default Accept header of application/json. + 'Accept': 'application/not-json', + 'X-Other-Header': 'foo', + } + self.set_http_responses_to({'foo': 'bar'}) + fetcher = self.create_fetcher() + fetcher.retrieve_full_uri('http://localhost', headers) + self.assert_request('GET', 'http://localhost', headers) + + def test_can_retrieve_uri(self): + json_body = { + "AccessKeyId": "a", + "SecretAccessKey": "b", + "Token": "c", + "Expiration": "d", + } + self.set_http_responses_to(json_body) + + fetcher = self.create_fetcher() + response = fetcher.retrieve_uri('/foo?id=1') + + self.assertEqual(response, json_body) + # Ensure we made calls to the right endpoint. + headers = {'Accept': 'application/json'} + self.assert_request('GET', 'http://169.254.170.2/foo?id=1', headers) + + def test_can_retry_requests(self): + success_response = { + "AccessKeyId": "a", + "SecretAccessKey": "b", + "Token": "c", + "Expiration": "d", + } + self.set_http_responses_to( + # First response is a connection error, should + # be retried. + ConnectionClosedError(endpoint_url=''), + # Second response is the successful JSON response + # with credentials. + success_response, + ) + fetcher = self.create_fetcher() + response = fetcher.retrieve_uri('/foo?id=1') + self.assertEqual(response, success_response) + + def test_propagates_credential_error_on_http_errors(self): + self.set_http_responses_to( + # In this scenario, we never get a successful response. + ConnectionClosedError(endpoint_url=''), + ConnectionClosedError(endpoint_url=''), + ConnectionClosedError(endpoint_url=''), + ConnectionClosedError(endpoint_url=''), + ConnectionClosedError(endpoint_url=''), + ) + # As a result, we expect an appropriate error to be raised. + fetcher = self.create_fetcher() + with self.assertRaises(MetadataRetrievalError): + fetcher.retrieve_uri('/foo?id=1') + self.assertEqual(self.http.send.call_count, fetcher.RETRY_ATTEMPTS) + + def test_error_raised_on_non_200_response(self): + self.set_http_responses_to( + self.fake_response(status_code=404, body=b'Error not found'), + self.fake_response(status_code=404, body=b'Error not found'), + self.fake_response(status_code=404, body=b'Error not found'), + ) + fetcher = self.create_fetcher() + with self.assertRaises(MetadataRetrievalError): + fetcher.retrieve_uri('/foo?id=1') + # Should have tried up to RETRY_ATTEMPTS. + self.assertEqual(self.http.send.call_count, fetcher.RETRY_ATTEMPTS) + + def test_error_raised_on_no_json_response(self): + # If the service returns a sucess response but with a body that + # does not contain JSON, we should still retry up to RETRY_ATTEMPTS, + # but after exhausting retries we propagate the exception. + self.set_http_responses_to( + self.fake_response(status_code=200, body=b'Not JSON'), + self.fake_response(status_code=200, body=b'Not JSON'), + self.fake_response(status_code=200, body=b'Not JSON'), + ) + fetcher = self.create_fetcher() + with self.assertRaises(MetadataRetrievalError) as e: + fetcher.retrieve_uri('/foo?id=1') + self.assertNotIn('Not JSON', str(e.exception)) + # Should have tried up to RETRY_ATTEMPTS. + self.assertEqual(self.http.send.call_count, fetcher.RETRY_ATTEMPTS) + + def test_can_retrieve_full_uri_with_fixed_ip(self): + uri = f'http://{ContainerMetadataFetcher.IP_ADDRESS}/foo?id=1' + self.assert_can_retrieve_metadata_from(uri) + + def test_localhost_http_is_allowed(self): + self.assert_can_retrieve_metadata_from('http://localhost/foo') + + def test_localhost_with_port_http_is_allowed(self): + self.assert_can_retrieve_metadata_from('http://localhost:8000/foo') + + def test_localhost_https_is_allowed(self): + self.assert_can_retrieve_metadata_from('https://localhost/foo') + + def test_can_use_127_ip_addr(self): + self.assert_can_retrieve_metadata_from('https://127.0.0.1/foo') + + def test_can_use_127_ip_addr_with_port(self): + self.assert_can_retrieve_metadata_from('https://127.0.0.1:8080/foo') + + def test_can_use_eks_ipv4_addr(self): + uri = 'http://169.254.170.23/credentials' + self.assert_can_retrieve_metadata_from(uri) + + def test_can_use_eks_ipv6_addr(self): + uri = 'http://[fd00:ec2::23]/credentials' + self.assert_can_retrieve_metadata_from(uri) + + def test_can_use_eks_ipv6_addr_with_port(self): + uri = 'https://[fd00:ec2::23]:8000' + self.assert_can_retrieve_metadata_from(uri) + + def test_can_use_loopback_v6_uri(self): + self.assert_can_retrieve_metadata_from('http://[::1]/credentials') + + def test_link_local_http_is_not_allowed(self): + self.assert_host_is_not_allowed('http://169.254.0.1/foo') + + def test_link_local_https_is_not_allowed(self): + self.assert_host_is_not_allowed('https://169.254.0.1/foo') + + def test_non_link_local_nonallowed_url(self): + self.assert_host_is_not_allowed('http://169.1.2.3/foo') + + def test_error_raised_on_nonallowed_url(self): + self.assert_host_is_not_allowed('http://somewhere.com/foo') + + def test_external_host_not_allowed_if_https(self): + self.assert_host_is_not_allowed('https://somewhere.com/foo') + + +class TestUnsigned(unittest.TestCase): + def test_copy_returns_same_object(self): + self.assertIs(botocore.UNSIGNED, copy.copy(botocore.UNSIGNED)) + + def test_deepcopy_returns_same_object(self): + self.assertIs(botocore.UNSIGNED, copy.deepcopy(botocore.UNSIGNED)) + + +class TestInstanceMetadataFetcher(unittest.TestCase): + def setUp(self): + urllib3_session_send = 'botocore.httpsession.URLLib3Session.send' + self._urllib3_patch = mock.patch(urllib3_session_send) + self._send = self._urllib3_patch.start() + self._imds_responses = [] + self._send.side_effect = self.get_imds_response + self._role_name = 'role-name' + self._creds = { + 'AccessKeyId': 'spam', + 'SecretAccessKey': 'eggs', + 'Token': 'spam-token', + 'Expiration': 'something', + } + self._expected_creds = { + 'access_key': self._creds['AccessKeyId'], + 'secret_key': self._creds['SecretAccessKey'], + 'token': self._creds['Token'], + 'expiry_time': self._creds['Expiration'], + 'role_name': self._role_name, + } + + def tearDown(self): + self._urllib3_patch.stop() + + def add_imds_response(self, body, status_code=200): + response = botocore.awsrequest.AWSResponse( + url='http://169.254.169.254/', + status_code=status_code, + headers={}, + raw=RawResponse(body), + ) + self._imds_responses.append(response) + + def add_get_role_name_imds_response(self, role_name=None): + if role_name is None: + role_name = self._role_name + self.add_imds_response(body=role_name.encode('utf-8')) + + def add_get_credentials_imds_response(self, creds=None): + if creds is None: + creds = self._creds + self.add_imds_response(body=json.dumps(creds).encode('utf-8')) + + def add_get_token_imds_response(self, token, status_code=200): + self.add_imds_response( + body=token.encode('utf-8'), status_code=status_code + ) + + def add_metadata_token_not_supported_response(self): + self.add_imds_response(b'', status_code=404) + + def add_imds_connection_error(self, exception): + self._imds_responses.append(exception) + + def add_default_imds_responses(self): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + + def get_imds_response(self, request): + response = self._imds_responses.pop(0) + if isinstance(response, Exception): + raise response + return response + + def _test_imds_base_url(self, config, expected_url): + self.add_default_imds_responses() + + fetcher = InstanceMetadataFetcher(config=config) + result = fetcher.retrieve_iam_role_credentials() + + self.assertEqual(result, self._expected_creds) + self.assertEqual(fetcher.get_base_url(), expected_url) + + def test_disabled_by_environment(self): + env = {'AWS_EC2_METADATA_DISABLED': 'true'} + fetcher = InstanceMetadataFetcher(env=env) + result = fetcher.retrieve_iam_role_credentials() + self.assertEqual(result, {}) + self._send.assert_not_called() + + def test_disabled_by_environment_mixed_case(self): + env = {'AWS_EC2_METADATA_DISABLED': 'tRuE'} + fetcher = InstanceMetadataFetcher(env=env) + result = fetcher.retrieve_iam_role_credentials() + self.assertEqual(result, {}) + self._send.assert_not_called() + + def test_disabling_env_var_not_true(self): + url = 'https://example.com/' + env = {'AWS_EC2_METADATA_DISABLED': 'false'} + + self.add_default_imds_responses() + + fetcher = InstanceMetadataFetcher(base_url=url, env=env) + result = fetcher.retrieve_iam_role_credentials() + + self.assertEqual(result, self._expected_creds) + + def test_ec2_metadata_endpoint_service_mode(self): + configs = [ + ( + {'ec2_metadata_service_endpoint_mode': 'ipv6'}, + 'http://[fd00:ec2::254]/', + ), + ( + {'ec2_metadata_service_endpoint_mode': 'ipv6'}, + 'http://[fd00:ec2::254]/', + ), + ( + {'ec2_metadata_service_endpoint_mode': 'ipv4'}, + 'http://169.254.169.254/', + ), + ( + {'ec2_metadata_service_endpoint_mode': 'foo'}, + 'http://169.254.169.254/', + ), + ( + { + 'ec2_metadata_service_endpoint_mode': 'ipv6', + 'ec2_metadata_service_endpoint': 'http://[fd00:ec2::010]/', + }, + 'http://[fd00:ec2::010]/', + ), + ] + + for config, expected_url in configs: + self._test_imds_base_url(config, expected_url) + + def test_metadata_endpoint(self): + urls = [ + 'http://fd00:ec2:0000:0000:0000:0000:0000:0000/', + 'http://[fd00:ec2::010]/', + 'http://192.168.1.1/', + ] + for url in urls: + self.assertTrue(is_valid_uri(url)) + + def test_ipv6_endpoint_no_brackets_env_var_set(self): + url = 'http://fd00:ec2::010/' + self.assertFalse(is_valid_ipv6_endpoint_url(url)) + + def test_ipv6_invalid_endpoint(self): + url = 'not.a:valid:dom@in' + config = {'ec2_metadata_service_endpoint': url} + with self.assertRaises(InvalidIMDSEndpointError): + InstanceMetadataFetcher(config=config) + + def test_ipv6_endpoint_env_var_set_and_args(self): + url = 'http://[fd00:ec2::254]/' + url_arg = 'http://fd00:ec2:0000:0000:0000:8a2e:0370:7334/' + config = {'ec2_metadata_service_endpoint': url} + + self.add_default_imds_responses() + + fetcher = InstanceMetadataFetcher(config=config, base_url=url_arg) + result = fetcher.retrieve_iam_role_credentials() + + self.assertEqual(result, self._expected_creds) + self.assertEqual(fetcher.get_base_url(), url_arg) + + def test_ipv6_imds_not_allocated(self): + url = 'http://fd00:ec2:0000:0000:0000:0000:0000:0000/' + config = {'ec2_metadata_service_endpoint': url} + + self.add_imds_response(status_code=400, body=b'{}') + + fetcher = InstanceMetadataFetcher(config=config) + result = fetcher.retrieve_iam_role_credentials() + self.assertEqual(result, {}) + + def test_ipv6_imds_empty_config(self): + configs = [ + ({'ec2_metadata_service_endpoint': ''}, 'http://169.254.169.254/'), + ( + {'ec2_metadata_service_endpoint_mode': ''}, + 'http://169.254.169.254/', + ), + ({}, 'http://169.254.169.254/'), + (None, 'http://169.254.169.254/'), + ] + + for config, expected_url in configs: + self._test_imds_base_url(config, expected_url) + + def test_includes_user_agent_header(self): + user_agent = 'my-user-agent' + self.add_default_imds_responses() + + InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + + self.assertEqual(self._send.call_count, 3) + for call in self._send.calls: + self.assertTrue(call[0][0].headers['User-Agent'], user_agent) + + def test_non_200_response_for_role_name_is_retried(self): + # Response for role name that have a non 200 status code should + # be retried. + self.add_get_token_imds_response(token='token') + self.add_imds_response( + status_code=429, body=b'{"message": "Slow down"}' + ) + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + result = InstanceMetadataFetcher( + num_attempts=2 + ).retrieve_iam_role_credentials() + self.assertEqual(result, self._expected_creds) + + def test_http_connection_error_for_role_name_is_retried(self): + # Connection related errors should be retried + self.add_get_token_imds_response(token='token') + self.add_imds_connection_error(ConnectionClosedError(endpoint_url='')) + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + result = InstanceMetadataFetcher( + num_attempts=2 + ).retrieve_iam_role_credentials() + self.assertEqual(result, self._expected_creds) + + def test_empty_response_for_role_name_is_retried(self): + # Response for role name that have a non 200 status code should + # be retried. + self.add_get_token_imds_response(token='token') + self.add_imds_response(body=b'') + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + result = InstanceMetadataFetcher( + num_attempts=2 + ).retrieve_iam_role_credentials() + self.assertEqual(result, self._expected_creds) + + def test_non_200_response_is_retried(self): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + # Response for creds that has a 200 status code but has an empty + # body should be retried. + self.add_imds_response( + status_code=429, body=b'{"message": "Slow down"}' + ) + self.add_get_credentials_imds_response() + result = InstanceMetadataFetcher( + num_attempts=2 + ).retrieve_iam_role_credentials() + self.assertEqual(result, self._expected_creds) + + def test_http_connection_errors_is_retried(self): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + # Connection related errors should be retried + self.add_imds_connection_error(ConnectionClosedError(endpoint_url='')) + self.add_get_credentials_imds_response() + result = InstanceMetadataFetcher( + num_attempts=2 + ).retrieve_iam_role_credentials() + self.assertEqual(result, self._expected_creds) + + def test_empty_response_is_retried(self): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + # Response for creds that has a 200 status code but is empty. + # This should be retried. + self.add_imds_response(body=b'') + self.add_get_credentials_imds_response() + result = InstanceMetadataFetcher( + num_attempts=2 + ).retrieve_iam_role_credentials() + self.assertEqual(result, self._expected_creds) + + def test_invalid_json_is_retried(self): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + # Response for creds that has a 200 status code but is invalid JSON. + # This should be retried. + self.add_imds_response(body=b'{"AccessKey":') + self.add_get_credentials_imds_response() + result = InstanceMetadataFetcher( + num_attempts=2 + ).retrieve_iam_role_credentials() + self.assertEqual(result, self._expected_creds) + + def test_exhaust_retries_on_role_name_request(self): + self.add_get_token_imds_response(token='token') + self.add_imds_response(status_code=400, body=b'') + result = InstanceMetadataFetcher( + num_attempts=1 + ).retrieve_iam_role_credentials() + self.assertEqual(result, {}) + + def test_exhaust_retries_on_credentials_request(self): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + self.add_imds_response(status_code=400, body=b'') + result = InstanceMetadataFetcher( + num_attempts=1 + ).retrieve_iam_role_credentials() + self.assertEqual(result, {}) + + def test_missing_fields_in_credentials_response(self): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + # Response for creds that has a 200 status code and a JSON body + # representing an error. We do not necessarily want to retry this. + self.add_imds_response( + body=b'{"Code":"AssumeRoleUnauthorizedAccess","Message":"error"}' + ) + result = InstanceMetadataFetcher().retrieve_iam_role_credentials() + self.assertEqual(result, {}) + + def test_token_is_included(self): + user_agent = 'my-user-agent' + self.add_default_imds_responses() + + result = InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + + # Check that subsequent calls after getting the token include the token. + self.assertEqual(self._send.call_count, 3) + for call in self._send.call_args_list[1:]: + self.assertEqual( + call[0][0].headers['x-aws-ec2-metadata-token'], 'token' + ) + self.assertEqual(result, self._expected_creds) + + def test_metadata_token_not_supported_404(self): + user_agent = 'my-user-agent' + self.add_imds_response(b'', status_code=404) + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + + result = InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + + for call in self._send.call_args_list[1:]: + self.assertNotIn('x-aws-ec2-metadata-token', call[0][0].headers) + self.assertEqual(result, self._expected_creds) + + def test_metadata_token_not_supported_403(self): + user_agent = 'my-user-agent' + self.add_imds_response(b'', status_code=403) + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + + result = InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + + for call in self._send.call_args_list[1:]: + self.assertNotIn('x-aws-ec2-metadata-token', call[0][0].headers) + self.assertEqual(result, self._expected_creds) + + def test_metadata_token_not_supported_405(self): + user_agent = 'my-user-agent' + self.add_imds_response(b'', status_code=405) + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + + result = InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + + for call in self._send.call_args_list[1:]: + self.assertNotIn('x-aws-ec2-metadata-token', call[0][0].headers) + self.assertEqual(result, self._expected_creds) + + def test_metadata_token_not_supported_timeout(self): + user_agent = 'my-user-agent' + self.add_imds_connection_error(ReadTimeoutError(endpoint_url='url')) + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + + result = InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + + for call in self._send.call_args_list[1:]: + self.assertNotIn('x-aws-ec2-metadata-token', call[0][0].headers) + self.assertEqual(result, self._expected_creds) + + def test_token_not_supported_exhaust_retries(self): + user_agent = 'my-user-agent' + self.add_imds_connection_error(ConnectTimeoutError(endpoint_url='url')) + self.add_get_role_name_imds_response() + self.add_get_credentials_imds_response() + + result = InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + + for call in self._send.call_args_list[1:]: + self.assertNotIn('x-aws-ec2-metadata-token', call[0][0].headers) + self.assertEqual(result, self._expected_creds) + + def test_metadata_token_bad_request_yields_no_credentials(self): + user_agent = 'my-user-agent' + self.add_imds_response(b'', status_code=400) + result = InstanceMetadataFetcher( + user_agent=user_agent + ).retrieve_iam_role_credentials() + self.assertEqual(result, {}) + + def test_v1_disabled_by_config(self): + config = {'ec2_metadata_v1_disabled': True} + self.add_imds_response(b'', status_code=404) + fetcher = InstanceMetadataFetcher(num_attempts=1, config=config) + with self.assertRaises(MetadataRetrievalError): + fetcher.retrieve_iam_role_credentials() + + def _get_datetime(self, dt=None, offset=None, offset_func=operator.add): + if dt is None: + dt = datetime.datetime.utcnow() + if offset is not None: + dt = offset_func(dt, offset) + + return dt + + def _get_default_creds(self, overrides=None): + if overrides is None: + overrides = {} + + creds = { + 'AccessKeyId': 'access', + 'SecretAccessKey': 'secret', + 'Token': 'token', + 'Expiration': '1970-01-01T00:00:00', + } + creds.update(overrides) + return creds + + def _convert_creds_to_imds_fetcher(self, creds): + return { + 'access_key': creds['AccessKeyId'], + 'secret_key': creds['SecretAccessKey'], + 'token': creds['Token'], + 'expiry_time': creds['Expiration'], + 'role_name': self._role_name, + } + + def _add_default_imds_response(self, status_code=200, creds=''): + self.add_get_token_imds_response(token='token') + self.add_get_role_name_imds_response() + self.add_imds_response( + status_code=200, body=json.dumps(creds).encode('utf-8') + ) + + def mock_randint(self, int_val=600): + randint_mock = mock.Mock() + randint_mock.return_value = int_val + return randint_mock + + @FreezeTime(module=botocore.utils.datetime, date=DATE) + def test_expiry_time_extension(self): + current_time = self._get_datetime() + expiration_time = self._get_datetime( + dt=current_time, offset=datetime.timedelta(seconds=14 * 60) + ) + new_expiration = self._get_datetime( + dt=current_time, offset=datetime.timedelta(seconds=20 * 60) + ) + + creds = self._get_default_creds( + {"Expiration": expiration_time.strftime(DT_FORMAT)} + ) + expected_data = self._convert_creds_to_imds_fetcher(creds) + expected_data["expiry_time"] = new_expiration.strftime(DT_FORMAT) + + self._add_default_imds_response(200, creds) + + with mock.patch("random.randint", self.mock_randint()): + fetcher = InstanceMetadataFetcher() + result = fetcher.retrieve_iam_role_credentials() + assert result == expected_data + + @FreezeTime(module=botocore.utils.datetime, date=DATE) + def test_expired_expiry_extension(self): + current_time = self._get_datetime() + expiration_time = self._get_datetime( + dt=current_time, + offset=datetime.timedelta(seconds=14 * 60), + offset_func=operator.sub, + ) + new_expiration = self._get_datetime( + dt=current_time, offset=datetime.timedelta(seconds=20 * 60) + ) + assert current_time > expiration_time + assert new_expiration > current_time + + creds = self._get_default_creds( + {"Expiration": expiration_time.strftime(DT_FORMAT)} + ) + expected_data = self._convert_creds_to_imds_fetcher(creds) + expected_data["expiry_time"] = new_expiration.strftime(DT_FORMAT) + + self._add_default_imds_response(200, creds) + + with mock.patch("random.randint", self.mock_randint()): + fetcher = InstanceMetadataFetcher() + result = fetcher.retrieve_iam_role_credentials() + assert result == expected_data + + @FreezeTime(module=botocore.utils.datetime, date=DATE) + def test_expiry_extension_with_config(self): + current_time = self._get_datetime() + expiration_time = self._get_datetime( + dt=current_time, + offset=datetime.timedelta(seconds=14 * 60), + offset_func=operator.sub, + ) + new_expiration = self._get_datetime( + dt=current_time, offset=datetime.timedelta(seconds=25 * 60) + ) + assert current_time > expiration_time + assert new_expiration > current_time + + creds = self._get_default_creds( + {"Expiration": expiration_time.strftime(DT_FORMAT)} + ) + expected_data = self._convert_creds_to_imds_fetcher(creds) + expected_data["expiry_time"] = new_expiration.strftime(DT_FORMAT) + + self._add_default_imds_response(200, creds) + + with mock.patch("random.randint", self.mock_randint()): + fetcher = InstanceMetadataFetcher( + config={"ec2_credential_refresh_window": 15 * 60} + ) + result = fetcher.retrieve_iam_role_credentials() + assert result == expected_data + + @FreezeTime(module=botocore.utils.datetime, date=DATE) + def test_expiry_extension_with_bad_datetime(self): + bad_datetime = "May 20th, 2020 19:00:00" + creds = self._get_default_creds({"Expiration": bad_datetime}) + self._add_default_imds_response(200, creds) + + fetcher = InstanceMetadataFetcher( + config={"ec2_credential_refresh_window": 15 * 60} + ) + results = fetcher.retrieve_iam_role_credentials() + assert results['expiry_time'] == bad_datetime + + +class TestIMDSRegionProvider(unittest.TestCase): + def setUp(self): + self.environ = {} + self.environ_patch = mock.patch('os.environ', self.environ) + self.environ_patch.start() + + def tearDown(self): + self.environ_patch.stop() + + def assert_does_provide_expected_value( + self, + fetcher_region=None, + expected_result=None, + ): + fake_session = mock.Mock(spec=Session) + fake_fetcher = mock.Mock(spec=InstanceMetadataRegionFetcher) + fake_fetcher.retrieve_region.return_value = fetcher_region + provider = IMDSRegionProvider(fake_session, fetcher=fake_fetcher) + value = provider.provide() + self.assertEqual(value, expected_result) + + def test_does_provide_region_when_present(self): + self.assert_does_provide_expected_value( + fetcher_region='us-mars-2', + expected_result='us-mars-2', + ) + + def test_does_provide_none(self): + self.assert_does_provide_expected_value( + fetcher_region=None, + expected_result=None, + ) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_use_truncated_user_agent(self, send): + session = Session() + session = Session() + session.user_agent_version = '3.0' + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('Botocore/3.0', args[0].headers['User-Agent']) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_can_use_ipv6(self, send): + session = Session() + session.set_config_variable('imds_use_ipv6', True) + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('[fd00:ec2::254]', args[0].url) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_use_ipv4_by_default(self, send): + session = Session() + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('169.254.169.254', args[0].url) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_can_set_imds_endpoint_mode_to_ipv4(self, send): + session = Session() + session.set_config_variable( + 'ec2_metadata_service_endpoint_mode', 'ipv4' + ) + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('169.254.169.254', args[0].url) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_can_set_imds_endpoint_mode_to_ipv6(self, send): + session = Session() + session.set_config_variable( + 'ec2_metadata_service_endpoint_mode', 'ipv6' + ) + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('[fd00:ec2::254]', args[0].url) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_can_set_imds_service_endpoint(self, send): + session = Session() + session.set_config_variable( + 'ec2_metadata_service_endpoint', 'http://myendpoint/' + ) + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('http://myendpoint/', args[0].url) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_can_set_imds_service_endpoint_custom(self, send): + session = Session() + session.set_config_variable( + 'ec2_metadata_service_endpoint', 'http://myendpoint' + ) + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('http://myendpoint/latest/meta-data', args[0].url) + + @mock.patch('botocore.httpsession.URLLib3Session.send') + def test_imds_service_endpoint_overrides_ipv6_endpoint(self, send): + session = Session() + session.set_config_variable( + 'ec2_metadata_service_endpoint_mode', 'ipv6' + ) + session.set_config_variable( + 'ec2_metadata_service_endpoint', 'http://myendpoint/' + ) + provider = IMDSRegionProvider(session) + provider.provide() + args, _ = send.call_args + self.assertIn('http://myendpoint/', args[0].url) + + +class TestSSOTokenLoader(unittest.TestCase): + def setUp(self): + super().setUp() + self.session_name = 'admin' + self.start_url = 'https://d-abc123.awsapps.com/start' + self.cache_key = '40a89917e3175433e361b710a9d43528d7f1890a' + self.session_cache_key = 'd033e22ae348aeb5660fc2140aec35850c4da997' + self.access_token = 'totally.a.token' + self.cached_token = { + 'accessToken': self.access_token, + 'expiresAt': '2002-10-18T03:52:38UTC', + } + self.cache = {} + self.loader = SSOTokenLoader(cache=self.cache) + + def test_can_load_token_exists(self): + self.cache[self.cache_key] = self.cached_token + access_token = self.loader(self.start_url) + self.assertEqual(self.cached_token, access_token) + + def test_can_handle_does_not_exist(self): + with self.assertRaises(SSOTokenLoadError): + self.loader(self.start_url) + + def test_can_handle_invalid_cache(self): + self.cache[self.cache_key] = {} + with self.assertRaises(SSOTokenLoadError): + self.loader(self.start_url) + + def test_can_save_token(self): + self.loader.save_token(self.start_url, self.cached_token) + access_token = self.loader(self.start_url) + self.assertEqual(self.cached_token, access_token) + + def test_can_save_token_sso_session(self): + self.loader.save_token( + self.start_url, + self.cached_token, + session_name=self.session_name, + ) + access_token = self.loader( + self.start_url, + session_name=self.session_name, + ) + self.assertEqual(self.cached_token, access_token) + + def test_can_load_token_exists_sso_session_name(self): + self.cache[self.session_cache_key] = self.cached_token + access_token = self.loader( + self.start_url, + session_name=self.session_name, + ) + self.assertEqual(self.cached_token, access_token) + + +@pytest.mark.parametrize( + 'header_name, headers, expected', + ( + ('test_header', {'test_header': 'foo'}, True), + ('Test_Header', {'test_header': 'foo'}, True), + ('test_header', {'Test_Header': 'foo'}, True), + ('missing_header', {'Test_Header': 'foo'}, False), + (None, {'Test_Header': 'foo'}, False), + ('test_header', HeadersDict({'test_header': 'foo'}), True), + ('Test_Header', HeadersDict({'test_header': 'foo'}), True), + ('test_header', HeadersDict({'Test_Header': 'foo'}), True), + ('missing_header', HeadersDict({'Test_Header': 'foo'}), False), + (None, HeadersDict({'Test_Header': 'foo'}), False), + ), +) +def test_has_header(header_name, headers, expected): + assert has_header(header_name, headers) is expected + + +class TestDetermineContentLength(unittest.TestCase): + def test_basic_bytes(self): + length = determine_content_length(b'hello') + self.assertEqual(length, 5) + + def test_empty_bytes(self): + length = determine_content_length(b'') + self.assertEqual(length, 0) + + def test_buffered_io_base(self): + length = determine_content_length(io.BufferedIOBase()) + self.assertIsNone(length) + + def test_none(self): + length = determine_content_length(None) + self.assertEqual(length, 0) + + def test_basic_len_obj(self): + class HasLen: + def __len__(self): + return 12 + + length = determine_content_length(HasLen()) + self.assertEqual(length, 12) + + def test_non_seekable_fileobj(self): + class Readable: + def read(self, *args, **kwargs): + pass + + length = determine_content_length(Readable()) + self.assertIsNone(length) + + def test_seekable_fileobj(self): + class Seekable: + _pos = 0 + + def read(self, *args, **kwargs): + pass + + def tell(self, *args, **kwargs): + return self._pos + + def seek(self, *args, **kwargs): + self._pos = 50 + + length = determine_content_length(Seekable()) + self.assertEqual(length, 50) + + +@pytest.mark.parametrize( + 'url, expected', + ( + ('https://s3-accelerate.amazonaws.com', True), + ('https://s3-accelerate.amazonaws.com/', True), + ('https://s3-accelerate.amazonaws.com/key', True), + ('http://s3-accelerate.amazonaws.com/key', True), + ('https://s3-accelerate.foo.amazonaws.com/key', False), + # bucket prefixes are not allowed + ('https://bucket.s3-accelerate.amazonaws.com/key', False), + # S3 accelerate can be combined with dualstack + ('https://s3-accelerate.dualstack.amazonaws.com/key', True), + ('https://bucket.s3-accelerate.dualstack.amazonaws.com/key', False), + ('https://s3-accelerate.dualstack.dualstack.amazonaws.com/key', False), + ('https://s3-accelerate.dualstack.foo.amazonaws.com/key', False), + ('https://dualstack.s3-accelerate.amazonaws.com/key', False), + # assorted other ways for URLs to not be valid for s3-accelerate + ('ftp://s3-accelerate.dualstack.foo.amazonaws.com/key', False), + ('https://s3-accelerate.dualstack.foo.c2s.ic.gov/key', False), + # None-valued url is accepted + (None, False), + ), +) +def test_is_s3_accelerate_url(url, expected): + assert is_s3_accelerate_url(url) == expected + + +@pytest.mark.parametrize( + 'headers, default, expected', + ( + ({}, 'ISO-8859-1', None), + ({'Content-Type': 'text/html; charset=utf-8'}, 'default', 'utf-8'), + ({'Content-Type': 'text/html; charset="utf-8"'}, 'default', 'utf-8'), + ({'Content-Type': 'text/html'}, 'ascii', 'ascii'), + ({'Content-Type': 'application/json'}, 'ISO-8859-1', None), + ), +) +def test_get_encoding_from_headers(headers, default, expected): + charset = get_encoding_from_headers(HeadersDict(headers), default=default) + assert charset == expected + + +def test_lru_cache_weakref(): + class ClassWithCachedMethod: + @lru_cache_weakref(maxsize=10) + def cached_fn(self, a, b): + return a + b + + cls1 = ClassWithCachedMethod() + cls2 = ClassWithCachedMethod() + + assert cls1.cached_fn.cache_info().currsize == 0 + assert getrefcount(cls1) == 2 + assert getrefcount(cls2) == 2 + # "The count returned is generally one higher than you might expect, because + # it includes the (temporary) reference as an argument to getrefcount()." + # https://docs.python.org/3.8/library/sys.html#getrefcount + + cls1.cached_fn(1, 1) + cls2.cached_fn(1, 1) + + # The cache now has two entries, but the reference count remains the same as + # before. + assert cls1.cached_fn.cache_info().currsize == 2 + assert getrefcount(cls1) == 2 + assert getrefcount(cls2) == 2 + + # Deleting one of the objects does not interfere with the cache entries + # related to the other object. + del cls1 + assert cls2.cached_fn.cache_info().currsize == 2 + assert cls2.cached_fn.cache_info().hits == 0 + assert cls2.cached_fn.cache_info().misses == 2 + cls2.cached_fn(1, 1) + assert cls2.cached_fn.cache_info().currsize == 2 + assert cls2.cached_fn.cache_info().hits == 1 # the call was a cache hit + assert cls2.cached_fn.cache_info().misses == 2 diff --git a/testbed/boto__botocore/tests/unit/test_validate.py b/testbed/boto__botocore/tests/unit/test_validate.py new file mode 100644 index 0000000000000000000000000000000000000000..38234b856f3159ae1875e284ec597fd5540f87b6 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_validate.py @@ -0,0 +1,658 @@ +import decimal +import io +from datetime import datetime + +from botocore.model import ShapeResolver +from botocore.validate import ParamValidator +from tests import unittest + +BOILER_PLATE_SHAPES = {'StringType': {'type': 'string'}} + + +class BaseTestValidate(unittest.TestCase): + def assert_has_validation_errors(self, given_shapes, input_params, errors): + # Given the shape definitions ``given_shape`` and the user input + # parameters ``input_params``, verify that the validation has + # validation errors containing the list of ``errors``. + # Also, this assumes the input shape name is "Input". + errors_found = self.get_validation_error_message( + given_shapes, input_params + ) + self.assertTrue(errors_found.has_errors()) + error_message = errors_found.generate_report() + for error in errors: + self.assertIn(error, error_message) + + def get_validation_error_message(self, given_shapes, input_params): + s = ShapeResolver(given_shapes) + input_shape = s.get_shape_by_name('Input') + validator = ParamValidator() + errors_found = validator.validate(input_params, input_shape) + return errors_found + + +class TestValidateRequiredParams(BaseTestValidate): + def test_validate_required_params(self): + self.assert_has_validation_errors( + given_shapes={ + 'Input': { + 'type': 'structure', + 'required': ['A', 'B'], + 'members': { + 'A': {'shape': 'StringType'}, + 'B': {'shape': 'StringType'}, + }, + }, + 'StringType': {'type': 'string'}, + }, + input_params={'A': 'foo'}, + errors=['Missing required parameter'], + ) + + def test_validate_nested_required_param(self): + self.assert_has_validation_errors( + given_shapes={ + 'Input': { + 'type': 'structure', + 'members': {'A': {'shape': 'SubStruct'}}, + }, + 'SubStruct': { + 'type': 'structure', + 'required': ['B', 'C'], + 'members': { + 'B': {'shape': 'StringType'}, + 'C': {'shape': 'StringType'}, + }, + }, + 'StringType': { + 'type': 'string', + }, + }, + input_params={'A': {'B': 'foo'}}, + errors=['Missing required parameter'], + ) + + def test_validate_unknown_param(self): + self.assert_has_validation_errors( + given_shapes={ + 'Input': { + 'type': 'structure', + 'required': ['A'], + 'members': { + 'A': {'shape': 'StringType'}, + }, + }, + 'StringType': {'type': 'string'}, + }, + input_params={'A': 'foo', 'B': 'bar'}, + errors=['Unknown parameter'], + ) + + +class TestValidateJSONValueTrait(BaseTestValidate): + def test_accepts_jsonvalue_string(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'json': { + 'shape': 'StrType', + 'jsonvalue': True, + 'location': 'header', + 'locationName': 'header-name', + } + }, + }, + 'StrType': {'type': 'string'}, + } + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={ + 'json': {'data': [1, 2.3, '3'], 'unicode': '\u2713'} + }, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_validate_jsonvalue_string(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'json': { + 'shape': 'StrType', + 'jsonvalue': True, + 'location': 'header', + 'locationName': 'header-name', + } + }, + }, + 'StrType': {'type': 'string'}, + } + + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={'json': {'date': datetime(2017, 4, 27, 0, 0)}}, + errors=[('Invalid parameter json must be json serializable: ')], + ) + + +class TestValidateDocumentType(BaseTestValidate): + def test_accepts_document_type_string(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'inlineDocument': { + 'shape': 'DocumentType', + } + }, + }, + 'DocumentType': {'type': 'structure', 'document': True}, + } + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={ + 'inlineDocument': { + 'data': [1, 2.3, '3', {'foo': None}], + 'unicode': '\u2713', + } + }, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_validate_document_type_string(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'inlineDocument': { + 'shape': 'DocumentType', + } + }, + }, + 'DocumentType': {'type': 'structure', 'document': True}, + } + + invalid_document = object() + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'inlineDocument': { + 'number': complex(1j), + 'date': datetime(2017, 4, 27, 0, 0), + 'list': [invalid_document], + 'dict': {'foo': (1, 2, 3)}, + } + }, + errors=[ + ('Invalid type for document parameter number'), + ('Invalid type for document parameter date'), + ('Invalid type for document parameter list[0]'), + ('Invalid type for document parameter foo'), + ], + ) + + +class TestValidateTaggedUnion(BaseTestValidate): + def test_accepts_one_member(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'taggedUnion': { + 'shape': 'TaggedUnionType', + } + }, + }, + 'TaggedUnionType': { + 'type': 'structure', + 'union': True, + 'members': { + 'Foo': {'shape': 'StringType'}, + 'Bar': {'shape': 'StringType'}, + }, + }, + 'StringType': {'type': 'string'}, + } + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={'taggedUnion': {'Foo': "mystring"}}, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_validate_one_member_is_set(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'taggedUnion': { + 'shape': 'TaggedUnionType', + } + }, + }, + 'TaggedUnionType': { + 'type': 'structure', + 'union': True, + 'members': { + 'Foo': {'shape': 'StringType'}, + 'Bar': {'shape': 'StringType'}, + }, + }, + 'StringType': {'type': 'string'}, + } + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={ + 'taggedUnion': {'Foo': "mystring", 'Bar': "mystring2"} + }, + ) + error_msg = errors.generate_report() + self.assertIn( + 'Invalid number of parameters set for tagged union structure', + error_msg, + ) + + def test_validate_known_member_is_set(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'taggedUnion': { + 'shape': 'TaggedUnionType', + } + }, + }, + 'TaggedUnionType': { + 'type': 'structure', + 'union': True, + 'members': { + 'Foo': {'shape': 'StringType'}, + 'Bar': {'shape': 'StringType'}, + }, + }, + 'StringType': {'type': 'string'}, + } + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={'taggedUnion': {'unknown': "mystring"}}, + ) + error_msg = errors.generate_report() + self.assertIn('Unknown parameter in taggedUnion', error_msg) + + def test_validate_structure_is_not_empty(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'taggedUnion': { + 'shape': 'TaggedUnionType', + } + }, + }, + 'TaggedUnionType': { + 'type': 'structure', + 'union': True, + 'members': { + 'Foo': {'shape': 'StringType'}, + 'Bar': {'shape': 'StringType'}, + }, + }, + 'StringType': {'type': 'string'}, + } + errors = self.get_validation_error_message( + given_shapes=self.shapes, input_params={'taggedUnion': {}} + ) + error_msg = errors.generate_report() + self.assertIn('Must set one of the following keys', error_msg) + + +class TestValidateTypes(BaseTestValidate): + def setUp(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'Str': {'shape': 'StrType'}, + 'Int': {'shape': 'IntType'}, + 'Bool': {'shape': 'BoolType'}, + 'List': {'shape': 'ListType'}, + 'Struct': {'shape': 'StructType'}, + 'Double': {'shape': 'DoubleType'}, + 'Long': {'shape': 'LongType'}, + 'Map': {'shape': 'MapType'}, + 'Timestamp': {'shape': 'TimeType'}, + }, + }, + 'StrType': {'type': 'string'}, + 'IntType': {'type': 'integer'}, + 'BoolType': {'type': 'boolean'}, + 'ListType': {'type': 'list'}, + 'StructType': {'type': 'structure'}, + 'DoubleType': {'type': 'double'}, + 'LongType': {'type': 'long'}, + 'MapType': {'type': 'map'}, + 'TimeType': {'type': 'timestamp'}, + } + + def test_validate_string(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'Str': 24, + 'Int': 'notInt', + 'Bool': 'notBool', + 'List': 'notList', + 'Struct': 'notDict', + 'Double': 'notDouble', + 'Long': 'notLong', + 'Map': 'notDict', + 'Timestamp': 'notTimestamp', + }, + errors=[ + 'Invalid type for parameter Str', + 'Invalid type for parameter Int', + 'Invalid type for parameter Bool', + 'Invalid type for parameter List', + 'Invalid type for parameter Struct', + 'Invalid type for parameter Double', + 'Invalid type for parameter Long', + 'Invalid type for parameter Map', + 'Invalid type for parameter Timestamp', + ], + ) + + def test_datetime_type_accepts_datetime_obj(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={'Timestamp': datetime.now()}, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_datetime_accepts_string_timestamp(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={'Timestamp': '2014-01-01 12:00:00'}, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_can_handle_none_datetimes(self): + # This is specifically to test a workaround a bug in dateutil + # where low level exceptions can propogate back up to + # us. + errors = self.get_validation_error_message( + given_shapes=self.shapes, input_params={'Timestamp': None} + ) + error_msg = errors.generate_report() + self.assertIn('Invalid type for parameter Timestamp', error_msg) + + +class TestValidateRanges(BaseTestValidate): + def setUp(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'Int': {'shape': 'IntType'}, + 'Long': {'shape': 'IntType'}, + 'String': {'shape': 'StringType'}, + 'List': {'shape': 'ListType'}, + 'OnlyMin': {'shape': 'MinStrOnly'}, + 'OnlyMax': {'shape': 'MaxStrOnly'}, + }, + }, + 'IntType': { + 'type': 'integer', + 'min': 0, + 'max': 1000, + }, + 'LongType': { + 'type': 'long', + 'min': 0, + 'max': 1000, + }, + 'StringType': { + 'type': 'string', + 'min': 1, + 'max': 10, + }, + 'MinStrOnly': {'type': 'string', 'min': 1}, + 'MaxStrOnly': {'type': 'string', 'max': 10}, + 'ListType': { + 'type': 'list', + 'min': 1, + 'max': 5, + 'member': {'shape': 'StringType'}, + }, + } + + def test_less_than_range(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'Int': -10, + 'Long': -10, + }, + errors=[ + 'Invalid value for parameter Int', + 'Invalid value for parameter Long', + ], + ) + + def test_does_not_validate_greater_than_range(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={ + 'Int': 100000000, + 'Long': 100000000, + }, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_within_range(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, input_params={'Int': 10} + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_string_min_length_contraint(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'String': '', + }, + errors=[ + 'Invalid length for parameter String', + ], + ) + + def test_does_not_validate_string_max_length_contraint(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={ + 'String': 'more than ten characters', + }, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_list_min_length_constraint(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'List': [], + }, + errors=[ + 'Invalid length for parameter List', + ], + ) + + def test_does_not_validate_list_max_length_constraint(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={ + 'List': ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], + }, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_only_min_value_specified(self): + # min anx max don't have to both be provided. + # It's valid to just have min with no max, and + # vice versa. + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'OnlyMin': '', + }, + errors=[ + 'Invalid length for parameter OnlyMin', + ], + ) + + def test_does_not_validate_max_when_only_max_value_specified(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={ + 'OnlyMax': 'more than ten characters', + }, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + +class TestValidateMapType(BaseTestValidate): + def setUp(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'Map': {'shape': 'MapType'}, + }, + }, + 'MapType': { + 'type': 'map', + 'key': {'shape': 'StringType'}, + 'value': {'shape': 'StringType'}, + }, + 'StringType': { + 'type': 'string', + 'min': 2, + }, + } + + def test_validate_keys_and_values(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={'Map': {'foo': '', 'a': 'foobar'}}, + errors=[ + 'Invalid length for parameter Map', + ], + ) + + +class TestValidationFloatType(BaseTestValidate): + def setUp(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'Float': {'shape': 'FloatType'}, + }, + }, + 'FloatType': { + 'type': 'float', + 'min': 2, + 'max': 5, + }, + } + + def test_range_float(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'Float': 1, + }, + errors=[ + 'Invalid value for parameter Float', + ], + ) + + def test_decimal_allowed(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={'Float': decimal.Decimal('2.12345')}, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_decimal_still_validates_range(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'Float': decimal.Decimal('1'), + }, + errors=[ + 'Invalid value for parameter Float', + ], + ) + + +class TestValidateTypeBlob(BaseTestValidate): + def setUp(self): + self.shapes = { + 'Input': { + 'type': 'structure', + 'members': { + 'Blob': {'shape': 'BlobType'}, + }, + }, + 'BlobType': { + 'type': 'blob', + 'min': 2, + 'max': 5, + }, + } + + def test_validates_bytes(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, input_params={'Blob': b'12345'} + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_validates_bytearray(self): + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={'Blob': bytearray(b'12345')}, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_validates_file_like_object(self): + value = io.BytesIO(b'foo') + + errors = self.get_validation_error_message( + given_shapes=self.shapes, + input_params={'Blob': value}, + ) + error_msg = errors.generate_report() + self.assertEqual(error_msg, '') + + def test_validate_type(self): + self.assert_has_validation_errors( + given_shapes=self.shapes, + input_params={ + 'Blob': 24, + }, + errors=[ + 'Invalid type for parameter Blob', + ], + ) diff --git a/testbed/boto__botocore/tests/unit/test_waiters.py b/testbed/boto__botocore/tests/unit/test_waiters.py new file mode 100644 index 0000000000000000000000000000000000000000..79dc29be99375b50c17d1675ddbb07b631a87894 --- /dev/null +++ b/testbed/boto__botocore/tests/unit/test_waiters.py @@ -0,0 +1,961 @@ +# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import io +import os + +import botocore +from botocore.exceptions import ClientError, WaiterConfigError, WaiterError +from botocore.loaders import Loader +from botocore.model import ServiceModel +from botocore.waiter import ( + NormalizedOperationMethod, + SingleWaiterConfig, + Waiter, + WaiterModel, + create_waiter_with_client, +) +from tests import BaseEnvVar, mock, unittest + + +class TestWaiterModel(unittest.TestCase): + def setUp(self): + self.boiler_plate_config = { + 'description': 'Waiter description', + 'operation': 'HeadBucket', + 'delay': 5, + 'maxAttempts': 20, + } + + def create_acceptor_function(self, for_config): + single_waiter = {'acceptors': [for_config]} + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + return config.acceptors[0].matcher_func + + def test_waiter_version(self): + self.assertEqual(WaiterModel({'version': 2, 'waiters': {}}).version, 2) + + def test_wont_load_missing_version_in_config(self): + # We only load waiter configs if we know for sure that we're + # loading version 2 of the format. + waiters = { + # Missing the 'version' key. + 'waiters': {} + } + with self.assertRaises(WaiterConfigError): + WaiterModel(waiters) + + def test_unsupported_waiter_version(self): + waiters = {'version': 1, 'waiters': {}} + with self.assertRaises(WaiterConfigError): + WaiterModel(waiters) + + def test_waiter_names(self): + waiters = { + 'version': 2, + 'waiters': { + 'BarWaiter': {}, + 'FooWaiter': {}, + }, + } + self.assertEqual( + WaiterModel(waiters).waiter_names, ['BarWaiter', 'FooWaiter'] + ) + + def test_get_single_waiter_config(self): + single_waiter = { + 'description': 'Waiter description', + 'operation': 'HeadBucket', + 'delay': 5, + 'maxAttempts': 20, + 'acceptors': [ + {'state': 'success', 'matcher': 'status', 'expected': 200}, + {'state': 'retry', 'matcher': 'status', 'expected': 404}, + ], + } + waiters = { + 'version': 2, + 'waiters': { + 'BucketExists': single_waiter, + }, + } + model = WaiterModel(waiters) + config = model.get_waiter('BucketExists') + self.assertEqual(config.operation, 'HeadBucket') + + def test_get_waiter_does_not_exist(self): + waiters = {'version': 2, 'waiters': {}} + model = WaiterModel(waiters) + with self.assertRaises(ValueError): + model.get_waiter('UnknownWaiter') + + def test_single_waiter_config_attributes(self): + single_waiter = { + 'description': 'Waiter description', + 'operation': 'HeadBucket', + 'delay': 5, + 'maxAttempts': 20, + 'acceptors': [], + } + config = SingleWaiterConfig(single_waiter) + self.assertEqual(config.description, 'Waiter description') + self.assertEqual(config.operation, 'HeadBucket') + self.assertEqual(config.delay, 5) + self.assertEqual(config.max_attempts, 20) + + def test_single_waiter_acceptors_built_with_matcher_func(self): + # When the list of acceptors are requested, we actually will transform + # them into values that are easier to use. + single_waiter = { + 'acceptors': [ + {'state': 'success', 'matcher': 'status', 'expected': 200}, + ], + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + success_acceptor = config.acceptors[0] + + self.assertEqual(success_acceptor.state, 'success') + self.assertEqual(success_acceptor.matcher, 'status') + self.assertEqual(success_acceptor.expected, 200) + self.assertTrue(callable(success_acceptor.matcher_func)) + + def test_single_waiter_acceptor_matches_jmespath(self): + single_waiter = { + 'acceptors': [ + { + 'state': 'success', + 'matcher': 'path', + 'argument': 'Table.TableStatus', + 'expected': 'ACCEPTED', + }, + ], + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + success_acceptor = config.acceptors[0].matcher_func + # success_acceptor is a callable that takes a response dict and returns + # True or False. + self.assertTrue( + success_acceptor({'Table': {'TableStatus': 'ACCEPTED'}}) + ) + self.assertFalse( + success_acceptor({'Table': {'TableStatus': 'CREATING'}}) + ) + + def test_single_waiter_supports_status_code(self): + single_waiter = { + 'acceptors': [ + {'state': 'success', 'matcher': 'status', 'expected': 200} + ], + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + success_acceptor = config.acceptors[0].matcher_func + self.assertTrue( + success_acceptor({'ResponseMetadata': {'HTTPStatusCode': 200}}) + ) + self.assertFalse( + success_acceptor({'ResponseMetadata': {'HTTPStatusCode': 404}}) + ) + + def test_single_waiter_supports_error(self): + single_waiter = { + 'acceptors': [ + { + 'state': 'success', + 'matcher': 'error', + 'expected': 'DoesNotExistError', + } + ], + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + success_acceptor = config.acceptors[0].matcher_func + self.assertTrue( + success_acceptor({'Error': {'Code': 'DoesNotExistError'}}) + ) + self.assertFalse( + success_acceptor({'Error': {'Code': 'DoesNotExistErorr'}}) + ) + + def test_single_waiter_supports_no_error(self): + single_waiter = { + 'acceptors': [ + { + 'state': 'success', + 'matcher': 'error', + 'expected': False, + } + ], + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + success_acceptor = config.acceptors[0].matcher_func + self.assertTrue(success_acceptor({})) + self.assertFalse(success_acceptor({'Error': {'Code': 'ExampleError'}})) + + def test_single_waiter_supports_any_error(self): + single_waiter = { + 'acceptors': [ + { + 'state': 'success', + 'matcher': 'error', + 'expected': True, + } + ], + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + success_acceptor = config.acceptors[0].matcher_func + self.assertTrue(success_acceptor({'Error': {'Code': 'ExampleError1'}})) + self.assertTrue(success_acceptor({'Error': {'Code': 'ExampleError2'}})) + + def test_unknown_matcher(self): + unknown_type = 'arbitrary_type' + single_waiter = { + 'acceptors': [ + { + 'state': 'success', + 'matcher': unknown_type, + 'expected': 'foo', + } + ] + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + with self.assertRaises(WaiterConfigError): + config.acceptors + + def test_single_waiter_supports_path_all(self): + matches = self.create_acceptor_function( + for_config={ + 'state': 'success', + 'matcher': 'pathAll', + 'argument': 'Tables[].State', + 'expected': 'GOOD', + } + ) + self.assertTrue(matches({'Tables': [{"State": "GOOD"}]})) + self.assertTrue( + matches({'Tables': [{"State": "GOOD"}, {"State": "GOOD"}]}) + ) + + def test_single_waiter_supports_path_any(self): + matches = self.create_acceptor_function( + for_config={ + 'state': 'failure', + 'matcher': 'pathAny', + 'argument': 'Tables[].State', + 'expected': 'FAIL', + } + ) + self.assertTrue(matches({'Tables': [{"State": "FAIL"}]})) + self.assertTrue( + matches({'Tables': [{"State": "GOOD"}, {"State": "FAIL"}]}) + ) + + def test_waiter_handles_error_responses_with_path_matchers(self): + path_any = self.create_acceptor_function( + for_config={ + 'state': 'success', + 'matcher': 'pathAny', + 'argument': 'length(Tables) > `0`', + 'expected': True, + } + ) + path_all = self.create_acceptor_function( + for_config={ + 'state': 'success', + 'matcher': 'pathAll', + 'argument': 'length(Tables) > `0`', + 'expected': True, + } + ) + path = self.create_acceptor_function( + for_config={ + 'state': 'success', + 'matcher': 'path', + 'argument': 'length(Tables) > `0`', + 'expected': True, + } + ) + self.assertFalse(path_any({'Error': {'Code': 'DoesNotExist'}})) + self.assertFalse(path_all({'Error': {'Code': 'DoesNotExist'}})) + self.assertFalse(path({'Error': {'Code': 'DoesNotExist'}})) + + def test_single_waiter_does_not_match_path_all(self): + matches = self.create_acceptor_function( + for_config={ + 'state': 'success', + 'matcher': 'pathAll', + 'argument': 'Tables[].State', + 'expected': 'GOOD', + } + ) + self.assertFalse( + matches({'Tables': [{"State": "GOOD"}, {"State": "BAD"}]}) + ) + self.assertFalse( + matches({'Tables': [{"State": "BAD"}, {"State": "GOOD"}]}) + ) + self.assertFalse( + matches({'Tables': [{"State": "BAD"}, {"State": "BAD"}]}) + ) + self.assertFalse(matches({'Tables': []})) + self.assertFalse( + matches( + { + 'Tables': [ + {"State": "BAD"}, + {"State": "BAD"}, + {"State": "BAD"}, + {"State": "BAD"}, + ] + } + ) + ) + + def test_path_all_missing_field(self): + matches = self.create_acceptor_function( + for_config={ + 'state': 'success', + 'matcher': 'pathAll', + 'argument': 'Tables[].State', + 'expected': 'GOOD', + } + ) + self.assertFalse( + matches({'Tables': [{"NotState": "GOOD"}, {"NotState": "BAD"}]}) + ) + + def test_path_all_matcher_does_not_receive_list(self): + matches = self.create_acceptor_function( + for_config={ + 'state': 'success', + 'matcher': 'pathAll', + 'argument': 'Tables[].State', + 'expected': 'GOOD', + } + ) + self.assertFalse(matches({"NotTables": []})) + + def test_single_waiter_supports_all_three_states(self): + single_waiter = { + 'acceptors': [ + { + 'state': 'success', + 'matcher': 'error', + 'expected': 'DoesNotExistError', + }, + {'state': 'success', 'matcher': 'status', 'expected': 200}, + { + 'state': 'success', + 'matcher': 'path', + 'argument': 'Foo.Bar', + 'expected': 'baz', + }, + ], + } + single_waiter.update(self.boiler_plate_config) + config = SingleWaiterConfig(single_waiter) + acceptors = config.acceptors + # Each acceptors should be able to handle not matching + # any type of response. + matches_nothing = {} + self.assertFalse(acceptors[0].matcher_func(matches_nothing)) + self.assertFalse(acceptors[1].matcher_func(matches_nothing)) + self.assertFalse(acceptors[2].matcher_func(matches_nothing)) + + +class TestWaitersObjects(unittest.TestCase): + def setUp(self): + pass + + def client_responses_are(self, *responses, **kwargs): + operation_method = kwargs['for_operation'] + operation_method.side_effect = responses + return operation_method + + def create_waiter_config( + self, operation='MyOperation', delay=0, max_attempts=3, acceptors=None + ): + if acceptors is None: + # Create some arbitrary acceptor that will never match. + acceptors = [ + {'state': 'success', 'matcher': 'status', 'expected': 1000} + ] + waiter_config = { + 'operation': operation, + 'delay': delay, + 'maxAttempts': max_attempts, + 'acceptors': acceptors, + } + config = SingleWaiterConfig(waiter_config) + return config + + def test_waiter_waits_until_acceptor_matches(self): + config = self.create_waiter_config( + max_attempts=3, + acceptors=[ + { + 'state': 'success', + 'matcher': 'path', + 'argument': 'Foo', + 'expected': 'SUCCESS', + } + ], + ) + # Simulate the client having two calls that don't + # match followed by a third call that matches the + # acceptor. + operation_method = mock.Mock() + waiter = Waiter('MyWaiter', config, operation_method) + self.client_responses_are( + {'Foo': 'FAILURE'}, + {'Foo': 'FAILURE'}, + {'Foo': 'SUCCESS'}, + for_operation=operation_method, + ) + waiter.wait() + self.assertEqual(operation_method.call_count, 3) + + def test_waiter_matches_with_invalid_error_response(self): + # Verify that the call will not raise WaiterError + # because of 'Error' key in success response. + config = self.create_waiter_config( + max_attempts=3, + acceptors=[ + { + 'state': 'success', + 'matcher': 'path', + 'argument': 'Foo', + 'expected': 'SUCCESS', + } + ], + ) + operation_method = mock.Mock() + waiter = Waiter('MyWaiter', config, operation_method) + self.client_responses_are( + {'Foo': 'SUCCESS', 'Error': 'foo'}, for_operation=operation_method + ) + waiter.wait() + self.assertEqual(operation_method.call_count, 1) + + def test_waiter_never_matches(self): + # Verify that a matcher will fail after max_attempts + # is exceeded. + config = self.create_waiter_config(max_attempts=3) + operation_method = mock.Mock() + self.client_responses_are( + {'Foo': 'FAILURE'}, + {'Foo': 'FAILURE'}, + {'Foo': 'FAILURE'}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + with self.assertRaises(WaiterError): + waiter.wait() + + def test_unspecified_errors_stops_waiter(self): + # If a waiter receives an error response, then the + # waiter immediately stops. + config = self.create_waiter_config() + operation_method = mock.Mock() + self.client_responses_are( + # This is an unknown error that's not called out + # in any of the waiter config, so when the + # waiter encounters this response it will transition + # to the failure state. + {'Error': {'Code': 'UnknownError', 'Message': 'bad error'}}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + with self.assertRaises(WaiterError): + waiter.wait() + + def test_last_response_available_on_waiter_error(self): + last_response = { + 'Error': {'Code': 'UnknownError', 'Message': 'bad error'} + } + config = self.create_waiter_config() + operation_method = mock.Mock() + self.client_responses_are( + last_response, for_operation=operation_method + ) + waiter = Waiter('MyWaiter', config, operation_method) + with self.assertRaises(WaiterError) as e: + waiter.wait() + self.assertEqual(e.exception.last_response, last_response) + + def test_unspecified_errors_propagate_error_code(self): + # If a waiter receives an error response, then the + # waiter should pass along the error code + config = self.create_waiter_config() + operation_method = mock.Mock() + error_code = 'error_message' + error_message = 'error_message' + self.client_responses_are( + # This is an unknown error that's not called out + # in any of the waiter config, so when the + # waiter encounters this response it will transition + # to the failure state. + {'Error': {'Code': error_code, 'Message': error_message}}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + + with self.assertRaisesRegex(WaiterError, error_message): + waiter.wait() + + def _assert_failure_state_error_raised( + self, acceptors, responses, expected_msg + ): + config = self.create_waiter_config(acceptors=acceptors) + operation_method = mock.Mock() + waiter = Waiter('MyWaiter', config, operation_method) + self.client_responses_are(*responses, for_operation=operation_method) + with self.assertRaisesRegex(WaiterError, expected_msg): + waiter.wait() + + def test_waiter_failure_state_error(self): + test_cases = [ + ( + [ + { + 'state': 'failure', + 'matcher': 'path', + 'argument': 'Foo', + 'expected': 'FAILURE', + } + ], + [{'Foo': 'FAILURE'}], + 'FAILURE', + ), + ( + [ + { + 'state': 'failure', + 'matcher': 'pathAll', + 'argument': 'Tables[].State', + 'expected': 'FAILURE', + } + ], + [{'Tables': [{"State": "FAILURE"}]}], + 'FAILURE', + ), + ( + [ + { + 'state': 'failure', + 'matcher': 'pathAny', + 'argument': 'Tables[].State', + 'expected': 'FAILURE', + } + ], + [{'Tables': [{"State": "FAILURE"}]}], + 'FAILURE', + ), + ( + [{'state': 'failure', 'matcher': 'status', 'expected': 404}], + [{'ResponseMetadata': {'HTTPStatusCode': 404}}], + '404', + ), + ( + [ + { + 'state': 'failure', + 'matcher': 'error', + 'expected': 'FailError', + } + ], + [{'Error': {'Code': 'FailError', 'Message': 'foo'}}], + 'FailError', + ), + ( + [ + { + 'state': 'retry', + 'matcher': 'error', + 'expected': 'RetryMe', + } + ], + [{'Success': False}] * 4, + 'Max attempts exceeded', + ), + ( + [ + {'state': 'success', 'matcher': 'status', 'expected': 200}, + { + 'state': 'retry', + 'matcher': 'error', + 'expected': 'RetryMe', + }, + ], + [ + {'Success': False}, + {'Error': {'Code': 'RetryMe', 'Message': 'foo'}}, + {'Success': False}, + {'Success': False}, + ], + 'Previously accepted state', + ), + ] + + for acceptors, responses, expected_msg in test_cases: + self._assert_failure_state_error_raised( + acceptors, responses, expected_msg + ) + + def test_waiter_transitions_to_failure_state(self): + acceptors = [ + # A success state that will never be hit. + {'state': 'success', 'matcher': 'status', 'expected': 1000}, + {'state': 'failure', 'matcher': 'error', 'expected': 'FailError'}, + ] + config = self.create_waiter_config(acceptors=acceptors) + operation_method = mock.Mock() + self.client_responses_are( + {'Nothing': 'foo'}, + # And on the second attempt, a FailError is seen, which + # causes the waiter to fail fast. + {'Error': {'Code': 'FailError', 'Message': 'foo'}}, + {'WillNeverGetCalled': True}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + with self.assertRaises(WaiterError): + waiter.wait() + # Not only should we raise an exception, but we should have + # only called the operation_method twice because the second + # response triggered a fast fail. + self.assertEqual(operation_method.call_count, 2) + + def test_waiter_handles_retry_state(self): + acceptor_with_retry_state = [ + {'state': 'success', 'matcher': 'status', 'expected': 200}, + {'state': 'retry', 'matcher': 'error', 'expected': 'RetryMe'}, + ] + config = self.create_waiter_config(acceptors=acceptor_with_retry_state) + operation_method = mock.Mock() + self.client_responses_are( + {'Nothing': 'foo'}, + {'Error': {'Code': 'RetryMe', 'Message': 'foo'}}, + {'Success': True, 'ResponseMetadata': {'HTTPStatusCode': 200}}, + {'NeverCalled': True}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + waiter.wait() + self.assertEqual(operation_method.call_count, 3) + + def test_kwargs_are_passed_through(self): + acceptors = [ + {'state': 'success', 'matcher': 'error', 'expected': 'MyError'}, + ] + config = self.create_waiter_config(acceptors=acceptors) + operation_method = mock.Mock() + self.client_responses_are( + {'Error': {'Code': 'MyError'}}, for_operation=operation_method + ) + waiter = Waiter('MyWaiter', config, operation_method) + waiter.wait(Foo='foo', Bar='bar', Baz='baz') + + operation_method.assert_called_with(Foo='foo', Bar='bar', Baz='baz') + + @mock.patch('time.sleep') + def test_waiter_honors_delay_time_between_retries(self, sleep_mock): + delay_time = 5 + config = self.create_waiter_config(delay=delay_time) + operation_method = mock.Mock() + self.client_responses_are( + # This is an unknown error that's not called out + # in any of the waiter config, so when the + # waiter encounters this response it will transition + # to the failure state. + {'Success': False}, + {'Success': False}, + {'Success': False}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + with self.assertRaises(WaiterError): + waiter.wait() + + # We attempt three times, which means we need to sleep + # twice, once before each subsequent request. + self.assertEqual(sleep_mock.call_count, 2) + sleep_mock.assert_called_with(delay_time) + + @mock.patch('time.sleep') + def test_waiter_invocation_config_honors_delay(self, sleep_mock): + config = self.create_waiter_config() + operation_method = mock.Mock() + self.client_responses_are( + {'Success': False}, + {'Success': False}, + {'Success': False}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + custom_delay = 3 + with self.assertRaises(WaiterError): + waiter.wait(WaiterConfig={'Delay': custom_delay}) + + # We attempt three times, which means we need to sleep + # twice, once before each subsequent request. + self.assertEqual(sleep_mock.call_count, 2) + sleep_mock.assert_called_with(custom_delay) + + def test_waiter_invocation_config_honors_max_attempts(self): + config = self.create_waiter_config() + operation_method = mock.Mock() + self.client_responses_are( + {'Success': False}, + {'Success': False}, + for_operation=operation_method, + ) + waiter = Waiter('MyWaiter', config, operation_method) + custom_max = 2 + with self.assertRaises(WaiterError): + waiter.wait(WaiterConfig={'MaxAttempts': custom_max}) + + self.assertEqual(operation_method.call_count, 2) + + +class TestCreateWaiter(unittest.TestCase): + def setUp(self): + self.waiter_config = { + 'version': 2, + 'waiters': { + 'WaiterName': { + 'operation': 'Foo', + 'delay': 1, + 'maxAttempts': 1, + 'acceptors': [], + }, + }, + } + self.waiter_model = WaiterModel(self.waiter_config) + self.service_json_model = { + 'metadata': {'serviceFullName': 'Amazon MyService'}, + 'operations': { + 'Foo': { + 'name': 'Foo', + 'input': {'shape': 'FooInputOutput'}, + 'output': {'shape': 'FooInputOutput'}, + } + }, + 'shapes': { + 'FooInputOutput': { + 'type': 'structure', + 'members': { + 'bar': { + 'shape': 'String', + 'documentation': 'Documents bar', + } + }, + }, + 'String': {'type': 'string'}, + }, + } + self.service_model = ServiceModel(self.service_json_model, 'myservice') + self.client = mock.Mock() + self.client.meta.service_model = self.service_model + + def test_can_create_waiter_from_client(self): + waiter_name = 'WaiterName' + waiter = create_waiter_with_client( + waiter_name, self.waiter_model, self.client + ) + self.assertIsInstance(waiter, Waiter) + + def test_waiter_class_name(self): + waiter_name = 'WaiterName' + waiter = create_waiter_with_client( + waiter_name, self.waiter_model, self.client + ) + self.assertEqual( + waiter.__class__.__name__, 'MyService.Waiter.WaiterName' + ) + + def test_waiter_help_documentation(self): + waiter_name = 'WaiterName' + waiter = create_waiter_with_client( + waiter_name, self.waiter_model, self.client + ) + with mock.patch('sys.stdout', io.StringIO()) as mock_stdout: + help(waiter.wait) + content = mock_stdout.getvalue() + lines = [ + ( + ' Polls :py:meth:`MyService.Client.foo` every 1 ' + 'seconds until a successful state is reached. An error ' + 'is raised after 1 failed checks.' + ), + ' **Request Syntax**', + ' ::', + ' waiter.wait(', + " bar='string'", + ' )', + ' :type bar: string', + ' :param bar: Documents bar', + ' :returns: None', + ] + for line in lines: + self.assertIn(line, content) + + +class TestOperationMethods(unittest.TestCase): + def test_normalized_op_method_makes_call(self): + client_method = mock.Mock() + op = NormalizedOperationMethod(client_method) + op(Foo='a', Bar='b') + + client_method.assert_called_with(Foo='a', Bar='b') + + def test_normalized_op_returns_error_response(self): + # Client objects normally throw exceptions when an error + # occurs, but we need to return the parsed error response. + client_method = mock.Mock() + op = NormalizedOperationMethod(client_method) + parsed_response = {'Error': {'Code': 'Foo', 'Message': 'bar'}} + exception = ClientError(parsed_response, 'OperationName') + client_method.side_effect = exception + actual_response = op(Foo='a', Bar='b') + self.assertEqual(actual_response, parsed_response) + + +class ServiceWaiterFunctionalTest(BaseEnvVar): + """ + This class is used as a base class if you want to functionally test the + waiters for a specific service. + """ + + def setUp(self): + super().setUp() + self.data_path = os.path.join( + os.path.dirname(botocore.__file__), 'data' + ) + self.environ['AWS_DATA_PATH'] = self.data_path + self.loader = Loader([self.data_path]) + + def get_waiter_model(self, service, api_version=None): + """Get the waiter model for the service.""" + with mock.patch( + 'botocore.loaders.Loader.list_available_services', + return_value=[service], + ): + return WaiterModel( + self.loader.load_service_model( + service, type_name='waiters-2', api_version=api_version + ) + ) + + def get_service_model(self, service, api_version=None): + """Get the service model for the service.""" + with mock.patch( + 'botocore.loaders.Loader.list_available_services', + return_value=[service], + ): + return ServiceModel( + self.loader.load_service_model( + service, type_name='service-2', api_version=api_version + ), + service_name=service, + ) + + +class CloudFrontWaitersTest(ServiceWaiterFunctionalTest): + def setUp(self): + super().setUp() + self.client = mock.Mock() + self.service = 'cloudfront' + self.old_api_versions = ['2014-05-31'] + + def assert_distribution_deployed_call_count(self, api_version=None): + waiter_name = 'DistributionDeployed' + waiter_model = self.get_waiter_model(self.service, api_version) + self.client.meta.service_model = self.get_service_model( + self.service, api_version + ) + self.client.get_distribution.side_effect = [ + {'Distribution': {'Status': 'Deployed'}} + ] + waiter = create_waiter_with_client( + waiter_name, waiter_model, self.client + ) + waiter.wait() + self.assertEqual(self.client.get_distribution.call_count, 1) + + def assert_invalidation_completed_call_count(self, api_version=None): + waiter_name = 'InvalidationCompleted' + waiter_model = self.get_waiter_model(self.service, api_version) + self.client.meta.service_model = self.get_service_model( + self.service, api_version + ) + self.client.get_invalidation.side_effect = [ + {'Invalidation': {'Status': 'Completed'}} + ] + waiter = create_waiter_with_client( + waiter_name, waiter_model, self.client + ) + waiter.wait() + self.assertEqual(self.client.get_invalidation.call_count, 1) + + def assert_streaming_distribution_deployed_call_count( + self, api_version=None + ): + waiter_name = 'StreamingDistributionDeployed' + waiter_model = self.get_waiter_model(self.service, api_version) + self.client.meta.service_model = self.get_service_model( + self.service, api_version + ) + self.client.get_streaming_distribution.side_effect = [ + {'StreamingDistribution': {'Status': 'Deployed'}} + ] + waiter = create_waiter_with_client( + waiter_name, waiter_model, self.client + ) + waiter.wait() + self.assertEqual(self.client.get_streaming_distribution.call_count, 1) + + def test_distribution_deployed(self): + # Test the latest version. + self.assert_distribution_deployed_call_count() + self.client.reset_mock() + + # Test previous api versions. + for api_version in self.old_api_versions: + self.assert_distribution_deployed_call_count(api_version) + self.client.reset_mock() + + def test_invalidation_completed(self): + # Test the latest version. + self.assert_invalidation_completed_call_count() + self.client.reset_mock() + + # Test previous api versions. + for api_version in self.old_api_versions: + self.assert_invalidation_completed_call_count(api_version) + self.client.reset_mock() + + def test_streaming_distribution_deployed(self): + # Test the latest version. + self.assert_streaming_distribution_deployed_call_count() + self.client.reset_mock() + + # Test previous api versions. + for api_version in self.old_api_versions: + self.assert_streaming_distribution_deployed_call_count(api_version) + self.client.reset_mock() diff --git a/testbed/boto__botocore/tox.ini b/testbed/boto__botocore/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..9014a42fe64d17fd5a28f77a67cbafadf8df102b --- /dev/null +++ b/testbed/boto__botocore/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py38,py39,py310,py311,py312 + +skipsdist = True + +[testenv] +commands = + {toxinidir}/scripts/ci/install + {toxinidir}/scripts/ci/run-tests diff --git a/testbed/cocotb__cocotb/.clang-format b/testbed/cocotb__cocotb/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..5e063acb82be70320c8583e2f4876636452c753a --- /dev/null +++ b/testbed/cocotb__cocotb/.clang-format @@ -0,0 +1,6 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause +BasedOnStyle: Google +IndentWidth: 4 +AccessModifierOffset: -2 diff --git a/testbed/cocotb__cocotb/.codecov.yml b/testbed/cocotb__cocotb/.codecov.yml new file mode 100644 index 0000000000000000000000000000000000000000..feae126f471d4bce7c657078e6ca65592a5eef39 --- /dev/null +++ b/testbed/cocotb__cocotb/.codecov.yml @@ -0,0 +1,27 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +# Codecov configuration +codecov: + notify: + # Codecov claims [1] to wait until all CI runs have completed, but that + # doesn't work for our CI setup, causing early reports to come in which + # indicate a drop in coverage. These reports are later updated as more + # reports come in. But by that time the first issue comment has already + # been made and an email has been sent. Prevent that by explicitly + # specifying the number of builds that need to be uploaded to codecov + # [2]. + # + # Keep this number in sync with the CI configuration! + # + # [1] https://docs.codecov.io/docs/merging-reports#how-does-codecov-know-when-to-send-notifications + # [2] https://docs.codecov.io/docs/notifications#preventing-notifications-until-after-n-builds + after_n_builds: 18 + +coverage: + status: + project: + default: + # Report a CI failure if coverage drops by more than 1 percent. + threshold: 1% diff --git a/testbed/cocotb__cocotb/.git-blame-ignore-revs b/testbed/cocotb__cocotb/.git-blame-ignore-revs new file mode 100644 index 0000000000000000000000000000000000000000..3289879f0f8199351afdcf7bf11a1e012b045ec6 --- /dev/null +++ b/testbed/cocotb__cocotb/.git-blame-ignore-revs @@ -0,0 +1,14 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +# The following command will configure your local git repo to ignore these commits +# when doing git-blame. +# git config blame.ignoreRevsFile .git-blame-ignore-revs + +# clang-format +78e69fa428477b73808d08aec0e6702a924497f8 +# black and isort +720b0e1071d0c720e61fa50fcb1813fd99198f20 +# ruff +eb254d7581b64e5384ee87f49d4363d72be6e20a diff --git a/testbed/cocotb__cocotb/.github/PULL_REQUEST_TEMPLATE.md b/testbed/cocotb__cocotb/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000000000000000000000000000000..23276dbff3481a576608c3e9256b51482e24494e --- /dev/null +++ b/testbed/cocotb__cocotb/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ + diff --git a/testbed/cocotb__cocotb/.github/dependabot.yml b/testbed/cocotb__cocotb/.github/dependabot.yml new file mode 100644 index 0000000000000000000000000000000000000000..6db8d3f4778036301a039032e7db76dcc5a88447 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/testbed/cocotb__cocotb/.github/generate-envs.py b/testbed/cocotb__cocotb/.github/generate-envs.py new file mode 100644 index 0000000000000000000000000000000000000000..2bfb837600c61d5b3fef8c06c342a47470386818 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/generate-envs.py @@ -0,0 +1,342 @@ +#!/usr/bin/env python3 +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +"""Get a list test environments.""" + +import argparse +import json +import sys + +ENVS = [ + # Test different Python versions with package managed Icarus on Ubuntu + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + # lowest version according to https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json + "os": "ubuntu-20.04", + "python-version": "3.6.7", + "group": "ci", + }, + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + # lowest version according to https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json + "os": "ubuntu-20.04", + "python-version": "3.7.1", + "group": "ci", + }, + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + "os": "ubuntu-20.04", + "python-version": "3.8", + "group": "ci", + }, + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + "os": "ubuntu-20.04", + "python-version": "3.9", + "group": "ci", + }, + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + "os": "ubuntu-20.04", + "python-version": "3.10", + "group": "ci", + }, + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + "os": "ubuntu-20.04", + "python-version": "3.11", + "group": "ci", + }, + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + "os": "ubuntu-20.04", + "python-version": "3.12", + "group": "ci", + }, + # A single test for the upcoming Python version. + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "apt", + "os": "ubuntu-20.04", + "python-version": "3.13.0-alpha - 3.13.0", + "group": "experimental", + }, + # Test Icarus on Ubuntu + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "master", + "os": "ubuntu-20.04", + "python-version": "3.8", + "group": "experimental", + }, + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "v12_0", # The latest release version. + "os": "ubuntu-20.04", + "python-version": "3.8", + "group": "experimental", + }, + # Test GHDL on Ubuntu + { + "lang": "vhdl", + "sim": "ghdl", + "sim-version": "v2.0.0", # GHDL 2.0 is the minimum supported version. + "os": "ubuntu-latest", + "python-version": "3.8", + "group": "ci", + }, + { + "lang": "vhdl", + "sim": "ghdl", + "sim-version": "master", + "os": "ubuntu-latest", + "python-version": "3.8", + "group": "experimental", + }, + # Test NVC on Ubuntu + { + "lang": "vhdl", + "sim": "nvc", + "sim-version": "r1.11.0", + "os": "ubuntu-latest", + "python-version": "3.8", + "group": "ci", + }, + # Test Verilator on Ubuntu + { + "lang": "verilog", + "sim": "verilator", + "sim-version": "8ea814e4b4ce7416188130647c87dea41401a5b6", + # Needs 22.04 for newer GCC with C++ coroutine support used with --timing mode + "os": "ubuntu-22.04", + "python-version": "3.8", + # Various cocotb tests are known to fail with Verilator. + # See also https://github.com/cocotb/cocotb/issues/3194 + "group": "ci", + }, + { + "lang": "verilog", + "sim": "verilator", + "sim-version": "master", + # Needs 22.04 for newer GCC with C++ coroutine support used with --timing mode + "os": "ubuntu-22.04", + "python-version": "3.8", + # Various cocotb tests are known to fail with Verilator. + # See also https://github.com/cocotb/cocotb/issues/3194 + "group": "experimental", + }, + # Test other OSes + # Icarus homebrew + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "homebrew-stable", + "os": "macos-11", + "python-version": "3.8", + "group": "ci", + }, + # Icarus homebrew (HEAD/master) + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "homebrew-HEAD", + "os": "macos-11", + "python-version": "3.8", + "group": "experimental", + }, + # Icarus windows from source + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "v12_0", + "os": "windows-latest", + "python-version": "3.8", + "toolchain": "mingw", + "extra-name": "mingw", + # mingw tests fail silently currently due to test harness limitations. + "group": "experimental", + }, + # use msvc instead of mingw + # { + # "lang": "verilog", + # "sim": "icarus", + # "sim-version": "v12_0", + # "os": "windows-latest", + # "python-version": "3.11", + # "toolchain": "msvc", + # "extra-name": "msvc", + # "group": "ci", + # }, + # Other + # use clang instead of gcc + { + "lang": "verilog", + "sim": "icarus", + "sim-version": "v12_0", + "os": "ubuntu-20.04", + "python-version": "3.8", + "cxx": "clang++", + "cc": "clang", + "extra-name": "clang", + "group": "ci", + }, + # Test Siemens Questa on Ubuntu + { + "lang": "verilog", + "sim": "questa", + "sim-version": "siemens/questa/2023.4", + "os": "ubuntu-20.04", + "self-hosted": True, + "python-version": "3.8", + "group": "ci", + }, + { + "lang": "vhdl and fli", + "sim": "questa", + "sim-version": "siemens/questa/2023.4", + "os": "ubuntu-20.04", + "self-hosted": True, + "python-version": "3.8", + "group": "ci", + }, + { + "lang": "vhdl and vhpi", + "sim": "questa", + "sim-version": "siemens/questa/2023.4", + "os": "ubuntu-20.04", + "self-hosted": True, + "python-version": "3.8", + "group": "ci", + }, + # Test Aldec Riviera-PRO on Ubuntu + { + "lang": "verilog", + "sim": "riviera", + "sim-version": "aldec/rivierapro/2023.10", + "os": "ubuntu-20.04", + "self-hosted": True, + "python-version": "3.8", + "group": "ci", + }, + { + "lang": "vhdl", + "sim": "riviera", + "sim-version": "aldec/rivierapro/2023.10", + "os": "ubuntu-20.04", + "self-hosted": True, + "python-version": "3.8", + "group": "ci", + }, + # Test Cadence Xcelium on Ubuntu + { + "lang": "verilog", + "sim": "xcelium", + "sim-version": "cadence/xcelium/2309", + "os": "ubuntu-20.04", + "self-hosted": True, + "python-version": "3.8", + "group": "ci", + }, + { + "lang": "vhdl", + "sim": "xcelium", + "sim-version": "cadence/xcelium/2309", + "os": "ubuntu-20.04", + "self-hosted": True, + "python-version": "3.8", + "group": "ci", + }, +] + + +def append_str_val(listref, my_list, key) -> None: + if key not in my_list: + return + listref.append(str(my_list[key])) + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--group") + parser.add_argument("--output-format", choices=("gha", "json"), default="json") + parser.add_argument( + "--gha-output-file", + type=argparse.FileType("a", encoding="utf-8"), + help="The $GITHUB_OUTPUT file.", + ) + + args = parser.parse_args() + + if args.group is not None and args.group != "": + selected_envs = [t for t in ENVS if "group" in t and t["group"] == args.group] + else: + # Return all tasks if no group is selected. + selected_envs = ENVS + + for env in selected_envs: + # The "runs-on" job attribute is a string if we're using the GitHub- + # provided hosted runners, or an array with special keys if we're + # using self-hosted runners. + if "self-hosted" in env and env["self-hosted"] and "runs-on" not in env: + env["runs-on"] = ["self-hosted", f"cocotb-private-{env['os']}"] + else: + env["runs-on"] = env["os"] + + # Assemble the human-readable name of the job. + name_parts = [] + append_str_val(name_parts, env, "extra-name") + append_str_val(name_parts, env, "sim") + if "/" in env["sim-version"]: + # Shorten versions like 'siemens/questa/2023.2' to '2023.2'. + name_parts.append(env["sim-version"].split("/")[-1]) + else: + name_parts.append(env["sim-version"]) + append_str_val(name_parts, env, "lang") + append_str_val(name_parts, env, "os") + append_str_val(name_parts, env, "python-version") + if "may-fail" in env and env["may-fail"]: + name_parts.append("May fail") + + env["name"] = "|".join(name_parts) + + if args.output_format == "gha": + # Output for GitHub Actions (GHA). Appends the configuration to + # the file named in the "--gha-output-file" argument. + + assert args.gha_output_file is not None + + # The generated JSON output may not contain newlines to be parsed by GHA + print(f"envs={json.dumps(selected_envs)}", file=args.gha_output_file) + + # Print the the selected environments for easier debugging. + print("Generated the following test configurations:") + print(json.dumps(selected_envs, indent=2)) + elif args.output_format == "json": + print(json.dumps(selected_envs, indent=2)) + else: + assert False + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/testbed/cocotb__cocotb/.github/issue_template.md b/testbed/cocotb__cocotb/.github/issue_template.md new file mode 100644 index 0000000000000000000000000000000000000000..99580e0c8d74bab2a698ef8a199eb493eb551912 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/issue_template.md @@ -0,0 +1,11 @@ + diff --git a/testbed/cocotb__cocotb/.github/workflows/benchmark.yml b/testbed/cocotb__cocotb/.github/workflows/benchmark.yml new file mode 100644 index 0000000000000000000000000000000000000000..dabd99ce4e5ae9ac35193b8398a1453ec635f6a6 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/benchmark.yml @@ -0,0 +1,79 @@ +name: Performance Benchmark +# adapted from https://github.com/benchmark-action/github-action-benchmark#charts-on-github-pages-1 + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + + tests: + + name: Python ${{matrix.python-version}} + runs-on: ubuntu-20.04 + + strategy: + fail-fast: false + matrix: + include: + - python-version: 3.8 + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{matrix.python-version}} + uses: actions/setup-python@v5 + with: + python-version: ${{matrix.python-version}} + + - name: Install Icarus Verilog + run: | + sudo apt-get install -y --no-install-recommends iverilog + + - name: Set up NVC (Ubuntu) + run: | + sudo apt-get install -y --no-install-recommends llvm-dev libdw-dev flex libzstd-dev pkg-config + git clone https://github.com/nickg/nvc.git + cd nvc + git reset --hard ${{matrix.sim-version}} + ./autogen.sh + mkdir build + cd build + ../configure + make -j $(nproc) + sudo make install + + - name: Run benchmark + run: | + pip install pytest pytest-benchmark + pip install . + pytest -c /dev/null tests/benchmark.py --benchmark-json output.json + + # Pushing the benchmark requires elevated permissions to the + # cocotb/cocotb-benchmark-results repository, which we only grant for + # master builds, not for PR builds. + - name: Generate a token to access cocotb/cocotb-benchmark-results + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + id: generate_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.COCOTB_CI_REPOACCESS_APP_ID }} + private-key: ${{ secrets.COCOTB_CI_REPOACCESS_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: cocotb-benchmark-results + + - name: Store benchmark result + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: benchmark-action/github-action-benchmark@v1 + continue-on-error: true + with: + tool: 'pytest' + output-file-path: output.json + alert-threshold: '120%' + fail-on-alert: true + github-token: ${{ steps.generate_token.outputs.token }} + auto-push: true + gh-repository: 'github.com/cocotb/cocotb-benchmark-results' diff --git a/testbed/cocotb__cocotb/.github/workflows/build-test-dev.yml b/testbed/cocotb__cocotb/.github/workflows/build-test-dev.yml new file mode 100644 index 0000000000000000000000000000000000000000..ae8b500b29c2b3c042036d72b49f8c935bf34a87 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/build-test-dev.yml @@ -0,0 +1,26 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +name: CI + +on: + # Run this workflow on every push to the master branch, or a stable branch. + push: + branches: + - master + - "stable/**" + pull_request: + branches: + - master + - 'stable/**' + +jobs: + test_dev: + name: Regression Tests + uses: ./.github/workflows/regression-tests.yml + with: + nox_session_test_sim: dev_test_sim + nox_session_test_nosim: dev_test_nosim + collect_coverage: true + group: ci diff --git a/testbed/cocotb__cocotb/.github/workflows/build-test-release.yml b/testbed/cocotb__cocotb/.github/workflows/build-test-release.yml new file mode 100644 index 0000000000000000000000000000000000000000..dc00aca639300f8618ac04be9cff11462f50e16b --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/build-test-release.yml @@ -0,0 +1,98 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +name: Release + +on: + # Run this workflow on every push to master or to a stable branch. + push: + branches: + - master + - "stable/**" + tags: + - 'v*' + +jobs: + build_release: + name: Build distribution on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # Keep going even if one matrix build fails. + matrix: + os: + - ubuntu-22.04 + - windows-2022 + - macos-12 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install nox + run: python3 -m pip install nox + + # Use the cibuildwheel configuration inside nox, instead of the + # cibuildwheel GitHub Action, to make the process easy to reproduce + # locally. + - name: Build cocotb release + run: nox -s release_build + + - uses: actions/upload-artifact@v4 + with: + name: cocotb-dist-${{ matrix.os }} + path: | + dist/*.whl + dist/*.tar.gz + + test_sdist: + name: Test the source distribution (sdist) + needs: build_release + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/download-artifact@v4 + with: + path: dist + pattern: cocotb-dist-* + merge-multiple: true + - name: Install nox + run: python3 -m pip install nox + - name: Smoke-test the sdist + run: nox -s release_test_sdist + + test_release: + name: Regression Tests + needs: build_release + uses: ./.github/workflows/regression-tests.yml + with: + nox_session_test_sim: release_test_sim + nox_session_test_nosim: release_test_nosim + download_artifacts: true + group: ci + + deploy_pypi: + name: Deploy to pypi.org + needs: + - test_release + - test_sdist + runs-on: ubuntu-22.04 + # Only upload tagged releases. + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/download-artifact@v4 + with: + path: dist + pattern: cocotb-dist-* + merge-multiple: true + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/testbed/cocotb__cocotb/.github/workflows/ecosystem-compat.yml b/testbed/cocotb__cocotb/.github/workflows/ecosystem-compat.yml new file mode 100644 index 0000000000000000000000000000000000000000..c65dd01d5ed0795737c80c28fc6ce4bbdafa134b --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/ecosystem-compat.yml @@ -0,0 +1,59 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +# Tests to ensure that projects depending on cocotb continue to work with the +# latest development version of cocotb. +# +# Generally, we test the development version of cocotb against supported, +# released versions of the other projects. (It is expected that the projects +# themselves test their in-development code against the released version of +# cocotb.) + +name: Ecosystem compatibility tests + +on: + # Run daily at midnight (UTC). + schedule: + - cron: '0 0 * * *' + # Allow triggering a CI run from the web UI. + workflow_dispatch: + +jobs: + cocotb-coverage: + name: Test cocotb-coverage 1.2 + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install Icarus Verilog + run: sudo apt-get install -y --no-install-recommends iverilog + + - name: Checkout cocotb repository + uses: actions/checkout@v4 + with: + path: cocotb + + - name: Install the development version of cocotb + run: pip3 install ./cocotb + + - name: Checkout cocotb-coverage repository + uses: actions/checkout@v4 + with: + repository: mciepluc/cocotb-coverage + path: cocotb-coverage + + - name: Install the release version of cocotb-coverage + run: pip3 install cocotb-coverage==1.2 + + - name: Run tests + # Don't run tests through tox (as present in cocotb-coverage) to be able + # to override the cocotb dependency. + run: | + pip3 install pytest + cd cocotb-coverage + export SIM=icarus + make -k -C tests diff --git a/testbed/cocotb__cocotb/.github/workflows/experimental.yml b/testbed/cocotb__cocotb/.github/workflows/experimental.yml new file mode 100644 index 0000000000000000000000000000000000000000..7b326e790e93feb583e6f1eec519fae83b9a8b02 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/experimental.yml @@ -0,0 +1,25 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +# A workflow where the tool is the moving target, or the tool is known to be +# not fully supported by cocotb, but we still want to see how its support +# evolves over time. + +name: Test experimental tool versions + +on: + # Run every Monday at 2am (UTC). + schedule: + - cron: '0 2 * * 1' + # Allow triggering a CI run from the web UI. + workflow_dispatch: + +jobs: + test_dev: + name: Regression Tests + uses: ./.github/workflows/regression-tests.yml + with: + nox_session_test_sim: dev_test_sim + nox_session_test_nosim: dev_test_nosim + group: experimental diff --git a/testbed/cocotb__cocotb/.github/workflows/lint.yml b/testbed/cocotb__cocotb/.github/workflows/lint.yml new file mode 100644 index 0000000000000000000000000000000000000000..4809beb063b016a9f8fcf4eb02850c6ee06a8e56 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +name: Lint + +on: + pull_request: + branches: + - master + - 'stable/**' + +jobs: + + lint-pre-commit: + runs-on: ubuntu-latest + name: pre-commit + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: pre-commit + run: | + pip install pre-commit + pre-commit run -a --show-diff-on-failure diff --git a/testbed/cocotb__cocotb/.github/workflows/pre-commit-autoupdate.yml b/testbed/cocotb__cocotb/.github/workflows/pre-commit-autoupdate.yml new file mode 100644 index 0000000000000000000000000000000000000000..317bce5efb58d988a0794a3bb52550b5d6d4ecb6 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/pre-commit-autoupdate.yml @@ -0,0 +1,35 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +name: "Update pre-commit hooks" + +on: + schedule: + - cron: "00 03 * * *" + +jobs: + update-pre-commit-hooks: + name: Update pre-commit hooks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Update pre-commit hooks + run: | + pip install pre-commit + pre-commit autoupdate + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + author: "github-actions[bot] " + commit-message: "Update pre-commit hooks" + branch: update-pre-commit + title: "Update pre-commit hooks" + body: | + Update pre-commit hooks to most recent versions + reviewers: | + cocotb/maintainers diff --git a/testbed/cocotb__cocotb/.github/workflows/regression-tests.yml b/testbed/cocotb__cocotb/.github/workflows/regression-tests.yml new file mode 100644 index 0000000000000000000000000000000000000000..4ef88dcc634ab87cb0849fb8911c74e1a63e0d99 --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/regression-tests.yml @@ -0,0 +1,239 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause +name: Regression Tests + +on: + workflow_call: + inputs: + nox_session_test_sim: + required: true + type: string + default: dev_test_sim + nox_session_test_nosim: + required: true + type: string + default: dev_test_nosim + collect_coverage: + required: false + type: boolean + default: false + download_artifacts: + required: false + type: boolean + default: false + group: + required: false + type: string + default: "ci" + description: Group of environments to run the tests against. Leave empty to run them all. + +jobs: + + generate_envs: + runs-on: ubuntu-latest + name: Generate a list of environments to run tests against + steps: + - uses: actions/checkout@v4 + - run: ./.github/generate-envs.py --output-format=gha --gha-output-file="$GITHUB_OUTPUT" --group="${{inputs.group}}" + id: run_generate_script + outputs: + envs: ${{ steps.run_generate_script.outputs.envs }} + + tests: + + needs: generate_envs + + name: ${{matrix.name}} + runs-on: ${{matrix.runs-on}} + env: + SIM: ${{matrix.sim}} + TOPLEVEL_LANG: ${{matrix.lang}} + CXX: ${{matrix.cxx || 'g++'}} + CC: ${{matrix.cc || 'gcc'}} + OS: ${{matrix.os}} + PYTHON_VERSION: ${{matrix.python-version}} + + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.generate_envs.outputs.envs) }} + + steps: + - uses: actions/checkout@v4 + with: + # GitHub PR's create a merge commit, and Actions are run on that commit. + # Codecov's uploader needs the previous commit (tip of PR branch) to associate coverage correctly. + # A fetch depth of 2 provides enough information without fetching the entire history. + fetch-depth: 2 + + # Download distribution artifacts (if any). + - uses: actions/download-artifact@v4 + with: + path: dist + pattern: cocotb-dist-* + merge-multiple: true + if: ${{ inputs.download_artifacts }} + + # Install Python + - name: Set up Python ${{matrix.python-version}} + if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') + uses: actions/setup-python@v5 + with: + python-version: ${{matrix.python-version}} + - name: Set up Anaconda ${{matrix.python-version}} (Windows) + if: startsWith(matrix.os, 'windows') + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + # Use base environment to properly import _sqlite3 DLL - see gh-3166 + activate-environment: "" + - name: Set up python version for Anaconda (base) ${{matrix.python-version}} (Windows) + if: startsWith(matrix.os, 'windows') + run: conda install --yes python=${{matrix.python-version}} + + # Run tests that don't need a simulator. + - name: Install Python testing dependencies + run: | + pip install nox + - name: Run tests without simulators + run: nox -s "${{ inputs.nox_session_test_nosim }}" + continue-on-error: ${{matrix.may-fail || false}} + + # Install Icarus + - name: Set up Icarus (Ubuntu - apt) + if: startsWith(matrix.os, 'ubuntu') && matrix.sim == 'icarus' && matrix.sim-version == 'apt' + run: | + sudo apt-get install -y --no-install-recommends iverilog + - name: Set up Icarus (Ubuntu - source) + if: startsWith(matrix.os, 'ubuntu') && matrix.sim == 'icarus' && matrix.sim-version != 'apt' + run: | + sudo apt-get install -y --no-install-recommends g++ gperf flex bison make autoconf + git clone https://github.com/steveicarus/iverilog.git + cd iverilog + git reset --hard ${{matrix.sim-version}} + bash ./autoconf.sh + bash ./configure + make -j $(nproc) + sudo make install + - name: Set up Icarus (Windows - source) + if: startsWith(matrix.os, 'windows') && matrix.sim == 'icarus' + run: | + conda install -c msys2 m2-base m2-make m2-autoconf m2-flex m2-bison m2-gperf m2w64-toolchain + git clone https://github.com/steveicarus/iverilog.git + cd iverilog + git reset --hard ${{matrix.sim-version}} + bash ./autoconf.sh + bash ./configure --host=x86_64-w64-mingw32 --prefix=/c/iverilog + make -j $(nproc) + make install + echo "C:\iverilog\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + - name: Set up Icarus (MacOS - homebrew --HEAD) + if: startsWith(matrix.os, 'macos') && matrix.sim == 'icarus' && matrix.sim-version == 'homebrew-HEAD' + run: | + brew install icarus-verilog --HEAD + - name: Set up Icarus (MacOS - homebrew) + if: startsWith(matrix.os, 'macos') && matrix.sim == 'icarus' && matrix.sim-version == 'homebrew-stable' + run: | + brew install icarus-verilog + + # Install GHDL + - name: Set up GHDL (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') && matrix.sim == 'ghdl' + run: | + sudo apt update + sudo apt-get install -y --no-install-recommends gnat + git clone https://github.com/ghdl/ghdl.git + cd ghdl + git reset --hard ${{matrix.sim-version}} + mkdir build + cd build + ../configure + make -j $(nproc) + sudo make install + + # Install NVC + - name: Set up NVC (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') && matrix.sim == 'nvc' + run: | + sudo apt-get install -y --no-install-recommends llvm-dev libdw-dev flex + git clone --depth=1 --no-single-branch https://github.com/nickg/nvc.git + cd nvc + git reset --hard ${{matrix.sim-version}} + ./autogen.sh + mkdir build + cd build + ../configure + make -j $(nproc) + sudo make install + + # Install Verilator + - name: Set up Verilator (Ubunutu - source) + if: startsWith(matrix.os, 'ubuntu') && matrix.sim == 'verilator' + run: | + sudo apt-get install -y --no-install-recommends help2man make g++ perl python3 autoconf flex bison libfl2 libfl-dev zlib1g zlib1g-dev + git clone https://github.com/verilator/verilator.git + cd verilator + git reset --hard ${{matrix.sim-version}} + autoconf + ./configure + make -j $(nproc) + sudo make install + + # Windows Testing + - name: Install cocotb build dependencies (Windows, mingw) + if: startsWith(matrix.os, 'windows') && matrix.toolchain == 'mingw' + run: conda install --yes -c msys2 m2-base m2-make m2w64-toolchain libpython + - name: Install cocotb runtime dependencies (Windows, msvc) + if: startsWith(matrix.os, 'windows') && matrix.toolchain == 'msvc' + run: conda install --yes -c msys2 m2-base m2-make + - name: Test (Windows) + if: startsWith(matrix.os, 'windows') + id: windowstesting + continue-on-error: ${{matrix.may-fail || false}} + timeout-minutes: 20 + # Virtual environments don't work on Windows with cocotb. Avoid using them + # in nox testing. + run: | + nox --no-venv -k "${{ inputs.nox_session_test_sim }} and ${{ matrix.sim }} and ${{ matrix.lang }}" + + # Ubuntu / MacOS Testing + - name: Install cocotb build dependencies (Ubuntu - g++) + if: startsWith(matrix.os, 'ubuntu') && (!matrix.cxx || matrix.cxx == 'g++') + run: | + sudo apt-get install g++ + - name: Install cocotb build dependencies (Ubuntu - clang++) + if: startsWith(matrix.os, 'ubuntu') && matrix.cxx == 'clang++' + run: | + sudo apt-get install clang + - name: Install cocotb build dependencies (MacOS) + if: startsWith(matrix.os, 'macos') + run: | + g++ --version + - name: Test (Ubuntu, MacOS) + id: unixtesting + if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') + continue-on-error: ${{matrix.may-fail || false}} + timeout-minutes: 30 + run: | + if [ "${{matrix.self-hosted}}" == "true" ]; then + module load "${{ matrix.sim-version }}" + fi + nox -k "${{ inputs.nox_session_test_sim }} and ${{ matrix.sim }} and ${{ matrix.lang }}" + + # codecov + - name: Combine and report coverage + if: inputs.collect_coverage + run: nox -s dev_coverage_combine + + - name: Upload to codecov + if: inputs.collect_coverage + uses: codecov/codecov-action@v3 + env: + # https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 + CODECOV_TOKEN: 669f2048-851e-479e-a618-8fa64f3736cc + with: + files: .python_coverage.xml,.cpp_coverage.xml + name: ${{ matrix.name }} + env_vars: SIM,TOPLEVEL_LANG,CXX,OS,PYTHON_VERSION + verbose: true diff --git a/testbed/cocotb__cocotb/.github/workflows/stale.yml b/testbed/cocotb__cocotb/.github/workflows/stale.yml new file mode 100644 index 0000000000000000000000000000000000000000..e2e4b21fdb07040866acbc0f7ccd1dd6f54e802d --- /dev/null +++ b/testbed/cocotb__cocotb/.github/workflows/stale.yml @@ -0,0 +1,32 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +name: "Stale Questions" +on: + schedule: + - cron: "00 02 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + repo-token: ${{secrets.GITHUB_TOKEN}} + days-before-stale: 30 + days-before-close: 7 + stale-issue-message: > + Has your question been resolved? If so please close this issue. + If it has not been resolved, you may need to provide more information. + If no more activity on this issue occurs in 7 days, it will be closed. + stale-issue-label: "status:stale" + stale-pr-message: > + Are you still actively working on this pull request? + You may have requested changes that need to be addressed. + If the maintainers aren't being timely with a review, we apologize. + Please bump this pull request to keep it alive. + If no more activity on this pull request occurs in 7 days, it will be closed. + stale-pr-label: "status:stale" + any-of-labels: "type:question,status:close?,status:needs-info" + operations-per-run: 30 diff --git a/testbed/cocotb__cocotb/.gitignore b/testbed/cocotb__cocotb/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d02f3b1704cf20b912cc60bd68ba22eb3ae78ca8 --- /dev/null +++ b/testbed/cocotb__cocotb/.gitignore @@ -0,0 +1,114 @@ +*.py[cod] + +# C extensions +*.so +*.dll + +# C objects +*.o + +# Python and C++ code coverage +.coverage +.coverage.cocotb +*.gcno +*.gcda +*.gcov +*.xml + +# Packaging +*.egg +*.egg-info +dist +build +eggs +parts +sdist +obj +develop-eggs +.installed.cfg +__pycache__ +.tox +.nox +.eggs + +# Vim tmp files +*.swp +*~ + +# VSCode project files +.vscode/ +*.code-workspace + +# Emacs tmp files +\#*\# +\.\#* + +# Mergetool tmp files +*.orig +*.bak + +# Waveforms +*.vcd +*.fst +*.fst.hier + +# Results +results.xml +combined_results.xml + +# Debuggers +.gdb_history + +# VCS files +*.tab +sim_build +ucli.key + +# Pytest +.pytest_cache + +# Cadence Incisive/Xcelium +*.elog +irun.log +xrun.log +irun.key +xrun.key +irun.history +xrun.history +INCA_libs +xcelium.d +ncelab_*.err +xmelab_*.err +ncsim_*.err +xmsim_*.err +bpad_*.err +.bpad/ +.simvision/ +waves.shm/ + +# Interface libraries built on setup +src/cocotb/libs +pip-wheel-metadata/ + +# Mentor Modelsim/Questa +tests/test_cases/*/modelsim.ini +tests/test_cases/*/transcript +examples/*/tests/modelsim.ini +examples/*/tests/transcript +*.wlf + +# Riviera +tests/test_cases/*/library.cfg +tests/test_cases/*/dataset.asdb +tests/test_cases/*/compile +examples/*/tests/library.cfg +examples/*/tests/dataset.asdb +examples/*/tests/compile + +# Tachyon DA CVC +tests/test_cases/*/verilog.log +examples/*/tests/verilog.log + +# Build artifacts +/dist/ +src/cocotb/_version.py diff --git a/testbed/cocotb__cocotb/.gitpod.yml b/testbed/cocotb__cocotb/.gitpod.yml new file mode 100644 index 0000000000000000000000000000000000000000..cd666989261374e27ff8b293c5526c84d0c9aa16 --- /dev/null +++ b/testbed/cocotb__cocotb/.gitpod.yml @@ -0,0 +1,39 @@ +image: + file: .gitpod.Dockerfile + +tasks: + - before: > + pip3 install -e . && + export COCOTB_REDUCED_LOG_FMT=1 + init: > + gp preview https://docs.cocotb.org/ && + cd /workspace/cocotb/examples/simple_dff && + gp open dff.sv && + gp open dff.vhdl && + gp open Makefile && + gp open test_dff.py && + make SIM=icarus && + EXTRA_ARGS="--trace-fst --trace-structs" make SIM=verilator && + gtkwave dump.fst --rcvar 'initial_window_x 1920' --rcvar 'initial_window_y 1061' --rcvar 'do_initial_zoom_fit yes' & + command: > + cd /workspace/cocotb/examples/simple_dff ; + history -s make SIM=cvc ; + history -s make SIM=ghdl TOPLEVEL_LANG=vhdl ; + history -s make SIM=icarus ; + history -s EXTRA_ARGS=\"--trace-fst --trace-structs\" make SIM=verilator ; + history -s gtkwave dump.fst --rcvar \'initial_window_x 1920\' --rcvar \'initial_window_y 1061\' --rcvar \'do_initial_zoom_fit yes\' ; + history -d 3 + +# NOTE: the geometry for gtkwave's fullscreen size can be found with xwininfo -root + +# https://www.gitpod.io/docs/config-ports/ +ports: + - port: 6080 # VNC for e.g. gtkwave + onOpen: notify + - port: 5900 + onOpen: ignore + +vscode: + extensions: + - mshr-h.veriloghdl@1.0.6:RPslnvyzniF7C66mxHT+Hg== + - vhdlwhiz.vhdl-by-vhdlwhiz@1.2.10:fJXQenGkzoZwUN/RddpuSw== diff --git a/testbed/cocotb__cocotb/.pre-commit-config.yaml b/testbed/cocotb__cocotb/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eee68bb5d9a441c2c754ab9e70727e35501e1e3c --- /dev/null +++ b/testbed/cocotb__cocotb/.pre-commit-config.yaml @@ -0,0 +1,34 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +exclude: "^.*/_vendor/" +repos: +# ruff with --fix should run before other formatting tools +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.2.1" + hooks: + # Run the linter. + - id: "ruff" + args: + - "--fix" + - "--exit-non-zero-on-fix" + # Run the formatter. + - id: ruff-format + +- repo: "https://github.com/pre-commit/mirrors-clang-format" + rev: "v17.0.6" + hooks: + - id: "clang-format" + exclude: "^src/cocotb/share/include/(sv_vpi|vhpi|vpi)_user(_ext)?.h" + types_or: [c, c++] + +- repo: "https://github.com/pre-commit/pre-commit-hooks" + rev: "v4.5.0" + hooks: + - id: "trailing-whitespace" + - id: "mixed-line-ending" + args: + - "--fix=lf" + - id: "end-of-file-fixer" + exclude: "^docs/source/diagrams/(svg|xml)/" diff --git a/testbed/cocotb__cocotb/.pylintrc b/testbed/cocotb__cocotb/.pylintrc new file mode 100644 index 0000000000000000000000000000000000000000..79c0abf4939c98d87203d7b895b885d93aaceb1e --- /dev/null +++ b/testbed/cocotb__cocotb/.pylintrc @@ -0,0 +1,528 @@ +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-whitelist=cocotb.simulator + +# Specify a score threshold to be exceeded before program exits with error. +fail-under=10.0 + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use. +jobs=0 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=no-member, + invalid-name, + too-many-locals, + too-many-nested-blocks, + too-many-instance-attributes, + too-many-arguments, + too-many-statements, + too-many-branches, + pointless-statement, + logging-not-lazy, + logging-format-interpolation, + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=c-extension-no-member + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'error', 'warning', 'refactor', and 'convention' +# which contain the number of messages in each category, as well as 'statement' +# which is the total number of statements analyzed. This score is used by the +# global evaluation report (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. +#argument-rgx= + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. +#class-attribute-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. +#variable-rgx= + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=120 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +#notes-rgx= + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it work, +# install the python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make, + _coro, + _trigger, + _outcome, + _advance, + _wait, + _name, + _id, + _library_coverage, + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=cls + + +[DESIGN] + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled). +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled). +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "BaseException, Exception". +overgeneral-exceptions=BaseException, + Exception diff --git a/testbed/cocotb__cocotb/.readthedocs.yml b/testbed/cocotb__cocotb/.readthedocs.yml new file mode 100644 index 0000000000000000000000000000000000000000..af2d3b0a88833dc851b905ccce13ff1ef6720fcd --- /dev/null +++ b/testbed/cocotb__cocotb/.readthedocs.yml @@ -0,0 +1,23 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + apt_packages: + - graphviz + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . + extra_requirements: + - bus + +sphinx: + configuration: docs/source/conf.py diff --git a/testbed/cocotb__cocotb/.theia/settings.json b/testbed/cocotb__cocotb/.theia/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..710824dc6433664a64421da4b4cdf653279d1589 --- /dev/null +++ b/testbed/cocotb__cocotb/.theia/settings.json @@ -0,0 +1,4 @@ +{ + // show leading and trailing whitespace + "editor.renderWhitespace": "boundary" +} diff --git a/testbed/cocotb__cocotb/LICENSE b/testbed/cocotb__cocotb/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ac27783d22bfc9b626583e7be5a405ed27151dd0 --- /dev/null +++ b/testbed/cocotb__cocotb/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2013 Potential Ventures Ltd +Copyright (c) 2013 SolarFlare Communications Inc +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL POTENTIAL VENTURES LTD BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/testbed/cocotb__cocotb/MANIFEST.in b/testbed/cocotb__cocotb/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..e2cd4678c38be8048f5707fdc966273ed16e2a85 --- /dev/null +++ b/testbed/cocotb__cocotb/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include src/cocotb/share * +recursive-include src/cocotb/_vendor * +include README.md +include LICENSE +include cocotb_build_libs.py diff --git a/testbed/cocotb__cocotb/Makefile b/testbed/cocotb__cocotb/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..e62084c7cb14fdb9436179ddc8d283e0e858d9ad --- /dev/null +++ b/testbed/cocotb__cocotb/Makefile @@ -0,0 +1,78 @@ +############################################################################### +# Copyright (c) 2013 Potential Ventures Ltd +# Copyright (c) 2013 SolarFlare Communications Inc +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Potential Ventures Ltd, +# SolarFlare Communications Inc nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL POTENTIAL VENTURES LTD BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +############################################################################### + +.PHONY: all +all: test + +.PHONY: clean +clean: + -@find . -name "obj" -exec rm -rf {} + + -@find . -name "*.pyc" -delete + -@find . -name "*results.xml" -delete + $(MAKE) -C examples clean + $(MAKE) -C tests clean + +.PHONY: do_tests +do_tests:: + $(MAKE) -k -C tests +do_tests:: + $(MAKE) -k -C examples + +# For Jenkins we use the exit code to detect compile errors or catastrophic +# failures and the XML to track test results +.PHONY: jenkins +jenkins: do_tests + ./bin/combine_results.py --suppress_rc --testsuites_name=cocotb_regression + +# By default want the exit code to indicate the test results +.PHONY: test +test: + $(MAKE) do_tests; ret=$$?; ./bin/combine_results.py && exit $$ret + +COCOTB_MAKEFILES_DIR = $(realpath $(shell cocotb-config --makefiles)) +AVAILABLE_SIMULATORS = $(patsubst .%,%,$(suffix $(wildcard $(COCOTB_MAKEFILES_DIR)/simulators/Makefile.*))) + +.PHONY: help +help: + @echo "" + @echo "This cocotb makefile has the following targets" + @echo "" + @echo "all, test - run regression producing combined_results.xml" + @echo " (return error code produced by sub-makes)" + @echo "jenkins - run regression producing combined_results.xml" + @echo " (return error code 1 if any failure was found)" + @echo "clean - remove build directory and all simulation artefacts" + @echo "" + @echo "The default simulator is Icarus Verilog." + @echo "To use another, set the environment variable SIM as below." + @echo "Available simulators:" + @for X in $(sort $(AVAILABLE_SIMULATORS)); do \ + echo export SIM=$$X; \ + done + @echo "" diff --git a/testbed/cocotb__cocotb/README.md b/testbed/cocotb__cocotb/README.md new file mode 100644 index 0000000000000000000000000000000000000000..97c75add51403484444668d325908d8266f8b925 --- /dev/null +++ b/testbed/cocotb__cocotb/README.md @@ -0,0 +1,134 @@ +**cocotb** is a coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python. + +[![Documentation Status](https://readthedocs.org/projects/cocotb/badge/?version=latest)](https://docs.cocotb.org/en/latest/) +[![CI](https://github.com/cocotb/cocotb/actions/workflows/build-test-dev.yml/badge.svg?branch=master)](https://github.com/cocotb/cocotb/actions/workflows/build-test-dev.yml) +[![PyPI](https://img.shields.io/pypi/dm/cocotb.svg?label=PyPI%20downloads)](https://pypi.org/project/cocotb/) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/cocotb/cocotb) +[![codecov](https://codecov.io/gh/cocotb/cocotb/branch/master/graph/badge.svg)](https://codecov.io/gh/cocotb/cocotb) + +* Read the [documentation](https://docs.cocotb.org) +* Get involved: + * [Raise a bug / request an enhancement](https://github.com/cocotb/cocotb/issues/new) (Requires a GitHub account) + * [Join the Gitter chat room](https://gitter.im/cocotb/Lobby) + +**Note: The current `master` branch of the cocotb repository is expected to be released as cocotb 2.0, which contains API-breaking changes from previous 1.x releases. Please use the `stable/1.8` branch if you're building cocotb from source, or just [install it from PyPi](https://pypi.org/project/cocotb/).** + +## Installation + +The current stable version of cocotb requires: + +- Python 3.6+ +- GNU Make 3+ +- An HDL simulator (such as [Icarus Verilog](https://docs.cocotb.org/en/stable/simulator_support.html#icarus-verilog), +[Verilator](https://docs.cocotb.org/en/stable/simulator_support.html#verilator), +[GHDL](https://docs.cocotb.org/en/stable/simulator_support.html#ghdl) or +[other simulator](https://docs.cocotb.org/en/stable/simulator_support.html)) + +After installing these dependencies, the latest stable version of cocotb can be installed with pip. + +```command +pip install cocotb +``` + +For more details on installation, including prerequisites, +see [the documentation](https://docs.cocotb.org/en/stable/install.html). + +For details on how to install the *development* version of cocotb, +see [the preliminary documentation of the future release](https://docs.cocotb.org/en/latest/install_devel.html#install-devel). + +## Usage + +As a first trivial introduction to cocotb, the following example "tests" a flip-flop. + +First, we need a hardware design which we can test. For this example, create a file `dff.sv` with SystemVerilog code for a simple [D flip-flop](https://en.wikipedia.org/wiki/Flip-flop_(electronics)#D_flip-flop). You could also use any other language a [cocotb-supported simulator](https://docs.cocotb.org/en/stable/simulator_support.html) understands, e.g. VHDL. + +```systemverilog +// dff.sv + +`timescale 1us/1ns + +module dff ( + output logic q, + input logic clk, d +); + +always @(posedge clk) begin + q <= d; +end + +endmodule +``` + +An example of a simple randomized cocotb testbench: + +```python +# test_dff.py + +import random + +import cocotb +from cocotb.clock import Clock +from cocotb.triggers import RisingEdge +from cocotb.types import LogicArray + +@cocotb.test() +async def dff_simple_test(dut): + """Test that d propagates to q""" + + # Assert initial output is unknown + assert LogicArray(dut.q.value) == LogicArray("X") + # Set initial input value to prevent it from floating + dut.d.value = 0 + + clock = Clock(dut.clk, 10, units="us") # Create a 10us period clock on port clk + # Start the clock. Start it low to avoid issues on the first RisingEdge + cocotb.start_soon(clock.start(start_high=False)) + + # Synchronize with the clock. This will regisiter the initial `d` value + await RisingEdge(dut.clk) + expected_val = 0 # Matches initial input value + for i in range(10): + val = random.randint(0, 1) + dut.d.value = val # Assign the random value val to the input port d + await RisingEdge(dut.clk) + assert dut.q.value == expected_val, f"output q was incorrect on the {i}th cycle" + expected_val = val # Save random value for next RisingEdge + + # Check the final input on the next clock + await RisingEdge(dut.clk) + assert dut.q.value == expected_val, "output q was incorrect on the last cycle" +``` + +A simple Makefile: + +```make +# Makefile + +TOPLEVEL_LANG = verilog +VERILOG_SOURCES = $(shell pwd)/dff.sv +TOPLEVEL = dff +MODULE = test_dff + +include $(shell cocotb-config --makefiles)/Makefile.sim +``` + +In order to run the test with Icarus Verilog, execute: + +```command +make SIM=icarus +``` + +[![asciicast](https://asciinema.org/a/317220.svg)](https://asciinema.org/a/317220) + +For more information please see the [cocotb documentation](https://docs.cocotb.org/) +and [our wiki](https://github.com/cocotb/cocotb/wiki). + +## Tutorials, examples and related projects + +* the tutorial section [in the official documentation](https://docs.cocotb.org/) +* [cocotb-bus](https://github.com/cocotb/cocotb-bus) for pre-packaged testbenching tools and reusable bus interfaces. +* [cocotb-based USB 1.1 test suite](https://github.com/antmicro/usb-test-suite-build) for FPGA IP, with testbenches for a variety of open source USB cores +* [`cocotb-coverage`](https://github.com/mciepluc/cocotb-coverage), an extension for Functional Coverage and Constrained Randomization +* [`uvm-python`](https://github.com/tpoikela/uvm-python), an almost 1:1 port of UVM 1.2 to Python +* our wiki [on extension modules](https://github.com/cocotb/cocotb/wiki/Further-Resources#extension-modules-cocotbext) +* the list of [GitHub projects depending on cocotb](https://github.com/cocotb/cocotb/network/dependents) diff --git a/testbed/cocotb__cocotb/bin/combine_results.py b/testbed/cocotb__cocotb/bin/combine_results.py new file mode 100644 index 0000000000000000000000000000000000000000..4d1c229fc096bc8874c27bbba61a35f5b88cbc6b --- /dev/null +++ b/testbed/cocotb__cocotb/bin/combine_results.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python +""" +Simple script to combine JUnit test results into a single XML file. + +Useful for Jenkins. +""" + +import argparse +import os +import sys +from xml.etree import ElementTree as ET + + +def find_all(name, path): + for root, dirs, files in os.walk(path): + if name in files: + yield os.path.join(root, name) + + +def get_parser(): + """Return the cmdline parser""" + parser = argparse.ArgumentParser( + description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + + parser.add_argument( + "--directory", + dest="directory", + type=str, + required=False, + default=".", + help="Name of base directory to search from", + ) + + parser.add_argument( + "--output_file", + dest="output_file", + type=str, + required=False, + default="combined_results.xml", + help="Name of output file", + ) + parser.add_argument( + "--testsuites_name", + dest="testsuites_name", + type=str, + required=False, + default="results", + help="Name value for testsuites tag", + ) + parser.add_argument( + "--verbose", + dest="debug", + action="store_const", + required=False, + const=True, + default=False, + help="Verbose/debug output", + ) + parser.add_argument( + "--suppress_rc", + dest="set_rc", + action="store_const", + required=False, + const=False, + default=True, + help="Suppress return code if failures found", + ) + + return parser + + +def main(): + parser = get_parser() + args = parser.parse_args() + rc = 0 + + result = ET.Element("testsuites", name=args.testsuites_name) + + for fname in find_all("results.xml", args.directory): + if args.debug: + print("Reading file %s" % fname) + tree = ET.parse(fname) + for ts in tree.iter("testsuite"): + if args.debug: + print( + "Ts name : {}, package : {}".format( + ts.get("name"), ts.get("package") + ) + ) + use_element = None + for existing in result: + if existing.get("name") == ts.get("name") and existing.get( + "package" + ) == ts.get("package"): + if args.debug: + print("Already found") + use_element = existing + break + if use_element is None: + result.append(ts) + else: + # for tc in ts.getiterator("testcase"): + use_element.extend(list(ts)) + + if args.debug: + ET.dump(result) + + testsuite_count = 0 + testcase_count = 0 + for testsuite in result.iter("testsuite"): + testsuite_count += 1 + for testcase in testsuite.iter("testcase"): + testcase_count += 1 + for failure in testcase.iter("failure"): + if args.set_rc: + rc = 1 + print( + "Failure in testsuite: '{}' classname: '{}' testcase: '{}' with parameters '{}'".format( + testsuite.get("name"), + testcase.get("classname"), + testcase.get("name"), + testsuite.get("package"), + ) + ) + if os.getenv("GITHUB_ACTIONS") is not None: + # Get test file relative to root of repo + repo_root = os.path.commonprefix( + [ + os.path.abspath(testcase.get("file")), + os.path.abspath(__file__), + ] + ) + relative_file = testcase.get("file").replace(repo_root, "") + print( + "::error file={},line={}::Test {}:{} failed".format( + relative_file, + testcase.get("lineno"), + testcase.get("classname"), + testcase.get("name"), + ) + ) + + print( + "Ran a total of %d TestSuites and %d TestCases" + % (testsuite_count, testcase_count) + ) + + ET.ElementTree(result).write(args.output_file, encoding="UTF-8") + return rc + + +if __name__ == "__main__": + rc = main() + sys.exit(rc) diff --git a/testbed/cocotb__cocotb/cocotb_build_libs.py b/testbed/cocotb__cocotb/cocotb_build_libs.py new file mode 100644 index 0000000000000000000000000000000000000000..9e2be0980a43f3795050d9be14f3168ce06ef779 --- /dev/null +++ b/testbed/cocotb__cocotb/cocotb_build_libs.py @@ -0,0 +1,828 @@ +# Copyright cocotb contributors +# Licensed under the Revised BSD License, see LICENSE for details. +# SPDX-License-Identifier: BSD-3-Clause + +import distutils +import logging +import os +import subprocess +import sys +import sysconfig +import textwrap +from distutils.ccompiler import get_default_compiler +from distutils.file_util import copy_file +from typing import List + +from setuptools import Extension +from setuptools.command.build_ext import build_ext as _build_ext + +logger = logging.getLogger(__name__) +cocotb_share_dir = os.path.abspath( + os.path.join(os.path.dirname(__file__), "src", "cocotb", "share") +) +_base_warns = [ + "-Wall", + "-Wextra", + "-Wcast-qual", + "-Wwrite-strings", + "-Wconversion", + # -Wno-missing-field-initializers is required on GCC 4.x to prevent a + # spurious warning `error: missing initializer for member ...` when + # compiling `PyTypeObject type = {};` in `simulatormodule.cpp`. + # (See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750.) This flag can be + # removed once we require later GCC versions. + "-Wno-missing-field-initializers", +] +_ccx_warns = _base_warns + ["-Wnon-virtual-dtor", "-Woverloaded-virtual"] +_extra_cxx_compile_args = [ + "-std=c++11", + "-fvisibility=hidden", + "-fvisibility-inlines-hidden", +] + _ccx_warns +if os.name != "nt": + _extra_cxx_compile_args += ["-flto"] + +_extra_cxx_compile_args_msvc = ["/permissive-"] + +# Make PRI* format macros available with C++11 compiler but older libc, e.g. on RHEL6. +_extra_defines = [("__STDC_FORMAT_MACROS", "")] + + +def create_sxs_assembly_manifest( + name: str, filename: str, libraries: List[str], dependency_only=False +) -> str: + """ + Create side-by-side (sxs) assembly manifest + + It contains dependencies to other assemblies (in our case the assemblies are equal to the other libraries). + For more details see: + - https://docs.microsoft.com/en-us/windows/win32/sbscs/assembly-manifests + - https://docs.microsoft.com/en-us/windows/win32/sbscs/using-side-by-side-assemblies + + Args: + name: The name of the assembly for which the manifest is generated, e.g. ``libcocotbutils``. + filename: The filename of the library, e.g. ``libcocotbutils.dll``. + libraries: A list of names of dependent manifests, e.g. ``["libgpilog"]``. + """ + + architecture = "amd64" if sys.maxsize > 2**32 else "x86" + dependencies = [] + + for lib in libraries: + dependencies.append( + textwrap.dedent( + """\ + + + + + + """ + ) + % (lib, architecture) + ) + + if not dependency_only: + manifest_body = textwrap.dedent( + """\ + + + + + %s + + """ + ) % ( + name, + architecture, + filename, + textwrap.indent("".join(dependencies), " ").strip(), + ) + else: + manifest_body = textwrap.dedent( + """\ + + + %s + + """ + ) % (textwrap.indent("".join(dependencies), " ").strip()) + + return manifest_body + + +def create_sxs_appconfig(filename): + """ + Create side-by-side (sxs) application configuration file. + + The application configuration specifies additional search paths for manifests. + For more details see: https://docs.microsoft.com/en-us/windows/win32/sbscs/application-configuration-files + """ + + config_body = textwrap.dedent( + """\ + + + + + + + + + """ + ) + + dirpath = os.path.dirname(filename) + os.makedirs(dirpath, exist_ok=True) + + with open(filename + ".2.config", "w", encoding="utf-8") as f: + f.write(config_body) + + +def create_rc_file(rc_filename, name, filename, libraries, runtime_libraries): + """ + Creates windows resource definition script to embed the side-by-side assembly manifest into the libraries. + + For more details see: https://docs.microsoft.com/en-us/windows/win32/menurc/about-resource-files + """ + + manifest = create_sxs_assembly_manifest(name, filename, libraries) + + # Escape double quotes and put every line between double quotes for embedding into rc file + manifest = manifest.replace('"', '""') + manifest = "\n".join(['"%s\\r\\n"' % x for x in manifest.splitlines()]) + + rc_body = ( + textwrap.dedent( + """\ + #pragma code_page(65001) // UTF-8 + #include + + LANGUAGE 0x00, 0x00 + + ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST + BEGIN + %s + END + """ + ) + % manifest + ) + + if runtime_libraries is not None: + manifest = create_sxs_assembly_manifest( + name, filename, runtime_libraries, dependency_only=True + ) + + # Escape double quotes and put every line between double quotes for embedding into rc file + manifest = manifest.replace('"', '""') + manifest = "\n".join(['"%s\\r\\n"' % x for x in manifest.splitlines()]) + + rc_body += ( + textwrap.dedent( + """\ + 1000 RT_MANIFEST + BEGIN + %s + END + """ + ) + % manifest + ) + + with open(rc_filename, "w", encoding="utf-8") as f: + f.write(rc_body) + + +def _get_lib_ext_name(): + """Get name of default library file extension on given OS.""" + + if os.name == "nt": + ext_name = "dll" + else: + ext_name = "so" + + return ext_name + + +class build_ext(_build_ext): + def _uses_msvc(self): + if self.compiler == "msvc": + return True + if self.compiler is None: + return get_default_compiler() == "msvc" + else: + return "msvc" == getattr(self.compiler, "compiler_type", None) + + def run(self): + if os.name == "nt": + create_sxs_appconfig( + self.get_ext_fullpath(os.path.join("cocotb", "simulator")) + ) + + super().run() + + def build_extensions(self): + if os.name == "nt": + if self._uses_msvc(): + # Initialize the compiler now so that compiler/linker flags are populated + if not self.compiler.initialized: + self.compiler.initialize() + + # Setuptools defaults to activate automatic manifest generation for msvc, + # disable it here as we manually generate it to also support mingw on windows + for k, ldflags in self.compiler._ldflags.items(): + self.compiler._ldflags[k] = [ + x for x in ldflags if not x.startswith("/MANIFEST") + ] + ["/MANIFEST:NO"] + + self.compiler.compile_options = [ + x for x in self.compiler.compile_options if not x.startswith("/W") + ] + ["/W4"] + + ext_names = {os.path.split(ext.name)[-1] for ext in self.extensions} + for ext in self.extensions: + fullname = self.get_ext_fullname(ext.name) + filename = self.get_ext_filename(fullname) + name = os.path.split(fullname)[-1] + filename = os.path.split(filename)[-1] + libraries = {"lib" + lib for lib in ext.libraries}.intersection( + ext_names + ) + rc_filename = name + ".rc" + runtime_libraries = None + + # Add the runtime dependency on libcocotb to libembed + if name == "libembed": + runtime_libraries = ["libcocotb"] + + # Strip lib prefix for msvc + if self._uses_msvc(): + name = name[3:] if name.startswith("lib") else name + libraries = { + (lib[3:] if lib.startswith("lib") else lib) for lib in libraries + } + if runtime_libraries is not None: + runtime_libraries = { + (lib[3:] if lib.startswith("lib") else lib) + for lib in runtime_libraries + } + create_rc_file( + rc_filename, name, filename, libraries, runtime_libraries + ) + + def_dir = os.path.join(cocotb_share_dir, "def") + self._gen_import_libs(def_dir) + + for e in self.extensions: + e.library_dirs += [def_dir] + + super().build_extensions() + + def build_extension(self, ext): + """Build each extension in its own temp directory to make gcov happy. + + A normal PEP 517 install still works as the temp directories are discarded anyway. + """ + lib_name = os.path.split(ext.name)[-1] + + if self._uses_msvc(): + ext.extra_compile_args += _extra_cxx_compile_args_msvc + else: + ext.extra_compile_args += _extra_cxx_compile_args + + if os.name == "nt": + # Align behavior of gcc with msvc and export only symbols marked with __declspec(dllexport) + ext.extra_link_args += ["-Wl,--exclude-all-symbols"] + else: + ext.extra_link_args += ["-flto"] + + rpaths = [] + if lib_name == "simulator": + rpaths += ["$ORIGIN/libs"] + install_name = None + else: + rpaths += ["$ORIGIN"] + install_name = lib_name + + if sys.platform == "darwin": + rpaths = [ + rpath.replace("$ORIGIN", "@loader_path") for rpath in rpaths + ] + if install_name is not None: + ext.extra_link_args += [ + "-Wl,-install_name,@rpath/%s.so" % install_name + ] + + if sys.platform == "linux": + # Avoid a runtime dependency on libstdc++. Some simulators + # ship a version of libstdc++6.so which is older than the + # one cocotb has been compiled with, which will then lead to + # load-time errors like "libstdc++.so.6: version + # `GLIBCXX_3.4.29' not found (required by + # /path/to/libcocotbvhpi_modelsim.so)." + ext.extra_link_args += ["-static-libstdc++"] + + ext.extra_link_args += ["-Wl,-rpath,%s" % rpath for rpath in rpaths] + + # vpi_user.h and vhpi_user.h require that WIN32 is defined + if os.name == "nt": + ext.define_macros += [("WIN32", "")] + + if lib_name == "libembed": + if self._uses_msvc(): + embed_lib_name = "cocotb" + else: + embed_lib_name = "libcocotb" + ext.define_macros += [ + ("EMBED_IMPL_LIB", embed_lib_name + "." + _get_lib_ext_name()) + ] + + old_build_temp = self.build_temp + self.build_temp = os.path.join(self.build_temp, ext.name) + super().build_extension(ext) + self.build_temp = old_build_temp + + # Needed for Windows to not assume python module (generate interface in def file) + def get_export_symbols(self, ext): + return None + + # For proper cocotb library naming, based on https://github.com/cython/cython/issues/1740 + def get_ext_filename(self, ext_name): + """ + Like the base class method, but for libraries that are not python extension: + - removes the ``.cpython-36m-x86_64-linux-gnu.`` or ``-cpython-36m.`` part before the extension + - replaces ``.pyd`` with ``.dll`` on windows. + """ + + filename = _build_ext.get_ext_filename(self, ext_name) + + # for the simulator python extension library, leaving suffix in place + if "simulator" == os.path.split(ext_name)[-1]: + return filename + + head, tail = os.path.split(filename) + tail_split = tail.split(".") + + # mingw on msys2 uses `-` as seperator + tail_split = tail_split[0].split("-") + + # strip lib prefix if msvc is used + if self._uses_msvc() and tail_split[0].startswith("lib"): + tail_split[0] = tail_split[0][3:] + + filename_short = os.path.join(head, tail_split[0] + "." + _get_lib_ext_name()) + + # icarus requires vpl extension + filename_short = filename_short.replace( + "libcocotbvpi_icarus.so", "libcocotbvpi_icarus.vpl" + ) + filename_short = filename_short.replace( + "libcocotbvpi_icarus.dll", "libcocotbvpi_icarus.vpl" + ) + filename_short = filename_short.replace( + "cocotbvpi_icarus.dll", "cocotbvpi_icarus.vpl" + ) + + return filename_short + + def finalize_options(self): + """Like the base class method,but add extra library_dirs path.""" + + super().finalize_options() + + for ext in self.extensions: + ext.library_dirs.append(os.path.join(self.build_lib, "cocotb", "libs")) + + def copy_extensions_to_source(self): + """Like the base class method, but copy libs into proper directory in develop.""" + + build_py = self.get_finalized_command("build_py") + for ext in self.extensions: + fullname = self.get_ext_fullname(ext.name) + filename = self.get_ext_filename(fullname) + modpath = fullname.split(".") + package = ".".join(modpath[:-1]) + package_dir = build_py.get_package_dir(package) + # unlike the method from `setuptools`, we do not call `os.path.basename` here + dest_filename = os.path.join(package_dir, filename) + src_filename = os.path.join(self.build_lib, filename) + + os.makedirs(os.path.dirname(dest_filename), exist_ok=True) + + copy_file( + src_filename, dest_filename, verbose=self.verbose, dry_run=self.dry_run + ) + if ext._needs_stub: + self.write_stub(package_dir or os.curdir, ext, True) + + def _gen_import_libs(self, def_dir): + """ + On Windows generate import libraries that contains the code required to + load the DLL (.a) based on module definition files (.def) + """ + + for sim in ["icarus", "modelsim", "aldec", "ghdl"]: + if self._uses_msvc(): + subprocess.run( + [ + self.compiler.lib, + "/def:" + os.path.join(def_dir, sim + ".def"), + "/out:" + os.path.join(def_dir, sim + ".lib"), + "/machine:" + ("X64" if sys.maxsize > 2**32 else "X86"), + ], + check=True, + ) + else: + subprocess.run( + [ + "dlltool", + "-d", + os.path.join(def_dir, sim + ".def"), + "-l", + os.path.join(def_dir, "lib" + sim + ".a"), + ], + check=True, + ) + + +def _get_python_lib_link(): + """Get name of python library used for linking""" + + if sys.platform == "darwin": + ld_library = sysconfig.get_config_var("LIBRARY") + else: + ld_library = sysconfig.get_config_var("LDLIBRARY") + + if ld_library is not None: + python_lib_link = os.path.splitext(ld_library)[0][3:] + else: + python_version = sysconfig.get_python_version().replace(".", "") + python_lib_link = "python" + python_version + + return python_lib_link + + +def _get_python_lib(): + """Get the library for embedded the python interpreter""" + + if os.name == "nt": + python_lib = _get_python_lib_link() + "." + _get_lib_ext_name() + elif sys.platform == "darwin": + python_lib = os.path.join( + sysconfig.get_config_var("LIBDIR"), "lib" + _get_python_lib_link() + "." + ) + if os.path.exists(python_lib + "dylib"): + python_lib += "dylib" + else: + python_lib += "so" + else: + python_lib = "lib" + _get_python_lib_link() + "." + _get_lib_ext_name() + + return python_lib + + +def _get_common_lib_ext(include_dirs, share_lib_dir): + """ + Defines common libraries. + + All libraries go into the same directory to enable loading without modifying the library path (e.g. LD_LIBRARY_PATH). + In Makefile `LIB_DIR` (s) is used to point to this directory. + """ + + # + # libcocotbutils + # + libcocotbutils_sources = [os.path.join(share_lib_dir, "utils", "cocotb_utils.cpp")] + if os.name == "nt": + libcocotbutils_sources += ["libcocotbutils.rc"] + libcocotbutils_libraries = ["gpilog"] + if sys.platform.startswith(("linux", "darwin", "cygwin", "msys")): + libcocotbutils_libraries.append("dl") # dlopen, dlerror, dlsym + libcocotbutils = Extension( + os.path.join("cocotb", "libs", "libcocotbutils"), + define_macros=[("COCOTBUTILS_EXPORTS", "")] + _extra_defines, + include_dirs=include_dirs, + libraries=libcocotbutils_libraries, + sources=libcocotbutils_sources, + ) + + # + # libgpilog + # + python_lib_dirs = [] + if sys.platform == "darwin": + python_lib_dirs = [sysconfig.get_config_var("LIBDIR")] + + libgpilog_sources = [os.path.join(share_lib_dir, "gpi_log", "gpi_logging.cpp")] + if os.name == "nt": + libgpilog_sources += ["libgpilog.rc"] + libgpilog = Extension( + os.path.join("cocotb", "libs", "libgpilog"), + define_macros=[("GPILOG_EXPORTS", "")] + _extra_defines, + include_dirs=include_dirs, + sources=libgpilog_sources, + ) + + # + # libpygpilog + # + libpygpilog_sources = [ + os.path.join(share_lib_dir, "py_gpi_log", "py_gpi_logging.cpp") + ] + if os.name == "nt": + libpygpilog_sources += ["libpygpilog.rc"] + libpygpilog = Extension( + os.path.join("cocotb", "libs", "libpygpilog"), + define_macros=[("PYGPILOG_EXPORTS", "")] + _extra_defines, + include_dirs=include_dirs, + libraries=["gpilog"], + sources=libpygpilog_sources, + ) + + # + # libembed + # + libembed_sources = [os.path.join(share_lib_dir, "embed", "embed.cpp")] + if os.name == "nt": + libembed_sources += ["libembed.rc"] + libembed = Extension( + os.path.join("cocotb", "libs", "libembed"), + define_macros=[("COCOTB_EMBED_EXPORTS", ""), ("PYTHON_LIB", _get_python_lib())] + + _extra_defines, + include_dirs=include_dirs, + libraries=["gpilog", "cocotbutils"], + sources=libembed_sources, + ) + + # + # libcocotb + # + libcocotb_sources = [os.path.join(share_lib_dir, "embed", "gpi_embed.cpp")] + if os.name == "nt": + libcocotb_sources += ["libcocotb.rc"] + libcocotb = Extension( + os.path.join("cocotb", "libs", "libcocotb"), + define_macros=_extra_defines, + include_dirs=include_dirs, + libraries=["gpilog", "cocotbutils", "pygpilog"], + sources=libcocotb_sources, + ) + + # + # libgpi + # + libgpi_sources = [ + os.path.join(share_lib_dir, "gpi", "GpiCbHdl.cpp"), + os.path.join(share_lib_dir, "gpi", "GpiCommon.cpp"), + ] + if os.name == "nt": + libgpi_sources += ["libgpi.rc"] + libgpi = Extension( + os.path.join("cocotb", "libs", "libgpi"), + define_macros=[ + ("GPI_EXPORTS", ""), + ("LIB_EXT", _get_lib_ext_name()), + ("SINGLETON_HANDLES", ""), + ] + + _extra_defines, + include_dirs=include_dirs, + libraries=["cocotbutils", "gpilog", "embed"], + sources=libgpi_sources, + ) + + # + # simulator + # + simulator_sources = [ + os.path.join(share_lib_dir, "simulator", "simulatormodule.cpp"), + ] + if os.name == "nt": + simulator_sources += ["simulator.rc"] + libsim = Extension( + os.path.join("cocotb", "simulator"), + define_macros=_extra_defines, + include_dirs=include_dirs, + libraries=["cocotbutils", "gpilog", "gpi", "pygpilog"], + library_dirs=python_lib_dirs, + sources=simulator_sources, + ) + + # The libraries in this list are compiled in order of their appearance. + # If there is a linking dependency on one library to another, + # the linked library must be built first. + return [libgpilog, libpygpilog, libcocotbutils, libembed, libgpi, libcocotb, libsim] + + +def _get_vpi_lib_ext( + include_dirs, share_lib_dir, sim_define, extra_lib=[], extra_lib_dir=[] +): + lib_name = "libcocotbvpi_" + sim_define.lower() + libcocotbvpi_sources = [ + os.path.join(share_lib_dir, "vpi", "VpiImpl.cpp"), + os.path.join(share_lib_dir, "vpi", "VpiCbHdl.cpp"), + ] + if os.name == "nt": + libcocotbvpi_sources += [lib_name + ".rc"] + libcocotbvpi = Extension( + os.path.join("cocotb", "libs", lib_name), + define_macros=[("COCOTBVPI_EXPORTS", ""), ("VPI_CHECKING", "1")] + + [(sim_define, "")] + + _extra_defines, + include_dirs=include_dirs, + libraries=["gpi", "gpilog"] + extra_lib, + library_dirs=extra_lib_dir, + sources=libcocotbvpi_sources, + ) + + return libcocotbvpi + + +def _get_vhpi_lib_ext( + include_dirs, share_lib_dir, sim_define, extra_lib=[], extra_lib_dir=[] +): + lib_name = "libcocotbvhpi_" + sim_define.lower() + libcocotbvhpi_sources = [ + os.path.join(share_lib_dir, "vhpi", "VhpiImpl.cpp"), + os.path.join(share_lib_dir, "vhpi", "VhpiCbHdl.cpp"), + ] + if os.name == "nt": + libcocotbvhpi_sources += [lib_name + ".rc"] + libcocotbvhpi = Extension( + os.path.join("cocotb", "libs", lib_name), + include_dirs=include_dirs, + define_macros=[("COCOTBVHPI_EXPORTS", ""), ("VHPI_CHECKING", 1)] + + [(sim_define, "")] + + _extra_defines, + libraries=["gpi", "gpilog"] + extra_lib, + library_dirs=extra_lib_dir, + sources=libcocotbvhpi_sources, + ) + + return libcocotbvhpi + + +def get_ext(): + cfg_vars = distutils.sysconfig.get_config_vars() + + if sys.platform == "darwin": + cfg_vars["LDSHARED"] = cfg_vars["LDSHARED"].replace("-bundle", "-dynamiclib") + + share_lib_dir = os.path.relpath(os.path.join(cocotb_share_dir, "lib")) + include_dirs = [ + os.path.relpath(os.path.join(cocotb_share_dir, "include")), + os.path.relpath(os.path.join(os.path.dirname(__file__), "src", "cocotb")), + ] + + ext = [] + + logger.info("Compiling interface libraries for cocotb ...") + + ext += _get_common_lib_ext(include_dirs, share_lib_dir) + + # + # Icarus Verilog + # + icarus_extra_lib = [] + logger.info("Compiling libraries for Icarus Verilog") + if os.name == "nt": + icarus_extra_lib = ["icarus"] + + icarus_vpi_ext = _get_vpi_lib_ext( + include_dirs=include_dirs, + share_lib_dir=share_lib_dir, + sim_define="ICARUS", + extra_lib=icarus_extra_lib, + ) + ext.append(icarus_vpi_ext) + + # + # Modelsim/Questa + # + modelsim_extra_lib = [] + logger.info("Compiling libraries for Modelsim/Questa") + if os.name == "nt": + modelsim_extra_lib = ["modelsim"] + + modelsim_vpi_ext = _get_vpi_lib_ext( + include_dirs=include_dirs, + share_lib_dir=share_lib_dir, + sim_define="MODELSIM", + extra_lib=modelsim_extra_lib, + ) + ext.append(modelsim_vpi_ext) + + modelsim_vhpi_ext = _get_vhpi_lib_ext( + include_dirs=include_dirs, + share_lib_dir=share_lib_dir, + sim_define="MODELSIM", + extra_lib=modelsim_extra_lib, + ) + ext.append(modelsim_vhpi_ext) + + lib_name = "libcocotbfli_modelsim" + fli_sources = [ + os.path.join(share_lib_dir, "fli", "FliImpl.cpp"), + os.path.join(share_lib_dir, "fli", "FliCbHdl.cpp"), + os.path.join(share_lib_dir, "fli", "FliObjHdl.cpp"), + ] + if os.name == "nt": + fli_sources += [lib_name + ".rc"] + fli_ext = Extension( + os.path.join("cocotb", "libs", lib_name), + define_macros=[("COCOTBFLI_EXPORTS", "")] + _extra_defines, + include_dirs=include_dirs, + libraries=["gpi", "gpilog"] + modelsim_extra_lib, + sources=fli_sources, + ) + + ext.append(fli_ext) + + # + # GHDL + # + ghdl_extra_lib = [] + logger.info("Compiling libraries for GHDL") + if os.name == "nt": + ghdl_extra_lib = ["ghdl"] + + ghdl_vpi_ext = _get_vpi_lib_ext( + include_dirs=include_dirs, + share_lib_dir=share_lib_dir, + sim_define="GHDL", + extra_lib=ghdl_extra_lib, + ) + ext.append(ghdl_vpi_ext) + + # + # IUS + # + if os.name == "posix": + logger.info("Compiling libraries for Incisive/Xcelium") + ius_vpi_ext = _get_vpi_lib_ext( + include_dirs=include_dirs, share_lib_dir=share_lib_dir, sim_define="IUS" + ) + ext.append(ius_vpi_ext) + + ius_vhpi_ext = _get_vhpi_lib_ext( + include_dirs=include_dirs, share_lib_dir=share_lib_dir, sim_define="IUS" + ) + ext.append(ius_vhpi_ext) + + # + # VCS + # + if os.name == "posix": + logger.info("Compiling libraries for VCS") + vcs_vpi_ext = _get_vpi_lib_ext( + include_dirs=include_dirs, share_lib_dir=share_lib_dir, sim_define="VCS" + ) + ext.append(vcs_vpi_ext) + + # + # Aldec Riviera Pro + # + aldec_extra_lib = [] + logger.info("Compiling libraries for Riviera") + if os.name == "nt": + aldec_extra_lib = ["aldec"] + + aldec_vpi_ext = _get_vpi_lib_ext( + include_dirs=include_dirs, + share_lib_dir=share_lib_dir, + sim_define="ALDEC", + extra_lib=aldec_extra_lib, + ) + ext.append(aldec_vpi_ext) + + aldec_vhpi_ext = _get_vhpi_lib_ext( + include_dirs=include_dirs, + share_lib_dir=share_lib_dir, + sim_define="ALDEC", + extra_lib=aldec_extra_lib, + ) + ext.append(aldec_vhpi_ext) + + # + # Verilator + # + if os.name == "posix": + logger.info("Compiling libraries for Verilator") + verilator_vpi_ext = _get_vpi_lib_ext( + include_dirs=include_dirs, + share_lib_dir=share_lib_dir, + sim_define="VERILATOR", + ) + ext.append(verilator_vpi_ext) + + # + # NVC + # + if os.name == "posix": + logger.info("Compiling libraries for NVC") + nvc_vhpi_ext = _get_vhpi_lib_ext( + include_dirs=include_dirs, share_lib_dir=share_lib_dir, sim_define="NVC" + ) + ext.append(nvc_vhpi_ext) + + return ext diff --git a/testbed/cocotb__cocotb/docs/.gitignore b/testbed/cocotb__cocotb/docs/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..4d9b5b5659306eb7d05c5baf54f8a9c5ad7dea6b --- /dev/null +++ b/testbed/cocotb__cocotb/docs/.gitignore @@ -0,0 +1,3 @@ +.venv +source/master-notes.rst +source/doxygen diff --git a/testbed/cocotb__cocotb/docs/Doxyfile b/testbed/cocotb__cocotb/docs/Doxyfile new file mode 100644 index 0000000000000000000000000000000000000000..b8665e44e0d8c67e2e367043f8762428e39bd136 --- /dev/null +++ b/testbed/cocotb__cocotb/docs/Doxyfile @@ -0,0 +1,2554 @@ +# Doxyfile 1.8.20 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "cocotb" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = source/doxygen + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# (including Cygwin) and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = NO + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = NO + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = NO + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../src/cocotb/share/include/gpi.h + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the "-p" option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = NO + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /