Skip to content

@purista/azure-secret-store v2.0.5


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

Class: AzureSecretStore

Defined in: azure-secret-store/src/AzureSecretStore.impl.ts:26

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.

Extends

Constructors

new AzureSecretStore()

new AzureSecretStore(config): AzureSecretStore

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

Parameters

config
cacheTtl?

number

Cache time to live in ms

enableCache?

boolean

Enable cache

enableGet?

boolean

Enable generally get method

enableRemove?

boolean

Enable generally remove method

enableSet?

boolean

Enable generally set method

logger?

Logger

A logger instance

logLevel?

LogLevelName

A log level for new logger if logger is not set

options?

SecretClientOptions

vaultUrl

string

The URL to reach the Azure Key Vault

Example

ts
https://[KEY_VAULT_NAME].vault.azure.net

Returns

AzureSecretStore

Overrides

SecretStoreBaseClass.constructor

Properties

cache

cache: SecretStoreCacheMap

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

Inherited from

SecretStoreBaseClass.cache


client

client: SecretClient

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


config

config: object

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

cacheTtl?

optional cacheTtl: number

Cache time to live in ms

enableCache?

optional enableCache: boolean

Enable cache

enableGet?

optional enableGet: boolean

Enable generally get method

enableRemove?

optional enableRemove: boolean

Enable generally remove method

enableSet?

optional enableSet: boolean

Enable generally set method

logger?

optional logger: Logger

A logger instance

logLevel?

optional logLevel: LogLevelName

A log level for new logger if logger is not set

options?

optional options: SecretClientOptions

vaultUrl

vaultUrl: string

The URL to reach the Azure Key Vault

Example
ts
https://[KEY_VAULT_NAME].vault.azure.net

Inherited from

SecretStoreBaseClass.config


logger

logger: Logger

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

Inherited from

SecretStoreBaseClass.logger


name

name: string

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

Inherited from

SecretStoreBaseClass.name

Methods

destroy()

destroy(): Promise<void>

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

Returns

Promise<void>

Inherited from

SecretStoreBaseClass.destroy


getSecret()

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

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

Type Parameters

SecretNames extends string[]

Parameters

secretNames

...SecretNames

Returns

Promise<ObjectWithKeysFromStringArray<SecretNames, undefined | string>>

Inherited from

SecretStoreBaseClass.getSecret


getSecretImpl()

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

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

Type Parameters

SecretNames extends string[]

Parameters

secretNames

...SecretNames

Returns

Promise<ObjectWithKeysFromStringArray<SecretNames, undefined | string>>

Overrides

SecretStoreBaseClass.getSecretImpl


removeSecret()

removeSecret(secretName): Promise<void>

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

Parameters

secretName

string

Returns

Promise<void>

Inherited from

SecretStoreBaseClass.removeSecret


removeSecretImpl()

protected removeSecretImpl(secretName): Promise<void>

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

Parameters

secretName

string

Returns

Promise<void>

Overrides

SecretStoreBaseClass.removeSecretImpl


setSecret()

setSecret(secretName, secretValue): Promise<void>

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

Parameters

secretName

string

secretValue

string

Returns

Promise<void>

Inherited from

SecretStoreBaseClass.setSecret


setSecretImpl()

protected setSecretImpl(secretName, secretValue): Promise<void>

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

Parameters

secretName

string

secretValue

string

Returns

Promise<void>

Overrides

SecretStoreBaseClass.setSecretImpl