Skip to content

Support for IAM Policy for Lambda Authorizer (v1) #184

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

Closed
missourian55 opened this issue Oct 31, 2020 · 14 comments
Closed

Support for IAM Policy for Lambda Authorizer (v1) #184

missourian55 opened this issue Oct 31, 2020 · 14 comments

Comments

@missourian55
Copy link

Appreciate you guys added few event types to support the LambdaAuthorizer, Any plans to add a event type for IAM policy response which will be compatible with REST API?

Currently I am using this class from blueprints
https://github.com/awslabs/aws-apigateway-lambda-authorizer-blueprints/blob/master/blueprints/java/src/io/AuthPolicy.java

APIGatewayCustomAuthorizerEvent (Rest) 
APIGatewayV2CustomAuthorizerEvent (http)
SimpleIAMPolicyResponse (http)
IAMPolicyResponse (rest) <---- missing
@msailes
Copy link
Collaborator

msailes commented Nov 2, 2020

Hi missourian55,

Yes, there is an open PR for this response. #174

Mark

@missourian55
Copy link
Author

Any ETA on when this will be merged and released? We love to have this soon to remove some custom implementation in our stack.

@msailes
Copy link
Collaborator

msailes commented Dec 31, 2020

Hi missourian55,

For a couple of reason this is proving a little annoying. In the short term I would continue to use the AuthPolicy class.

Please reply back if you have any questions.

@msailes msailes mentioned this issue Jan 11, 2021
@msailes
Copy link
Collaborator

msailes commented Mar 24, 2021

This has been released in version 3.8.0

@msailes msailes closed this as completed Mar 24, 2021
@missourian55
Copy link
Author

missourian55 commented Mar 25, 2021

Just gave IamPolicyResponse a try on Rest API. Getting below error

Execution failed due to configuration error: Unable to parse given policy: Syntax error at position (-1,-1)

{"principalId":"some","policyDocument":{"Version":"2012-10-17","Statement":[{"Condition":null,"Action":"execute-api:Invoke","Resource":["arn:aws:execute-api:us-east-1:123456789012:hr2mbvlnw6/some/POST/somemethod"],"Effect":"Allow"}]},"context":null}

I cannot use IamPolicyResponse with REST API? Its only for Http API (API GW V2)?

@msailes
Copy link
Collaborator

msailes commented Mar 25, 2021

My apologies, the response required for the REST API has an additional field "usageIdentifierKey": "{api-key}" and is a required field.

I'll create a new PR.

@missourian55
Copy link
Author

@msailes Thanks for looking into this. Currently we are using AuthPolicy for REST api and we never populated usageIdentifierKey. Is this a new breaking change?

If I need to populate this where I should get this value from?

@msailes
Copy link
Collaborator

msailes commented Mar 25, 2021

Do you have an example handler that you can share which exhibits this error?

@missourian55
Copy link
Author

is it possible to share in any private mode? Otherwise I need to do lot of scrubbing to eliminate my company info

@msailes
Copy link
Collaborator

msailes commented Mar 25, 2021

You can contact me on my username @amazon.co.uk

@missourian55
Copy link
Author

Done

@wilerson
Copy link

Any ETA on merging and releasing #233 ?

@msailes
Copy link
Collaborator

msailes commented May 26, 2021

@wilerson we hope to release this in June.

@msailes
Copy link
Collaborator

msailes commented Jun 2, 2021

this has been released in v3.9.0

@msailes msailes closed this as completed Jun 2, 2021
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

No branches or pull requests

3 participants