pub struct OAuth { /* private fields */ }Expand description
OAuth 2.1 resource-server settings. Build with OAuth::builder.
Cheap to clone.
Implementations§
Source§impl OAuth
impl OAuth
Sourcepub fn builder(
resource: impl Into<String>,
verifier: impl TokenVerifier,
) -> OAuthBuilder
pub fn builder( resource: impl Into<String>, verifier: impl TokenVerifier, ) -> OAuthBuilder
Starts the settings of the MCP server identified by resource, its
canonical URI (for example https://mcp.example.com/mcp, the URL
clients connect to). Tokens are checked by verifier, which must
only accept tokens issued for resource (audience).
Sourcepub fn metadata_url(&self) -> &str
pub fn metadata_url(&self) -> &str
The URL of the Protected Resource Metadata document, sent in
WWW-Authenticate challenges.
Sourcepub fn metadata_paths(&self) -> &[String]
pub fn metadata_paths(&self) -> &[String]
The paths at which clients look for the metadata document: the path-specific well-known URI first, then the root one.
Sourcepub fn metadata_service(&self) -> ProtectedResourceMetadata
pub fn metadata_service(&self) -> ProtectedResourceMetadata
A tower::Service that answers with the metadata document. Mount it
at each of metadata_paths when not using
serve.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OAuth
impl !UnwindSafe for OAuth
impl Freeze for OAuth
impl Send for OAuth
impl Sync for OAuth
impl Unpin for OAuth
impl UnsafeUnpin for OAuth
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