pub struct SuperAdminToken { /* private fields */ }Expand description
An opaque token that authorizes RLS bypass.
Create via one of the named constructors:
SuperAdminToken::for_system_process— cron, startup, cross-tenant internalsSuperAdminToken::for_webhook— inbound callbacksSuperAdminToken::for_auth— login, register, token refresh
External code cannot fabricate this token — it has a private field and no public field constructor.
§Usage
let token = SuperAdminToken::for_system_process("cron::cleanup");
let ctx = RlsContext::super_admin(token);
assert!(ctx.bypasses_rls());Implementations§
Source§impl SuperAdminToken
impl SuperAdminToken
Sourcepub fn for_system_process(_reason: &str) -> Self
pub fn for_system_process(_reason: &str) -> Self
Issue a token for a system/background process.
Use for cron jobs, startup introspection, and internal cross-tenant
maintenance paths. For shared/public reference data, prefer
RlsContext::global() instead of bypass.
The _reason parameter documents intent at the call site
(e.g. "cron::check_expired_holds"). Drivers like qail-pg
may log it via tracing.
Sourcepub fn for_webhook(_source: &str) -> Self
pub fn for_webhook(_source: &str) -> Self
Issue a token for an inbound webhook or gateway trigger.
Use for Meta WhatsApp callbacks, Xendit payment callbacks,
and gateway event triggers that are authenticated via shared
secret (X-Trigger-Secret) rather than JWT.
Trait Implementations§
Source§impl Clone for SuperAdminToken
impl Clone for SuperAdminToken
Source§fn clone(&self) -> SuperAdminToken
fn clone(&self) -> SuperAdminToken
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 SuperAdminToken
impl Debug for SuperAdminToken
Source§impl PartialEq for SuperAdminToken
impl PartialEq for SuperAdminToken
Source§fn eq(&self, other: &SuperAdminToken) -> bool
fn eq(&self, other: &SuperAdminToken) -> bool
self and other values to be equal, and is used by ==.