pub struct AuthContext {
pub sender_id: String,
pub channel: String,
pub permissions: UserPermissions,
}Expand description
Authentication context threaded through the request pipeline.
Attached to ChatRequest by the agent loop after resolving the sender’s
identity from channel authentication. When absent, the router defaults
to zero-trust permissions.
Default returns zero-trust values (empty sender_id, empty channel,
zero-trust permissions). For CLI use, call AuthContext::cli_default()
which sets sender_id=“local”, channel=“cli”, and admin permissions.
Fields§
§sender_id: StringUnique sender identifier (platform-specific).
Telegram: user ID, Slack: user ID, Discord: user ID, CLI: "local".
channel: StringChannel name the request originated from.
permissions: UserPermissionsResolved permissions for this sender.
Implementations§
Source§impl AuthContext
impl AuthContext
Sourcepub fn cli_default() -> Self
pub fn cli_default() -> Self
Convenience constructor for CLI use. Sets sender_id = "local",
channel = "cli", and admin-level permissions. Callers must
explicitly opt into CLI privileges – this is NOT the Default.
Trait Implementations§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Source§fn clone(&self) -> AuthContext
fn clone(&self) -> AuthContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more