Approved for after the 2026-10-09 customer call; not part of v0.4.6.
What changes
(a) 202 after the signature check.POST /webhook/{tenant}/gitea-source verifies the signature, parses and routes the event, then answers 202 Accepted. Entitlement (automation_allowed), the tenant database, ensure_target and the scan run in a tokio::spawned task. Ignored events still answer 200; 401/404/400 are unchanged.
(b) 5 s timeout on the registry's Keycloak token request (registry.rs::bearer). The registry requests already had 5 s; the token POST only had the shared client's 30 s while holding the token lock.
(c) Durations logged.Gitea source webhook answered with status and elapsed_ms; the background task logs handled (outcome) or not handled (reason, e.g. refused: ...) with its own elapsed_ms.
Behaviour to know
A refusal by entitlement or ladder no longer shows as 403 in Gitea's delivery log; it is in the agent log (Gitea source webhook not handled: refused: ...).
Deliveries were already handled concurrently; with background work, a created and a deleted for the same repository arriving within milliseconds could still apply out of order, as before. The periodic sync corrects it.
Tests
tests/git_source.rs now expects 202 and waits for the target, its detection and the archive.
New unit test: a token endpoint that accepts and never answers fails after the request timeout, not 30 s.
clippy -p compliance-agent --all-targets -D warnings, fmt, both tests run locally against Mongo.
Approved for after the 2026-10-09 customer call; not part of v0.4.6.
## What changes
- **(a) 202 after the signature check.** `POST /webhook/{tenant}/gitea-source` verifies the signature, parses and routes the event, then answers `202 Accepted`. Entitlement (`automation_allowed`), the tenant database, `ensure_target` and the scan run in a `tokio::spawn`ed task. Ignored events still answer 200; 401/404/400 are unchanged.
- **(b) 5 s timeout on the registry's Keycloak token request** (`registry.rs::bearer`). The registry requests already had 5 s; the token POST only had the shared client's 30 s while holding the token lock.
- **(c) Durations logged.** `Gitea source webhook answered` with `status` and `elapsed_ms`; the background task logs `handled` (outcome) or `not handled` (reason, e.g. `refused: ...`) with its own `elapsed_ms`.
## Behaviour to know
- A refusal by entitlement or ladder no longer shows as 403 in Gitea's delivery log; it is in the agent log (`Gitea source webhook not handled: refused: ...`).
- Deliveries were already handled concurrently; with background work, a `created` and a `deleted` for the same repository arriving within milliseconds could still apply out of order, as before. The periodic sync corrects it.
## Tests
- `tests/git_source.rs` now expects 202 and waits for the target, its detection and the archive.
- New unit test: a token endpoint that accepts and never answers fails after the request timeout, not 30 s.
- clippy `-p compliance-agent --all-targets -D warnings`, fmt, both tests run locally against Mongo.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
A verified delivery that asks for work is now answered 202 Accepted right
after the signature check. The entitlement check, ensure_target and the scan
run in a background task, so a slow registry or Keycloak no longer runs into
Gitea's delivery timeout. Ignored events still answer 200; bad signatures,
unknown sources and invalid JSON still answer 401/404/400.
The registry's Keycloak token request gets an explicit 5 s timeout (the
registry requests already had one); before, a hung Keycloak held the token
lock for the shared client's 30 s.
The handler logs its answer's status and duration; the background work logs
its outcome (or why it was refused) and its own duration.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit e396141490 into main2026-10-09 11:22:01 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Approved for after the 2026-10-09 customer call; not part of v0.4.6.
What changes
POST /webhook/{tenant}/gitea-sourceverifies the signature, parses and routes the event, then answers202 Accepted. Entitlement (automation_allowed), the tenant database,ensure_targetand the scan run in atokio::spawned task. Ignored events still answer 200; 401/404/400 are unchanged.registry.rs::bearer). The registry requests already had 5 s; the token POST only had the shared client's 30 s while holding the token lock.Gitea source webhook answeredwithstatusandelapsed_ms; the background task logshandled(outcome) ornot handled(reason, e.g.refused: ...) with its ownelapsed_ms.Behaviour to know
Gitea source webhook not handled: refused: ...).createdand adeletedfor the same repository arriving within milliseconds could still apply out of order, as before. The periodic sync corrects it.Tests
tests/git_source.rsnow expects 202 and waits for the target, its detection and the archive.-p compliance-agent --all-targets -D warnings, fmt, both tests run locally against Mongo.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p