Repository navigation
SCAN-2: no single-nullifier request in the frontend; deploy check and log audit - #10
Merged
Merged
Conversation
…eck and a log audit for the owner's follow-up The history page already matches nullifiers in the browser (66bc1a7). What was left: - frontend/src/lib/api.ts still exported getNullifier(nf) (GET /nullifiers/:nf), unused. It is removed, and frontend/tests/spent.test.mjs now fails if any source file can name one nullifier in a request, or if the history scan calls anything but the two uniform downloads. - docs/api.md warns API users not to call GET /nullifiers/:nf with a nullifier of their own. - deploy/scan2-verify.sh: read-only check of a deployed explorer (lookup route gone, paged set served, no lookup in the served history page's chunks); --record prints the dated line the issue asks for. - deploy/scan2-log-audit.sh: on the explorer host, counts log lines that hold a lookup or a /nullifiers/<hex> URL (dry run, never prints them); --purge --before <day> removes them. - CI: a deploy-scripts job (shellcheck + both offline tests). Tracks randprotocol/monorepo#16 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 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.
Tracks randprotocol/monorepo#16
The history page already matches nullifiers in the browser (66bc1a7, 2dea39b, 0df5bc9 on main). The issue was reopened because no deployment is recorded and the access logs were never purged. This PR closes what was still open in code and makes the two owner steps checkable.
Code
frontend/src/lib/api.ts: the unusedgetNullifier(nf)(GET /nullifiers/:nf) is removed, so nothing in the frontend can name one nullifier in a request.frontend/tests/spent.test.mjs: two new guards. No source file may reference a single-nullifier lookup or build a/nullifiers/<value>path, and exactly one nullifier request exists (the paged set, whose only inputs are the server's cursor and a constant limit). The history scan may call onlygetEnvelopePageandgetNullifierPage. Re-addinggetNullifiermakes the first guard fail (tried locally).docs/api.md:GET /nullifiers/:nfstays in the public API; the table now says not to call it with a nullifier of your own wallet.Owner follow-up, made executable
deploy/scan2-verify.sh [--record] <base-url>: read-only. Passes only whenPOST /api/v1/nullifiers/lookupanswers 404/405,GET /api/v1/nullifiers?limit=1serves{nullifiers, next}, and no/_next/staticchunk referenced by the served/en/viewingcontains a nullifier lookup.--recordprints a dated line for the issue.deploy/scan2-log-audit.sh: run on the explorer host. Dry run by default: counts lines holding a lookup or a/nullifiers/<64 hex>URL in journald (randscan-api, randscan-frontend, caddy) and in plain log files, and never prints a matching line.--purge --before YYYY-MM-DDrotates and vacuums the journal up to that day and removes the matching lines from plain files.deploy/README.md: the two steps.deploy-scriptsjob (shellcheck, then both offline tests).Not done here (owner)
scan2-verify.sh --record, post the line on the issue.scan2-log-audit.shon the host and purge if it finds anything. Neither script has been run against the live explorer.🤖 Generated with Claude Code