Skip to main content

zaun_community_protocol/command/
migration.rs

1//! Host migration commands (specification ยง13 `migration.*`, migration.md, ADR-0013).
2
3use serde::{Deserialize, Serialize};
4
5use super::{BodyError, Validate};
6use crate::json::SignedJson;
7use crate::keys::PublicKey;
8
9/// `migration.reauth`: on an unbound connection to the host that took the community over, a
10/// member proves its existing member key and the connection binds to the same `MemberId`.
11/// Responds with [`super::invite::Admitted`]. The envelope's `community_id` names the
12/// community; the hello before it must name it too, so the challenge and proof cover it.
13#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
14pub struct Reauth {
15    /// The member's existing key.
16    pub member_public_key: PublicKey,
17    /// Signed `MemberReauth` (ctx `zaun/v1/member-reauth`).
18    pub reauth: SignedJson,
19}
20
21impl Validate for Reauth {
22    fn validate(&self) -> Result<(), BodyError> {
23        Ok(())
24    }
25}