pub struct Challenge {
pub nonce: Vec<u8>,
pub timestamp: Option<Timestamp>,
pub challenger_id: String,
pub expires_at: Option<Timestamp>,
pub protocol_version: u32,
pub capabilities: Vec<String>,
}Expand description
Authentication challenge for peer verification
Fields§
§nonce: Vec<u8>Random nonce (32 bytes) for replay protection
timestamp: Option<Timestamp>Challenge creation timestamp
challenger_id: StringChallenger’s device ID (hex string)
expires_at: Option<Timestamp>Challenge expiration timestamp
protocol_version: u32Protocol version the challenger speaks (ADR-065).
0 = pre-rc.21+1 peer (no version field on the wire, prost
default). The responder negotiates by picking
min(challenge.protocol_version, CURRENT_PROTOCOL_VERSION) and
signs the byte construction associated with that version. See
SignedChallengeResponse.signature for the per-version byte
string and ADR-065 for the full negotiation rule.
capabilities: Vec<String>Capability strings the challenger advertises (ADR-065). Sorted, opaque ASCII identifiers. At protocol version 1 this is advertised-but-not-signed — consumers driving feature-flagged behaviour (e.g. “this peer supports the new cell-formation flow”) can read this field and adjust soft policy, but the field is not part of the signed-message byte construction. A future v2 revision may extend the signed bytes to cover capabilities; see ADR-065 “Capabilities (v1 semantics)” for the rationale.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Challenge
impl<'de> Deserialize<'de> for Challenge
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>,
Source§impl Message for Challenge
impl Message for Challenge
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.