Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
serverless-plugin-cfauthorizer
Advanced tools
Kenneth Falck kennu@sc5.io 2016
Compatibility: Serverless 1.0
This plugin allows you to define your own API Gateway Authorizers as the Serverless CloudFormation resources and apply them to HTTP endpoints. Currently the main use case for this is to enable Cognito User Pool authorizers, which are not yet supported by Serverless 1.0.
npm install --save serverless-plugin-cfauthorizer
You will first need to add a custom authorizer in the custom cfAuthorizers section of your serverless.yml. Here is an example of a Cognito User Pool authorizer. To use this example, you need to substitute your own User Pool ARN on the last line. Note that the properties of the authorizer are standard CloudFormation properties, so you can use any supported values.
custom:
cfAuthorizers:
MyAuthorizer:
Type: "COGNITO_USER_POOLS"
Name: "MyUserPoolAuthorizer"
IdentitySource: "method.request.header.Authorization"
ProviderARNs:
- "arn:aws:cognito-idp:eu-west-1:xxxxxxxxxxxx:userpool/eu-west-1_xxxxxxxxx"
Once the above resource has been added, you can configure individual HTTP endpoints in serverless.yml to use the authorizer. They will refer to it using the resource name, which is MyAuthorizer in the example.
functions:
hello:
handler: handler.hello
events:
- http:
method: get
path: hello
cfAuthorizer: MyAuthorizer
After making the changes, all you need to do is redeploy the service:
sls deploy
Use API Gateway Console to verify that the authorizer has been deployed properly.
FAQs
Kenneth Falck <kennu@sc5.io> 2016
The npm package serverless-plugin-cfauthorizer receives a total of 15 weekly downloads. As such, serverless-plugin-cfauthorizer popularity was classified as not popular.
We found that serverless-plugin-cfauthorizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.