pub struct DirectAuthProvider { /* private fields */ }Expand description
Auth provider backed by a pre-populated map of server URL to bearer token. Used when the cloud/gateway passes per-request MCP OAuth tokens.
Implementations§
Trait Implementations§
Source§impl AuthProvider for DirectAuthProvider
impl AuthProvider for DirectAuthProvider
Source§fn auth_header_for<'a>(
&'a self,
_user_id: &'a str,
_tenant_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'a>>
fn auth_header_for<'a>( &'a self, _user_id: &'a str, _tenant_id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'a>>
Return the Authorization header value for the given user/tenant context.
Returns
None if no auth is needed.Source§fn auth_header_for_resource<'a>(
&'a self,
_user_id: &'a str,
_tenant_id: &'a str,
resource: Option<&'a str>,
_scopes: Option<&'a [String]>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'a>>
fn auth_header_for_resource<'a>( &'a self, _user_id: &'a str, _tenant_id: &'a str, resource: Option<&'a str>, _scopes: Option<&'a [String]>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'a>>
Return an Authorization header scoped to a specific resource and OAuth scopes. Read more
Auto Trait Implementations§
impl Freeze for DirectAuthProvider
impl RefUnwindSafe for DirectAuthProvider
impl Send for DirectAuthProvider
impl Sync for DirectAuthProvider
impl Unpin for DirectAuthProvider
impl UnsafeUnpin for DirectAuthProvider
impl UnwindSafe for DirectAuthProvider
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