All Projects → Nike-Inc → cerberus-node-client

Nike-Inc / cerberus-node-client

Licence: Apache-2.0 license
Node client for interacting with a Cerberus backend. It can be used in Amazon EC2 instances and Amazon Lambdas.

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to cerberus-node-client

cerberus-java-client
Java Client for Cerberus
Stars: ✭ 14 (-12.5%)
Mutual labels:  cerberus, cerberus-client
climatecontrol
Python library for loading settings and config data from files and environment variables
Stars: ✭ 20 (+25%)
Mutual labels:  cerberus
cerberus research
Research tools for analysing Cerberus banking trojan.
Stars: ✭ 110 (+587.5%)
Mutual labels:  cerberus
Cerberus
A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.
Stars: ✭ 4,356 (+27125%)
Mutual labels:  cerberus
cerberus-lifecycle-cli
Command Line Interface for managing a Cerberus environment in AWS
Stars: ✭ 15 (-6.25%)
Mutual labels:  cerberus
cerberus-serverless-components
A collection of AWS Serverless components for Cerberus
Stars: ✭ 12 (-25%)
Mutual labels:  cerberus

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].