#[non_exhaustive]pub enum SignIn {
OwnerPassword,
ServiceCredential,
Custom(fn(&mut ServiceEnv) -> Option<Arc<dyn CredentialVerifier>>),
}Expand description
How people sign in, and what their tokens carry.
Deliberately small. For single sign-on, MFA or many named users, put an identity-aware
gateway (such as Cloudflare Access or oauth2-proxy) in front of /authorize; see
SECURITY.md.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
OwnerPassword
One person, the owner, signs in with OAUTH_ADMIN_PASSWORD. Tools act with the server’s
own upstream configuration (say, an account’s app password in the environment).
MCP_AUTH_TOKEN may be set as well, for clients that cannot do OAuth.
ServiceCredential
Each person signs in with their own credential for the upstream service, checked by the
CredentialVerifier of the enabled service that has one
(Service::credential_verifier; more than one is a configuration error, since each
service’s tools would receive a credential meant for another upstream). Tools find it as a
Credential in the request extensions, so one server can
serve many people. Clients may also send the credential itself as their bearer token.
A verifier with an upstream provider, such as an
UpstreamVerifier, has people sign in at the
provider instead, and the credential it grants is carried the same way; see
crate::upstream.
Custom(fn(&mut ServiceEnv) -> Option<Arc<dyn CredentialVerifier>>)
A verifier built from the environment by your function, which records any problems in
env.errors.
Trait Implementations§
Auto Trait Implementations§
impl Forget for SignIn
impl Freeze for SignIn
impl RefUnwindSafe for SignIn
impl Send for SignIn
impl Sync for SignIn
impl Unpin for SignIn
impl UnsafeUnpin for SignIn
impl UnwindSafe for SignIn
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more