pub enum TokenScopeView {
Wildcard,
TenantSet {
tenants: Vec<u64>,
},
Dev,
}Expand description
Stable, JSON-friendly projection of a TokenScope.
The on-wire shape is tagged by kind so consumers can pattern-match
without inspecting field presence:
{"kind":"wildcard"}— wildcard scope (tenant=*).{"kind":"tenant_set","tenants":[1,2,3]}— explicit tenant set.{"kind":"dev"}— dev-mode synthetic scope.
Variants§
Wildcard
Token may address every tenant. Produced by token:tenant=* and
by legacy bare entries.
TenantSet
Token is restricted to the listed tenant ids. Always sorted on output so two equivalent scopes render byte-identically — useful for diff-based audit-stream consumers.
Dev
Dev-mode pass-through. Distinct from Wildcard so an audit
reader can tell “the operator opted into wildcard” from “no auth
was configured”.
Implementations§
Source§impl TokenScopeView
impl TokenScopeView
Sourcepub fn from_scope(scope: &TokenScope) -> Self
pub fn from_scope(scope: &TokenScope) -> Self
Project a TokenScope into the JSON-shaped view. Caller is
expected to handle the dev-mode case explicitly via Self::Dev.
Trait Implementations§
Source§impl Clone for TokenScopeView
impl Clone for TokenScopeView
Source§fn clone(&self) -> TokenScopeView
fn clone(&self) -> TokenScopeView
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 TokenScopeView
impl Debug for TokenScopeView
Auto Trait Implementations§
impl Freeze for TokenScopeView
impl RefUnwindSafe for TokenScopeView
impl Send for TokenScopeView
impl Sync for TokenScopeView
impl Unpin for TokenScopeView
impl UnsafeUnpin for TokenScopeView
impl UnwindSafe for TokenScopeView
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more