pub trait MintPolicy:
Send
+ Sync
+ Debug {
// Required method
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,
Self: 'async_trait;
}Expand description
Resolves the audience a newly minted key may be stamped with.
requested is the caller-supplied audience (e.g. "team-alpha"); None means “no audience
requested and none can be defaulted” – under the opaque-label model there is no “myself”
audience for a caller’s identity to default to, so every implementation must return Err for
requested: None, admin or not. Async and fallible for the same reason as ReadPolicy –
wired by mint_key (analytics-web-srv/src/ingestion_keys.rs), gated by
MintGate/AuthenticatedUser rather than AdminUser.
Required Methods§
Sourcefn 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,
Self: '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,
Self: 'async_trait,
Resolves the audience to stamp on a newly minted key, or Err if requested is outside
what caller may mint (including requested: None – see the trait doc comment).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".