pub struct EdgeConfig {
pub version: u32,
pub name: String,
pub overlay_ip: IpAddr,
pub prefix_len: u8,
pub private_key: String,
pub public_key: String,
pub peers: Vec<PeerSpec>,
pub dns_server: Option<IpAddr>,
pub dns_domain: Option<String>,
pub expires_at_unix: u64,
}Expand description
Portable artifact for a minted edge peer
(OverlaydRequest::MintEdgePeer → OverlaydResponse::EdgeConfig):
everything a short-lived unprivileged WireGuard edge process needs to
join the overlay. Minted peers die with overlayd — provisioners re-mint
rather than persist and reuse a config.
Fields§
§version: u32Always EDGE_CONFIG_VERSION for configs minted by this build;
EdgeConfig::from_token rejects anything else.
name: StringThe caller-chosen handle the peer was minted under.
overlay_ip: IpAddrThe edge peer’s allocated overlay address.
prefix_len: u8Prefix length of the overlay network (interface address + on-link route).
private_key: StringBase64 WireGuard private key for the edge peer’s device.
public_key: StringBase64 WireGuard public key matching private_key (registered in the
mesh by overlayd; echoed for the caller’s bookkeeping).
peers: Vec<PeerSpec>The peers the edge should configure (the minting node, at least). Each
PeerSpec::allowed_ips is a comma-separated CIDR list by the
established convention — vzagent splits on ','.
dns_server: Option<IpAddr>Overlay DNS resolver IP for the edge peer, if any.
dns_domain: Option<String>Overlay DNS search domain, if any.
expires_at_unix: u64Unix-seconds when the peer expires and is swept from the mesh.
Implementations§
Source§impl EdgeConfig
impl EdgeConfig
Sourcepub fn to_token(&self) -> String
pub fn to_token(&self) -> String
Encode the config as a single zledge1.-prefixed URL-safe-base64
(no padding) string of its compact-JSON form, suitable for CLI flags /
env vars (the prefix-versioned CLI-string idiom, cf.
WorkerBootstrapToken::to_cli_string in zlayer-secrets).
§Panics
Never in practice: EdgeConfig JSON-serializes infallibly (no
non-string map keys, no fallible Serialize impls).
Sourcepub fn from_token(token: &str) -> Result<EdgeConfig, EdgeTokenError>
pub fn from_token(token: &str) -> Result<EdgeConfig, EdgeTokenError>
Decode a token previously produced by Self::to_token.
§Errors
Returns EdgeTokenError::BadPrefix when the zledge1. prefix is
missing, EdgeTokenError::Decode / EdgeTokenError::Parse on
base64 / JSON failure, and EdgeTokenError::UnsupportedVersion when
the payload’s version is not EDGE_CONFIG_VERSION.
Trait Implementations§
Source§impl Clone for EdgeConfig
impl Clone for EdgeConfig
Source§fn clone(&self) -> EdgeConfig
fn clone(&self) -> EdgeConfig
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 EdgeConfig
impl Debug for EdgeConfig
Source§impl<'de> Deserialize<'de> for EdgeConfig
impl<'de> Deserialize<'de> for EdgeConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EdgeConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EdgeConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for EdgeConfig
Source§impl PartialEq for EdgeConfig
impl PartialEq for EdgeConfig
Source§fn eq(&self, other: &EdgeConfig) -> bool
fn eq(&self, other: &EdgeConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for EdgeConfig
impl Serialize for EdgeConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for EdgeConfig
Auto Trait Implementations§
impl Freeze for EdgeConfig
impl RefUnwindSafe for EdgeConfig
impl Send for EdgeConfig
impl Sync for EdgeConfig
impl Unpin for EdgeConfig
impl UnsafeUnpin for EdgeConfig
impl UnwindSafe for EdgeConfig
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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