Closed spacemandev-git closed 4 years ago
Doesn't seem like the error is coming from paseto, but rather, node. Maybe the worker_threads
module is not available in that build?
Going to retry with an official v12 runtime when that becomes available on lambda
Works fine in the official node12.x
runtime.
START RequestId: d8726aa1-4c84-44f5-895c-090498e0b76d Version: $LATEST
2019-11-22T13:29:41.688Z d8726aa1-4c84-44f5-895c-090498e0b76d INFO issued token: v2.public.eyJ0ZXN0IjoxMiwiaWF0IjoiMjAxOS0xMS0yMlQxMzoyOTo0MS42ODVaIn20kNcGmftZH2XPSek6tGmzi_Xo1W9eLV1RnMflIDJAGCqsFCw0ewH7Xo3ZqV8G_a5nxndRgG_rmRzkQUPKp0AI
2019-11-22T13:29:41.688Z d8726aa1-4c84-44f5-895c-090498e0b76d INFO verified: {
payload: { test: 12, iat: '2019-11-22T13:29:41.685Z' },
footer: undefined,
version: 'v2',
purpose: 'public'
}
END RequestId: d8726aa1-4c84-44f5-895c-090498e0b76d
REPORT RequestId: d8726aa1-4c84-44f5-895c-090498e0b76d Duration: 4.98 ms Billed Duration: 100 ms Memory Size: 1024 MB Max Memory Used: 93 MB
const { V2 } = require('paseto')
module.exports.handler = async (event, context) => {
const key = await V2.generateKey('public')
const token = await V2.sign({ test: 12 }, key)
console.log('issued token:', token, '\n')
const verified = await V2.verify(token, key, { complete: true })
console.log('verified:', verified, '\n')
}
Describe the bug
I tried the same code locally as I did on aws lambda, and the lambda container could not execute. I am using a custom runtime (node v12.13) from here (https://github.com/lambci/node-custom-lambda) as the only official lambda runtimes are v8 and v10 but I don't think that's the issue.
To Reproduce Here's a sample lambda function to test the library in that I'm using
Expected behavior When used locally this code creates and verifies a token
Environment:
Bug: