Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@life-without-barriers/lambda-authentication
Advanced tools
Custom lamdba authorizer for AWS API Gateway/Serverless
JWT auth for API Gateway custom authorizers & Serverless
Uses HMACSHA256 with a shared secret. If you are using tokens signed using RSA, v1 might give you some ideas. Uses a cookie to roundtrip the JWT, so make sure you consider CSRF protection on your api endpoints.
This package is intended to run on node v6.10.x (the latest version of node available to lambda at the time)
First, export the authorizer with the correct path:
const authorizer = require('@life-without-barriers/lambda-authentication').authorizer
exports.myAuthorizer = authorizer({
path: '/my-cool-site', // The path to your API
logger: bunyan.createLogger({ name: 'my-app' }), // Accepts any bunyan logger. optional
audience: 'abc123', // The audience
issuer: 'my-openid-org', // the issuer
cookieName: 'foo', // the name of the cookie that contains the JWT
secret: 'secret key for HMAC signing'
})
Then, expose the lambda in your serverless.yml
and delegate authorization to it:
functions:
myAuthorizer:
handler: app.myAuthorizer
app:
handler: app.myApp
events:
- http:
path: /my-cool-site
method: get
cors: true
authorizer:
name: myAuthorizer
identitySource: method.request.header.Cookie # IMPORTANT! use cookie auth
FAQs
Custom lamdba authorizer for AWS API Gateway/Serverless
We found that @life-without-barriers/lambda-authentication demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.