pub enum TokenSubject {
Anonymous,
Authenticated(SubjectId),
Flow(CodeId),
}Expand description
The subject binding for a form token (RFC-007 §13.3).
Explicit variants prevent the “empty string for anonymous” anti-pattern identified in RFC-007 §13.3. Bindings are persisted as part of the token record and checked on consume.
Variants§
Anonymous
Token issued before authentication (e.g. a join form).
Authenticated(SubjectId)
Token issued for an authenticated subject.
Flow(CodeId)
Token bound to a transient flow ID (e.g. a join ticket).
Implementations§
Source§impl TokenSubject
impl TokenSubject
Sourcepub fn as_binding_str(&self) -> String
pub fn as_binding_str(&self) -> String
A stable string representation persisted in the store. This is not a security boundary on its own; the store’s consume WHERE clause enforces the binding.
Trait Implementations§
Source§impl Clone for TokenSubject
impl Clone for TokenSubject
Source§fn clone(&self) -> TokenSubject
fn clone(&self) -> TokenSubject
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenSubject
impl Debug for TokenSubject
impl Eq for TokenSubject
Source§impl PartialEq for TokenSubject
impl PartialEq for TokenSubject
Source§fn eq(&self, other: &TokenSubject) -> bool
fn eq(&self, other: &TokenSubject) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TokenSubject
Auto Trait Implementations§
impl Freeze for TokenSubject
impl RefUnwindSafe for TokenSubject
impl Send for TokenSubject
impl Sync for TokenSubject
impl Unpin for TokenSubject
impl UnsafeUnpin for TokenSubject
impl UnwindSafe for TokenSubject
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
Mutably borrows from an owned value. Read more