## Summary
- Add `WithAPIKey(key string)` option to `PrivilegeHandler`
- When set, `Fetch()` sends `Authorization: Bearer <key>` header
- Backward compatible: no key = no header (existing behavior)
## Test plan
- [x] Unit test verifying Authorization header is sent
- [x] Unit test verifying no header without key
- [x] Existing tests still pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add WithAPIKey option to set a Bearer token on requests to the
authz-service /authz endpoint. When set, Fetch() includes an
Authorization header. Backward compatible - no key means no header.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
argoyle
scheduled this pull request to auto merge when all checks succeed 2026-03-12 07:24:39 +00:00
Move lock acquisition to the top of Process() instead of per-case.
Previously UserAdded and UserRemoved read the privileges map without
holding any lock, causing data races with concurrent Fetch/IsAllowed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
WithAPIKey(key string)option toPrivilegeHandlerFetch()sendsAuthorization: Bearer <key>headerTest plan
🤖 Generated with Claude Code
Coverage Report
Total coverage: 97.5%
Coverage Report
Total coverage: 97.3%