Skip to main content

AuthorizationSummary

Enum AuthorizationSummary 

Source
pub enum AuthorizationSummary {
    Action {
        action_type: String,
        identity: String,
        details: Vec<(String, String)>,
    },
    Commit {
        message: String,
    },
    Opaque {
        digest_hex: String,
    },
}
Expand description

What a signer is authorizing, derived from the exact bytes being signed.

Variants§

§

Action

A signed action request: the action, the signing identity, and the legible payload fields (e.g. an agent capability call’s capability, budget, and target).

Fields

§action_type: String

The action being authorized.

§identity: String

The identity signing the action.

§details: Vec<(String, String)>

The action payload’s top-level fields, rendered as key/value pairs.

§

Commit

A git commit’s message — the legible content being authorized. The commit’s git author line is deliberately excluded: it is an unverified self-claim, and the authorizing identity is always the verdict’s cryptographically-verified signer, never the git author.

Fields

§message: String

The commit message.

§

Opaque

Signed bytes whose content is not legible from the signature (e.g. an artifact attestation binds a digest, not content). The digest is named so consent is never silently blank; content consent must be established out of band.

Fields

§digest_hex: String

Lowercase hex SHA-256 of the signed bytes.

Implementations§

Source§

impl AuthorizationSummary

Source

pub fn from_signed_bytes(signed_bytes: &[u8]) -> Self

Derive a legible summary from the exact bytes a signature will cover.

Recognizes a signed action request (canonical JSON with type/identity/payload) and a git commit object; anything else is summarized by its SHA-256 digest rather than silently shown as nothing.

Args:

  • signed_bytes: the bytes the signature covers.

Usage:

let summary = AuthorizationSummary::from_signed_bytes(&payload);
println!("Authorizing: {summary}");

Trait Implementations§

Source§

impl Clone for AuthorizationSummary

Source§

fn clone(&self) -> AuthorizationSummary

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AuthorizationSummary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AuthorizationSummary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AuthorizationSummary

Source§

impl PartialEq for AuthorizationSummary

Source§

fn eq(&self, other: &AuthorizationSummary) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AuthorizationSummary

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.