0.0.6 • Published 3 years ago

vault_prototype v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Build Status npm version codecov

Installation

yarn add vault_prototype

npm install vault_prototype

Using token

const vault_prototype = require('vault_prototype');

(async function () {

    try {

        const vault = vault_prototype({
            apiVersion: 'v1',
            endpoint: 'http://127.0.0.1:3370',
            token: 's.Jfium3aoAYNVvFHQpUxB8EGR' ,
        });

        const secrets = await vault.get(`secret/hello-world/data/test`);

        console.log(secrets);
        // { password: 'my-long-password', xxx: 'yyy' }
    }
    catch (e) {

        console.log({
            general_vault_error: e
        })
    }

}());

AppRole

https://www.vaultproject.io/docs/auth/approle#via-the-cli-1

const vault_prototype = require('vault_prototype');

(async function () {

    try {

        const vault = vault_prototype({
            apiVersion: 'v1',
            endpoint: 'http://127.0.0.1:3370'
        });

        await vault.generateTokenAppRole({
            role_id     : process.env.VAULT_ROLE_ID,
            secret_id   : process.env.VAULT_SECRET_ID,
        });

        const secrets = await vault.get(`secret/hello-world/data/test`);

        console.log(secrets)
        // { password: 'my-long-password', xxx: 'yyy' }
    }
    catch (e) {

        console.log({
            general_vault_error: e
        })
    }

}());
0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago