Repository navigation
Commit e92bc6a
test(buzz-relay): add PostgreSQL atomicity witnesses for NIP-FI admission
Adds three #[ignore] PostgreSQL integration tests to the nip_fi::admission
pg_integration module that prove the FI-INV-09 all-or-none invariant:
pg_nip_fi_rollback_leaves_zero_rows
Opens a SERIALIZABLE transaction, writes all nine NIP-FI admission tables
(replay claims, operation receipts, identity bindings, lifecycle history,
authorization events, admission results, authority epochs, protected object
authority), then explicitly rolls back. Asserts zero rows remain in every
table — no orphan enrollment, replay, receipt, evidence, or fence rows
survive a transaction abort.
pg_nip_fi_failed_insert_clears_prior_nip_fi_writes
Same setup, but instead of explicit rollback the test triggers a mid-tx
PK violation (duplicate proof_event_id). After the aborted transaction is
rolled back, asserts zero rows remain. This is the FI-TRACE-FINAL-DENIAL-
NO-MUTATION witness: a failure after admission writes does not leave any
durable authorization state.
pg_nip_fi_successful_commit_persists_all_rows
Positive control: commits the same writes and asserts at least one row
in every NIP-FI table.
Also fixes connection::test_conn_with_auth to include the new
nip_fi_assertion / nip_fi_proof_meta fields added in PR 4.
Tests require DATABASE_URL or BUZZ_TEST_DATABASE_URL and all migrations.
Run: cargo test -p buzz-relay -- --ignored pg_nip_fi --nocapture
Co-authored-by: Will Pfleger <[email protected]>
Signed-off-by: Will Pfleger <[email protected]>1 parent 8167cdd commit e92bc6a
2 files changed
Lines changed: 609 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| 758 | + | |
| 759 | + | |
758 | 760 | | |
759 | 761 | | |
760 | 762 | | |
| |||
0 commit comments