Repository navigation
✨ EMS-AUDIT: imports' checksums, deleted events in account exports, admin keys after commit, new tenants' realms (part 2) - #3929
Merged
Conversation
… backlog line, admin keys after commit, retired events in account exports - Election event and tenant configuration imports record the file's computed SHA-256, the declared checksum and whether they match, and counts. - New tenants' realms get the tenant log listener, admin events and roles. - Every outbox worker pass writes pending_entries and oldest_pending_seconds. - AdminPublicKey is posted after the key's transaction commits, under a delivery id per account and key; the tenant log migration backfills keys the tenant log does not announce. - ACCOUNT_WITH_EVENTS exports read deleted events' retired databases, opened read-only for the read under the event database lock and closed again; the deletion entry keeps the retired log's system public key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An export holds what the log holds: `/export-tenant-logs` now refuses with 403 a caller with `tenant-logs-export` but without `tenant-logs-read`, as the design asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… counts An import's entry now shows the file's SHA-256, whether it matches the checksum the admin declared, and what the file held, instead of raw extra details. The tenant log's Export shows only to those who can also read it, as Harvest requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fetch-document built a private document's S3 key from the election event the caller named. The tenant log's Export asks with an empty event, so its link pointed at tenant-…/event-/document-…, which does not exist: every tenant log export failed to download with NoSuchKey. The key now comes from the document's own election event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The deletion entry now keeps the retired log's system public key, since the event's keys are deleted with it. The popup shows it in the deleted event's section instead of as a raw detail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d export permissions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 2
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
ereslibre
marked this pull request as ready for review
October 16, 2026 22:21
…s without a server The coverage profile skips the database tests, so the new read of a retired event database lowered electoral-log-native's ratios. Check the retired database's IDs before the server is asked, and test that read, the read-only store, log queries and board names without a server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only a route test whose realm keys can't be fetched reached the reason of KEYS_UNAVAILABLE, and not on every run, so harvest's coverage changed between runs of the same code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Parent issue: https://github.com/sequentech/meta/issues/13781
Design package EMS-AUDIT, second part. #3902 gave each tenant a signed tenant log; this pull request closes the gaps it listed or left open, apart from the route-by-route entries (see "Split with #3928" below).
What changes
undeclared,matchesormismatch). The entry also counts what the file held: elections, contests, candidates, areas and areas per contest, or configuration sections. A failed commit of a tenant configuration import no longer records the import.retired event <ID>. Each retired database is checked against the catalog, opened read-only under the event database lock, and closed to connections again, including when the read fails. The deletion entry keeps the retired log's system public key, since the event's keys are deleted with it.AdminPublicKeyis posted to the tenant log only once the transaction that saved the key commits. A rollback leaves nothing behind (before, it could leave a public key in the log whose key was then lost). The delivery id is per account and key, so the key is posted once. The tenant log migration backfills keys created before keys went to the tenant log, and running it again does nothing. The outbox can't carry this statement (it only postsAuditbodies), so a small post-commit task does it instead.custom-event-listener, admin events with details, and thetenant-logs-read/tenant-logs-exportroles granted to theadmingroup.{"target":"audit_log_outbox","pending_entries":N,"oldest_pending_seconds":S}, zeros included, so security monitoring can alert on entries waiting more than 5 minutes. This replaces thewaiting/oldest_secondsnames. It is documented in the developer page./export-tenant-logsneedstenant-logs-readas well astenant-logs-export(403 otherwise). The portal shows the tenant log's Export only to people who have both.fetch-documentbuilt a private document's S3 key from the event the caller named. The tenant log asks with an empty event, so the link pointed attenant-…/event-/document-…(NoSuchKey). The key now comes from the document's own event.Split with #3928
#3928 (VOTE-AUDIT, meta#14259) closes the "routes write no AdminChange" gap from #3902 for every Harvest route, including messaging accounts, certificate authorities, countries and deleting a tenant. It does this by letting the
audit_change()trigger see Step's own writes. To avoid logging each change twice, this pull request adds no per-route entries. The two pull requests touch different files.Acceptance (meta#13781)
Ticked where #3902 (merged) and this pull request together meet the criterion. Items 2, 3 and 5 also need #3928.
postgres_audit_log_outbox)Not in this pull request
signing_log_outbox.jboss-loggingfor the tenant realm. Existing realms are set up by the one-off task, and new tenants by this pull request.Upgrade notes
waiting/oldest_secondsmust readpending_entries/oldest_pending_seconds.tenant-logs-exportneedtenant-logs-readtoo.Tests
--include-ignored), including reading a retired database and closing it again.decrypted_archives_use_private_owned_files_and_leave_no_plaintextneeds anopensslbinary on the host, and passes with one.postgres_audit_log_outbox(8, including the post-commit key announcement, the backfill and retired events in exports) andpostgres_audit_change(18) pass.LogEntryDialogstories (17, with a new import story), story inventory,typecheck:stories, and the journeyssettings/logs,settings/accessandevents/operations(29).Not measured locally: the per-package coverage gates.
Demo
Video with voiceover, to upload to meta#13781: import, then an event edit, deletion, the account export with the retired log, a new tenant's realm, and the backlog line.
🤖 Generated with Claude Code