Realm settings
Turn the secrets store on, and set the defaults every vault follows for history, check-and-set, shares and emergency access.
AvailableAPI
One settings object per realm, vaultSettings, holds what every vault takes when a secret sets nothing of its own:
how much history is kept, whether writes must name the version they replace, how long one-time shares last and how
long an emergency nominee waits. A realm administrator writes it once, by turning the store on, and changes it
whenever the realm’s policy changes.
Before you begin
Section titled “Before you begin”- Who: a realm administrator. Turning the store on needs
RealmOwner, or a privilege of your own that allowsMODIFYon secrets; changing the settings needsMODIFYon the realm’s settings, whichRealmOwnergives. Reading them needsREAD, whichRealmViewergives too. See Delegated administration. - Where: the API. There are no screens yet.
- First: nothing. The store is off until you turn it on.
How it works
Section titled “How it works”The managed vaults’ settings sit in the managed section. The one-time shares’ sit at the top, since they span both
kinds of vault. The sealed vaults’ sit in sealed: see Sealed vault settings.
| Setting | What it does | Default | Range |
|---|---|---|---|
managed.maxVersions | Versions a path keeps | 10 | 1 to 100 |
managed.casRequired | Every write must use check-and-set | false | |
managed.deleteVersionAfter | Seconds after which a version reads as deleted; 0 keeps them | 0 | 0 to ten years |
managed.emergencyDelayDefault | Seconds a nominee waits after asking, when the grantor names no delay | 604800 (a week) | 1 second to ten years |
managed.tokenReuse | How long a sign-in keeps its access to its own keys open between requests | session, 600 seconds | see below |
shareDefaultTtl | Seconds a one-time share waits when its maker names no lifetime | 600 (ten minutes) | 1 second to 30 days |
shareMaxTtl | The longest a one-time share may wait, in seconds | 604800 (a week) | 1 second to 30 days |
managed.tokenReuse is { "mode": "session", "ttl": 600 } by default: a sign-in keeps its access to its own keys
open between requests for ttl seconds (10 to 3600), never past the session’s end. Set mode to request to reopen
that access on every request instead: stricter, and slower.
Set it up
Section titled “Set it up”As a realm administrator (Call the API shows how to get $CVYUH_SESSION):
-
Turn the store on:
Terminal window curl -X POST https://foobar.cvyuh.com/api/v0/vault/managed/v1/enable \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"The realm writes
vaultSettingswith the defaults above, and answers201the first time and200after. Until then every other call to the store answers409. -
Read the settings, and note their
rev:Terminal window curl https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"A
404means the store isn’t on yet. -
Change them, sending only the fields to change, each in its section:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-H 'If-Match: "<rev>"' \-d '{ "managed": { "maxVersions": 5 } }'
Anyone signed in to the realm reads the first three at
https://foobar.cvyuh.com/api/v0/vault/managed/v1/config, as max_versions, cas_required and
delete_version_after.
What users see
Section titled “What users see”A change applies to every vault at once, to the next request: a lower managed.maxVersions at each path’s next write,
a new managed.deleteVersionAfter to versions written after it, new share lifetimes to shares made after it. Nothing
already written is changed. No one is told of the change.
When it fails
Section titled “When it fails”| Answer | When | What to do |
|---|---|---|
403 turning the store on | The caller isn’t a realm administrator | Ask someone holding RealmOwner |
404 reading the settings | The store isn’t on yet | Turn it on first |
400 | A field the settings don’t name, or a value out of range | Send only the fields in the table, each in its section |
412 | The settings changed since you read their rev | Read again, and send your change with the new rev |
409 from any vault call | The store isn’t on | Turn it on |
Limits and defaults
Section titled “Limits and defaults”Every default and range is in the table above. None can be raised past its range.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
A PATCH answers 400 though the field exists | It was sent at the top instead of in its section | Put maxVersions and the other managed fields under managed |
| A path keeps more versions than the realm’s limit | The path sets its own max_versions | A path’s own setting wins; see Metadata |
Writes start failing with 400 after a change | managed.casRequired is now true | Writers send options.cas; see Check-and-set |
Audit record
Section titled “Audit record”Turning the store on is a CREATED change record on vaultSettings, and each change an UPDATED or PATCHED one,
with what changed, before and after. Read it in
Change history at
https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings/history.
Good to know
Section titled “Good to know”- Only a realm administrator turns the store on. Anyone else is refused (
403). - A path’s own setting wins over the realm’s, where it sets one. Check-and-set is the exception: a path can require
it, but can’t lift the realm’s
managed.casRequired. - A field the settings don’t name is refused (
400), at the top or in a section, so a change in an old shape fails rather than setting nothing. - A guarded change. With
If-Matchand therevyou read, a change made since then makes yours fail rather than overwrite it. - The realm sets only how long shares last. Anyone who may view a secret can grant or share it to anyone in the realm; no setting turns links or grants off or limits who may receive them yet. See What’s next for sharing.
- There is no call to turn the store off.
Coming next
Section titled “Coming next”A setting for whether a user’s first vault is sealed or managed (personalDefault). It can be set, but nothing reads it
yet: see What’s next for vaults.
Related
Section titled “Related”- Set the realm’s defaults: the task, start to finish.
- Metadata: a path’s own settings.