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

cerberus-node-client

v4.0.0

Published

Node client for Cerberus Key Mgmt

Downloads

18,826

Readme

Cerberus Node Client

This is a node client for interacting with a Cerberus backend. It can be used in any environment that has AWS credentials available.

To learn more about Cerberus, please visit the Cerberus website.

This library is compatible with node 12.x +, for previous versions of Node use the 1.x versions of the client

Node.js CI codecov NPM License

Installation

npm install --save cerberus-node-client

Usage

See the CerberusClient class on the the docs site

Authentication

The cerberus client uses the AWS SDK Credentials provider chain to load AWS IAM credentials and authenticates with Cerberus via the sts auth endpoint This client will work in any environment that has access to AWS Credentials.

Cerberus will attempt to authenticate one its first call. The authentication result will be stored and reused. If the token has expired on a subsequent call, authentication will be repeated with the original configuration. You should not have to worry about authentication or token expiration; just use the client.

Testing

First, make sure the following environment variables are set before running the Node Client integration tests:

export CERBERUS_HOST="https://example.cerberus.com"
export TEST_REGION="us-west-2"
export TEST_SDB="my-sdb"
export TEST_SDB_CATEGORY="app"

Ensure the TEST_SDB and TEST_SDB_CATEGORY variables match up with the path to your test sdb (i.e. app/my-sdb/test-path)

Then make sure AWS credentials have been obtained. One method is by running gimme-aws-creds:

gimme-aws-creds

Next, in the project directory run:

npm run style && npm run test:unit:local && npm run test:integration

If applicable, we recommend running the Node Client integration tests in both AWS Global and AWS China using the corresponding hosts, regions, and AWS credentials.

A Note about Lambdas and Cerberus

While this client supports any env with IAM credentials, generally it does NOT make sense to store Lambda secrets in Cerberus for two reasons:

  1. Cerberus can't support the scale that lambdas may need, e.g. thousands of requests per second
  2. Lambdas will not want the extra latency needed to authenticate and read from Cerberus

A better solution for Lambda secrets is using the encrypted environmental variables feature provided by AWS.

Another option is to store Lambda secrets in Cerberus but only read them at Lambda deploy time, then storing them as encrypted environmental variables, to avoid the extra Cerberus runtime latency.

License

Cerberus Management Service is released under the Apache License, Version 2.0

[coverage img]codecov