@purista/gcloud-secret-store v2.0.5
PURISTA API / @purista/gcloud-secret-store / GoogleSecretStore
Class: GoogleSecretStore
Defined in: gcloud-secret-store/src/GoogleSecretStore.impl.ts:27
The secret store adapter for Google Secret Manager. It will store, retrive, update or remove secrets in Google Secret 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 GoogleSecretStore()
new GoogleSecretStore(
config
):GoogleSecretStore
Defined in: gcloud-secret-store/src/GoogleSecretStore.impl.ts:30
Parameters
config
cacheTtl?
number
Cache time to live in ms
client?
ClientOptions
Google client options
enableCache?
boolean
Enable cache
enableGet?
boolean
Enable generally get method
enableRemove?
boolean
Enable generally remove method
enableSet?
boolean
Enable generally set method
logger?
A logger instance
logLevel?
A log level for new logger if logger is not set
project
string
The google project id in format of projects/* without ending /secrets
Example
projects/428371962963
Returns
Overrides
SecretStoreBaseClass
.constructor
Properties
cache
cache:
SecretStoreCacheMap
Defined in: core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:20
Inherited from
client
client:
SecretManagerServiceClient
Defined in: gcloud-secret-store/src/GoogleSecretStore.impl.ts:28
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
client?
optional
client:ClientOptions
Google client options
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
project
project:
string
The google project id in format of projects/* without ending /secrets
Example
projects/428371962963
Inherited from
logger
logger:
Logger
Defined in: core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:17
Inherited from
name
name:
string
Defined in: core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:19
Inherited from
Methods
destroy()
destroy():
Promise
<void
>
Defined in: core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:28
Returns
Promise
<void
>
Inherited from
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: gcloud-secret-store/src/GoogleSecretStore.impl.ts:35
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()
removeSecretImpl(
secretName
):Promise
<void
>
Defined in: gcloud-secret-store/src/GoogleSecretStore.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()
setSecretImpl(
secretName
,secretValue
):Promise
<void
>
Defined in: gcloud-secret-store/src/GoogleSecretStore.impl.ts:60
Parameters
secretName
string
secretValue
string
Returns
Promise
<void
>