Skip to content

@purista/dapr-sdk v2.0.5


PURISTA API / @purista/dapr-sdk / DaprSecretStore

Class: DaprSecretStore

Defined in: dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:17

DaprSecretStore is an adapter which connects to the secret store provided by the underlaying Dapr infrastructure.

Dapr currently provides only the possibility to fetch a secret. Creating a new secret, changing an existing secret or removal of secrets is not supported.

Extends

Constructors

new DaprSecretStore()

new DaprSecretStore(config?): DaprSecretStore

Defined in: dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:20

Parameters

config?
cacheTtl?

number

Cache time to live in ms

clientConfig?

DaprClientConfig

The Dapr client config to interact with Dapr sidecar

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

metadata?

{ namespace: string; }

Dapr secret store metadata

metadata.namespace?

string

In case of deploying into namespace other than default, the namespace (e.g. production) must be set

secretStoreName?

string

The name of the secret store

Returns

DaprSecretStore

Overrides

SecretStoreBaseClass.constructor

Properties

cache

cache: SecretStoreCacheMap

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

Inherited from

SecretStoreBaseClass.cache


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

clientConfig?

optional clientConfig: DaprClientConfig

The Dapr client config to interact with Dapr sidecar

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

metadata?

optional metadata: object

Dapr secret store metadata

metadata.namespace?

optional metadata.namespace: string

In case of deploying into namespace other than default, the namespace (e.g. production) must be set

secretStoreName?

optional secretStoreName: string

The name of the secret store

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: dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:55

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: dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:93

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): Promise<void>

Defined in: dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:89

Parameters

_secretName

string

Returns

Promise<void>

Overrides

SecretStoreBaseClass.setSecretImpl