-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat: provide context with app transport signer #119
base: master
Are you sure you want to change the base?
Conversation
Adds the "SignWithContext" interface that allows implementations that use I/O (e.g. calls to a remote KMS) to use the context of the current request, allowing it to participate in the cancellation/timeout as appropriate.
c5edb74
to
74c1f7d
Compare
Note: if the approach in #119 is OK, I'd change this implementation to implement the newer options interface. |
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 looks good - thanks!
t.Fatalf("error calling RoundTrip: %v", err) | ||
} | ||
|
||
if !check.Captured { |
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: you can omit this - check.Value will be nil if this is not set, and we're always comparing against a populated want value.
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.
That's quite true. I added this so the test failure was more self explanatory even though it's not strictly necessary. Happy to remove it though, LMK what you think.
The test doesn't require key variability, so using a simpler type makes a lot of sense.
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.
Marking this for re-review, LMK whether you'd like the explicit test failure message or the implicit behaviour.
@wlynch / @bradleyfalzon do you have any further refinements or comments on how you would like this PR to proceed? I'm happy to put some more effort into it if that's what it needs. |
@wlynch / @bradleyfalzon following up on this to see whether or not you'd like me to proceed, and to let you know that I'm still monitoring this PR. This is not meant to add pressure: I realise we are all busy on other things. |
Adds the
SignWithContext
interface that allows implementations that use I/O (e.g. calls to a remote KMS) to use the context of the current request, allowing it to participate in cancellation/timeout as appropriate.Backwards compatibility is preserved by wrapping a
Signer
implementation in wrappingSignerWithContextAdapter
. The existingSigner
interface has been marked as deprecated to signal to implementors of the new implementation.The existing
RSASigner
now implements both interfaces, with theSign
method marked as deprecated. This preserves backwards compatibility and avoids requiring an adaptor for the default implementation.Fixes #117