chore(python): add user agent suffix to kms requests#1686
Conversation
0f93be8 to
696a07b
Compare
46e5f12 to
740fc32
Compare
|
Detected changes to the release files or to the check-files action |
|
Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS |
aab326d to
8a1faf8
Compare
|
Detected changes to the release files or to the check-files action |
|
Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS |
|
|
||
| // Update the version in ComAmazonawsKms/src/Index.dfy DafnyUserAgentSuffix function | ||
| { | ||
| files: ["ComAmazonawsKms/src/Index.dfy"], | ||
| from: 'var version := ".*"', | ||
| to: 'var version := "${nextRelease.version}"', | ||
| results: [CheckResults("ComAmazonawsKms/src/Index.dfy")], | ||
| countMatches: true, | ||
| }, |
There was a problem hiding this comment.
See ComAmazonawsKms/src/Index.dfy
With this change, this will ensure that user agent suffix always include the current mplVersion during release.
There was a problem hiding this comment.
oh nice! how did you go about testing this?
did you run this change on a fork?
There was a problem hiding this comment.
Yes, I ran semantic release command on this branch in my local and checkout the changes into new branch.
npx semantic-release --branches imabhichow/python-user-agent --no-ci
There was a problem hiding this comment.
tagging a repo is a built in function of semantic release. So, while testing this you might have tagged v1.11.2. https://github.com/aws/aws-cryptographic-material-providers-library/tree/v1.11.2.
You can just delete this tag and its safe because only Go cares about tags and there is no go.mod in the root of the repo. That's the reason we only have tag protection for releases/go/**/**.
There was a problem hiding this comment.
So, while testing this you might have tagged v1.11.2. https://github.com/aws/aws-cryptographic-material-providers-library/tree/v1.11.2.
Good catch Rishav. I will delete the tag.
| @@ -24,15 +26,18 @@ class default__(aws_cryptography_internal_kms.internaldafny.generated.Com_Amazon | |||
| @staticmethod | |||
| def KMSClient(boto_client = None, region = None): | |||
| if boto_client is None: | |||
There was a problem hiding this comment.
Will this only append the user agent string to the default client (i.e. the client we create when the customer doesn't provide one)? Is it possible to also add it to the user defined one?
There was a problem hiding this comment.
Yes, this will only append to the default client.
Is it possible to also add it to the user defined one?
I'll look at the Python implementation and see if we can append the user agent. (I assume other runtimes do not append user agent strings to customer-supplied ones).
There was a problem hiding this comment.
I am able to add user agent string to user provided kms client, however, when user provided client also passes a user_agent_extra string, MPL will override the customer provided one user_agent_extra.
I am uncertain if we want this behavior for user/customer provided client. (I also looked into other runtime i.e. Java, Java does not add user agent string to customer provided clients)
There was a problem hiding this comment.
Oh I think we may be able to append to the existing user_agent_extra if there's one.
|
Detected changes to the release files or to the check-files action |
|
Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS |
|
Detected changes to the release files or to the check-files action |
|
Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS |
|
Detected changes to the release files or to the check-files action |
|
Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS |
|
Detected changes to the release files or to the check-files action |
## [1.11.2](v1.11.1...v1.11.2) (2026-02-02) ### Fixes -- DotNet * **dotnet:** build from main ([#1781](#1781)) ([b2d6075](b2d6075)) ### Maintenance -- All Languages * **dafny:** add fuzz testing to MPL ([#1622](#1622)) ([14fad38](14fad38)) * **dafny:** add new SearchAndReplaceWhole and friends ([#1680](#1680)) ([74e98c1](74e98c1)) * **dafny:** bump setup_dafny ([#1712](#1712)) ([2c57523](2c57523)) * **dafny:** optimize mutation map for O(1) performance in Go ([#1687](#1687)) ([68cd7cb](68cd7cb)) ### Maintenance -- Python * **python:** add user agent suffix to kms requests ([#1686](#1686)) ([b69aaf2](b69aaf2)) * **python:** allow local testing ([#1651](#1651)) ([8b221c4](8b221c4)) * **python:** exclude generated tests from project distribution ([#1627](#1627)) ([505eee0](505eee0)) * **python:** tests for OpaqueWithText ([#1656](#1656)) ([25e1219](25e1219)) ### Maintenance -- Go * **go:** add go 1.25 to CI ([#1684](#1684)) ([49aa27c](49aa27c)) * **go:** put back content() in mutable maps extern ([#1694](#1694)) ([bb0ec0c](bb0ec0c)) * **go:** Release dynamodb Go module 0.2.1 ([#1671](#1671)) ([c82e136](c82e136)) * **go:** Release dynamodb Go module 0.2.2 ([#1698](#1698)) ([76846e1](76846e1)) * **go:** Release kms Go module 0.2.1 ([#1667](#1667)) ([dd8cdf1](dd8cdf1)) * **go:** Release kms Go module 0.2.2 ([#1697](#1697)) ([79c0531](79c0531)) * **go:** Release kms Go module 0.3.0 ([#1746](#1746)) ([1e438f3](1e438f3)) * **go:** Release mpl Go module 0.2.1 ([#1672](#1672)) ([9bc43c0](9bc43c0)) * **go:** Release mpl Go module 0.2.2 ([#1704](#1704)) ([5f2aa33](5f2aa33)) * **go:** Release mpl Go module 0.3.0 ([#1751](#1751)) ([1ac31b6](1ac31b6)) * **go:** Release primitives Go module 0.2.1 ([#1669](#1669)) ([dca265f](dca265f)) * **go:** Release primitives Go module 0.2.2 ([#1699](#1699)) ([d4c3a20](d4c3a20)) * **go:** Release primitives Go module 0.3.0 ([#1748](#1748)) ([541e04a](541e04a)) * **go:** Release smithy-dafny-standard-library Go module 0.2.1 ([#1666](#1666)) ([fa3f98b](fa3f98b)) * **go:** Release smithy-dafny-standard-library Go module 0.2.2 ([#1696](#1696)) ([4312195](4312195)) * **go:** remove create pull request step in go release workflow ([#1681](#1681)) ([7eafe88](7eafe88)) * **go:** test with go 1.23 ([#1737](#1737)) ([987ac0f](987ac0f)) * **go:** update Go release script for ESDK and DB-ESDK ([#1653](#1653)) ([ea64f20](ea64f20)) * **go:** update release script ([#1676](#1676)) ([34f9689](34f9689)) * **go:** Update release script to cd to right directory ([#1679](#1679)) ([952c42f](952c42f)) ### Maintenance -- Rust * **rust:** bump dafny version for rust to 4.10 ([#1725](#1725)) ([f41b3c4](f41b3c4)) * **rust:** clean up kms module ([#1752](#1752)) ([6878377](6878377)) * **rust:** fix clippy warning. Bump test dependencies ([#1715](#1715)) ([7b8d6ac](7b8d6ac)) * **rust:** more compatible blocking ([#1780](#1780)) ([3ea1161](3ea1161)) * **rust:** note unused parameter ([#1693](#1693)) ([49759c9](49759c9)) * **rust:** prepare for initial Rust crate publication ([#1755](#1755)) ([1e28a61](1e28a61)) * **rust:** provide fips feature flag ([#1703](#1703)) ([f6bdd23](f6bdd23)) * **rust:** release 0.2.0 ([#1782](#1782)) ([03c999c](03c999c)) * **rust:** remove warnings ([#1724](#1724)) ([453359a](453359a)) ### Miscellaneous * add managed policy to cfn template ([#1758](#1758)) ([81cc558](81cc558)) * Add UserAgent string to KMS client ([#1716](#1716)) ([09b2cda](09b2cda)) * bump CI to macos-14 ([#1734](#1734)) ([1413b88](1413b88)) * bump smithy-dafny ([#1657](#1657)) ([e2fb76c](e2fb76c)) * bump smithy-dafny ([#1706](#1706)) ([dc1678a](dc1678a)) * **CI:** ci action to upload performance logs to cloudwatch ([#1754](#1754)) ([c5b3ac6](c5b3ac6)) * **ci:** Install Go/goimports as codegen dependencies ([#1713](#1713)) ([7a6fd63](7a6fd63)) * **CI:** test DB-ESDK java examples from MPL ([#1692](#1692)) ([4e06e37](4e06e37)) * **CI:** update slack notification to include link of GHA run ([#1659](#1659)) ([c6e2c20](c6e2c20)) * clean up submodule URL to remove embedded username ([#1757](#1757)) ([df1ec90](df1ec90)) * **deps:** bump actions/download-artifact from 4 to 6 in /.github/workflows ([#1747](#1747)) ([2a767e7](2a767e7)) * **deps:** update deps across the repo ([#1773](#1773)) ([edcc64c](edcc64c)) * update check-files ([#1785](#1785)) ([14af920](14af920)) * update kms externs correctly ([#1717](#1717)) ([e11ba53](e11ba53)) * Update workflow permissions ([#1783](#1783)) ([37f416e](37f416e))
* **dotnet:** build from main ([#1781](#1781)) ([b2d6075](b2d6075)) * **dafny:** add fuzz testing to MPL ([#1622](#1622)) ([14fad38](14fad38)) * **dafny:** add new SearchAndReplaceWhole and friends ([#1680](#1680)) ([74e98c1](74e98c1)) * **dafny:** bump setup_dafny ([#1712](#1712)) ([2c57523](2c57523)) * **dafny:** optimize mutation map for O(1) performance in Go ([#1687](#1687)) ([68cd7cb](68cd7cb)) * **python:** add user agent suffix to kms requests ([#1686](#1686)) ([b69aaf2](b69aaf2)) * **python:** allow local testing ([#1651](#1651)) ([8b221c4](8b221c4)) * **python:** exclude generated tests from project distribution ([#1627](#1627)) ([505eee0](505eee0)) * **python:** tests for OpaqueWithText ([#1656](#1656)) ([25e1219](25e1219)) * **go:** add go 1.25 to CI ([#1684](#1684)) ([49aa27c](49aa27c)) * **go:** put back content() in mutable maps extern ([#1694](#1694)) ([bb0ec0c](bb0ec0c)) * **go:** Release dynamodb Go module 0.2.1 ([#1671](#1671)) ([c82e136](c82e136)) * **go:** Release dynamodb Go module 0.2.2 ([#1698](#1698)) ([76846e1](76846e1)) * **go:** Release kms Go module 0.2.1 ([#1667](#1667)) ([dd8cdf1](dd8cdf1)) * **go:** Release kms Go module 0.2.2 ([#1697](#1697)) ([79c0531](79c0531)) * **go:** Release kms Go module 0.3.0 ([#1746](#1746)) ([1e438f3](1e438f3)) * **go:** Release mpl Go module 0.2.1 ([#1672](#1672)) ([9bc43c0](9bc43c0)) * **go:** Release mpl Go module 0.2.2 ([#1704](#1704)) ([5f2aa33](5f2aa33)) * **go:** Release mpl Go module 0.3.0 ([#1751](#1751)) ([1ac31b6](1ac31b6)) * **go:** Release primitives Go module 0.2.1 ([#1669](#1669)) ([dca265f](dca265f)) * **go:** Release primitives Go module 0.2.2 ([#1699](#1699)) ([d4c3a20](d4c3a20)) * **go:** Release primitives Go module 0.3.0 ([#1748](#1748)) ([541e04a](541e04a)) * **go:** Release smithy-dafny-standard-library Go module 0.2.1 ([#1666](#1666)) ([fa3f98b](fa3f98b)) * **go:** Release smithy-dafny-standard-library Go module 0.2.2 ([#1696](#1696)) ([4312195](4312195)) * **go:** remove create pull request step in go release workflow ([#1681](#1681)) ([7eafe88](7eafe88)) * **go:** test with go 1.23 ([#1737](#1737)) ([987ac0f](987ac0f)) * **go:** update Go release script for ESDK and DB-ESDK ([#1653](#1653)) ([ea64f20](ea64f20)) * **go:** update release script ([#1676](#1676)) ([34f9689](34f9689)) * **go:** Update release script to cd to right directory ([#1679](#1679)) ([952c42f](952c42f)) * **rust:** bump dafny version for rust to 4.10 ([#1725](#1725)) ([f41b3c4](f41b3c4)) * **rust:** clean up kms module ([#1752](#1752)) ([6878377](6878377)) * **rust:** fix clippy warning. Bump test dependencies ([#1715](#1715)) ([7b8d6ac](7b8d6ac)) * **rust:** more compatible blocking ([#1780](#1780)) ([3ea1161](3ea1161)) * **rust:** note unused parameter ([#1693](#1693)) ([49759c9](49759c9)) * **rust:** prepare for initial Rust crate publication ([#1755](#1755)) ([1e28a61](1e28a61)) * **rust:** provide fips feature flag ([#1703](#1703)) ([f6bdd23](f6bdd23)) * **rust:** release 0.2.0 ([#1782](#1782)) ([03c999c](03c999c)) * **rust:** remove warnings ([#1724](#1724)) ([453359a](453359a)) * add managed policy to cfn template ([#1758](#1758)) ([81cc558](81cc558)) * Add UserAgent string to KMS client ([#1716](#1716)) ([09b2cda](09b2cda)) * bump CI to macos-14 ([#1734](#1734)) ([1413b88](1413b88)) * bump smithy-dafny ([#1657](#1657)) ([e2fb76c](e2fb76c)) * bump smithy-dafny ([#1706](#1706)) ([dc1678a](dc1678a)) * **CI:** ci action to upload performance logs to cloudwatch ([#1754](#1754)) ([c5b3ac6](c5b3ac6)) * **ci:** Install Go/goimports as codegen dependencies ([#1713](#1713)) ([7a6fd63](7a6fd63)) * **CI:** test DB-ESDK java examples from MPL ([#1692](#1692)) ([4e06e37](4e06e37)) * **CI:** update slack notification to include link of GHA run ([#1659](#1659)) ([c6e2c20](c6e2c20)) * clean up submodule URL to remove embedded username ([#1757](#1757)) ([df1ec90](df1ec90)) * **deps:** bump actions/download-artifact from 4 to 6 in /.github/workflows ([#1747](#1747)) ([2a767e7](2a767e7)) * **deps:** update deps across the repo ([#1773](#1773)) ([edcc64c](edcc64c)) * update check-files ([#1785](#1785)) ([14af920](14af920)) * update kms externs correctly ([#1717](#1717)) ([e11ba53](e11ba53)) * Update workflow permissions ([#1783](#1783)) ([37f416e](37f416e))
* **dotnet:** build from main ([#1781](#1781)) ([b2d6075](b2d6075)) * **dafny:** add fuzz testing to MPL ([#1622](#1622)) ([14fad38](14fad38)) * **dafny:** add new SearchAndReplaceWhole and friends ([#1680](#1680)) ([74e98c1](74e98c1)) * **dafny:** bump setup_dafny ([#1712](#1712)) ([2c57523](2c57523)) * **dafny:** optimize mutation map for O(1) performance in Go ([#1687](#1687)) ([68cd7cb](68cd7cb)) * **python:** add user agent suffix to kms requests ([#1686](#1686)) ([b69aaf2](b69aaf2)) * **python:** allow local testing ([#1651](#1651)) ([8b221c4](8b221c4)) * **python:** exclude generated tests from project distribution ([#1627](#1627)) ([505eee0](505eee0)) * **python:** tests for OpaqueWithText ([#1656](#1656)) ([25e1219](25e1219)) * **go:** add go 1.25 to CI ([#1684](#1684)) ([49aa27c](49aa27c)) * **go:** put back content() in mutable maps extern ([#1694](#1694)) ([bb0ec0c](bb0ec0c)) * **go:** Release dynamodb Go module 0.2.1 ([#1671](#1671)) ([c82e136](c82e136)) * **go:** Release dynamodb Go module 0.2.2 ([#1698](#1698)) ([76846e1](76846e1)) * **go:** Release kms Go module 0.2.1 ([#1667](#1667)) ([dd8cdf1](dd8cdf1)) * **go:** Release kms Go module 0.2.2 ([#1697](#1697)) ([79c0531](79c0531)) * **go:** Release kms Go module 0.3.0 ([#1746](#1746)) ([1e438f3](1e438f3)) * **go:** Release mpl Go module 0.2.1 ([#1672](#1672)) ([9bc43c0](9bc43c0)) * **go:** Release mpl Go module 0.2.2 ([#1704](#1704)) ([5f2aa33](5f2aa33)) * **go:** Release mpl Go module 0.3.0 ([#1751](#1751)) ([1ac31b6](1ac31b6)) * **go:** Release primitives Go module 0.2.1 ([#1669](#1669)) ([dca265f](dca265f)) * **go:** Release primitives Go module 0.2.2 ([#1699](#1699)) ([d4c3a20](d4c3a20)) * **go:** Release primitives Go module 0.3.0 ([#1748](#1748)) ([541e04a](541e04a)) * **go:** Release smithy-dafny-standard-library Go module 0.2.1 ([#1666](#1666)) ([fa3f98b](fa3f98b)) * **go:** Release smithy-dafny-standard-library Go module 0.2.2 ([#1696](#1696)) ([4312195](4312195)) * **go:** remove create pull request step in go release workflow ([#1681](#1681)) ([7eafe88](7eafe88)) * **go:** test with go 1.23 ([#1737](#1737)) ([987ac0f](987ac0f)) * **go:** update Go release script for ESDK and DB-ESDK ([#1653](#1653)) ([ea64f20](ea64f20)) * **go:** update release script ([#1676](#1676)) ([34f9689](34f9689)) * **go:** Update release script to cd to right directory ([#1679](#1679)) ([952c42f](952c42f)) * **rust:** bump dafny version for rust to 4.10 ([#1725](#1725)) ([f41b3c4](f41b3c4)) * **rust:** clean up kms module ([#1752](#1752)) ([6878377](6878377)) * **rust:** fix clippy warning. Bump test dependencies ([#1715](#1715)) ([7b8d6ac](7b8d6ac)) * **rust:** more compatible blocking ([#1780](#1780)) ([3ea1161](3ea1161)) * **rust:** note unused parameter ([#1693](#1693)) ([49759c9](49759c9)) * **rust:** prepare for initial Rust crate publication ([#1755](#1755)) ([1e28a61](1e28a61)) * **rust:** provide fips feature flag ([#1703](#1703)) ([f6bdd23](f6bdd23)) * **rust:** release 0.2.0 ([#1782](#1782)) ([03c999c](03c999c)) * **rust:** remove warnings ([#1724](#1724)) ([453359a](453359a)) * add managed policy to cfn template ([#1758](#1758)) ([81cc558](81cc558)) * Add UserAgent string to KMS client ([#1716](#1716)) ([09b2cda](09b2cda)) * bump CI to macos-14 ([#1734](#1734)) ([1413b88](1413b88)) * bump smithy-dafny ([#1657](#1657)) ([e2fb76c](e2fb76c)) * bump smithy-dafny ([#1706](#1706)) ([dc1678a](dc1678a)) * **CI:** ci action to upload performance logs to cloudwatch ([#1754](#1754)) ([c5b3ac6](c5b3ac6)) * **ci:** Install Go/goimports as codegen dependencies ([#1713](#1713)) ([7a6fd63](7a6fd63)) * **CI:** test DB-ESDK java examples from MPL ([#1692](#1692)) ([4e06e37](4e06e37)) * **CI:** update slack notification to include link of GHA run ([#1659](#1659)) ([c6e2c20](c6e2c20)) * clean up submodule URL to remove embedded username ([#1757](#1757)) ([df1ec90](df1ec90)) * **deps:** bump actions/download-artifact from 4 to 6 in /.github/workflows ([#1747](#1747)) ([2a767e7](2a767e7)) * **deps:** update deps across the repo ([#1773](#1773)) ([edcc64c](edcc64c)) * update check-files ([#1785](#1785)) ([14af920](14af920)) * update kms externs correctly ([#1717](#1717)) ([e11ba53](e11ba53)) * Update workflow permissions ([#1783](#1783)) ([37f416e](37f416e))
Issue #, if available:
Description of changes:
Before Change:
"userAgent": "Boto3/1.40.10 md/Botocore#1.40.10 ua/2.1 os/macos#24.5.0 md/arch#arm64 lang/python#3.12.11 md/pyimpl#CPython m/Z,b,D cfg/retry-mode#legacy Botocore/1.40.10"After Change
"userAgent": "Boto3/1.40.10 md/Botocore#1.40.10 ua/2.1 os/macos#24.5.0 md/arch#arm64 lang/python#3.12.11 md/pyimpl#CPython m/b,D,Z cfg/retry-mode#legacy Botocore/1.40.10 AwsCryptographicMPL/Python/1.11.0"Squash/merge commit message, if applicable:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.