Skip to content

Project for experimenting with Node.js cryptographic libraries.

Notifications You must be signed in to change notification settings

tgillus/node-crypto-playground

Repository files navigation

Node Crypto Playground

This project serves as a playground for experimenting with Node.js cryptographic libraries.

Some of the code examples require an Auth0 with an API connection that issues OAuth access tokens.

Some of the code examples require the creation of an AWS Cognito user pool that issues OAuth access tokens. The AWS Cloud Development Kit (CDK) is used to create all of the necessary AWS Cognito resources.

Prerequisites

Ensure the following requirements are met prior to usage:

Setup

  1. Clone the repository:
git clone git@github.com:tgillus/node-crypto-playground.git
  1. Install the project dependencies:
cd node-crypto-playground
npm install
  1. Create a .env in the root of the project based on the .env.example file and add values for each of the environment variables:
cp .env.example .env

The environment variables have place holder values that need to be replaced with actual values.

NOTE: The .env file is used to store sensitive information such as OAuth client id and client secret values. Do not commit the .env file to source control.

Commands

Command Description
npm run build Check for TypeScript errors.
npm run watch Watch for changes and check for TypeScript errors.
npm run test Execute unit tests.
npm run cdk deploy Deploy a CDK stack to AWS.
npm run cdk diff Compare a deployed stack with current state.
npm run cdk destroy Delete a CDK stack (and its associated resources) from AWS.
npm run cdk synth Emit synethesize CloudFormation template for a CDK stack.
npm run format Format source files.
npm run lint Run linter against source files.
npm run lint:fix Lint source files and fix issues disovered by the linter.

Command Examples

Deploy AWS Cognito Resources

npm run cdk deploy -- --all

Request and Validate an Auth0 Access Token

npx tsx src/playground/crypto/oauth/auth0/auth0.ts

Request and Validate an AWS Cognito Access Token

npx tsx src/playground/crypto/oauth/cognito/openid-client.ts

Delete AWS Cognito Resources

npm run cdk destroy -- --all --force

About

Project for experimenting with Node.js cryptographic libraries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published