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

fix: missing export for api key auth middleware #528

Merged
merged 4 commits into from
Mar 31, 2022

Conversation

eduardomourar
Copy link
Contributor

@eduardomourar eduardomourar commented Mar 27, 2022

Issue #, if available: N/A

Description of changes:

This fix will make easier to use the HttpApiKeyAuth middleware by exporting it in the entrypoint of a NPM package. That way we can simply import like this:

import { getHttpApiKeyAuthPlugin } from "sample-client-sdk";

Instead of:

import { getHttpApiKeyAuthPlugin } from "sample-client-sdk/dist-types/middleware/HttpApiKeyAuth";

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

@eduardomourar eduardomourar marked this pull request as ready for review March 27, 2022 21:50
@eduardomourar eduardomourar requested a review from a team as a code owner March 27, 2022 21:50
@eduardomourar eduardomourar force-pushed the fix/export-api-key-middleware branch from 2e8bf5d to 0798c45 Compare March 28, 2022 19:45
@eduardomourar
Copy link
Contributor Author

@adamthom-amzn , could you help us with this PR, please?

@adamthom-amzn
Copy link
Contributor

I'm not familiar with the use of this middleware - is the middleware not added automatically when the model has the trait applied? Do you have an example of why you would need to import something from this middleware in your code?

@eduardomourar
Copy link
Contributor Author

It only adds automatically the configuration for me, not the auth middleware.

Screenshot 2022-03-28 at 23 25 53

Also, I would like to make some customization to it (for instance, use it to populate a bearer token in the authorization header), so I have to use the middleware being autogenerated because there is no public library like this one.

@trivikr trivikr self-requested a review March 30, 2022 23:00
@trivikr trivikr merged commit a636b58 into smithy-lang:main Mar 31, 2022
@eduardomourar eduardomourar deleted the fix/export-api-key-middleware branch March 31, 2022 20:11
srchase pushed a commit to srchase/smithy-typescript that referenced this pull request Mar 17, 2023
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