Skip to main content

Authorization

Struct Authorization 

Source
pub struct Authorization {
    pub format_version: u16,
    pub basis: Basis,
    pub approvers: Vec<ContentHash>,
}
Expand description

Why a OpKind::Submit was allowed to land (D43).

The gate that admits a landing runs at apply time inside the node’s submission policy, so without this the log records that a ref moved and never why. A later additive field cannot repair that: entries written before it stay blank, and that window is permanently unauditable. So it ships with the first Submit ever accepted.

The record is checked, not trusted. Everything here except the ACL’s own grants is derivable from the fold, and View::validate rederives it and refuses a mismatch — the OpKind::RecordRefSnapshot discipline, for the same reason: a claim every replayer verifies is worth more than one only the admitting node could have checked.

Fields§

§format_version: u16

Wire-format version; see FORMAT_VERSION.

§basis: Basis

The rule that admitted the landing.

§approvers: Vec<ContentHash>

Actor ids whose standing approvals the basis rested on, in the review’s verdict order.

Actor ids, never channel names. An id is hash(pubkey) and is the trust root (D9); a channel name is mutable, and an audit record that reads differently later than it read when written is not an audit record. Resolved through the log’s own OpKind::BindKey records by View::bound_actor_at, so the join is replayable — and an approval whose channel the log binds to no key, or to more than one, cannot land through this op at all.

What an id here proves, exactly. It is the key the log bound to the approving channel as of the verdict’s own position (VerdictState::at), not proof that this key cast the verdict: the fold is handed only the op, never the entry, so ReviewState::verdicts is keyed by channel and no review can record a signer. Resolving at the verdict’s position rather than the landing’s is what keeps the claim true across a key rotation (D44) — the replacement key never saw the review. That is also why freezing the id here is worth doing: KeyBinding::channel is the one field a later re-binding may change, so the answer is only stable once written down.

Empty is a distinct value from absent. A basis that requires no approvals records [], and a reader can tell that from a log predating the field, because such a log holds no Submit.

Implementations§

Source§

impl Authorization

Source

pub fn new(basis: Basis, approvers: Vec<ContentHash>) -> Self

Creates an authorization at the current wire-format version.

Trait Implementations§

Source§

impl Clone for Authorization

Source§

fn clone(&self) -> Authorization

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 Authorization

Source§

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

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

impl<'de> Deserialize<'de> for Authorization

Source§

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 PartialEq for Authorization

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Authorization

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Authorization

Source§

impl StructuralPartialEq for Authorization

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<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> 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, 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,