apigateway - support AuthorizationScopes property on Method resource
See original GitHub issueUsage of Cognito with API GW requires definition of OAuth scopes otherwise all API requests get rejected.
Here is snippet of method definition:
const proxy = rest.root.addResource('{any+}')
proxy.addMethod("ANY", x.lambda, {
authorizer: {authorizerId: x.auth.ref},
authorizationType: api.AuthorizationType.COGNITO,
// authorizationScopes <-- absolutely needed here
requestParameters: {
"method.request.header.Authorization": true,
}
})
CfnMethod
supports the property
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigateway.CfnMethod.html
but MethodOptions
does not support it
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigateway.MethodOptions.html
and Method
class does not pass 'em to CfnMethod
https://github.com/aws/aws-cdk/blob/v1.25.0/packages/@aws-cdk/aws-apigateway/lib/method.ts#L150
Environment
- CLI Version : 1.25.0
- Framework Version:
- OS : MacOS
- Language : typescript
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
AWS::ApiGateway::Method - AWS CloudFormation
Properties · ApiKeyRequired. Indicates whether the method requires clients to submit a valid API key. · AuthorizationScopes. A list of authorization scopes ......
Read more >PutMethodRequest (AWS SDK for Java - 2.18.37)
Request to add a method to an existing Resource resource. ... this returns true if the service returned a value for the AuthorizationScopes...
Read more >aws.apigateway.Method - Pulumi
Documentation for the aws.apigateway.Method resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >Invalid ARN when creating an integration for AWS::ApiGateway
Specifically, the Integration property. ResourceHttpGet: Type: AWS::ApiGateway::Method Properties: AuthorizationScopes: - openid ...
Read more >@aws-cdk/aws-apigateway NPM | npm.io
To help with this, Resources and Methods for the same REST API can be ... Method can be configured using the authorizationScopes property...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, that’s correct.
This has been implemented in 1.28.0.