Classes · @purista/gcloud-secret-store
GoogleSecretStore
Secret store backed by Google Secret Manager.
Signature
class GoogleSecretStore Examples
const store = new GoogleSecretStore({
project: 'projects/example-project',
cacheTtl: 30_000,
})
await store.setSecret('acme-prod-payments-api-token', 'placeholder-secret')
const secret = await store.getSecret('acme-prod-payments-api-token') Constructors
1 entry
constructor
Constructor
new constructor(config: { cacheTtl: number; client: ClientOptions; enableCache: boolean; enableGet: boolean; enableRemove: boolean; enableSet: boolean; ... }) Creates a Google Secret Manager-backed secret store.
Properties
5 entries
cache
Property
cache: SecretStoreCacheMap Optional in-memory cache of secret values.
client
Property
client: SecretManagerServiceClient Google Secret Manager client used for secret operations.
config
Property
config: { cacheTtl: number; client: ClientOptions; enableCache: boolean; enableGet: boolean; enableRemove: boolean; enableSet: boolean; ... } Store configuration including operation toggles and cache settings.
logger
Property
logger: Logger Child logger scoped to the store name.
name
Property
name: string Store name used in logs and diagnostics.
Methods
7 entries
destroy
Method
destroy(): Promise<void> Shutdown hook for store adapters.
getSecret
Method
getSecret<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>> Get one or more secrets by name.
getSecretImpl
Method
getSecretImpl<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>> Adapter-specific secret lookup implementation.
removeSecret
Method
removeSecret(secretName: string): Promise<void> Remove one secret by name.
removeSecretImpl
Method
removeSecretImpl(secretName: string): Promise<void> Removes a secret resource from Google Secret Manager.
setSecret
Method
setSecret(secretName: string, secretValue: string): Promise<void> Store or replace one secret value.
setSecretImpl
Method
setSecretImpl(secretName: string, secretValue: string): Promise<void> Adds a new secret version, creating the secret resource first when needed.