npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

digital-lambda-authorizer

v0.1.12

Published

API Gateway lambda authorizer that validates Okta tokens for Digital applications.

Downloads

4

Readme

digital-lambda-authorizer

Lambda function that acts as an authorizer for Digital API Gateways.

The logic for the authorizer validates an Okta token, which should be supplied in a request header when clients make calls to a protected resource. This codebase allows parameters to be supplied for the Okta client ID and issuer URL that is used in the token validation process. Due to this parameterization, it is possible to deploy this authorizer multiple times to the same environment and the same account (using different parameter values) when you have more than 1 Okta client ID that being used to generate tokens.

Local Environment Setup

You will need to have the following installed on your computer:

  • node 14.0.0 and npm
    • MacOS users should consider installing nvm for easy switching of node versions
  • AWS CLI - Install the AWS CLI and [configure it with your AWS credentials].
  • SAM CLI - Install the SAM CLI
    • The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.
  • Docker or Docker Desktop - Install Docker community edition

Testing locally

Steps

  1. Acquire a token (which can be done with Postman) and set it into src/test/event.json as the value for the authorizationTokengit property.
  2. Create/update a file in the root directory of this project called local-env-var-overrides.json and populate it with correct values. The contents of the file should be based on the local-env-var-overrides.json.example template
  3. Execute the below command

npm run-script test-invoke-local-lambda

Deploying manually to the AWS Dev environment

To deploy the authorizer for use by Digital applications, run this command npm run-script deploy:dev

To deploy the authorizer for use by Digital applications, run this command npm run-script deploy:dev-fleet

Note - running the correct script will ensure that the right stack name and parameter values are used.