Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function config(options?: Options) {
this.vault = VaultLib(options)
}
const setupVaultWithGithubToken = async ({ endpoint }) => {
const { VAULT_AUTH_GITHUB_TOKEN } = process.env;
if (!VAULT_AUTH_GITHUB_TOKEN)
throw Error('VAULT_AUTH_GITHUB_TOKEN not found');
const vaultClient = vault({ endpoint });
const res = await vaultClient.githubLogin({
token: VAULT_AUTH_GITHUB_TOKEN,
});
vaultClient.token = res.auth.client_token;
return vaultClient;
};