pub struct McpOAuthService;Expand description
Service for loading, refreshing, and persisting MCP OAuth tokens.
Implementations§
Source§impl McpOAuthService
impl McpOAuthService
pub fn new() -> McpOAuthService
Sourcepub fn prepare_login(
&self,
provider_name: &str,
config: &McpOAuthConfig,
) -> Result<McpOAuthPreparedLogin, Error>
pub fn prepare_login( &self, provider_name: &str, config: &McpOAuthConfig, ) -> Result<McpOAuthPreparedLogin, Error>
Prepare the authorization URL without a resource binding.
Such a flow cannot be completed securely; use prepare_login_for_resource
when the token will be used by an HTTP MCP provider.
Sourcepub fn prepare_login_for_resource(
&self,
provider_name: &str,
config: &McpOAuthConfig,
resource: &str,
) -> Result<McpOAuthPreparedLogin, Error>
pub fn prepare_login_for_resource( &self, provider_name: &str, config: &McpOAuthConfig, resource: &str, ) -> Result<McpOAuthPreparedLogin, Error>
Prepare a login bound to the HTTP resource that will receive the token.
pub async fn complete_login( &self, provider_name: &str, config: &McpOAuthConfig, prepared: &McpOAuthPreparedLogin, code: &str, ) -> Result<McpOAuthLoginCompletion, Error>
pub fn status( &self, provider_name: &str, storage_mode: AuthCredentialsStoreMode, ) -> Result<McpOAuthStatus, Error>
Sourcepub fn status_for_resource(
&self,
provider_name: &str,
config: &McpOAuthConfig,
resource: &str,
) -> Result<McpOAuthStatus, Error>
pub fn status_for_resource( &self, provider_name: &str, config: &McpOAuthConfig, resource: &str, ) -> Result<McpOAuthStatus, Error>
Report authentication only when the stored binding matches the configured resource.
pub fn load_token( &self, provider_name: &str, storage_mode: AuthCredentialsStoreMode, ) -> Result<Option<McpOAuthToken>, Error>
Sourcepub async fn resolve_access_token(
&self,
provider_name: &str,
config: &McpOAuthConfig,
) -> Result<Option<String>, Error>
👎Deprecated since 0.180.6: use resolve_access_token_for_resource with the receiving resource
pub async fn resolve_access_token( &self, provider_name: &str, config: &McpOAuthConfig, ) -> Result<Option<String>, Error>
use resolve_access_token_for_resource with the receiving resource
Unbound resolution is rejected because it cannot identify the receiving resource.
Sourcepub async fn resolve_access_token_for_resource(
&self,
provider_name: &str,
config: &McpOAuthConfig,
resource: &str,
) -> Result<Option<String>, Error>
pub async fn resolve_access_token_for_resource( &self, provider_name: &str, config: &McpOAuthConfig, resource: &str, ) -> Result<Option<String>, Error>
Resolve only a token bound to the current authorization and resource configuration.
pub fn logout( &self, provider_name: &str, storage_mode: AuthCredentialsStoreMode, ) -> Result<McpOAuthLoginCompletion, Error>
Trait Implementations§
Source§impl Clone for McpOAuthService
impl Clone for McpOAuthService
Source§fn clone(&self) -> McpOAuthService
fn clone(&self) -> McpOAuthService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 McpOAuthService
impl Debug for McpOAuthService
Source§impl Default for McpOAuthService
impl Default for McpOAuthService
Source§fn default() -> McpOAuthService
fn default() -> McpOAuthService
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for McpOAuthService
impl RefUnwindSafe for McpOAuthService
impl Send for McpOAuthService
impl Sync for McpOAuthService
impl Unpin for McpOAuthService
impl UnsafeUnpin for McpOAuthService
impl UnwindSafe for McpOAuthService
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