You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(apigateway): authorization scope is not added when not explicitly defining authorization type in method or root api (#30822)
### Issue # (if applicable)
Closes#30444
### Reason for this change
The original PR caused a breaking change, we can't rollback because it
was released in v2.142.0 and it fixes customers issues (partially).
Simply doing a revert will be breaking for those customers again.
### Description of changes
Identified the root cause and we should use `AuthorizationType` instead
of `AuthorizationTypeOption`. `AuthorizationType` defaults to find the
authorization type from the authorizer, falling back to use the auth
type defined in the `Method` construct's options property and falling
back to `None`.
`AuthorizationTypeOptions` on the other hand tries to find the auth type
from `Method` construct's options property which can be None because
it's optional.
### Description of how you validated changes
New unit tests covering the changes and new integration tests covering
it.
### 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*
---------
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-method.js.snapshot/apigatewaywithauthorizerandproxyDefaultTestDeployAssertDBEA1774.assets.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-method.js.snapshot/apigatewaywithauthorizerandproxyDefaultTestDeployAssertDBEA1774.template.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-method.js.snapshot/cdk.out
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-method.js.snapshot/integ.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-method.js.snapshot/integtest-restapi-with-authorizer-and-proxy.assets.json
0 commit comments