Commit 38a2284
authored
fix(apigateway): set authorization scope when authorization type is Cognito (#30035)
### Issue # (if applicable)
Closes #29781
### Reason for this change
Authorization scope is set even when the auth type is None. This will cause deployment failure
>12:52:11 PM | CREATE_FAILED | AWS::ApiGateway::Method | ActionsApiGatewayI...oxyOPTIONS041B022A
Resource handler returned message: "Invalid Method authorization type specified. Authorization Scopes are only valid for COGNITO_USER_POOLS authorization type (Servic
e: ApiGateway, Status Code: 400, Request ID: f9c6357b-428e-42a8-884c-07b77939d165)" (RequestToken: bb8de2e9-37b7-ca15-9bd8-547bc7eea134, HandlerErrorCode: InvalidRequ
est)
### Description of changes
Check when auth type is not Cognito, set auth scope to none. Not a breaking change because original templates cannot deploy.
### Description of how you validated changes
All existing and new tests pass.
### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 3e9e0a8 commit 38a2284
File tree
13 files changed
+1706
-11
lines changed- packages
- @aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers
- assets
- integ.api-with-authorizer-and-proxy.js.snapshot
- asset.8b7a863f778f5314bab7fdad7a7957ef133c826bb93a8611a3bac36ae684e683
- aws-cdk-lib/aws-apigateway
- lib
- test
13 files changed
+1706
-11
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments