Class

VaultService

VaultService()

Service encapsulating HashiCorp Vault interactions for secret management.

Constructor

# new VaultService()

View Source services/vault.service.js, line 8

Methods

# async authenticateWithAppRole() → {Promise.<void>}

Authenticate using the AppRole method.

View Source services/vault.service.js, line 59

Resolves when a client token is assigned.

Promise.<void>

# close() → {void}

Close vault connections and cleanup.

View Source services/vault.service.js, line 240

void

# async deleteSecret(key) → {Promise.<boolean>}

Delete a secret from HashiCorp Vault.

Parameters:
Name Type Description
key string

Secret path to delete.

View Source services/vault.service.js, line 163

True when deletion succeeded.

Promise.<boolean>

# async getSecret(optionalKeyopt) → {Promise.<(Record.<string, string>|null)>}

Retrieve a secret from HashiCorp Vault (with optional key override).

Parameters:
Name Type Attributes Description
optionalKey string <optional>

Optional secret path; defaults to configured mount.

View Source services/vault.service.js, line 127

Secret payload or null when missing.

Promise.<(Record.<string, string>|null)>

# async hasSecret(key) → {Promise.<boolean>}

Check if a secret exists in HashiCorp Vault.

Parameters:
Name Type Description
key string

Secret path to check.

View Source services/vault.service.js, line 190

True when the secret exists.

Promise.<boolean>

# async healthCheck() → {Promise.<boolean>}

Check if HashiCorp Vault is healthy and accessible.

View Source services/vault.service.js, line 260

True when Vault operations succeed.

Promise.<boolean>

# async initialize() → {Promise.<void>}

Initialize the HashiCorp Vault service.

View Source services/vault.service.js, line 17

Resolves when initialization completes.

Promise.<void>

# async listKeys() → {Promise.<Array.<string>>}

List all keys in the vault (requires list capability on the mount path).

View Source services/vault.service.js, line 211

Collection of stored secret keys.

Promise.<Array.<string>>

# async setSecret(key, value) → {Promise.<void>}

Store a secret in HashiCorp Vault.

Parameters:
Name Type Description
key string

Path to store the secret under.

value Record.<string, string>

Secret payload map.

View Source services/vault.service.js, line 101

Resolves when the value is persisted.

Promise.<void>