Identity

Trait Identity 

Source
pub trait Identity:
    Send
    + Sync
    + Debug {
    // Required methods
    fn verify(&self, claim: &str) -> Result<Actor, Rejected>;
    fn kind(&self) -> &'static str;

    // Provided methods
    fn verifies(&self) -> bool { ... }
    fn login(&self) -> Option<&RelyingParty> { ... }
}
Expand description

How a claimed identity becomes a verified one.

Required Methods§

Source

fn verify(&self, claim: &str) -> Result<Actor, Rejected>

Verify what a client said about itself.

claim is the raw string from the hello frame or the ?actor= query — whatever the client sent, unmodified, including empty.

Source

fn kind(&self) -> &'static str

What this provider is, for the dashboard and for the startup line. An operator who cannot tell from the logs whether authentication is on does not have authentication.

Provided Methods§

Source

fn verifies(&self) -> bool

Whether this provider verifies anything at all.

Exists so the runtime can say it is unauthenticated rather than leaving it to be inferred. docs/42 §42.6’s whole point is that an absent control was invisible.

Source

fn login(&self) -> Option<&RelyingParty>

The browser-facing half, for a provider that can run a login flow.

None for both of this module’s providers, and that is the honest answer rather than a missing feature: neither issues anything, so neither has anywhere to send a browser. crate::oidc::RelyingParty does, and the HTTP edge asks this rather than being told which provider is configured.

Implementors§