-
Notifications
You must be signed in to change notification settings - Fork 103
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: support @httpApiKeyAuth trait #473
feat: support @httpApiKeyAuth trait #473
Conversation
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Show resolved
Hide resolved
.../java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPluginTest.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Show resolved
Hide resolved
First round of fixes pushed, will rebase & squash them once I've got all the comments addressed. |
@kstich @mtdowling @JordonPhillips what are the next steps I need to take for this PR? Is there any chance you'll have an opportunity to review soon? I don't mean to be pushy, just don't know what timeline to expect here as I haven't heard anything since Tuesday afternoon. I left the changes from code review comments as separate commits so they would be easier to review, but I could rebase, squash back to a single commit, and mark ready for review. I think I've addressed all of Kevin's comments and the tests (unit tests as well as manual testing of a generated client) seem to indicate this does what I hoped it would. |
Pushed a change ( |
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Show resolved
Hide resolved
.../java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPluginTest.java
Outdated
Show resolved
Hide resolved
...rc/main/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth.ts
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Show resolved
Hide resolved
...are/amazon/smithy/typescript/codegen/integration/http-api-key-auth-trait-all-optional.smithy
Outdated
Show resolved
Hide resolved
Pushed changes to address most comments; still need to do the work to support an API key in a query parameter. |
I think I've addressed all of the review comments so far. I've realized, though, that I'm missing the validator to check for conflicts. I probably won't get to that today, maybe tomorrow. |
Silly me, I got confused, the validator is for a different PR. I think this is ready to be re-reviewed. |
I think this is ready to move to non-draft, I've initiated the CI run. |
This adds codegen support for services and operations that use the @httpApiKeyAuth trait. The generated client will have a new `apiKey` config attribute. This value will be injected into the header that's specified in the trait by new middleware that's included in the codegen client.
eae855f
to
7684950
Compare
Thanks @kstich ! |
...rc/main/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth.ts
Outdated
Show resolved
Hide resolved
...rc/main/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth.ts
Show resolved
Hide resolved
...rc/main/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth.ts
Outdated
Show resolved
Hide resolved
Pushed fixup commits to address comments and fix missing |
...main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java
Show resolved
Hide resolved
Pushed a behavioural change in |
f2f40d3
to
5dd6606
Compare
kstich had provided approval over comment in #473 (comment)
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
We will create a new middleware to handle API keys in the context of Smithy generated models (probably not applicable for AWS specific services). The code is based heavily on [this PR]( smithy-lang/smithy-typescript#473 ) from the Smithy TypeScript repository. In order for it to work, we need to ensure the Bearer token middleware succeeds even when the `token` is not set.
Co-authored-by: Trivikram Kamat <[email protected]>
Issue #, if available: Fixes #453.
Description of changes: This adds codegen support for services and operations that use the
@httpApiKeyAuth
trait.The generated client will have a new
apiKey
config attribute. This value will be injected into the header/query parameter that's specified in the trait by new middleware that's included in the codegen client.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.