pub struct AudienceMintPolicy { /* private fields */ }Expand description
The shipped MintPolicy. Every caller, admin included, may mint only an audience in their
mint set – grants[a].mint, never grants[a].read (a read grant confers no mint
authority, unchanged from AudienceReadPolicy’s split); being able to read public via its
seeded read grant does not imply being able to mint into it – that requires its own grant
naming public in a "mint" list (in production, the seeded ('public', 'mint', '*') row,
schema v9).
A route’s authorization is the authority that route’s own effect requires: minting yields
write access to an audience, so it requires a grant on that audience – is_admin confers
none. mint_key (analytics-web-srv/src/ingestion_keys.rs) delegates authorization to this
policy for every caller, with no admin-specific arm of its own accord (its own gate,
MintGate, only enforces the self-service knob against non-admins).
Implementations§
Source§impl AudienceMintPolicy
impl AudienceMintPolicy
Sourcepub fn new(grants: AudienceGrants) -> AudienceMintPolicy
pub fn new(grants: AudienceGrants) -> AudienceMintPolicy
Builds a policy with an explicit static grant map.
Sourcepub fn with_store(
self,
store: Arc<SnapshotSource<AudienceGrantsLoader>>,
) -> AudienceMintPolicy
pub fn with_store( self, store: Arc<SnapshotSource<AudienceGrantsLoader>>, ) -> AudienceMintPolicy
Attaches the DB-backed grant store. Built alongside AudienceReadPolicy::with_store for
symmetry – unlike the read side, no production call site attaches a store through this
method: mint_key constructs its AudienceMintPolicy via new, so mint grants stay
resolved by a fresh, uncached point query against audience_grants, never a
DbAudienceGrantsSource snapshot.
Trait Implementations§
Source§impl Clone for AudienceMintPolicy
impl Clone for AudienceMintPolicy
Source§fn clone(&self) -> AudienceMintPolicy
fn clone(&self) -> AudienceMintPolicy
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 AudienceMintPolicy
impl Debug for AudienceMintPolicy
Source§impl Default for AudienceMintPolicy
impl Default for AudienceMintPolicy
Source§fn default() -> AudienceMintPolicy
fn default() -> AudienceMintPolicy
Source§impl MintPolicy for AudienceMintPolicy
impl MintPolicy for AudienceMintPolicy
Source§fn resolve_audience<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
caller: &'life1 AuthContext,
requested: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
AudienceMintPolicy: 'async_trait,
fn resolve_audience<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
caller: &'life1 AuthContext,
requested: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
AudienceMintPolicy: 'async_trait,
Err if requested is outside
what caller may mint (including requested: None – see the trait doc comment).Auto Trait Implementations§
impl !RefUnwindSafe for AudienceMintPolicy
impl !UnwindSafe for AudienceMintPolicy
impl Freeze for AudienceMintPolicy
impl Send for AudienceMintPolicy
impl Sync for AudienceMintPolicy
impl Unpin for AudienceMintPolicy
impl UnsafeUnpin for AudienceMintPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].