Commit Graph

13 Commits

Author SHA1 Message Date
argoyle fe0abd62c8 feat(client): add API key authentication for /authz endpoint (#294)
Release / release (push) Successful in 1m15s
authz_client / vulnerabilities (push) Successful in 2m9s
authz_client / test (push) Successful in 2m21s
pre-commit / pre-commit (push) Successful in 4m46s
## 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)

Reviewed-on: #294
2026-03-12 07:32:12 +00:00
argoyle af93e418f4 fix: change to write lock for thread safety in json unmarshal
Replace read lock with write lock in client.go to ensure thread 
safety during the unmarshalling of JSON data. This prevents 
concurrent read access and potential data races, improving 
the integrity of the privileges data structure.
2025-11-02 21:56:54 +01:00
argoyle b6ec9feeae feat: add salary privilege to privilege management system
Add support for the salary privilege in the privilege handler. 
Implement associated logic to process and validate the 
salary privilege in the test cases. Update the data 
structures to include the new privilege and ensure 
correct functionality in the privilege processing flow.
2025-09-06 14:49:56 +02:00
argoyle 50a6071eec feat: add setup method for privilege event consumers
Adds a Setup method to PrivilegeHandler that configures AMQP consumers 
for user and privilege events. This enables the handling of User.Added, 
User.Removed, Privilege.Added, and Privilege.Removed events in a 
streamlined manner, enhancing the event-driven capabilities of the 
handler.
2025-04-11 23:50:15 +02:00
argoyle 46e1bd284c fix: prohibit concurrent read/write 2023-12-26 18:21:59 +01:00
argoyle abfeb751b2 chore: replace deprecated ioutil.ReadAll 2022-11-10 10:54:45 +01:00
argoyle 610edd6576 chore: switch to moved goamqp 2022-07-20 17:25:13 +02:00
argoyle a2164c4beb chore: update to latest version of goamqp 2021-05-15 14:42:19 +02:00
argoyle 376278e2be chore: modify event structure 2020-04-12 20:33:35 +02:00
argoyle db43357ce0 feat: add handling of removed privilege 2019-12-31 11:53:49 +01:00
argoyle 1476170f88 feat: add name and registration number to event 2019-12-08 15:46:52 +01:00
argoyle d1898339b1 fix: print unexpected messages 2019-11-22 08:12:48 +01:00
argoyle 6aa7257739 feat: initial version 2019-11-05 21:24:54 +01:00