feat: run probabilistic audit on any authenticated webhook #11

Merged
rcsheets merged 1 commit from feat/audit-on-any-hook into master 2026-03-26 04:41:48 +00:00
Owner

Move the MaybeAudit call before the event type check so that any
webhook with a valid signature triggers the reconciliation roll,
not just repository events. This increases audit coverage when
additional hook types (push, issue, etc.) are enabled in Forgejo.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Move the MaybeAudit call before the event type check so that any webhook with a valid signature triggers the reconciliation roll, not just repository events. This increases audit coverage when additional hook types (push, issue, etc.) are enabled in Forgejo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: run probabilistic audit on any authenticated webhook
Some checks failed
CI / ci (push) Has been cancelled
CI / ci (pull_request) Has been cancelled
E2E smoke test / e2e (pull_request) Has been cancelled
3ffc939605
Move the MaybeAudit call before the event type check so that any
webhook with a valid signature triggers the reconciliation roll,
not just repository events. This increases audit coverage when
additional hook types (push, issue, etc.) are enabled in Forgejo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator

Automated review by pr-reviewer v0.15.0 | Safety Check | anthropic | tracking id r-c4b8bc-10930b
This is an AI-generated review and may contain mistakes.

Status: Completed


Verdict: LGTM — The change safely moves the audit trigger to run on all authenticated webhooks instead of only repository events, which aligns with the stated goal.
Complexity: moderate

Safety Check Review

This change moves the MaybeAudit call from after the repository event type check to before it, so that probabilistic reconciliation occurs on any authenticated webhook rather than only repository events.

Key observations:

  • The webhook signature validation occurs before this point in the flow, so only authenticated requests will trigger audits
  • The async goroutine pattern remains unchanged
  • The logic is simply moved up in the function, no behavioral changes to the audit mechanism itself
  • Early return for non-repository events still occurs after the audit trigger

No security vulnerabilities, obvious bugs, or breaking changes identified.

*Automated review by [pr-reviewer](https://git.brooktrails.org/brooktrails/pr-reviewer) v0.15.0 | Safety Check | anthropic | tracking id `r-c4b8bc-10930b`* *This is an AI-generated review and may contain mistakes.* **Status:** ✅ Completed --- **✅ Verdict: LGTM** — The change safely moves the audit trigger to run on all authenticated webhooks instead of only repository events, which aligns with the stated goal. **Complexity:** moderate # Safety Check Review This change moves the `MaybeAudit` call from after the repository event type check to before it, so that probabilistic reconciliation occurs on any authenticated webhook rather than only repository events. ## Key observations: - The webhook signature validation occurs before this point in the flow, so only authenticated requests will trigger audits - The async goroutine pattern remains unchanged - The logic is simply moved up in the function, no behavioral changes to the audit mechanism itself - Early return for non-repository events still occurs after the audit trigger No security vulnerabilities, obvious bugs, or breaking changes identified.
rcsheets merged commit 688244e30a into master 2026-03-26 04:41:48 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
brooktrails/forgejo-runner-operator!11
No description provided.