Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

Support for Custom Authorizer of the REQUEST type #1159

Open james-burke-codes opened 7 years ago

james-burke-codes commented 7 years ago

Context

It is now possible when creating a custom authorizer for API Gateways to set a REQUEST type event payload which will pass all headers instead of just the authorization token header.

http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-request-lambda-function-create

Is there any plan to integrate this into Zappa?

Miserlou commented 7 years ago

Sounds great! Send over a PR!

jcronyn commented 6 years ago

Investigated this and it doesn't appear that Cloudformation currently supports accepting REQUEST as the Type for an Authorizer

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html#w2ab2c21c10c22c13

scoates commented 6 years ago

Marked cantfix until we get a way to do this on CFN.

ionutm82 commented 6 years ago

Hi,

I talked to AWS support engineers and it seems that there is a bug in documentation. The Cloudformation support is already there. Below is a template I received from AWS support:

{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "RestAPI": {
            "Type": "AWS::ApiGateway::RestApi",
            "Properties": {
                "Name": "RestAPI"
            }
        },
        "Authorizer": {
            "Type": "AWS::ApiGateway::Authorizer",
            "Properties": {
                "AuthorizerUri": "arn:aws:apigateway:region:lambda:path/path/invocations",
                "IdentitySource": "method.request.header.Auth",
                "Name": "Authorizer",
                "RestApiId": {
                    "Ref": "RestAPI"
                },
                "Type": "REQUEST"
            }
        }
    }
}

Can you, please, let me know when we can have this feature in Zappa?

[Edit: formatting –@scoates]

jcgodino commented 5 years ago

Hello, is there a plan to implement the 'REQUEST' type?