-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Chalice Deploy - Create Custom Authorizer along with Gateway API? #309
Comments
There's a PR that adds back behavior in older versions of chalice: #322 Once that PR's merged, the workflow becomes:
from chalice import CustomAuthorizer
authorizer = CustomAuthorizer(
'MyCustomAuth', header='Authorization',
authorizer_uri=('arn:aws:apigateway:region:lambda:path/2015-03-01'
'/functions/arn:aws:lambda:region:account-id:'
'function:FunctionName/invocations'))
@app.route('/custom-auth', methods=['GET'], authorizer=authorizer)
def authenticated():
return {"secure": True} The next step we're looking at is providing your custom authorizer as part of the chalice app so chalice would handle deploying that lambda function as well. There's a few things we need to properly handle multiple lambda functions in a single chalice app, but it is something that's on our backlog. |
Is it possible to pass in the execution role that the Authorizer runs as? It's creating a default execution role right now and that's just not going to work. I'm getting pretty desperate here, I'm about a day away from abandoning chalice altogether. Thanks. |
There's no support for chalice creating the authorizer function right now as part of Let me know if you have any feedback on the proposal. |
It appears as if this code is creating the authorizer (not the function itself)- it definitely is. So, given that can you alllow for the passing in of the auth execution role? |
@abcondas, as an alternative, what about having chalice apply a resource policy to the function so that api gateway is capable of invoking it for authorization? Since the function has to pre-exist at this point, adding a resource permission to it might be easier to manage than creating an execution role for the authorization invocation. |
I'm using chalice 0.6.0 (but I don't think this is possible in the latest version either) - is it possible to get chalice deploy to create the custom authorizer, along with the rest api and lambda function? If not, then how is this supposed to work? Use chalice deploy to create the api and lambda, then create the authorizer, then go back and add the authorizer id to the route definitions and redeploy the lambda function? There must be a way to do this through chalice deploy, please advise. And if not, then let this be my official request to add this functionality as quickly as possible. Thanks!
The text was updated successfully, but these errors were encountered: