#[non_exhaustive]pub enum Presentation {
Bearer {
token: String,
},
ApiKey {
key: String,
},
Cookie {
header: String,
},
SignedChallenge {
scheme: String,
key_id: String,
challenge: String,
signature: String,
},
}Expand description
Credential material as a transport presented it.
The variants describe carriers and proof shapes, not products: Bearer
is “an opaque token in the Authorization header”, not “a JWT”. Which
Authenticator handles a given presentation is decided by
Authenticator::accepts, never by the variant alone — an API key and a
JWT both arrive as Bearer in practice, and both authenticators get a
look.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bearer
A bearer token, as extracted from Authorization: Bearer <token>.
ApiKey
An API key presented in a dedicated header or query parameter.
Fields
Cookie
A raw Cookie: header value, with all its pairs intact.
SignedChallenge
A signed challenge-response: the caller proved possession of a key by signing a server-issued nonce.
This is the variant that makes NIP-42, WebAuthn, and mTLS-style proofs
expressible without changing Authenticator. The fields are
deliberately scheme-agnostic strings; the authenticator that claims a
scheme owns their interpretation.
Fields
scheme: StringNames the proof scheme, e.g. "nip42". An authenticator matches
on this in Authenticator::accepts.
Implementations§
Source§impl Presentation
impl Presentation
Sourcepub fn kind_label(&self) -> &str
pub fn kind_label(&self) -> &str
A short, non-secret label for logs and audit records.
Never includes the material itself — a Debug of a Presentation
does, so prefer this in anything that is written down.