2.1.2-0 • Published 2 years ago

@teamfabric/authorizer-commmerce v2.1.2-0

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
2 years ago

README

Global Authorizer function to authorize protected routes

How do I get set up?

  • Summary of set up npm install @teamfabric/authorizer Add a route under a /app/routes/auth/authorizer.js Copy and paste below
const { authorize } = require('@teamfabric/authorizer')
exports.handler = async event => {
  return authorize(event)
}

In your serverless.yml add the handeer to the route above

functions:
  authorizerFunc:
    handler: app/routes/auth/authorize.handler

For routes you want to protect add

authorizer:
    name: authorizerFunc # execute this before function call!
    resultTtlInSeconds: 0

For example

user-get:
    name: ${self:provider.apiName}-user-get
    memorySize: 512
    handler: app/routes/user/core/get.handler
    events:
      - http:
          method: get
          path: /user/{userId}
          private: true
          authorizer:
            name: authorizerFunc # execute this before function call!
            resultTtlInSeconds: 0

TO DO

  • move the jwt public and private key to files
2.1.2-0

2 years ago

2.1.1

2 years ago

2.1.1-0

2 years ago

2.1.0

2 years ago

2.1.0-5

2 years ago

2.1.0-4

2 years ago

2.1.0-3

3 years ago

2.1.0-2

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

1.0.1-0

3 years ago