@thatsmrtalbot/secrets
v1.0.6
Published
Get secrets from various providers
Downloads
7
Readme
Typescript secret manager
Simple library to abstract obtaining secrets.
Currently supports:
- Docker secrets (1.13)
- File based secrets
- Envrionment vars
Usage:
You can get values as a buffer:
secrets.use(new EnvironmentProvider());
secrets.get("private_key").then((value : Buffer) => {
// Do something with the private key
});
Or as a string:
secrets.use(new EnvironmentProvider());
secrets.get("private_key", 'utf8').then((value : string) => {
// Do something with the private key
});
Providers
Environment
import EnvironmentProvider from "@thatsmrtalbot/secrets/lib/environment"
secrets.use(new EnvironmentProvider());
Docker
import DockerProvider from "@thatsmrtalbot/secrets/lib/docker"
secrets.use(new DockerProvider());
File
import FileProvider from "@thatsmrtalbot/secrets/lib/file"
secrets.use(new FileProvider("/some/dir"));