-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add s3 presign command #2113
Add s3 presign command #2113
Conversation
That way we can still use assert_params_for_cmd for code that does not make client API calls.
This command is paired with `get-object`, so it can be used to create presigned URLs you can use to retrieve objects in S3. There's a couple of enhancements I see in the future: * `presign-post` * `presign-put` * Copying the arg table to support all the params used by `get-object`
USAGE = "<S3Uri>" | ||
ARG_TABLE = [{'name': 'path', | ||
'positional_arg': True, 'synopsis': USAGE}, | ||
{'name': 'expires-in', 'nargs': '?', |
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.
Is '?'
is intentional for ``nargsfor
expires-in`? Seems strange that you can provide `--expires-in` without a value especially since `default` is already being set.
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.
Not intentional, I'll remove.
Looks good. Pretty straightforward. I had a couple of small questions. |
|
||
class TestPresignCommand(BaseAWSCommandParamsTest): | ||
|
||
maxDiff = None |
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.
BaseAWSCommandParamsTest
already sets this, does it not carry through?
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.
I've gone ahead and removed this.
Tiny questions in addition to Kyle's, but looks good. |
@kyleknap @JordonPhillips feedback incorporated, let me know if I've missed anything. |
|
Thanks. Looks good. 🚢 |
This command is paired with
get-object
, so it canbe used to create presigned URLs you can use to retrieve
objects in S3. There's a couple of enhancements I see in
the future:
presign-post
presign-put
get-object
I also had to make a few misc commits to the testutils module to fix
a few bugs I encountered while working on tests for this code.
Example usage:
cc @kyleknap @JordonPhillips
Closes #462