Secrets

Replace a secret’s value

Replaces the value and moves revision_id. Send the revision_id you read: if it has moved since, the answer is 409 with reason: "stale_revision" and nothing changed. Sending the same request again gets the same answer: read the secret again and retry with its current revision_id.

A computer bound to it as an environment variable gets the new value in its desktop session at its next start or restart; on an image that supports it, a running one is also sent the new value for new shells and for every exec, plain or with session: "desktop", so the next one sees it, while programs already running keep the value they started with. One bound to it as a FILE is also sent the new value while it runs. Both are sent asynchronously and on a best-effort basis: the answer does not wait for that, and does not say whether it landed. Unless the update was confirmed — not if its host was unreachable, or refused it, or took it and never answered — a running computer may still hold the old value until its next start or restart, which always delivers the latest.

A secret a computer’s egress_proxy.credentials_secret_id names must keep a user:password value (a colon, no control characters, one trailing newline ignored): any other is refused with 400 and nothing changed. Owners only.

A secret in a workspace is found only with that workspace_id; for any other it is a 404, a workspace_id that names no workspace of this account included. An API key confined to a workspace that names any other scope, null included, is refused with 403 instead; an account-wide key gets the 404.

Requires the owner role or higher.

put/secrets/{id}

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/secrets/{id}
  • Auth: HTTP bearer

Path parameters

idstring required

The secret id.

Request body

valuestring required

The new value: 1 to 4096 bytes of UTF-8.

revision_idstring required

The revision_id a read of this secret answered.

workspace_idstring nullable

The workspace the secret belongs to. Leave it out for an account-wide one.

Response

The secret at its new revision, without its value.

idstring required

csec- and sixteen hex characters. What a binding names as secret_id.

namestring required

Its name, as sent with leading and trailing spaces trimmed. Up to 60 characters. Unique within its scope, ignoring ASCII case: names that differ only in ASCII case collide (409, reason: "name_taken").

workspace_idstring nullable required

The workspace it belongs to, or null for one available account-wide.

revision_idstring required

csr- and twenty-four hex characters. Moves every time the value is replaced; a replace or delete sends back the one it read.

created_atstring required

RFC 3339 timestamp.

updated_atstring required

RFC 3339 timestamp of the last replace, or of the create.

last_used_atstring nullable required

When it was last delivered to a computer. null until it has been.

Changes

No recorded changes to this operation across all 1 revision of this API.