pub struct ChainLinkJson {
pub id: Option<Uuid>,
pub kind: ChainLinkKind,
pub sequence: Option<i64>,
pub payload: String,
pub attestation: String,
pub signature: Option<String>,
pub created_at: Option<DateTime<Utc>>,
}Expand description
JSON wire shape of a chain link on the public GET /enclaves/{id}/upgrade-chain route. The opaque byte fields are
carried as base64 strings here (vs. the raw-bytes ChainLink used
at rest and inside the validator). Consumed by the CLI today and,
eventually, by the backend + chain-host so all three surfaces share
one definition.
payload, attestation, and signature are standard base64 with
padding. Decode them before handing the bytes to validate_chain_link
for re-verification.
Fields§
§id: Option<Uuid>Assigned by the backend on insert; absent on the wire shape
chain-host sends to the ingest route.
kind: ChainLinkKind§sequence: Option<i64>Monotonic per-enclave, starts at 0 for the boot link.
payload: StringBase64 of the CBOR-encoded kind-specific payload.
attestation: StringBase64 of the COSE_Sign1 NSM attestation document. user_data
is bound to sha256(payload_bytes).
signature: Option<String>Base64 of the raw 64-byte ECDSA P-256 r||s signature. Absent on boot links (they’re authenticated by the attestation alone), required on upgrade/revocation links.
created_at: Option<DateTime<Utc>>Wall-clock time the backend appended this link. None on the
chain-host ingest direction.
Implementations§
Source§impl ChainLinkJson
impl ChainLinkJson
Sourcepub fn into_chain_link(&self) -> Result<ChainLink, ChainLinkDecodeError>
pub fn into_chain_link(&self) -> Result<ChainLink, ChainLinkDecodeError>
Decode the base64 wire fields into the raw-bytes ChainLink the
validator consumes. id carries through; sequence narrows
i64 -> u64 and errors on a negative value rather than coercing.
This is the single decode path for every consumer of the public
GET /enclaves/{id}/upgrade-chain endpoint (the SDK’s
trust-upgrades walk and the CLI’s upgrade chain), so the
base64 handling is defined once in the audited crate rather than
re-implemented per caller.
Sourcepub fn into_recorded_link(&self) -> Result<RecordedLink, ChainLinkDecodeError>
pub fn into_recorded_link(&self) -> Result<RecordedLink, ChainLinkDecodeError>
Decode into a RecordedLink, carrying created_at as the
ingest reference instant for time-dependent rules (revocation
valid_from).
Trait Implementations§
Source§impl Clone for ChainLinkJson
impl Clone for ChainLinkJson
Source§fn clone(&self) -> ChainLinkJson
fn clone(&self) -> ChainLinkJson
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more