pub struct AuthRequest {
pub task_id: Option<TaskId>,
pub id: String,
pub provider: String,
pub operation: AuthOperation,
pub challenge: MetadataMap,
}Expand description
A request for authentication credentials before a tool can proceed.
Emitted as ToolInterruption::AuthRequired when a tool (typically an
MCP integration) needs OAuth tokens, API keys, or other credentials that
the user must supply interactively.
Fields§
§task_id: Option<TaskId>Runtime task identifier associated with this auth request, if any.
id: StringUnique identifier for this auth challenge.
provider: StringName of the authentication provider (e.g. "github", "google").
operation: AuthOperationThe operation that triggered the auth requirement.
challenge: MetadataMapProvider-specific challenge data (e.g. OAuth URLs, scopes).
Implementations§
Source§impl AuthRequest
impl AuthRequest
Sourcepub fn new(
id: impl Into<String>,
provider: impl Into<String>,
operation: AuthOperation,
) -> Self
pub fn new( id: impl Into<String>, provider: impl Into<String>, operation: AuthOperation, ) -> Self
Builds an auth request with no task id and empty challenge metadata.
Sourcepub fn with_task_id(self, task_id: impl Into<TaskId>) -> Self
pub fn with_task_id(self, task_id: impl Into<TaskId>) -> Self
Sets the associated task id.
Sourcepub fn with_challenge(self, challenge: MetadataMap) -> Self
pub fn with_challenge(self, challenge: MetadataMap) -> Self
Replaces the auth challenge payload.
Source§impl AuthRequest
impl AuthRequest
Sourcepub fn server_id(&self) -> Option<&str>
pub fn server_id(&self) -> Option<&str>
Convenience accessor that delegates to AuthOperation::server_id.
Trait Implementations§
Source§impl Clone for AuthRequest
impl Clone for AuthRequest
Source§fn clone(&self) -> AuthRequest
fn clone(&self) -> AuthRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthRequest
impl Debug for AuthRequest
Source§impl<'de> Deserialize<'de> for AuthRequest
impl<'de> Deserialize<'de> for AuthRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AuthRequest
impl PartialEq for AuthRequest
Source§impl Serialize for AuthRequest
impl Serialize for AuthRequest
impl Eq for AuthRequest
impl StructuralPartialEq for AuthRequest
Auto Trait Implementations§
impl Freeze for AuthRequest
impl RefUnwindSafe for AuthRequest
impl Send for AuthRequest
impl Sync for AuthRequest
impl Unpin for AuthRequest
impl UnsafeUnpin for AuthRequest
impl UnwindSafe for AuthRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more