question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

apigateway - support AuthorizationScopes property on Method resource

See original GitHub issue

Usage 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nija-atcommented, Mar 5, 2020

Yes, that’s correct.

0reactions
nija-atcommented, Mar 16, 2020

This has been implemented in 1.28.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found