serverless-plugin-authorizer

1.0.1 • Public • Published

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: request

However, 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: request

Using authorize: true to your http event like so:

# After 
functions:
  myFunction:
    handler: src/myFunction.handler
    events:
      http:
        path: path/to/function
        method: get
        authorize: true

Install

Using yarn:

yarn add serverless-plugin-authorizer

Using npm:

npm install serverless-plugin-authorizer --save-dev

Add the plugin to your serverless.yml file:

plugins:
  - serverless-plugin-authorizer

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1

Package Sidebar

Install

npm i serverless-plugin-authorizer

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

37.5 kB

Total Files

5

Last publish

Collaborators

  • davidvanleeuwen