1.0.0 • Published 2 years ago

vault_http_api v1.0.0

Weekly downloads
-
License
Unlicense
Repository
-
Last release
2 years ago

vault_http_api

VaultHttpApi - JavaScript client for vault_http_api The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault.

The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication.

What is VGS

Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store.

VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case.

Tokenization is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. Get started with Tokenization.

Zero Data is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. Get started with Zero Data.

Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. Get started with Control.

Learn about Tokenization

Authentication

This API uses Basic authentication and is implemented using industry best practices to ensure the security of the connection. Read more about Identity and Access Management at VGS

Credentials to access the API can be generated on the dashboard by going to the Settings section of the vault of your choosing.

Docs » Guides » Access credentials

Resource Limits

Data Limits

This API allows storing data up to 32MB in size.

Rate Limiting

The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request.

Your current rate limit is included as HTTP headers in every API response:

Header NameDescription
x-ratelimit-remainingThe number of requests remaining in the 1-minute window.

If you exceed the rate limit, the API will reject the request with HTTP 429 Too Many Requests.

Errors

The API uses standard HTTP status codes to indicate whether the request succeeded or not.

In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response:

{
    \"errors\": [
        {
            \"status\": 400,
            \"title\": \"Bad request\",
            \"detail\": \"Too many values (limit: 20)\",
            \"href\": \"https://api.sandbox.verygoodvault.com/aliases\"
        }
    ]
}

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install vault_http_api --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your vault_http_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var VaultHttpApi = require('vault_http_api');

var defaultClient = VaultHttpApi.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

var api = new VaultHttpApi.AliasesApi()
var opts = {
  'createAliasesRequest': {"data":[{"value":122105155,"classifiers":["bank-account"],"format":"UUID","storage":"PERSISTENT"}]} // {CreateAliasesRequest} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createAliases(opts, callback);

Documentation for API Endpoints

All URIs are relative to https://api.sandbox.verygoodvault.com

ClassMethodHTTP requestDescription
VaultHttpApi.AliasesApicreateAliasesPOST /aliasesCreate aliases
VaultHttpApi.AliasesApideleteAliasDELETE /aliases/{alias}Delete alias
VaultHttpApi.AliasesApirevealAliasGET /aliases/{alias}Reveal single alias
VaultHttpApi.AliasesApirevealMultipleAliasesGET /aliasesReveal multiple aliases
VaultHttpApi.AliasesApiupdateAliasPUT /aliases/{alias}Update data classifiers

Documentation for Models

Documentation for Authorization

basicAuth

  • Type: HTTP basic authentication