Skip to content

Secret methods: revoke, rotate, store

The Secret Verbs revoke, rotate, store as typed SDK methods, with inputs, result, refusals and an example.

Reference for Secret, one group of Secret methods.

Secret.revoke

Revoke ends a Secret so no call fills it again; the record and its history stay. Verb page.

TypeScript
interface SecretVerbs {
  revoke(input: SecretRevokeInput, options?: SB.CallOptions): SB.Call<Secret>
}

Emits Secret.revoked.

Inputs

InputTypeRequiredDescription
secretSecretrequiredThe Secret to revoke.
reasontextWhy, such as a leaked value.

Returns

OutputTypeRequiredDescription
secretSecretrequiredThe revoked Secret.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const secret = await $.Secret.revoke({ secret: 'secret_UaNXUkKsJB' })

Secret.rotate

Rotate replaces a Secret’s value, and calls already running finish on the old one. Verb page.

TypeScript
interface SecretVerbs {
  rotate(input: SecretRotateInput, options?: SB.CallOptions): SB.Call<Secret>
}

Emits Secret.rotated.

Inputs

InputTypeRequiredDescription
secretSecretrequiredThe Secret to rotate.
valuestringThe new value; omitted when the upstream issues one.

Returns

OutputTypeRequiredDescription
secretSecretrequiredThe Secret, with its new rotatedAt.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const secret = await $.Secret.rotate({ secret: 'secret_UaNXUkKsJB' })

Secret.store

Store writes a Secret’s value for one environment; the value is never returned by any Interface. Verb page.

TypeScript
interface SecretVerbs {
  store(input: SecretStoreInput, options?: SB.CallOptions): SB.Call<Secret>
}

Emits Secret.stored.

Inputs

InputTypeRequiredDescription
namestringrequiredThe name Functions declare.
valuestringrequiredThe credential; write-only.
environmentstringrequiredWhere it holds.

Returns

OutputTypeRequiredDescription
secretSecretrequiredThe Secret, without its value.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const secret = await $.Secret.store({ name: 'MAPS_KEY', value: 'Example value', environment: 'test' })