-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement opt-in unsigned requests for clients. #448
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
This change makes it possible to override the signature version at client
creation time using a parameter. It also introduces the concept of an
advanced configuration object for clients:
```python
import botocore
from botocore.client import Config
config = Config(signature_version=botocore.UNSIGNED)
s3 = session.create_client('s3', config=config)
```
This does **not** move any existing parameters into the advanced
configuration object, and thus is not yet a breaking change. It
does include the following:
* Adds `botocore.UNSIGNED` as a sentinel to disable signing
* Updates `botocore.handlers.disable_signing` to use `botocore.UNSIGNED`
* Adds a `botocore.client.Config` object to store signature version
* Modifies client creation to use this new config
* Updated / new unit tests
tests/unit/test_session.py
Outdated
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.
We've discussed in the past not mocking value objects. Let's just use the actual Config object here.
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.
Will this affect the CLI? We set the endpoint's signature version to None. You can check real quick by running this test: https://github.com/aws/aws-cli/blob/develop/tests/integration/customizations/s3/test_plugin.py#L1594
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.
Given it's now a sentinel, we should be using identity checks instead of equality check (signature_version is not botocore.UNSIGNED)
|
This looks good to me. 🚢 If the integration test that I pointed out does fail, a subsequent pull request will have to be made to change |
|
@kyleknap good call. I've created an associated pull request with the CLI for this. After it's been reviewed I'll merge in both. |
tests/unit/test_signers.py
Outdated
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 comment is no longer accurate.
|
Looks good, just a couple small things. |
Implement opt-in unsigned requests for clients.
This change makes it possible to override the signature version at client
creation time using a parameter. It also introduces the concept of an
advanced configuration object for clients:
This does not move any existing parameters into the advanced
configuration object, and thus is not yet a breaking change. It
does include the following:
botocore.UNSIGNEDas a sentinel to disable signingbotocore.handlers.disable_signingto usebotocore.UNSIGNEDbotocore.client.Configobject to store signature versioncc @jamesls @kyleknap