Expand description
The on-disk credential (~/.config/tracevault/credentials.json) and the
two kinds of authentication the CLI supports.
There are exactly two, and they are not interchangeable:
tvk_API key — what automation and CI use, forever. Never expires, never refreshes, comes fromTRACEVAULT_API_KEY, a projectconfig.toml, or thetokenfield of this file.- Keycloak session — what a human gets from
tracevault login(RFC 8628 device flow). Short-lived access token plus anoffline_accessrefresh token, stored under theauthobject, and refreshed transparently so unattended git hooks never prompt.
The file shape is additive: a pre-Keycloak file
({"server_url","token","email"}, possibly still carrying a pre
single-tenant org_slug) keeps working untouched.
Structs§
- Credentials
credentials.json.- Keycloak
Session - A live Keycloak session for the human who ran
tracevault login.
Enums§
- Credential
- How a request authenticates itself.
Constants§
- REFRESH_
WINDOW_ SECS - How long before expiry an access token is proactively refreshed. Sized to comfortably cover a slow request that is issued just under the wire: a token that would expire mid-flight is refreshed first instead.
Functions§
- resolve_
credentials - Resolve server URL and credential from multiple sources. Priority: env var > credentials file > project config.toml Returns (server_url, credential).
- resolve_
credentials_ quiet resolve_credentialswithout the config-conflict warning.- same_
server - Whether two TraceVault base URLs identify the same instance.