Skip to main content

revoke_admin_token

Function revoke_admin_token 

Source
pub fn revoke_admin_token(
    auth_path: &Path,
    token: Option<&str>,
    owner: Option<&str>,
) -> Result<RevokeTokenOutcome, String>
Expand description

Revokes admin/API token(s) from the JSON token file at auth_path (config.json / CORTEX_AUTH_FILE) — the inverse of set_admin_token. Removes either a specific token or every token mapped to owner (the caller supplies exactly one). Merges into the existing file (other tokens are preserved) and writes atomically; rewrites only when something actually changed. The library logic behind cortex revoke-token. A revoked token stops working immediately — the frontend re-reads this file on every gated request.