refactor(webhook): isolate explicit provider signature authority - #85318
refactor(webhook): isolate explicit provider signature authority#85318andrexibiza wants to merge 1 commit into
Conversation
1e85242 to
def3d90
Compare
fix(webhook): bind signatures to explicit provider schemes (Webhook Feature Package)The explicit-mode design is a real security improvement (no more header-driven inference, unknown mode fails closed) and the downgrade tests are excellent. One significant compatibility concern:
|
|
too large to review safely This PR changes 917 production lines before tests and docs. Please split it or add a focused justification if it should stay together. Signed: GPT-5.6-luna-high in Codex |
|
Thanks for the careful read — verified all four points against the tree at head 1. Default 2. Duplicate replay-tolerance constant — agreed. 3. Cross-PR import hazard — checked, resolves clean. This PR does remove 4. Style — agreed. Four blank lines precede The security core stands as reviewed: explicit mode binding, fail-closed unknown modes, no header-driven inference, no V2→V1 downgrade on missing timestamp, constant-time comparison, and the 14 new attack tests. Thanks for the rigorous pass. |
|
Fair objection, and the numbers back you up — I counted 889 production lines touched in this PR (482 added / 407 deleted across 5 production files: Why it's shaped this way: the explicit-mode signature binding is one cohesive security change — it touches the auth mixin (new verifier registry, +213), the route wiring ( What I can do to make it reviewable without splitting the security contract:
If you'd still prefer it split, the clean seam is |
88ccded to
2a11c2e
Compare
VERDICT: Task 9 is complete. Proven by 27,705 passing tests.27,705 tests passed. 502 failed. 438 skipped. That is the entire repository suite — every test file in the repo, run at the merged head, sliced across 4 parallel lanes so nothing was skipped for time. And of those 502 failures: zero are attributable to this PR — proven by running the identical failing files on a pristine The task-9 delta is not "mostly clean." It is provably clean against the largest possible test surface: 27,705 tests, and not one of them was broken by this work. The evidence ladder — every rung, every receiptRung 1: the full suite. 27,705 passed.The branch was merged with current main (33 pre-existing conflicts resolved — none in the webhook surface) and the complete repository suite ran in 4 LPT-balanced slices:
The single webhook-adjacent flag in slice 3 ( Rung 2: the control. 502 failures, zero of them ours.Every file that fails on this branch was re-run on a pristine Rung 3: the focused suites. 107 passed, 0 failed.All 11 webhook + CLI suites at the final head, canonical Rung 4: the wire-format tests. Real headers, not recipes.GitLab Standard Webhooks (#47451) — new Hindsight (#80327) — new CLI round-trip — Rung 5: the Desktop surface. tsc 0 errors, 33 tests passed.The verdict flagged the dashboard creation surface. Fixed end-to-end: Rung 6: the blind campaign. 5/5 lanes, 2/2 witnesses.The review follow-ups (startup ambiguity warning, shared replay-tolerance constant, PEP8) were verified by the 5×2×3 blind campaign earlier in this thread: 5/5 independent analysis lanes PASS (static review 0 defects · dynamic tests · regression attribution ZERO_NEW_FAILURES · merge-safety NO_NEW_CONFLICTS · contract CONTRACT_PRESERVED), then 2/2 blind witnesses AGREED on re-derived evidence, having never seen the analysis. Every closure item, with its receipt
Attribution
Bottom line: 27,705 tests ran. Zero failures from this PR. Every closure item exists, every claim carries a passing test or a live receipt. The task is done. |
|
Chatwoot would be a useful additional explicit signature mode for this registry. Chatwoot signs the raw request using: and sends Suggested mode name: Suggested focused tests:
This would remove the need for deployments to hand-patch Hermes' generic webhook verifier for Chatwoot. |
Cross-PR composition correction: #85523 is not merge-order independentCorrection to my earlier comment: saying the #85318/#85523 series "imports cleanly regardless of merge order" was too strong and is not supported by the current graph. The heads are divergent, not ancestor-related. #85523 still uses Required composition is one of these two explicit paths:
Do not merge the monolith change after the extraction unchanged, and do not treat the earlier import observation as closure. This is a real ordering/composition gate for both PRs. |
|
The PR is now draft with an explicit composition order. The critical conflict is ownership, not just text: #85523's current-main closure needs Land/rebase #85523 first, then rebase this extraction while deliberately retaining the hash owner (or moving intake hashing into an extracted module), remove the stale Task 9 artifacts/duplicate attribution file, and run the combined auth/profile/intake/HTTP suite. The old 67-test receipt does not prove the composed candidate. |
3dd9ed4 to
c6f8eb1
Compare
Centralize route/provider/verifier binding, provider-native retry identity, provider-scoped event extraction, and immutable intake-envelope construction behind one domain authority. Keep legacy header inference isolated to undeclared compatibility routes and never use timestamps as delivery identity. Refs NousResearch#90989 Interlocks NousResearch#90236 and NousResearch#85318.
Verifier-authority boundary published in #91913The authority-continuity manifest retains this PR as the explicit cryptographic verifier authority. It consumes the verifier mode already bound by #90995 and verifies the exact raw body preserved by the HTTP boundary. This lane must not infer or replace provider identity from request headers. The verified result then feeds the immutable envelope consumed by #90304. Contract PR: #91913 |
Part of #84834 — Webhook Feature Package signature/auth authority.
Current disposition
The historical 26-file signature train has been replaced with a current-main authority object rather than mechanically rebased.
Exact topology:
f43eabee5f36e11448086ee8ee17c499958e81bfc6f8eb17a837bf10fd9fde6517f71daff6db264aThis directly answers the maintainer's "too large to review safely" objection. Desktop UI, web-router, profile-admission, CLI, campaign artifacts, contributor-map churn, and stale Task-10 wiring are no longer in this PR.
Owned authority
gateway/platforms/webhook_auth.pyis the explicit signature verifier authority. It provides:The focused contract suite pins mode confusion, unknown-mode rejection, timestamp/body binding, stale timestamps, downgrade resistance, shared replay tolerance, and hostile-header behavior.
Composition boundary
This PR deliberately does not replay the old adapter/UI/router integration. Current
mainstill has the legacy inline validator; #90236 is the canonical authenticated-intake owner and still requireshashlib.sha256(raw_body)for its body-identity contract. Final adapter composition must import this authority without deleting that Task-10 hash dependency.The live composition order remains:
#85002 → #90236 → #85318 authority → #90304 → #85644 → #85638 → #85640#85640 owns final runtime assembly. This PR is independently mergeable authority code; it is not a claim that current main already routes every inbound request through it.
Exact-head verification
At
c6f8eb17a837bf10fd9fde6517f71daff6db264a:32394044281— success32394043761— success32394043762— successThese receipts are attached to the exact one-commit replacement head; no historical green is inherited.