-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(apigateway): support for API Key values and names #7714
Conversation
Allows for specifying a value for the API Key, either as part of addApiKey or RateLimitedApiKey construct. fixes #3233
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
*/ | ||
public addApiKey(id: string): IApiKey { | ||
public addApiKey(id: string, value?: string): IApiKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will make the API less extendible.
Instead create a new interface called ApiKeyOptions
which will be inherited into ApiKeyProps
. The second parameter of this API call will be of the type ApiKeyOptions
.
Here's an example - https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-cognito/lib/user-pool.ts#L666-L682
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By doing this, and moving apiKeyName
to ApiKeyOptions
, you will be able to fix this as well - #7767 😊
…ming of the key fixes #7767
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes. Docs need corresponding update.
```ts | ||
const key = api.addApiKey('ApiKey', 'MyApiKeyThatIsAtLeast20Characters'); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is not aligned with code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh. Whoops! Posted an update to the README.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Commit Message
feat(apigateway): specify API key name and value in
addApiKey()
(#7714)fixes #3233
fixes #7767
End Commit Message
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license