-
Notifications
You must be signed in to change notification settings - Fork 109
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
[examples] Add an example of an APIGateway Lambda Authorizer #453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One change to make
Unrelated - do we have CI set up for the examples?
When invoking the Lambda function without `Authorization` header, the response is a `401 Unauthorized` error. | ||
|
||
```bash | ||
curl -v https://6sm6270j21.execute-api.us-east-1.amazonaws.com/demo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This URL should probably match the URL from the output above
< content-length: 26 | ||
< apigw-requestid: D3bfpidOoAMESiQ= | ||
< | ||
* Connection #0 to host 6sm6270j21.execute-api.us-east-1.amazonaws.com left intact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, one needs to change
Thanks @0xTim for the review. I'll make the change and merge. Yes, we have a CI flow for the examples :
|
Add an example of an APIGateway Lambda Authorizer
Motivation:
Lambda Authorizers allow developers to write custom logic to validate HTTP REST requests.
This example shows how to write a Lambda Authorizer in Swift and how to configure an API Gateway to use a Lambda Authorizer.
This example use a SAM template to deploy the resources.
Modifications:
Examples/APIGateway+LambdaAuthorizer
directory with the source code, atemplate.yaml
, and aREADME
file.Examples/README
Result:
There is a new example showing how to develop a Lambda authorizer in Swift and how to attach it to an APIGateway with SAM