3.0.3 • Published 2 years ago
@teamfabric/authorizer v3.0.3
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
3.0.3
2 years ago
3.0.2
2 years ago
3.0.1
2 years ago
2.1.0-11
2 years ago
2.1.0-9
2 years ago
2.1.0-8
2 years ago
2.1.0-7
2 years ago
2.1.0-6
2 years ago
2.1.0-5
2 years ago
2.1.0-4
2 years ago
2.1.0-3
2 years ago
2.1.0-2
2 years ago
2.1.0-1
2 years ago
3.0.0
3 years ago
2.0.0
3 years ago
1.1.0-alpha.4
3 years ago
1.1.0-alpha.3
3 years ago
1.1.0-alpha.2
3 years ago
1.1.0-alpha.1
3 years ago
1.1.0-alpha.0
4 years ago
1.0.0-beta.1
4 years ago
1.0.0-beta.0
4 years ago
1.0.0-alpha.1
4 years ago
1.0.0-alpha.0
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago