This repository contains working code examples for NodeJS, described in posts made on my website and Medium . What follows is an installation guide and links to examples.
In this example the jsonwebtoken library is showcased, with example of how to use a public/private keypair to sign and verify a token.
JWTs are very useful, especially for decoupled software infrastructure architecture such as Microservices, Security First, or Serverless. As technology progresses and more APIs are built to scale, it becomes critical to think about how we deal with authorization, not just authentication.
In this example prototyping is showcased using filecaching as an example. We want the methods for setting and getting cache on our API, but we also want to implement TTL for file cache.
Mixins or base classing can be used for the same purpose, but every once in a while you run into issues with both those approaches, and here prototyping is my goto.