1.0.1 • Published 8 years ago
serverless-plugin-authorizer v1.0.1
Serverless Plugin Authorizer
Normally you would define this in every function in your http event:
# Before
authorizer:
resultTtlInSeconds: 30
arn: arn:aws:lambda:xxxx:function:authorizer-fn
type: requestHowever, now you can add authorization which will allow everything to be passed through as authorizer in your functions.
# After
custom:
authorization:
resultTtlInSeconds: 30
arn: arn:aws:lambda:xxxx:function:authorizer-fn
type: requestUsing authorize: true to your http event like so:
# After
functions:
myFunction:
handler: src/myFunction.handler
events:
- http:
path: path/to/function
method: get
authorize: trueInstall
Using yarn:
yarn add serverless-plugin-authorizerUsing npm:
npm install serverless-plugin-authorizer --save-devAdd the plugin to your serverless.yml file:
plugins:
- serverless-plugin-authorizer1.0.1
8 years ago