pub struct TokenPolicy { /* private fields */ }Expand description
A per-purpose lifetime ceiling (ADR 0014, issue #137).
The signer applies the policy at sign time: a requested exp beyond
the ceiling is clamped down, and a missing exp gets the ceiling as a
definite expiry. Only a purpose whose ceiling is None may mint a
genuinely non-expiring token, and that must be a justified line in the
policy table, never an omission by the caller.
Implementations§
Source§impl TokenPolicy
impl TokenPolicy
Sourcepub fn with_max(self, action: &str, secs: Option<i64>) -> Self
pub fn with_max(self, action: &str, secs: Option<i64>) -> Self
Overrides one action’s ceiling. Some(secs) bounds the action;
None makes it explicitly non-expiring — a decision a venture
must name on purpose, which is exactly the point of issue #137.
A zero ceiling means the same as None (max_ttl_secs maps it),
so the table always carries the decision, never an omission.
Sourcepub fn max_ttl_secs(&self, purpose: &str) -> Option<i64>
pub fn max_ttl_secs(&self, purpose: &str) -> Option<i64>
The ceiling for a purpose’s action part (the text after the first
., the whole string when there is none). None means an
explicitly sanctioned non-expiring purpose.
Trait Implementations§
Source§impl Clone for TokenPolicy
impl Clone for TokenPolicy
Source§fn clone(&self) -> TokenPolicy
fn clone(&self) -> TokenPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more