Skip to content

PURISTA API / Modules / @purista/dapr-sdk / DaprSecretStore

Class: DaprSecretStore

@purista/dapr-sdk.DaprSecretStore

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.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DaprSecretStore(config?): DaprSecretStore

Parameters

NameTypeDescription
config?Object-
config.cacheTtl?numberCache time to live in ms
config.clientConfig?DaprClientConfigThe Dapr client config to interact with Dapr sidecar
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.metadata?ObjectDapr secret store metadata
config.metadata.namespace?stringIn case of deploying into namespace other than default, the namespace (e.g. production) must be set
config.secretStoreName?stringThe name of the secret store

Returns

DaprSecretStore

Overrides

SecretStoreBaseClass.constructor

Defined in

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

Properties

cache

cache: SecretStoreCacheMap

Inherited from

SecretStoreBaseClass.cache

Defined in

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


client

Private client: HttpClient<DaprClientConfig>

Defined in

dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:18


config

config: Object

Type declaration

NameTypeDescription
cacheTtl?numberCache time to live in ms
clientConfig?DaprClientConfigThe Dapr client config to interact with Dapr sidecar
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
metadata?{ namespace?: string }Dapr secret store metadata
metadata.namespace?stringIn case of deploying into namespace other than default, the namespace (e.g. production) must be set
secretStoreName?stringThe name of the secret store

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

dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:55


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

dapr-sdk/src/DaprSecretStore/DaprSecretStore.impl.ts:93


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

Parameters

NameType
_secretNamestring

Returns

Promise<void>

Overrides

SecretStoreBaseClass.setSecretImpl

Defined in

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