pub struct NameRecord {
pub name: String,
pub microvm_id: String,
pub endpoint: String,
pub agent_token: String,
pub region: String,
pub at: u64,
pub identity_host_seed: Option<String>,
pub identity_vm_public_key: Option<String>,
pub egress_posture: Option<String>,
}Expand description
One kept VM’s name, and everything an adopt needs to address it.
camelCase on the wire: this is the CLI registry’s on-disk format, read by later
versions, so fields are only ever added, and optional ones default when absent.
Fields§
§name: String§microvm_id: String§endpoint: String§agent_token: StringThe launch’s agent token: a bearer credential for the VM.
region: String§at: u64Seconds since the epoch when the name was registered.
identity_host_seed: Option<String>The launching host’s identity secret, base64, when run --identity generated one.
Persisted for the reason the agent token is: a later tunnel --verify-identity
needs it. It raises what a stolen record can do from “call the VM” to “call the VM
and impersonate the launching host to it”, which is the same trust domain.
identity_vm_public_key: Option<String>The VM’s public key, base64 — the pin --verify-identity checks the far end against.
egress_posture: Option<String>The egress posture label of the launch this name was registered for, when the
registering command launched the VM. None means unknown, never “open”.
Implementations§
Source§impl NameRecord
impl NameRecord
Sourcepub fn new(
name: impl Into<String>,
microvm_id: impl Into<String>,
endpoint: impl Into<String>,
agent_token: impl Into<String>,
region: impl Into<String>,
) -> Result<Self, Error>
pub fn new( name: impl Into<String>, microvm_id: impl Into<String>, endpoint: impl Into<String>, agent_token: impl Into<String>, region: impl Into<String>, ) -> Result<Self, Error>
A record for a VM this process can already address, stamped with the current time.
Refuses an illegal name or an empty id, endpoint, or token: a record missing any of them resolves to a VM nobody can adopt.
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
The record as JSON, secrets included — the form to store privately.
Trait Implementations§
Source§impl Clone for NameRecord
impl Clone for NameRecord
Source§impl Debug for NameRecord
Redacts the agent token and the identity seed: this type reaches logs through errors
and test output, and both values are credentials.
impl Debug for NameRecord
Redacts the agent token and the identity seed: this type reaches logs through errors and test output, and both values are credentials.
Source§impl<'de> Deserialize<'de> for NameRecord
impl<'de> Deserialize<'de> for NameRecord
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 PartialEq for NameRecord
impl PartialEq for NameRecord
Source§impl Serialize for NameRecord
impl Serialize for NameRecord
impl StructuralPartialEq for NameRecord
Auto Trait Implementations§
impl Freeze for NameRecord
impl RefUnwindSafe for NameRecord
impl Send for NameRecord
impl Sync for NameRecord
impl Unpin for NameRecord
impl UnsafeUnpin for NameRecord
impl UnwindSafe for NameRecord
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<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