pub struct BackendAuthCapabilities {
pub mechanisms: Vec<AuthMechanism>,
pub default: Option<usize>,
}Expand description
What the backend advertises at _info’s auth_capabilities field.
Per AUTHZ-S01-output §2. Backwards-compatible addition: clients that don’t know the field continue to ignore it.
Fields§
§mechanisms: Vec<AuthMechanism>Mechanisms the backend supports. May be empty (no auth wired) but
conventionally contains at least one entry; the framework default
emits [Anonymous] when no backend has called
DynamicHub::with_auth_capabilities.
default: Option<usize>Index into mechanisms for the “primary” mechanism a generic client
should try first. None means “no opinion; client chooses.”
Implementations§
Source§impl BackendAuthCapabilities
impl BackendAuthCapabilities
Sourcepub fn new(
mechanisms: Vec<AuthMechanism>,
default: Option<usize>,
) -> Result<Self, BackendAuthCapabilitiesError>
pub fn new( mechanisms: Vec<AuthMechanism>, default: Option<usize>, ) -> Result<Self, BackendAuthCapabilitiesError>
Construct a BackendAuthCapabilities, validating that default (if
present) is in range.
Sourcepub fn anonymous_default() -> Self
pub fn anonymous_default() -> Self
The default value emitted by _info for backends that have not called
DynamicHub::with_auth_capabilities: a single Anonymous mechanism,
no preferred default.
This preserves today’s substrate behavior (anyone can call) while signaling “no auth wired” to capability-aware clients.
Trait Implementations§
Source§impl Clone for BackendAuthCapabilities
impl Clone for BackendAuthCapabilities
Source§fn clone(&self) -> BackendAuthCapabilities
fn clone(&self) -> BackendAuthCapabilities
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 BackendAuthCapabilities
impl Debug for BackendAuthCapabilities
Source§impl<'de> Deserialize<'de> for BackendAuthCapabilities
impl<'de> Deserialize<'de> for BackendAuthCapabilities
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 BackendAuthCapabilities
impl JsonSchema for BackendAuthCapabilities
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 BackendAuthCapabilities
impl PartialEq for BackendAuthCapabilities
Source§fn eq(&self, other: &BackendAuthCapabilities) -> bool
fn eq(&self, other: &BackendAuthCapabilities) -> bool
self and other values to be equal, and is used by ==.