GithubHelp home page GithubHelp logo

bug: Library breaks on lambda about paseto HOT 3 CLOSED

panva avatar panva commented on June 15, 2024
bug: Library breaks on lambda

from paseto.

Comments (3)

panva avatar panva commented on June 15, 2024

Doesn't seem like the error is coming from paseto, but rather, node. Maybe the worker_threads module is not available in that build?

from paseto.

spacemandev-git avatar spacemandev-git commented on June 15, 2024

Going to retry with an official v12 runtime when that becomes available on lambda

from paseto.

panva avatar panva commented on June 15, 2024

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')
}

from paseto.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.