-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Prefer signature version from service models over endpoints.json #3465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
{ | ||
"type": "bugfix", | ||
"category": "``endpoints``", | ||
"description": "Prefer signature version from service models over endpoints.json." | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure if we want this, as it should be transparent. #2816 didn't have a changelog entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a nuance we don't need to highlight. These aren't public interfaces and as long as the change is a no-op for the end user, it's kind of moot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
"type": "bugfix", | ||
"category": "``endpoints``", | ||
"description": "Prefer signature version from service models over endpoints.json." | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a nuance we don't need to highlight. These aren't public interfaces and as long as the change is a no-op for the end user, it's kind of moot.
botocore/client.py
Outdated
# importexport is modeled with V2, but we previously allowed | ||
# endpoints.json to move it to v4 before switching this method | ||
# to prefer the service models | ||
if service_name == 'importexport': | ||
return 'v4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any other options for this? S3 has it's own special cases throughout the code but adding more random service conditionals is ideally avoided. I'd maybe suggest we add a handler to set this explicitly for the service instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One note on the approach in b2da232:
client.meta.config.signature_version
for importexport
will now return v2
(instead of v4
) since this doesn't execute the choose-signer
event.
I removed that assertion from the functional test, but left the assertion that the request ultimately has the V4 header.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #3465 +/- ##
===========================================
+ Coverage 92.94% 93.04% +0.10%
===========================================
Files 66 67 +1
Lines 14956 15132 +176
===========================================
+ Hits 13901 14080 +179
+ Misses 1055 1052 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment on a nit, but otherwise LGTM.
Co-authored-by: Nate Prewitt <[email protected]>
* release-1.38.15: Bumping version to 1.38.15 Update to latest models Prefer signature version from service models over endpoints.json (#3465) Bump jinja2 from 3.1.4 to 3.1.6
Background
An upcoming service is re-using an existing endpoint prefix that is still present in
endpoints.json
with an explicitsignatureVersions
.The new service is specifying a different
signatureVersion
in its service model. However botocore is still preferring the version fromendpoints.json
#2816 in 2022 last touched this area. However this logic:
botocore/botocore/client.py
Lines 836 to 843 in 6f783fe
only prefers the service model over
endpoints.json
if the service model's signature version is not in the this list:botocore/botocore/client.py
Lines 69 to 78 in 6f783fe
My interpretation is that this allowed new services to model new signature versions such as
bearer
, but preserved our original behavior of usingendpoints.json
as the source of truth.Approach
Now, I removed that
_LEGACY_SIGNATURE_VERSIONS
set. We'll prefer the service model it its set, but still fall back toendpoints.json
if not.This required some custom handling for S3, S3Control, and Import/Export to preserve their current resolved values.
For Reviewers: Long term, we likely want to remove
endpoints.json
entirely. I didn't do so yet, as thatresolved
is plumbed around pretty heavily, and we do have unit tests that are guarding the current code paths. But let me know if you'd rather do so now.Testing