pub enum Mutation<'a> {
Register {
agent_key: &'a VerifyingKey,
endpoints: &'a [Endpoint],
expires_at: SystemTime,
},
UpdateEndpoint {
endpoints: &'a [Endpoint],
expires_at: SystemTime,
},
Refresh {
ttl: Duration,
expires_at: SystemTime,
},
Deregister,
}Expand description
A write to an existing registration, with the parameters that write carries.
This mirrors the mutating crate::Dht methods so that the parameters
which distinguish two calls of the same kind (which endpoints, how much
TTL) are inside what the signature covers, and it names the resulting
record’s expires_at so that no field of the record a write produces sits
outside the signature.
Variants§
Register
Create the record with exactly this content.
Registration is a write like any other and needs the same authorization. Without it, an attestation token lifted from a public record would be enough to re-register that URI pointing anywhere: the token binds the agent key, but nothing would bind the endpoints.
Fields
agent_key: &'a VerifyingKeyThe key the new record will name as its only writer.
expires_at: SystemTimeWhen the new record will expire.
UpdateEndpoint
Replace the record’s endpoints with these.
A migration does not change when the record lapses, so expires_at is
the expiry the record already carries. A store derives it from the
record it holds rather than accepting it from the caller, so the two
cannot describe the same write differently.
Fields
expires_at: SystemTimeWhen the record will expire, unchanged by this write.
Refresh
Extend the record’s lifetime to this instant.
expires_at is what a store applies. ttl is what the agent asked
for, and is signed alongside it because it is an argument of the call:
a backend that reports the requested lifetime, or carries it on the
wire, must not be able to report one the agent never asked for. The
instant is what the record ends up holding, so the instant is what
stores act on. Only the signer knows both, because only the signer
knows when it signed.
Fields
expires_at: SystemTimeWhen the record will expire once this write is applied.
Deregister
Remove the record.