-
Notifications
You must be signed in to change notification settings - Fork 91
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
Feature request: support @httpApiKeyAuth with scheme #453
Comments
@mtdowling thanks for your help with the original change in Smithy and the recommendation to take next steps here. Do you know who I should ping to start the conversation? |
Right now the only auth that's implemented for smithy-typescript is AWS's sigv4 auth: https://github.com/aws/aws-sdk-js-v3/blob/main/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAwsAuthPlugin.java To implement api key auth, you'd need to write a plugin to handle it much like that. I'm not sure when we'd be getting around to doing this, but if you want to tack a shot at it then we'd be happy to review. |
Thanks for the pointer @JordonPhillips . I'll try to figure it out, will quite likely have questions. |
OK @JordonPhillips @mtdowling, I'm back with the questions I promised 🙂:
I'll keep digging but thought I'd get these questions out there. |
Update: I think I've gotten very close to where I want. I don't particularly love the idea of having to publish a separate middleware module to set a header (though I have seen that there's already one in the AWS SDK to set the Host header), so am going to see what I can figure out so that
I haven't yet figured out how to extract the |
Update: I've figured out how to use Two parallel paths of investigation next:
|
Next layer of the onion: I'm trying to use
but that's translating into Had a brief hiccup around Also need to figure out how to change these; hopefully it's just something I shouldn't have in my model or something I'm missing:
So close! |
Figured out the correct magic by looking at other places where things were being imported:
makes the imports relativize properly. The AWS SDK headers are an unrelated problem that I'm choosing to ignore for now. Next step: tests. Will look at AddAwsAuthPluginTest.java for inspiration. |
Initial tests for the Java code are done. Need to learn how to write tests for the middleware. Back to AddAwsAuthPlugin.java:223 to see how tests get added to the client and sts-client-defaultRoleAssumers.spec.ts for examples! |
So |
I intend to create a draft PR in the morning. Anything I should keep in mind other than what's in CONTRIBUTING.md and looking at existing PRs for examples? |
In response to smithy-lang/smithy#872, smithy-lang/smithy#893 added support for describing services that require a custom scheme value in the
Authorization
header; for example:if the
Authorization
header is supposed to look likeAuthorization: ApiKey {value}
. The folks there said that opening an issue here to request support would be the best next step to building an SDK that can interact with a service like this.Searching through this repository I wasn't able to find any references to
auth
orauthorization
, so I'm not sure where to start. Opening this issue to start the conversation.The text was updated successfully, but these errors were encountered: