test: pin provision-first gate-submit, recipients, and argv leaks - #118
Draft
cursor[bot] wants to merge 1 commit into
Draft
test: pin provision-first gate-submit, recipients, and argv leaks#118cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Gate-submit tests still treated a provisioning 503 as a gate refusal, so answers-never-leave was a false pass. Align them with provision first. Also pin the store client's recipient payload, Typst/email argv, ssh stdin for identities, the contact form's PGP fail-closed path, and boot-time unhandled-rejection suppression. Co-authored-by: Ralphie B. <nyagrodha@users.noreply.github.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.
Risky behavior now covered
storeEncryptedAnswerruns last because the gate has no delete.storeEncryptedAnswerforwardsrecipientsandskippedin the JSON body. Omitted recipients travel as[](the gate's "use my default" contract), not as an absent field that would encrypt to the wrong key.data.jsonis 0600; a failed render leaves the working directory empty. These run in CI —render_test.tsskips without typst.clearEnvso DATABASE_URL and JWT_SECRET are not inherited; a permanent 5xx is not retried.StrictHostKeyChecking=yesandBatchMode=yes; the key box destination comes from the environment, not a baked-in IP.console.erroris a category string, never the caught error (which can quote the message body).unhandledrejectioncallspreventDefaultbefore Fresh starts, and logs only a class name. The gate logs that the age recipient loaded, not which one.notifyDeliveredchecksres.okso a 404 cannot hide.CI now also runs the existing hermetic audience, client-ip, QR, email, keystore, bundle-validation, co-op QR, privacy, and rewritten gate-submit tests that were passing locally and running nowhere.
Test files added/updated
routes/api/gate-submit_test.ts(rewritten) — provision-first fail-closedlib/gate_encrypt_test.ts(updated) — recipients/skipped payloadromania/tests/render_argv_test.ts(added)romania/tests/render_service_contract_test.ts(added)lib/email_argv_test.ts(added)lib/session-keys_transport_test.ts(added)routes/contact-form_script_test.ts(added)lib/unhandled_rejection_test.ts(added)lib/rust_recipient_log_test.ts(added).github/workflows/ci.yml— runs the new files plus existing audience/client-ip/qr-scans/email/keystore/validateBundle/WillyStCo-op/privacy/gate-submit suitesWhy these tests materially reduce regression risk
These are the production paths that take plaintext answers, private keys, and mail envelopes off this host. A provisioning failure that still posted answers, a dropped
recipientsfield, answers on/proc/<pid>/cmdline, an identity on ssh argv, a PGP checkbox that silently posted cleartext, or an unhandled rejection that took the site down would all ship as silent security or availability failures. None of this overlaps the open coverage PRs (#112 JWT/callback, #114 consent/session-keys injection/contact, #115 gate API/beacon/verify/wearable, #116 profile/store-bounds/metrics/gate cookies, #117 audience-count/questionnaire-auth/session-cleanup/mailer-argv).Hermetic: no Postgres, no SMTP dialogue, no qpdf, no typst binary required for the new render tests. 181 Deno tests passed locally, including the full CI set.
No production behavior changes.