Classes · @purista/gcloud-secret-store

GoogleSecretStore

Secret store backed by Google Secret Manager.

Signature

GoogleSecretStore.ts typescript
class GoogleSecretStore

Examples

example-1.ts typescript
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

Source
constructor.ts typescript
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.ts typescript
cache: SecretStoreCacheMap

Optional in-memory cache of secret values.

client

Property

Source
client.ts typescript
client: SecretManagerServiceClient

Google Secret Manager client used for secret operations.

config

Property

config.ts typescript
config: { cacheTtl: number; client: ClientOptions; enableCache: boolean; enableGet: boolean; enableRemove: boolean; enableSet: boolean; ... }

Store configuration including operation toggles and cache settings.

logger

Property

logger.ts typescript
logger: Logger

Child logger scoped to the store name.

name

Property

name.ts typescript
name: string

Store name used in logs and diagnostics.

Methods

7 entries

destroy

Method

destroy.ts typescript
destroy(): Promise<void>

Shutdown hook for store adapters.

getSecret

Method

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

Get one or more secrets by name.

getSecretImpl

Method

Source
getSecretImpl.ts typescript
getSecretImpl<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>

Adapter-specific secret lookup implementation.

removeSecret

Method

removeSecret.ts typescript
removeSecret(secretName: string): Promise<void>

Remove one secret by name.

removeSecretImpl

Method

Source
removeSecretImpl.ts typescript
removeSecretImpl(secretName: string): Promise<void>

Removes a secret resource from Google Secret Manager.

setSecret

Method

setSecret.ts typescript
setSecret(secretName: string, secretValue: string): Promise<void>

Store or replace one secret value.

setSecretImpl

Method

Source
setSecretImpl.ts typescript
setSecretImpl(secretName: string, secretValue: string): Promise<void>

Adds a new secret version, creating the secret resource first when needed.