pub struct ProviderCredentialConfig {Show 13 fields
pub source: SourceKind,
pub kind: Option<ProviderKind>,
pub base_url: Option<String>,
pub headers: IndexMap<String, String>,
pub auth_header: Option<String>,
pub region: Option<String>,
pub var: Option<String>,
pub url: Option<String>,
pub claims: Map<String, Value>,
pub broker_headers: IndexMap<String, String>,
pub app_auth: AppAuth,
pub refresh_skew_ms: Option<u64>,
pub fetch_timeout_ms: Option<u64>,
}Expand description
One provider entry.
Fields§
§source: SourceKind§kind: Option<ProviderKind>§base_url: Option<String>§headers: IndexMap<String, String>Extra headers on every model request (not sent when a credential moves the request to a different origin).
auth_header: Option<String>OpenAI-compatible: header carrying the key instead of Authorization: Bearer,
e.g. api-key for Azure. Gemini: authorization sends a bearer token (Vertex AI).
region: Option<String>Bedrock: AWS region.
var: Option<String>env source: variable name.
url: Option<String>token_broker source: broker URL.
claims: Map<String, Value>token_broker source: extra JSON fields sent to the broker.
broker_headers: IndexMap<String, String>token_broker source: extra headers sent to the broker.
app_auth: AppAuthtoken_broker source: app authentication.
refresh_skew_ms: Option<u64>Cached sources: refresh this long before expiry (default 60 000 ms).
fetch_timeout_ms: Option<u64>Cached sources: fail a credential fetch after this long (default 15 000 ms).
Implementations§
Source§impl ProviderCredentialConfig
impl ProviderCredentialConfig
Sourcepub fn kind_for(&self, name: &str) -> Result<ProviderKind, LlmError>
pub fn kind_for(&self, name: &str) -> Result<ProviderKind, LlmError>
The provider kind: explicit, or implied by a well-known name.
Sourcepub fn validate(&self, name: &str) -> Result<ProviderKind, LlmError>
pub fn validate(&self, name: &str) -> Result<ProviderKind, LlmError>
Reject fields that the chosen source or kind would silently ignore.
Sourcepub fn needs_host(&self) -> bool
pub fn needs_host(&self) -> bool
Whether this entry needs a host app to supply credentials at run time.