Skip to main content

resolve_token

Function resolve_token 

Source
pub fn resolve_token(
    env_token: Option<String>,
    cache: &AuthCache,
    server: &str,
) -> Option<ResolvedToken>
Expand description

Resolve the effective bearer token for server.

Precedence per ADR-0007: a non-blank DSP_TOKEN env token wins over any cached token; a blank or unset DSP_TOKEN falls through to the cache. Returns None when neither source has a token.

The env token is server-agnostic and wins regardless of the cache contents for any server. Surrounding whitespace in the env value is trimmed: a JWT never contains whitespace, so DSP_TOKEN=" " is treated as absent.