pub struct Redaction {
pub redacted_blob: ContentHash,
pub state: ChangeId,
pub path: String,
pub reason: String,
pub redactor: Principal,
pub redacted_at: DateTime<Utc>,
pub signature: Option<StateSignature>,
pub purged_at: Option<DateTime<Utc>>,
pub supersedes: Option<ContentHash>,
}Expand description
A redaction declaration on a single blob in a single state.
Fields§
§redacted_blob: ContentHashThe blob whose bytes should no longer materialize.
state: ChangeIdThe state in which the path resides. A redaction is scoped to the
(blob, state, path) triple; --all-states produces one redaction
per matching state.
path: StringPath within the state’s tree where the blob lives.
reason: StringOperator-supplied reason (“leaked credential”, “PII”, …).
redactor: PrincipalWho declared the redaction.
redacted_at: DateTime<Utc>When the redaction was declared. RFC3339 string at the wire format
boundary; DateTime<Utc> internally.
signature: Option<StateSignature>Optional cryptographic signature over the canonical signing payload
(see [canonical_signing_payload]). None for unsigned redactions
(still recorded in the oplog, still surfaced in materialize, but
reviewers will see them flagged unsigned).
purged_at: Option<DateTime<Utc>>When heddle purge removed the underlying blob bytes. None while
the redaction is declared-but-bytes-still-on-disk.
supersedes: Option<ContentHash>The redaction this one supersedes, if any — for chains where the reason or scope was updated. Identified by the prior redaction’s content hash.
Implementations§
Source§impl Redaction
impl Redaction
Sourcepub fn canonical_signing_payload(&self) -> Vec<u8> ⓘ
pub fn canonical_signing_payload(&self) -> Vec<u8> ⓘ
Build the canonical bytes a signer covers. Anything outside this
payload (e.g. purged_at, signature itself) is intentionally
excluded — purges happen after signing, and the signature can’t sign
itself.
Sourcepub fn mark_purged(&mut self, at: DateTime<Utc>) -> bool
pub fn mark_purged(&mut self, at: DateTime<Utc>) -> bool
Mark the redaction as purged. Returns true if the state changed
(false if already purged — callers can use this for idempotency).
Sourcepub fn stub_text(&self, redaction_id: &ContentHash) -> String
pub fn stub_text(&self, redaction_id: &ContentHash) -> String
Format the stub a reader sees instead of the redacted blob content. Plain text, ASCII-only, safe to embed in materialized worktrees and downstream Git exports.