Skip to main content

VerifiedState

Struct VerifiedState 

Source
pub struct VerifiedState { /* private fields */ }
Expand description

A verified history prefix. Its fields cannot be mutated without validation.

Implementations§

Source§

impl VerifiedState

Source

pub fn transport_host(&self, node: &str) -> Result<&str>

Resolve a live logical node to its native transport host. This does not check freshness or authenticate the host’s key.

Source

pub fn authorize_chat_carrier( &self, logical_node: &str, authenticated_node: &str, ) -> Result<()>

Check only the signed transport mapping. The caller must first use authorize_node on this same verified state to authenticate the carrier’s exact node key and check freshness at the current wall-clock time. Hosting permits chat transport only, never configuration operations, and does not replace per-chat permission checks.

Source

pub fn host_node( &self, owner: &(impl ConfigurationSigner + ?Sized), node_id: &str, parent: &str, now: u64, ) -> Result<SignedState>

Assign a native parent using existing configuration signing authority. Repeating the same mapping is allowed and changes no configuration grants.

Source§

impl VerifiedState

Source

pub fn migrate_to_peers( &self, owner: &OwnerKey, node: &NodeIdentity, header: Header, now: u64, ) -> Result<SignedState>

Prepare the single owner-authenticated migration. The caller first durably fences the legacy writer, then publishes this candidate through the log. Existing restrictions and identities are preserved exactly.

Source

pub fn advance_committed( &mut self, update: SignedState, commit: &Commit, head: &Head, ) -> Result<Head>

Called only after opening the committed ciphertext. head is the durable local log checkpoint, never a value supplied by the proposal. The runtime must persist the returned head and authority transactionally.

Source§

impl VerifiedState

Source

pub fn authorize_owner_candidate( &self, owner: &OwnerKey, candidate: &SignedOwnerCandidate, now: u64, ) -> Result<SignedOwnerTransition>

Persist a write fence before returning this authorization to another node.

Source

pub fn authorize_owner_candidate_with_journal( &self, owner: &OwnerKey, candidate: &SignedOwnerCandidate, journal: Digest, now: u64, ) -> Result<SignedOwnerTransition>

The caller snapshots completed decisions in the same transaction that freezes signing. The digest authenticates that exact transfer manifest.

Source

pub fn verify_owner_authorization( &self, candidate: &SignedOwnerCandidate, authorization: &SignedOwnerTransition, ) -> Result<()>

Verifies authorization at its original issue time. Once issued, retrying completion after the candidate deadline must preserve the same decision.

Source

pub fn accept_owner_authorization( &self, key: &OwnerKey, candidate: &SignedOwnerCandidate, authorization: &SignedOwnerTransition, now: u64, ) -> Result<SignedState>

Source§

impl VerifiedState

Source

pub fn owner_epoch(&self) -> u32

Source

pub fn transfer_owner( &self, owner: &OwnerKey, successor: &OwnerKey, now: u64, ) -> Result<SignedState>

Requires possession of both the current signer and a fresh successor. This creates a record only; persistence, fencing and recovery approval belong to the caller. An expired lease does not invalidate the signer.

Source§

impl VerifiedState

Source

pub fn bootstrap(anchor: TrustAnchor, genesis: SignedState) -> Result<Self>

Bootstrap from the genesis whose digest and owner key were pinned independently. Expired state can be loaded for synchronization, but cannot authorize operations.

Source

pub fn restore( anchor: TrustAnchor, checkpoint: Checkpoint, signed: SignedState, ) -> Result<Self>

Restore only the exact checkpoint held in trusted endpoint storage.

Source

pub fn anchor(&self) -> &TrustAnchor

Source

pub fn checkpoint(&self) -> &Checkpoint

Source

pub fn signed(&self) -> &SignedState

Source

pub fn state(&self) -> &ClusterState

Source

pub fn require_fresh(&self, now: u64) -> Result<()>

Source

pub fn authorize_node( &self, node_id: &str, signing_key: &PublicKey, now: u64, ) -> Result<&NodeMember>

Authorizes a node key, not chat discovery or messaging. Check chat policy separately.

Source

pub fn apply_chain(&mut self, updates: &[SignedState], now: u64) -> Result<()>

Validate a full contiguous update chain before changing any in-memory authority. Historical intermediate records may be expired; the final record must be fresh.

Source

pub fn advance_history(&mut self, updates: &[SignedState]) -> Result<()>

Advance verified history in bounded batches while offline or catching up. This may leave expired state; authorize_node still requires fresh authority.

Source

pub fn renew( &self, owner: &(impl ConfigurationSigner + ?Sized), now: u64, ) -> Result<SignedState>

Renewal may repair an expired configuration using endpoint-held owner authority.

Source

pub fn set_release_channel( &self, signer: &(impl ConfigurationSigner + ?Sized), channel: ReleaseChannel, now: u64, ) -> Result<SignedState>

Source

pub fn set_policy( &self, owner: &(impl ConfigurationSigner + ?Sized), policy: Policy, now: u64, ) -> Result<SignedState>

Source

pub fn configure( &self, owner: &(impl ConfigurationSigner + ?Sized), name: &str, node: (&str, &str), policy: Policy, now: u64, ) -> Result<SignedState>

Apply an owner-authorized TOML edit as one ordered cluster revision.

Source

pub fn rename_node( &self, signer: &(impl ConfigurationSigner + ?Sized), node_id: &str, name: &str, now: u64, ) -> Result<SignedState>

Source

pub fn enroll( &self, owner: &(impl ConfigurationSigner + ?Sized), request: &SignedEnrollment, approved_fingerprint: Digest, now: u64, ) -> Result<SignedState>

approved_fingerprint must be independently confirmed by the owner; merely echoing a fingerprint supplied by the relay does not authenticate enrollment.

Source

pub fn enroll_configurator( &self, owner: &(impl ConfigurationSigner + ?Sized), request: &SignedEnrollment, approved: Digest, now: u64, ) -> Result<SignedState>

Explicit owner approval for a machine used to manage cluster configuration.

Source

pub fn delegate_configuration( &self, owner: &(impl ConfigurationSigner + ?Sized), node: &str, allow: bool, now: u64, ) -> Result<SignedState>

Source

pub fn rotate_node_key( &self, owner: &(impl ConfigurationSigner + ?Sized), request: &SignedEnrollment, approved_fingerprint: Digest, now: u64, ) -> Result<SignedState>

Source

pub fn revoke_node( &self, owner: &(impl ConfigurationSigner + ?Sized), node_id: &str, now: u64, ) -> Result<SignedState>

Source

pub fn replace_node( &self, owner: &(impl ConfigurationSigner + ?Sized), signed: &SignedEnrollment, approved: Digest, can_configure: bool, now: u64, ) -> Result<SignedState>

Retire the pinned old identity and admit a fresh identity atomically. Endpoint code separately refuses replacing the active signing owner.

Trait Implementations§

Source§

impl Clone for VerifiedState

Source§

fn clone(&self) -> Self

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

Auto Trait Implementations§

§

impl Forget for VerifiedState

§

impl Freeze for VerifiedState
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<SignedOwnerTransition>: Freeze, *const LeafNode<String, NodeMember> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, NodeMember)>>: Freeze, *const LeafNode<String, SetValZST> is !null: Freeze, PhantomData<Box<(String, SetValZST)>>: Freeze, *const LeafNode<[u8; 32], SetValZST> is !null: Freeze, PhantomData<Box<([u8; 32], SetValZST)>>: Freeze, PhantomData<Rule>: Freeze, *const LeafNode<String, Vec<String>> is !null: Freeze, PhantomData<Box<(String, Vec<String>)>>: Freeze, *const LeafNode<String, RelayGrant> is !null: Freeze, PhantomData<Box<(String, RelayGrant)>>: Freeze, *const LeafNode<String, AdminGrant> is !null: Freeze, PhantomData<Box<(String, AdminGrant)>>: Freeze, *const LeafNode<String, GroupAdminGrant> is !null: Freeze, PhantomData<Box<(String, GroupAdminGrant)>>: Freeze,

§

impl Move for VerifiedState

§

impl RefUnwindSafe for VerifiedState

§

impl Send for VerifiedState
where RawVecInner: Send, NodeRef<Owned, String, NodeMember, LeafOrInternal>: Send, BoxRaw<(String, NodeMember)>: Send, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Send, BoxRaw<(String, SetValZST)>: Send, NodeRef<Owned, [u8; 32], SetValZST, LeafOrInternal>: Send, BoxRaw<([u8; 32], SetValZST)>: Send, NodeRef<Owned, String, Vec<String>, LeafOrInternal>: Send, BoxRaw<(String, Vec<String>)>: Send, NodeRef<Owned, String, RelayGrant, LeafOrInternal>: Send, BoxRaw<(String, RelayGrant)>: Send, NodeRef<Owned, String, AdminGrant, LeafOrInternal>: Send, BoxRaw<(String, AdminGrant)>: Send, NodeRef<Owned, String, GroupAdminGrant, LeafOrInternal>: Send, BoxRaw<(String, GroupAdminGrant)>: Send,

§

impl Sync for VerifiedState
where RawVecInner: Sync, NodeRef<Owned, String, NodeMember, LeafOrInternal>: Sync, BoxRaw<(String, NodeMember)>: Sync, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Sync, BoxRaw<(String, SetValZST)>: Sync, NodeRef<Owned, [u8; 32], SetValZST, LeafOrInternal>: Sync, BoxRaw<([u8; 32], SetValZST)>: Sync, NodeRef<Owned, String, Vec<String>, LeafOrInternal>: Sync, BoxRaw<(String, Vec<String>)>: Sync, NodeRef<Owned, String, RelayGrant, LeafOrInternal>: Sync, BoxRaw<(String, RelayGrant)>: Sync, NodeRef<Owned, String, AdminGrant, LeafOrInternal>: Sync, BoxRaw<(String, AdminGrant)>: Sync, NodeRef<Owned, String, GroupAdminGrant, LeafOrInternal>: Sync, BoxRaw<(String, GroupAdminGrant)>: Sync,

§

impl Unpin for VerifiedState
where *const u8 is !null: Unpin, *const LeafNode<String, NodeMember> is !null: Unpin, Box<(String, NodeMember)>: Unpin, *const LeafNode<String, SetValZST> is !null: Unpin, Box<(String, SetValZST)>: Unpin, *const LeafNode<[u8; 32], SetValZST> is !null: Unpin, Box<([u8; 32], SetValZST)>: Unpin, *const LeafNode<String, Vec<String>> is !null: Unpin, Box<(String, Vec<String>)>: Unpin, *const LeafNode<String, RelayGrant> is !null: Unpin, Box<(String, RelayGrant)>: Unpin, *const LeafNode<String, AdminGrant> is !null: Unpin, Box<(String, AdminGrant)>: Unpin, *const LeafNode<String, GroupAdminGrant> is !null: Unpin, Box<(String, GroupAdminGrant)>: Unpin,

§

impl UnsafeUnpin for VerifiedState

§

impl UnwindSafe for VerifiedState

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.