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