Skip to main content

MeshControl

Trait MeshControl 

Source
pub trait MeshControl: Send + Sync {
    // Required methods
    fn admit<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        mesh_pubkey_hex: &'life1 str,
        jti: &'life2 str,
        possession_proof: &'life3 [u8],
        proof_iat: u64,
        now: u64,
        advertise_addr: Option<&'life4 str>,
    ) -> Pin<Box<dyn Future<Output = Result<JoinOutcome, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn rotate_key<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn revoke<'life0, 'async_trait>(
        &'life0 self,
        node: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn members<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MeshMember>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn promote<'life0, 'async_trait>(
        &'life0 self,
        node: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The cluster mesh control operations exposed to the control-plane API, implemented by the cluster runtime over ClusterNode; None on a non-cluster node (the routes then return 501).

Required Methods§

Source

fn admit<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, mesh_pubkey_hex: &'life1 str, jti: &'life2 str, possession_proof: &'life3 [u8], proof_iat: u64, now: u64, advertise_addr: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<JoinOutcome, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Admit a joining node presenting a bearer join token whose single-use handle is jti: verify the possession proof (possession_proof over cose::join_challenge(jti, mesh_pubkey_hex, proof_iat), fresh at now) against mesh_pubkey_hex, then — if valid and the token isn’t spent — trust the key cluster-wide, add it to membership (id derived from the key), and return the current members as root-signed assertions. Err is a human-readable failure (e.g. this node has no root key to vouch for members).

Source

fn rotate_key<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rotate this node’s mesh identity (make-before-break) and return the new public key (SPKI hex). Node-local: only the node itself can mint + persist its private key, so this rotates the key of the node whose API is hit.

Source

fn revoke<'life0, 'async_trait>( &'life0 self, node: u64, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Revoke node from the mesh: delete its trust cluster-wide (so it can no longer authenticate) and drop it from the quorum. Err is a human-readable failure.

Source

fn members<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<MeshMember>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The current Raft membership (voters + learners), for the Kubernetes operator’s membership reconciler. caught_up is meaningful only on the leader; hit the leader for a promote decision.

Source

fn promote<'life0, 'async_trait>( &'life0 self, node: u64, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Promote a caught-up learner node to a voter (leader-only; a no-op on a follower). Err is a human-readable failure.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§