1.0.1 • Published 6 years ago

serverless-plugin-authorizer v1.0.1

Weekly downloads
58
License
MIT
Repository
github
Last release
6 years ago

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