-
Notifications
You must be signed in to change notification settings - Fork 55
Use existing type HttpRequest rather than specific PresignedRequest to represent presigned requests #292
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
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.
Overall looks good, one minor fix requested.
As I was reviewing it occurred to me is there any additional data that might need added over time to a presigned request such that using HttpRequest directly would become a bad idea? Should we keep PresignedRequest but have it only have a single member for now such that we leave room for additions?
e.g.
data class PresignedRequest(val request: HttpRequest)| "${endpoint.protocol}://${endpoint.hostname}${signedRequest.encodedPath}", | ||
| signedRequest.headers.toSdkHeaders() | ||
| // The signer returns the path as an encoded string, we need to partially decode this to load into [HttpRequest]. | ||
| val path = signedRequest.encodedPath.substringBefore('?') |
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.
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.
Nice! They're also much better functions than what I slapped together. I wish there was a better way of type/function discovery in the IDE.
What additional kinds of data can you think of that might be part of an |
I don't know that is why I brought it up as a possible extensibility concern. If we can't think of anything and no other teams can provide any reason I'm not overly concerned. |
Issue #
fixes #267
Description of changes
HttpRequestrather than aPresignedRequest. This allows for easy use with theHttpClientEngineimplementations in the SDK.Testing Done
The following clients were run against the generated SDKs for STS, S3, and Polly to verify functionality.
presigner-tests.zip
Scope
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.