vault-provider
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

vault-provider

node-vault Facade to use in dataverse NodeJS projects

Config

Name Description
vaultAddr The URL of the Vault with port
vaultSecretPath Path of the secrets to be used in the application
vaultAuthType Authentication type. Only 'userpass' is supported as of now
vaultUser If the auth type is 'userpass', provide a username
vaultPassword If the auth type is 'userpass', provide a password

Usage

import VaultProvider from 'vault-provider';
import { VaultOptions } from 'kafka-provider';
import { Config as LoggerConfig } from 'commonjs-logger';
import { vaultAddr, vaultAuthType, vaultPassword, vaultSecretPath, vaultUser } from '../config/config';

const config: VaultOptions = {
  vaultAddr,
  vaultSecretPath,
  vaultAuthType,
  vaultUser,
  vaultPassword,
};

const loggerConfig: LoggerConfig = {
  logLevel: loggerLogLevel,
  logStyle: loggerLogStyle,
  appName: appName,
  moduleName: 'VaultProvider',
};

const provider = new VaultProvider(config, loggerConfig);

export default provider;

// Initialize
import vaultProvider from './providers/vault';
await vaultProvider.initialize();

// Write something to the Vault
await vaultProvider.write(user.id, secretAccessKey);

// Read something from the Vault
const secretAccessKey = await vaultProvider.read(user.id);

Readme

Keywords

Package Sidebar

Install

npm i vault-provider

Weekly Downloads

7

Version

1.0.2

License

ISC

Unpacked Size

68.1 kB

Total Files

12

Last publish

Collaborators

  • anokhi0895