-
Notifications
You must be signed in to change notification settings - Fork 244
Allow customizing httpBearerAuth scheme #872
Description
I'd like to model a service that uses what is effectively the HTTP Bearer authentication mechanism but with a different scheme. Would it be possible to extend the httpBearerAuth trait to support this?
I'm thinking something like this:
@httpBearerAuth(scheme="ApiKey")
which would result in HTTP requests with an Authorization: ApiKey {key} header. Existing services or services that use the Bearer scheme would continue to use @httpBearerAuth without the parameter -- I'm hoping that's possible but am still new to the Smithy syntax.
Is this possible? Is it a bad idea? Is there a better way to accomplish this? I think the alternative is to create a new @authDefinition that does the right thing, but I don't particularly want to reinvent all of the surrounding codegen ecosystem just to change from Bearer to ApiKey. On a related note, I recognize that existing codegen would need to be updated to support this, where would I go to learn more?