Documentation
¶
Overview ¶
Package datasubject defines the shared wire contract for account export and erasure requests between the Cloud coordinator and every service that stores data about a subject.
Authority ¶
Cloud owns the account, the subject reference and the lifecycle request and is the only coordinator. Each participant owns, exports and erases the data it holds. This package owns only the stable JSON shape, local validation and the completion rule; it performs no network I/O and persists nothing.
Subject reference ¶
SubjectRef is an opaque identifier resolved by Cloud. A raw e-mail address is never a valid subject.
Receipts ¶
A participant answers with a Receipt signed with its own Ed25519 key over the canonical JSON of the receipt without its signature. Backups and logs that age out later are reported as retained with a retained_until instant, never claimed as erased. The aggregate receipt carries no subject, tenant, user or job identifier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanCompleteErasure ¶
CanCompleteErasure applies the coordinator rule: an erasure completes only when every registered participant returned erased or nothing_held for the request. The error names the first participant that does not qualify.
Types ¶
type Dataset ¶
type Dataset struct {
ID string `json:"id"`
Action string `json:"action"`
Rows int64 `json:"rows"`
Store string `json:"store"`
}
Dataset reports what a participant did with one dataset.
type Processor ¶
type Processor struct {
Name string `json:"name"`
Action string `json:"action"`
Reference string `json:"reference"`
}
Processor reports the deletion mechanism of a downstream processor.
type Receipt ¶
type Receipt struct {
RequestID string `json:"request_id"`
Service string `json:"service"`
Kind Kind `json:"kind"`
State ReceiptState `json:"state"`
CompletedAt time.Time `json:"completed_at"`
Datasets []Dataset `json:"datasets"`
Retained []Retained `json:"retained"`
Processors []Processor `json:"processors"`
ReasonCode *string `json:"reason_code"`
Signature []byte `json:"signature"`
}
Receipt is the signed terminal answer of one participant.
func (Receipt) Seal ¶
func (r Receipt) Seal(key ed25519.PrivateKey) (Receipt, error)
Seal validates the receipt and signs it with the participant key.
func (Receipt) SigningBytes ¶
SigningBytes is the canonical JSON of the receipt without its signature.
type ReceiptState ¶
type ReceiptState string
ReceiptState is the terminal outcome a participant reports.
const ( ReceiptErased ReceiptState = "erased" ReceiptNothingHeld ReceiptState = "nothing_held" ReceiptExported ReceiptState = "exported" ReceiptBlocked ReceiptState = "blocked" ReceiptFailed ReceiptState = "failed" )
Receipt states. Only Erased and NothingHeld let an erasure complete; Exported is the terminal state of an export.
type Request ¶
type Request struct {
RequestID string `json:"request_id"`
Kind Kind `json:"kind"`
SubjectRef string `json:"subject_ref"`
RequestedAt time.Time `json:"requested_at"`
Deadline time.Time `json:"deadline"`
}
Request is delivered to every participant; it is idempotent on RequestID.
type RequestState ¶
type RequestState string
RequestState is the participant-reported progress of a request.
const ( StateAccepted RequestState = "accepted" StateRunning RequestState = "running" StateDone RequestState = "done" StateBlocked RequestState = "blocked" StateFailed RequestState = "failed" )
Request states.