Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

kggilmer
Copy link
Contributor

@kggilmer kggilmer commented Aug 24, 2021

Issue #, if available: N/A

Description of changes:

  • Adds an annotation trait that provides context about which specific service operations may have client-side presigners. This state is currently modeled in customizations in various SDKs. Some samples: Java v2 (in code, eg S3), Go v2, and Kotlin SDKs.

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.

Copy link
Contributor

@JordonPhillips JordonPhillips left a 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

Comment on lines 148 to 153
.. smithy-trait:: aws.auth#cognitoUserPools
.. _aws.auth#cognitoUserPools-trait:

------------------------
``presignable`` trait
------------------------
Copy link
Contributor

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)

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

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.

Copy link
Contributor Author

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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines 158 to 159
difficult or impossible. This trait indicates that a client presigner could be
generated for the given operation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@kggilmer
Copy link
Contributor Author

bump @JordonPhillips

Copy link
Contributor

@JordonPhillips JordonPhillips left a 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

@brainstorm
Copy link

Does this trait account for the new Sigv4-A or just Sigv4? See awslabs/aws-sdk-rust#139 (comment) for more details.

@kggilmer
Copy link
Contributor Author

@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:

------------------------
Copy link
Member

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.

Copy link
Contributor Author

@kggilmer kggilmer Feb 3, 2022

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.

Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/may/MAY

Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2021

Copy link
Contributor Author

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
Copy link
Member

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"?

Copy link
Contributor Author

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."
Copy link
Member

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."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in #1077

kggilmer added a commit to kggilmer/smithy that referenced this pull request Feb 3, 2022
@kggilmer
Copy link
Contributor Author

kggilmer commented Feb 3, 2022

Closing in favor of #1077

@kggilmer kggilmer closed this Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants