mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-05 22:32:12 +00:00
2.8 KiB
2.8 KiB
title, summary, read_when
| title | summary | read_when | ||
|---|---|---|---|---|
| Auth Credential Semantics | Canonical credential eligibility and resolution semantics for auth profiles |
|
Auth Credential Semantics
This document defines the canonical credential eligibility and resolution semantics used across:
resolveAuthProfileOrderresolveApiKeyForProfilemodels status --probedoctor-auth
The goal is to keep selection-time and runtime behavior aligned.
Stable Probe Reason Codes
okexcluded_by_auth_ordermissing_credentialinvalid_expiresexpiredunresolved_refno_model
Token Credentials
Token credentials (type: "token") support inline token and/or tokenRef.
Eligibility rules
- A token profile is ineligible when both
tokenandtokenRefare absent. expiresis optional.- If
expiresis present, it must be a finite number greater than0. - If
expiresis invalid (NaN,0, negative, non-finite, or wrong type), the profile is ineligible withinvalid_expires. - If
expiresis in the past, the profile is ineligible withexpired. tokenRefdoes not bypassexpiresvalidation.
Resolution rules
- Resolver semantics match eligibility semantics for
expires. - For eligible profiles, token material may be resolved from inline value or
tokenRef. - Unresolvable refs produce
unresolved_refinmodels status --probeoutput.
Explicit Auth Order Filtering
- When
auth.order.<provider>or the auth-store order override is set for a provider,models status --probeonly probes profile ids that remain in the resolved auth order for that provider. - A stored profile for that provider that is omitted from the explicit order is
not silently tried later. Probe output reports it with
reasonCode: excluded_by_auth_orderand the detailExcluded by auth.order for this provider.
Probe Target Resolution
- Probe targets can come from auth profiles, environment credentials, or
models.json. - If a provider has credentials but OpenClaw cannot resolve a probeable model
candidate for it,
models status --probereportsstatus: no_modelwithreasonCode: no_model.
OAuth SecretRef Policy Guard
- SecretRef input is for static credentials only.
- If a profile credential is
type: "oauth", SecretRef objects are not supported for that profile credential material. - If
auth.profiles.<id>.modeis"oauth", SecretRef-backedkeyRef/tokenRefinput for that profile is rejected. - Violations are hard failures in startup/reload auth resolution paths.
Legacy-Compatible Messaging
For script compatibility, probe errors keep this first line unchanged:
Auth profile credentials are missing or expired.
Human-friendly detail and stable reason codes may be added on subsequent lines.