pub enum AuthStrategy {
Bedrock,
Vertex,
ApiKey,
OauthToken,
Subscription,
}Expand description
Active auth strategy, as inferred from the host environment.
See module-level docs for precedence rules.
Variants§
Bedrock
CLAUDE_CODE_USE_BEDROCK is truthy. Requests are routed to
AWS Bedrock; AWS credentials are resolved separately by the
Bedrock SDK from the host environment.
Vertex
CLAUDE_CODE_USE_VERTEX is truthy. Requests are routed to
Google Vertex; GCP credentials are resolved separately.
ApiKey
ANTHROPIC_API_KEY is set. Direct API access, billed to that key.
OauthToken
CLAUDE_CODE_OAUTH_TOKEN is set. OAuth token (typically from
claude setup-token).
Subscription
No auth env var set. The CLI will look for stored credentials
under ~/.claude/ (the result of an interactive claude login).
May or may not actually be authenticated – this strategy
reports “the env doesn’t pin anything,” not “you are logged in.”
Implementations§
Trait Implementations§
Source§impl Clone for AuthStrategy
impl Clone for AuthStrategy
Source§fn clone(&self) -> AuthStrategy
fn clone(&self) -> AuthStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AuthStrategy
Source§impl Debug for AuthStrategy
impl Debug for AuthStrategy
impl Eq for AuthStrategy
Source§impl PartialEq for AuthStrategy
impl PartialEq for AuthStrategy
Source§fn eq(&self, other: &AuthStrategy) -> bool
fn eq(&self, other: &AuthStrategy) -> bool
self and other values to be equal, and is used by ==.