-
Notifications
You must be signed in to change notification settings - Fork 218
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 presignable trait to Smithy #897
Conversation
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.
Sorry for the delay on this, looks like it got a bit lost between oncalls
.. smithy-trait:: aws.auth#cognitoUserPools | ||
.. _aws.auth#cognitoUserPools-trait: | ||
|
||
------------------------ | ||
``presignable`` trait | ||
------------------------ |
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.
You'll need to add a smithy-trait
directive here and make sure that the cognito user pools directive is directly above its trait. Also the title here should be fully qualified, e.g. aws.auth#presignable
(to be fair, we're inconsistent on this currently)
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.
Ah, I didn't notice the significance of these directives. Fixed, thanks.
Trait value | ||
Annotation trait. | ||
|
||
The following example defines a service operation for which presigned requests can be generated for. |
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.
You should include a directions on how to pre-sign a request, or at least link to any existing AWS docs that do the same.
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.
fixed
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: no need for the last "for" in the above sentence.
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.
fixed in #1077
"smithy.api#trait": { | ||
"selector": "operation" | ||
}, | ||
"smithy.api#documentation": "indicates that a client presigner could be generated for the given operation." |
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.
"smithy.api#documentation": "indicates that a client presigner could be generated for the given operation." | |
"smithy.api#documentation": "Indicates that a client presigner can be generated for the given operation." |
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.
fixed
difficult or impossible. This trait indicates that a client presigner could be | ||
generated for the given operation. |
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.
difficult or impossible. This trait indicates that a client presigner could be | |
generated for the given operation. | |
difficult or impossible. This trait indicates that a client presigner can be | |
generated for the given operation. |
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.
fixed
bump @JordonPhillips |
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.
Looks good! Lets get some more feedback from the other sdk teams before we merge though
Does this trait account for the new Sigv4-A or just Sigv4? See awslabs/aws-sdk-rust#139 (comment) for more details. |
@brainstorm the trait is not auth implementation specific. Rather, the trait references a specific operation. Details such as auth scheme can be determined elsewhere in the model associated with the tagged operation. |
.. smithy-trait:: aws.auth#presignable | ||
.. _aws.auth#presignable-trait: | ||
|
||
------------------------ |
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 needs to span the entire width of the text. So add more "-" characters.
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.
fixed in #1077
operation invocation that may be used in contexts where direct calls may be | ||
difficult or impossible. This trait indicates that a client presigner can be | ||
generated for the given operation. | ||
|
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 think this line needs to be removed.
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.
fixed in #1077
Trait value | ||
Annotation trait. | ||
|
||
The following example defines a service operation for which presigned requests can be generated for. |
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: no need for the last "for" in the above sentence.
operation PingServer {} | ||
|
||
|
||
Given this model, a client-side code generator may generate a function that presigns a `PingServer` request. |
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.
nit: we typically try to wrap .rst files at 80 chars
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.
s/may/MAY
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.
fixed in #1077
@@ -0,0 +1,39 @@ | |||
/* | |||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
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.
2021
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.
fixed in #1077 (2022)
------------------------ | ||
|
||
Trait Summary | ||
A presigner is a client-side utility that generates a presigned request for a given |
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.
Can this start with a short sentence like: "Indicates that an operation can be presigned"?
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.
fixed in #1077
"smithy.api#trait": { | ||
"selector": "operation" | ||
}, | ||
"smithy.api#documentation": "Indicates that a client presigner can be generated for the given operation." |
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.
Suggestion: "Indicates that an operation can be presigned."
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.
fixed in #1077
Closing in favor of #1077 |
Issue #, if available: N/A
Description of changes:
NOTE: this trait only models a specific use case for presigners: generators. It does not model "presign url autofill parameters" of some services due to current migration away from this to other approaches.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.