pub struct UpgradeIntent {
pub intent_id: Uuid,
pub from_protocol_version: String,
pub to_protocol_version: String,
pub from_suite_id: u16,
pub to_suite_id: u16,
pub proposer_user: Uuid,
pub proposer_device: Uuid,
pub deadline_secs: u64,
}Expand description
The signed-over content of an upgrade proposal (versioning.md step 1). Every field is covered by
the proposer’s DSK hybrid signature in the enclosing SignedUpgradeIntent.
Fields§
§intent_id: UuidUUIDv7 idempotency key for the whole ceremony — a duplicate/contradictory proposal under a different id is rejected while one is in flight; a replayed one is a no-op.
from_protocol_version: StringThe album’s current (immutable) protocol_version.
to_protocol_version: StringThe target protocol_version the fork is pinned to.
from_suite_id: u16The album’s current crypto_suite_id wire codepoint.
to_suite_id: u16The target crypto_suite_id wire codepoint (may equal from_suite_id for a protocol-only
upgrade; differs for a suite migration).
proposer_user: UuidThe account the proposing admin device belongs to.
proposer_device: UuidThe proposing admin device (its DSK signs this intent; verified against the device directory).
deadline_secs: u64The deadline duration in whole seconds (default DEFAULT_UPGRADE_DEADLINE). The
effective expiry is received_at + deadline on the server’s trusted clock — see
is_expired; a member clock can neither extend nor shorten it.
Implementations§
Source§impl UpgradeIntent
impl UpgradeIntent
Sourcepub fn signing_bytes(&self) -> Result<Vec<u8>, UpgradeError>
pub fn signing_bytes(&self) -> Result<Vec<u8>, UpgradeError>
The canonical-CBOR signing bytes the proposer’s DSK covers.
§Errors
Returns UpgradeError::Encode if the intent cannot be canonically encoded.
Sourcepub fn is_expired(&self, received_at: Timestamp, now: Timestamp) -> bool
pub fn is_expired(&self, received_at: Timestamp, now: Timestamp) -> bool
Whether this intent has expired: now >= received_at + deadline on the caller’s (server’s)
trusted clock. Overflow is treated as expired (fail-closed). This is the only clock
evaluation; it is a server concern here and is exercised in isolation.
Trait Implementations§
Source§impl Clone for UpgradeIntent
impl Clone for UpgradeIntent
Source§fn clone(&self) -> UpgradeIntent
fn clone(&self) -> UpgradeIntent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UpgradeIntent
impl Debug for UpgradeIntent
Source§impl<'de> Deserialize<'de> for UpgradeIntent
impl<'de> Deserialize<'de> for UpgradeIntent
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>,
impl Eq for UpgradeIntent
Source§impl PartialEq for UpgradeIntent
impl PartialEq for UpgradeIntent
Source§fn eq(&self, other: &UpgradeIntent) -> bool
fn eq(&self, other: &UpgradeIntent) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for UpgradeIntent
impl Serialize for UpgradeIntent
impl StructuralPartialEq for UpgradeIntent
Auto Trait Implementations§
impl Freeze for UpgradeIntent
impl RefUnwindSafe for UpgradeIntent
impl Send for UpgradeIntent
impl Sync for UpgradeIntent
impl Unpin for UpgradeIntent
impl UnsafeUnpin for UpgradeIntent
impl UnwindSafe for UpgradeIntent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more