Skip to content

PURISTA API / Modules / @purista/azure-secret-store / AzureSecretStore

Class: AzureSecretStore

@purista/azure-secret-store.AzureSecretStore

The secret store adapter for Azure Secrets Manager. It will store, retrive, update or remove secrets in Azure Secrets Manager.

For performance reasons, and to reduce costs, the secret values are cached in memory after first fetch.

You can disable the whole caching via config by setting enableCache to false. If the cache is enabled, you can set the ttl for cached secret values via config cacheTtl (in ms).

This will return the cached secret if available and if ttl is not exceeded. If a secret value exceeds the ttl, it does not automatically get removed from cache. It will be removed/overwritten on next get request.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AzureSecretStore(config): AzureSecretStore

Parameters

NameTypeDescription
configObject-
config.cacheTtl?numberCache time to live in ms
config.enableCache?booleanEnable cache
config.enableGet?booleanEnable generally get method
config.enableRemove?booleanEnable generally remove method
config.enableSet?booleanEnable generally set method
config.logLevel?LogLevelNameA log level for new logger if logger is not set
config.logger?LoggerA logger instance
config.options?SecretClientOptions-
config.vaultUrlstringThe URL to reach the Azure Key Vault Example ts https://[KEY_VAULT_NAME].vault.azure.net

Returns

AzureSecretStore

Overrides

SecretStoreBaseClass.constructor

Defined in

azure-secret-store/src/AzureSecretStore.impl.ts:29

Properties

cache

cache: SecretStoreCacheMap

Inherited from

SecretStoreBaseClass.cache

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:20


client

client: SecretClient

Defined in

azure-secret-store/src/AzureSecretStore.impl.ts:27


config

config: Object

Type declaration

NameTypeDescription
cacheTtl?numberCache time to live in ms
enableCache?booleanEnable cache
enableGet?booleanEnable generally get method
enableRemove?booleanEnable generally remove method
enableSet?booleanEnable generally set method
logLevel?LogLevelNameA log level for new logger if logger is not set
logger?LoggerA logger instance
options?SecretClientOptions-
vaultUrlstringThe URL to reach the Azure Key Vault Example ts https://[KEY_VAULT_NAME].vault.azure.net

Inherited from

SecretStoreBaseClass.config

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:18


logger

logger: Logger

Inherited from

SecretStoreBaseClass.logger

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:17


name

name: string

Inherited from

SecretStoreBaseClass.name

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:19

Methods

destroy

destroy(): Promise<void>

Returns

Promise<void>

Inherited from

SecretStoreBaseClass.destroy

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:28


getSecret

getSecret<SecretNames>(...secretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, undefined | string>>

Type parameters

NameType
SecretNamesextends string[]

Parameters

NameType
...secretNamesSecretNames

Returns

Promise<ObjectWithKeysFromStringArray<SecretNames, undefined | string>>

Inherited from

SecretStoreBaseClass.getSecret

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:23


getSecretImpl

getSecretImpl<SecretNames>(...secretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, undefined | string>>

Type parameters

NameType
SecretNamesextends string[]

Parameters

NameType
...secretNamesSecretNames

Returns

Promise<ObjectWithKeysFromStringArray<SecretNames, undefined | string>>

Overrides

SecretStoreBaseClass.getSecretImpl

Defined in

azure-secret-store/src/AzureSecretStore.impl.ts:37


removeSecret

removeSecret(secretName): Promise<void>

Parameters

NameType
secretNamestring

Returns

Promise<void>

Inherited from

SecretStoreBaseClass.removeSecret

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:25


removeSecretImpl

removeSecretImpl(secretName): Promise<void>

Parameters

NameType
secretNamestring

Returns

Promise<void>

Overrides

SecretStoreBaseClass.removeSecretImpl

Defined in

azure-secret-store/src/AzureSecretStore.impl.ts:56


setSecret

setSecret(secretName, secretValue): Promise<void>

Parameters

NameType
secretNamestring
secretValuestring

Returns

Promise<void>

Inherited from

SecretStoreBaseClass.setSecret

Defined in

core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:27


setSecretImpl

setSecretImpl(secretName, secretValue): Promise<void>

Parameters

NameType
secretNamestring
secretValuestring

Returns

Promise<void>

Overrides

SecretStoreBaseClass.setSecretImpl

Defined in

azure-secret-store/src/AzureSecretStore.impl.ts:60