pub struct AuthorizationEvidence { /* private fields */ }Expand description
Opaque, time-bounded authorization evidence issued by a product layer.
Implementations§
Source§impl AuthorizationEvidence
impl AuthorizationEvidence
Sourcepub fn new(
issuer: ProducerRef,
scope: AuthorizationScope,
issued_at: Timestamp,
expires_at: Timestamp,
) -> Result<Self, AuthorizationError>
pub fn new( issuer: ProducerRef, scope: AuthorizationScope, issued_at: Timestamp, expires_at: Timestamp, ) -> Result<Self, AuthorizationError>
Creates time-bounded authorization evidence.
Sourcepub fn with_plan_fingerprint(self, fingerprint: PlanFingerprint) -> Self
pub fn with_plan_fingerprint(self, fingerprint: PlanFingerprint) -> Self
Binds authorization to an immutable plan fingerprint.
Sourcepub fn with_confirmation_ref(
self,
confirmation_ref: impl Into<String>,
) -> Result<Self, AuthorizationError>
pub fn with_confirmation_ref( self, confirmation_ref: impl Into<String>, ) -> Result<Self, AuthorizationError>
Records an opaque human-confirmation reference.
Sourcepub fn validate_binding(
&self,
operation: &OperationName,
target: &TargetRef,
now: Timestamp,
expected_plan: Option<&PlanFingerprint>,
) -> Result<(), AuthorizationError>
pub fn validate_binding( &self, operation: &OperationName, target: &TargetRef, now: Timestamp, expected_plan: Option<&PlanFingerprint>, ) -> Result<(), AuthorizationError>
Validates expiration and exact operation, target, and plan binding.
Sourcepub fn id(&self) -> &AuthorizationId
pub fn id(&self) -> &AuthorizationId
Returns the evidence identity.
Sourcepub fn issuer(&self) -> &ProducerRef
pub fn issuer(&self) -> &ProducerRef
Returns the issuing product or policy component.
Sourcepub fn scope(&self) -> &AuthorizationScope
pub fn scope(&self) -> &AuthorizationScope
Returns the exact approved scope.
Sourcepub const fn expires_at(&self) -> Timestamp
pub const fn expires_at(&self) -> Timestamp
Returns the authorization expiry.
Sourcepub fn plan_fingerprint(&self) -> Option<&PlanFingerprint>
pub fn plan_fingerprint(&self) -> Option<&PlanFingerprint>
Returns the bound plan fingerprint when present.
Sourcepub fn confirmation_ref(&self) -> Option<&str>
pub fn confirmation_ref(&self) -> Option<&str>
Returns the opaque confirmation reference when present.
Trait Implementations§
Source§impl Clone for AuthorizationEvidence
impl Clone for AuthorizationEvidence
Source§fn clone(&self) -> AuthorizationEvidence
fn clone(&self) -> AuthorizationEvidence
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 AuthorizationEvidence
impl Debug for AuthorizationEvidence
Source§impl<'de> Deserialize<'de> for AuthorizationEvidence
impl<'de> Deserialize<'de> for AuthorizationEvidence
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for AuthorizationEvidence
impl JsonSchema for AuthorizationEvidence
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for AuthorizationEvidence
impl PartialEq for AuthorizationEvidence
Source§fn eq(&self, other: &AuthorizationEvidence) -> bool
fn eq(&self, other: &AuthorizationEvidence) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AuthorizationEvidence
impl Serialize for AuthorizationEvidence
impl Eq for AuthorizationEvidence
impl StructuralPartialEq for AuthorizationEvidence
Auto Trait Implementations§
impl Freeze for AuthorizationEvidence
impl RefUnwindSafe for AuthorizationEvidence
impl Send for AuthorizationEvidence
impl Sync for AuthorizationEvidence
impl Unpin for AuthorizationEvidence
impl UnsafeUnpin for AuthorizationEvidence
impl UnwindSafe for AuthorizationEvidence
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.