Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gremlin-aws-sigv4

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gremlin-aws-sigv4

This package provides an extension for Apache's TinkerPop3 Gremlin [javascript driver](https://github.com/apache/tinkerpop/tree/master/gremlin-javascript/src/main/javascript/gremlin-javascript) compatible with [IAM Database Authentication for Neptune](htt

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gremlin-aws-sigv4

This package provides an extension for Apache's TinkerPop3 Gremlin javascript driver compatible with IAM Database Authentication for Neptune.

Installation

This project is a Node.js module and can be installed with npm.

npm install gremlin-aws-sigv4

Usage

This package reads the environment variables for AWS authentication. These variables can be overridden.

Usage with environment variables

These three enviroment variables must be defined.

  • AWS_ACCESS_KEY_ID – AWS access key.
  • AWS_SECRET_ACCESS_KEY – AWS secret key.
  • AWS_DEFAULT_REGION – AWS region.
  const gremlin = require('gremlin-aws-sigv4');

  const host = 'your-instance.neptune.amazonaws.com';
  const port = 8182;

  // creates the connection
  const graph = new gremlin.structure.Graph();
  const connection = new gremlin.driver.AwsSigV4DriverRemoteConnection(host, port);
  const g = graph.traversal().withRemote(connection);

  // run the query, here it counts the number of vertices in database
  const count = await g.V().count().next();

  // close the connection
  connection.close();

Usage without environment variables

  const gremlin = require('gremlin-aws-sigv4');

  const host = 'your-instance.neptune.amazonaws.com';
  const port = 8182;
  const opts = {
    accessKey: 'your-access-key',
    secretKey: 'your-secret-key',
    region: 'your-region',
  };

  // creates the connection
  const graph = new gremlin.structure.Graph();
  const connection = new gremlin.driver.AwsSigV4DriverRemoteConnection(host, port, opts);
  const g = graph.traversal().withRemote(connection);

  // run the query, here it counts the number of vertices in database
  const count = await g.V().count().next();

  // close the connection
  connection.close();

Tests

Unit tests

# install dependencies
npm install

# run the tests
npm run test:unit

Integration tests

Docker is required to run integration tests, a gremlin-server container will be created.

# install dependencies
npm install

# start docker container
npm run docker:start

# run the tests
npm run test:e2e

# stop and delete docker container
npm run docker:stop

All tests and coverage

Docker is required to run all tests, a gremlin-server container will be created.

# install dependencies
npm install

# start docker container
npm run docker:start

# run the tests
npm run test

# stop and delete docker container
npm run docker:stop

Dependencies

Contribute

Please do contribute! Open an issue or submit a pull request.

The project falls under @Shutterstock's Code of Conduct.

License

License: MIT

Keywords

FAQs

Package last updated on 12 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc