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(apigateway): support for API Key values and names #7714

Merged
merged 5 commits into from
May 13, 2020
Merged

feat(apigateway): support for API Key values and names #7714

merged 5 commits into from
May 13, 2020

Conversation

njlynch
Copy link
Contributor

@njlynch njlynch commented Apr 30, 2020

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

Allows for specifying a value for the API Key, either as part of
addApiKey or RateLimitedApiKey construct.

fixes #3233
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: cfd1f68
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

*/
public addApiKey(id: string): IApiKey {
public addApiKey(id: string, value?: string): IApiKey {
Copy link
Contributor

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

Copy link
Contributor

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 😊

@mergify mergify bot dismissed nija-at’s stale review May 13, 2020 11:15

Pull request has been modified.

@njlynch njlynch changed the title feat(apigateway): add support for specifying API Key values feat(apigateway): support for API Key values and names May 13, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 485b292
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@nija-at nija-at left a 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.

Comment on lines 183 to 185
```ts
const key = api.addApiKey('ApiKey', 'MyApiKeyThatIsAtLeast20Characters');
```
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@mergify mergify bot dismissed nija-at’s stale review May 13, 2020 12:28

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: ddf943d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented May 13, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: bdf871a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented May 13, 2020

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).

@mergify mergify bot merged commit e93da2c into aws:master May 13, 2020
@njlynch njlynch deleted the njlynch/issue-3233 branch May 13, 2020 15:48
karupanerura pushed a commit to karupanerura/aws-cdk that referenced this pull request May 22, 2020
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.

Custom names for API keys in API Gateway API Gateway: Custom API key value and API key export
3 participants