Skip to content
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(experimentalIdentityAndAuth): Add generic @httpApiKeyAuth support #883

Merged
merged 3 commits into from
Sep 1, 2023

Conversation

syall
Copy link
Contributor

@syall syall commented Aug 18, 2023

Issue #, if available:

N/A.

Description of changes:

NOTE: All of these are under the experimentalIdentityAndAuth feature flag

NOTE: Dependent on #881

  • Adding config properties apiKey:
    /**
     * The API key to use when making requests.
     */
    apiKey?: ApiKeyIdentity | ApiKeyIdentityProvider;
  • @smithy/experimental-identity-and-auth package: add the ApiKeyIdentity interface and ApiKeyIdentityProvider type, HttpApiKeyAuthLocation enum, and default HttpApiKeyAuthSigner implementation.
  • Add back operations that support @httpApiKeyAuth in the generic client test

Testing:

  • @httpApiKeyAuth client codegen diff given the following model changes: https://gist.github.com/syall/a595c7738c380176a528ff29016f1c2c#file-httpapikeyauth-trait-client-diff
    • The existing integration generated middleware and tests in the client package, which is why there is such a large removal in the diff.
     @fakeProtocol
     // feat(experimentalIdentityAndAuth): uncomment operations as individual
     //   auth scheme support is implemented
    -// @httpApiKeyAuth(name: "X-Api-Key", in: "header")
    +@httpApiKeyAuth(name: "X-Api-Key", in: "header")
     // @httpBearerAuth
     // @sigv4(name: "weather")
     // @auth([sigv4])
    @@ -26,12 +26,12 @@ service Weather {
             // feat(experimentalIdentityAndAuth): uncomment operations as individual
             //   auth scheme support is implemented
             // experimentalIdentityAndAuth
    -        // OnlyHttpApiKeyAuth
    +        OnlyHttpApiKeyAuth
             // OnlyHttpBearerAuth
             // OnlyHttpApiKeyAndBearerAuth
             // OnlyHttpApiKeyAndBearerAuthReversed
    -        // OnlyHttpApiKeyAuthOptional
    -        // SameAsService
    +        OnlyHttpApiKeyAuthOptional
    +        SameAsService
         ]
     }
  • No codegen diff for aws-sdk-js-v3

If one or more of the packages in the /packages directory has been modified, be sure yarn changeset add has been run and its output has
been committed and included in this pull request. See CONTRIBUTING.md.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@syall syall force-pushed the add-generic-httpApiKeyAuth-support branch 3 times, most recently from cfc571d to dc89424 Compare August 21, 2023 20:34
@syall syall force-pushed the add-generic-httpApiKeyAuth-support branch 9 times, most recently from 0b91bda to 27cc259 Compare August 23, 2023 00:11
@syall syall force-pushed the add-generic-httpApiKeyAuth-support branch from 27cc259 to 1127eb3 Compare August 31, 2023 19:25
@syall syall marked this pull request as ready for review August 31, 2023 19:32
@syall syall requested review from a team as code owners August 31, 2023 19:32
@syall syall force-pushed the add-generic-httpApiKeyAuth-support branch 2 times, most recently from 994525e to 3dda396 Compare August 31, 2023 23:01
Steven Yuan added 3 commits September 1, 2023 14:09
Remove the `experimentalIdentityAndAuth` checks within the integration,
and add a new `AddHttpApiKeyAuthIntegration` that is decided based on
`matchesSettings()`.

Registers the `@httpApiKeyAuth` scheme.
@syall syall force-pushed the add-generic-httpApiKeyAuth-support branch from 3dda396 to 5764b4b Compare September 1, 2023 21:09
@syall syall merged commit b24966e into smithy-lang:main Sep 1, 2023
@syall syall deleted the add-generic-httpApiKeyAuth-support branch September 7, 2023 17:23
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.

3 participants