Classes
Members
# secretsConfig
The dynamic configuration for secrets to load
Methods
# addISecretConfig(config) → {void}
Add a new secret configuration dynamically
Parameters:
| Name | Type | Description |
|---|---|---|
config |
ISecretConfig
|
The configuration for the secrets to add |
A promise that resolves when the secrets are added
void
# get(key) → {string|undefined}
Get a secret value
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string
|
The key of the secret to get |
The value of the secret
string
|
undefined
# getConfiguredSecrets() → {Array.<string>}
Get all configured secret keys
An array of all configured secret keys
Array.<string>
# getISecretConfig(secretName) → {ISecretKey|undefined}
Get configuration for a specific secret
Parameters:
| Name | Type | Description |
|---|---|---|
secretName |
string
|
The name of the secret to get the configuration for |
The configuration for the secret, or undefined if not found
ISecretKey
|
undefined
# getLoadedKeys() → {Array.<string>}
Get all loaded secret keys (for debugging)
An array of all loaded secret keys
Array.<string>
# getVaultConfig(secretName) → {ISecretConfig|undefined}
Get vault configuration for a specific secret
Parameters:
| Name | Type | Description |
|---|---|---|
secretName |
string
|
The name of the secret to get the vault configuration for |
The vault configuration for the secret, or undefined if not found
ISecretConfig
|
undefined
# handleSecretKeyFallback(secretKey, results) → {void}
Handle fallback for a single secret key
Parameters:
| Name | Type | Description |
|---|---|---|
secretKey |
ISecretKey
|
The secret key to handle the fallback for |
results |
object
|
The results of the loading process |
success |
number
|
The number of secrets that were loaded successfully |
failed |
number
|
The number of secrets that failed to load |
fallbacks |
number
|
The number of secrets that were loaded from fallback values |
A promise that resolves when the secrets are loaded
void
# handleVaultFallback(config, results) → {void}
Handle fallback for all keys in a vault configuration
Parameters:
| Name | Type | Description |
|---|---|---|
config |
ISecretConfig
|
The configuration for the secrets to load |
results |
object
|
The results of the loading process |
success |
number
|
The number of secrets that were loaded successfully |
failed |
number
|
The number of secrets that failed to load |
fallbacks |
number
|
The number of secrets that were loaded from fallback values |
A promise that resolves when the secrets are loaded
void
# has(key) → {boolean}
Check if a secret exists in memory
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string
|
The key of the secret to check |
True if the secret exists in memory, false otherwise
boolean
# isSecretsLoaded() → {boolean}
Check if secrets are loaded
True if the secrets are loaded, false otherwise
boolean
# loadAllFallbacks()
Load all fallback values (emergency fallback)
# async loadSecrets()
Load secrets from Vault dynamically based on configuration
# async loadVaultSecrets(config, results) → {Promise.<void>}
Load secrets from a vault key based on its configuration
Parameters:
| Name | Type | Description |
|---|---|---|
config |
ISecretConfig
|
The configuration for the secrets to load |
results |
object
|
The results of the loading process |
success |
number
|
The number of secrets that were loaded successfully |
failed |
number
|
The number of secrets that failed to load |
fallbacks |
number
|
The number of secrets that were loaded from fallback values |
A promise that resolves when the secrets are loaded
Promise.<void>
# validateRequiredSecrets()
Validate that all required secrets were loaded
# static getInstance() → {VaultSecrets}
Get the instance of the VaultSecrets class
The instance of the VaultSecrets class