pub enum AuthMechanism {
Bearer {
header: HeaderName,
},
Cookie {
cookie: CookieName,
login: MethodPath,
refresh: Option<MethodPath>,
logout: Option<MethodPath>,
},
Oidc {
issuer: IssuerUrl,
client_id: ClientId,
exchange: Option<MethodPath>,
request_scopes: Vec<String>,
},
Anonymous,
}Expand description
Tagged union of supported auth mechanisms a backend advertises.
Wire form: discriminated on kind, snake_case ("bearer", "cookie",
"oidc", "anonymous"). See AUTHZ-S01-output §2 for canonical JSON
examples.
Variants§
Bearer
Static bearer token (today’s substrate --api-key shape). Not
user-bound; the token authorizes the bearer.
Fields
header: HeaderNameHeader carrying the token, e.g. Authorization.
Cookie
Cookie session, with a backend-defined login method that issues
Set-Cookie.
Fields
Name of the session cookie.
login: MethodPathMethod the client calls to issue/establish the cookie.
refresh: Option<MethodPath>Optional method to renew the cookie.
logout: Option<MethodPath>Optional method to invalidate the cookie.
Oidc
OIDC mechanism (designed-for; may not be implemented in initial epic).
Fields
exchange: Option<MethodPath>Optional auth.exchange-style method the backend exposes to swap
an ID token for a backend session cookie.
Anonymous
Anonymous — the backend accepts unauthenticated callers for some methods.
Advertising Anonymous is not permission to bypass scoping:
per-method #[plexus::method(public)] markers gate which methods
anonymous callers may invoke (AUTHZ-CORE-1 / AUTHZ-CORE-2). The
advertisement says “anonymous is one of the accepted shapes”; the
authorization layer says “this specific method is callable that way.”
Trait Implementations§
Source§impl Clone for AuthMechanism
impl Clone for AuthMechanism
Source§fn clone(&self) -> AuthMechanism
fn clone(&self) -> AuthMechanism
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AuthMechanism
impl Debug for AuthMechanism
Source§impl<'de> Deserialize<'de> for AuthMechanism
impl<'de> Deserialize<'de> for AuthMechanism
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>,
Source§impl JsonSchema for AuthMechanism
impl JsonSchema for AuthMechanism
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for AuthMechanism
impl PartialEq for AuthMechanism
Source§fn eq(&self, other: &AuthMechanism) -> bool
fn eq(&self, other: &AuthMechanism) -> bool
self and other values to be equal, and is used by ==.