Skip to content

Conversation

@kggilmer
Copy link
Contributor

Issue #

fixes #267

Description of changes

  • Presigner returns a HttpRequest rather than a PresignedRequest. This allows for easy use with the HttpClientEngine implementations 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kggilmer kggilmer requested review from aajtodd and ianbotsf August 23, 2021 22:51
Copy link
Contributor

@aajtodd aajtodd left a 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('?')
Copy link
Contributor

Choose a reason for hiding this comment

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

correctness

There are already functions in crt-util to do both of these:

Copy link
Contributor Author

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.

@ianbotsf
Copy link
Contributor

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?

What additional kinds of data can you think of that might be part of an HttpRequest?

@aajtodd
Copy link
Contributor

aajtodd commented Aug 24, 2021

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?

What additional kinds of data can you think of that might be part of an HttpRequest?

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.

@kggilmer kggilmer merged commit b4c12e6 into main Aug 24, 2021
@kggilmer kggilmer deleted the fix-presigner-types branch August 24, 2021 20:45
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.

Simple interop between presigned requests and our HTTP client abstractions

3 participants