Type the audit-log decision field with a Decision enum#208
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the bare
i32decisionwire value in the audit log with a typedDecisionenum, so producers and readers share one source of truth for the1=ALLOW / 2=DENY / 3=ABORTmapping.Producer (
firma-sidecar)firma_sidecar::audit::Decision(#[repr(u8)],Serialize_repr+Deserialize_repr). JSON wire stays numeric — no format change.AuditPayload.decision,ExecutionEvent.decision,DecisionOverride.decision, andAuditDecisionFields.decision_codefromi32toDecision.DECISION_ALLOW/DENY/ABORTmagic-int constants (pipeline + test copies).as i32; signing hashes(decision as i32).to_string()so existing signatures stay byte-identical.Reader (
firmamonitor)AuditLite.decisionnow decodes intoAuditLiteDecision { Known(Decision), Unknown(i64) }via a customDeserializeimpl. Three states preserved: absent (None), present-but-unrecognized (Unknown→ rendersUNKNOWN), known. An off-range code never drops the whole record.PROTO_DECISION_*constants and thedecision_labelfn (now aDisplayimpl).Tests
tests/e2e/audit.rsconsumes the production enum instead of a local copy.Also regenerates
Cargo.lock, which was stale onmain(manifest0.1.2, lock0.1.1).Invariants
Wire format unchanged, signatures unchanged, deterministic enforcement unaffected.
just checkpasses.