381 Commits

Author SHA1 Message Date
releaser 45512115c5 chore(release): prepare for v0.5.0 (#295)
Release / release (push) Successful in 40s
authz_client / vulnerabilities (push) Successful in 1m23s
authz_client / test (push) Successful in 2m1s
pre-commit / pre-commit (push) Successful in 4m10s
## [0.5.0] - 2026-03-12

### 🚀 Features

- *(client)* Add API key authentication for /authz endpoint (#294)

### ⚙️ Miscellaneous Tasks

- *(deps)* Update golang:1.25.5 docker digest to 3a01526 (#271)
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.24.0 (#273)
- *(deps)* Update dependency go to v1.25.6 (#274)
- *(deps)* Update golang docker tag to v1.25.6 (#275)
- Remove GitLab CI configuration
- Add code coverage integration
- *(deps)* Update dependency go to v1.25.7 (#279)
- *(deps)* Update dependency go to v1.26.0 (#280)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.9.0 (#281)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.10.0 (#282)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.10.1 (#283)
- *(deps)* Update dependency go to v1.26.1 (#286)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.1 (#288)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.2 (#290)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.3 (#292)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: #295
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-03-12 07:39:47 +00:00
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
renovate a54cf45a4b chore(deps): update pre-commit hook golangci/golangci-lint to v2.11.3 (#292)
Release / release (push) Successful in 1m21s
authz_client / vulnerabilities (push) Successful in 2m9s
authz_client / test (push) Successful in 4m40s
pre-commit / pre-commit (push) Successful in 7m39s
2026-03-10 11:12:34 +00:00
renovate f9a5ef7085 chore(deps): update pre-commit hook golangci/golangci-lint to v2.11.2 (#290)
pre-commit / pre-commit (push) Successful in 4m44s
Release / release (push) Successful in 1m2s
authz_client / vulnerabilities (push) Failing after 2h42m46s
authz_client / test (push) Failing after 2h42m53s
2026-03-07 22:09:47 +00:00
renovate 200e7cf963 chore(deps): update pre-commit hook golangci/golangci-lint to v2.11.1 (#288)
Release / release (push) Successful in 57s
authz_client / vulnerabilities (push) Successful in 1m46s
authz_client / test (push) Successful in 2m49s
pre-commit / pre-commit (push) Successful in 5m49s
2026-03-06 15:11:17 +00:00
renovate 110f6206f9 chore(deps): update dependency go to v1.26.1 (#286)
Release / release (push) Successful in 1m13s
authz_client / vulnerabilities (push) Successful in 1m36s
authz_client / test (push) Successful in 2m27s
pre-commit / pre-commit (push) Successful in 10m39s
2026-03-06 01:18:10 +00:00
renovate c53d80792c chore(deps): update pre-commit hook golangci/golangci-lint to v2.10.1 (#283)
Release / release (push) Successful in 1m31s
authz_client / vulnerabilities (push) Successful in 2m39s
authz_client / test (push) Successful in 3m54s
pre-commit / pre-commit (push) Successful in 8m34s
2026-02-17 17:01:30 +00:00
renovate ebc0c3bb8e chore(deps): update pre-commit hook golangci/golangci-lint to v2.10.0 (#282)
Release / release (push) Failing after 41s
authz_client / vulnerabilities (push) Successful in 17m19s
authz_client / test (push) Successful in 18m59s
pre-commit / pre-commit (push) Successful in 52m24s
2026-02-17 15:01:11 +00:00
renovate cb59762fc9 chore(deps): update pre-commit hook golangci/golangci-lint to v2.9.0 (#281)
authz_client / vulnerabilities (push) Successful in 2m12s
Release / release (push) Successful in 1m55s
authz_client / test (push) Successful in 4m10s
pre-commit / pre-commit (push) Successful in 17m58s
2026-02-11 07:13:35 +00:00
renovate a82466cb27 chore(deps): update dependency go to v1.26.0 (#280)
Release / release (push) Successful in 1m22s
authz_client / vulnerabilities (push) Successful in 4m20s
authz_client / test (push) Successful in 4m30s
pre-commit / pre-commit (push) Successful in 9m2s
2026-02-11 06:19:26 +00:00
renovate 29eab978f7 chore(deps): update dependency go to v1.25.7 (#279)
Release / release (push) Failing after 58s
authz_client / test (push) Successful in 4m30s
authz_client / vulnerabilities (push) Successful in 3m54s
pre-commit / pre-commit (push) Successful in 12m54s
2026-02-04 16:16:32 +00:00
argoyle f3166426b6 Merge pull request 'ci: add code coverage integration' (#277) from ci-coverage-integration into main
Release / release (push) Failing after 4m57s
authz_client / vulnerabilities (push) Successful in 7m21s
authz_client / test (push) Successful in 8m12s
pre-commit / pre-commit (push) Successful in 14m37s
Reviewed-on: #277
2026-01-28 12:38:20 +00:00
argoyle 3171c53393 ci: add code coverage integration
authz_client / test (pull_request) Successful in 6m57s
authz_client / vulnerabilities (pull_request) Successful in 7m26s
pre-commit / pre-commit (pull_request) Successful in 12m3s
Add go-test-coverage for coverage threshold enforcement. Coverage data
is uploaded as artifacts on main branch and compared against baseline
in PRs using shell script that gracefully handles first run without
baseline. PR comments show coverage percentage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:03:07 +01:00
argoyle 7af8e00b4c Merge pull request 'chore: remove GitLab CI configuration' (#276) from remove-gitlab-ci into main
Release / release (push) Failing after 1m59s
authz_client / test (push) Successful in 2m49s
pre-commit / pre-commit (push) Successful in 7m12s
authz_client / vulnerabilities (push) Successful in 10m29s
Reviewed-on: #276
2026-01-18 20:15:35 +00:00
argoyle 0c0f321b33 chore: remove GitLab CI configuration
authz_client / test (pull_request) Successful in 6m42s
authz_client / vulnerabilities (pull_request) Successful in 9m50s
pre-commit / pre-commit (pull_request) Successful in 18m32s
2026-01-18 20:36:13 +01:00
renovate 87805f1552 chore(deps): update golang docker tag to v1.25.6 (#275)
authz_client / vulnerabilities (push) Successful in 1m28s
authz_client / test (push) Successful in 2m27s
Release / release (push) Successful in 2m49s
pre-commit / pre-commit (push) Successful in 5m23s
2026-01-15 22:06:58 +00:00
renovate 74ee30bccc chore(deps): update dependency go to v1.25.6 (#274)
Release / release (push) Successful in 2m33s
authz_client / test (push) Successful in 4m27s
authz_client / vulnerabilities (push) Successful in 6m55s
pre-commit / pre-commit (push) Successful in 15m1s
2026-01-15 20:06:38 +00:00
renovate 646e4f31c4 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.24.0 (#273)
Release / release (push) Successful in 2m12s
authz_client / test (push) Successful in 5m48s
authz_client / vulnerabilities (push) Successful in 6m17s
pre-commit / pre-commit (push) Successful in 17m3s
2026-01-13 21:08:37 +00:00
renovate 881fac379f chore(deps): update golang:1.25.5 docker digest to 3a01526 (#271)
authz_client / test (push) Successful in 2m23s
authz_client / vulnerabilities (push) Successful in 2m32s
Release / release (push) Successful in 1m57s
pre-commit / pre-commit (push) Successful in 6m25s
2026-01-13 14:35:12 +00:00
argoyle 2c2bd2798f Merge pull request 'chore(release): prepare for v0.4.1' (#270) from next-release into main
Release / release (push) Successful in 48s
authz_client / test (push) Successful in 1m42s
authz_client / vulnerabilities (push) Successful in 1m41s
pre-commit / pre-commit (push) Successful in 4m20s
Reviewed-on: #270
2026-01-09 14:05:17 +00:00
releaser 204b108ece chore(release): prepare for v0.4.1
authz_client / test (pull_request) Successful in 3m27s
authz_client / vulnerabilities (pull_request) Successful in 3m36s
pre-commit / pre-commit (pull_request) Successful in 5m37s
2026-01-09 13:57:10 +00:00
releaser fa795a58cf chore(release): prepare for v0.4.1 2026-01-09 13:57:03 +00:00
argoyle 60650b9c04 Merge pull request 'chore: migrate module path to gitea.unbound.se' (#269) from migrate-to-gitea into main
authz_client / test (push) Successful in 4m45s
authz_client / vulnerabilities (push) Successful in 4m55s
Release / release (push) Successful in 4m58s
pre-commit / pre-commit (push) Has been cancelled
Reviewed-on: #269
2026-01-09 13:50:03 +00:00
argoyle 60d9eea9c9 chore: migrate module path to gitea.unbound.se
authz_client / test (pull_request) Successful in 1m56s
authz_client / vulnerabilities (pull_request) Successful in 2m31s
pre-commit / pre-commit (pull_request) Successful in 5m21s
Update module path from git.unbound.se to gitea.unbound.se for Go module
discovery over HTTPS.
2026-01-09 14:30:26 +01:00
argoyle dd571f8d85 Merge pull request 'chore(deps): update actions/setup-python action to v6' (#268) from renovate/actions-setup-python-6.x into main
authz_client / vulnerabilities (push) Successful in 3m7s
authz_client / test (push) Successful in 3m36s
pre-commit / pre-commit (push) Successful in 5m22s
Reviewed-on: #268
2026-01-09 09:28:58 +00:00
renovate 1f822b2957 chore(deps): update actions/setup-python action to v6
authz_client / test (pull_request) Successful in 5m50s
authz_client / vulnerabilities (pull_request) Successful in 5m33s
pre-commit / pre-commit (pull_request) Successful in 9m6s
2026-01-09 09:01:53 +00:00
argoyle 5b49b36a32 Merge pull request 'chore(release): prepare for v0.4.0' (#244) from next-release into main
Release / release (push) Successful in 1m17s
authz_client / test (push) Successful in 2m41s
authz_client / vulnerabilities (push) Successful in 2m41s
pre-commit / pre-commit (push) Successful in 4m51s
Reviewed-on: #244
2026-01-09 08:57:37 +00:00
releaser a06bae1da9 chore(release): prepare for v0.4.0 2026-01-09 08:55:47 +00:00
releaser 90084cc3a4 chore(release): prepare for v0.4.0 2026-01-09 08:55:36 +00:00
argoyle 7825fa17a6 Merge pull request 'ci: add pre-commit and release workflows' (#266) from add-workflows into main
authz_client / vulnerabilities (push) Successful in 1m30s
Release / release (push) Successful in 1m10s
authz_client / test (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Reviewed-on: #266
2026-01-09 08:53:38 +00:00
argoyle 73f854ba06 ci: add pre-commit and release workflows
authz_client / test (pull_request) Successful in 3m9s
authz_client / vulnerabilities (pull_request) Successful in 3m53s
pre-commit / pre-commit (pull_request) Successful in 7m22s
2026-01-09 09:45:06 +01:00
argoyle 5b3527439f Merge pull request 'refactor: update module path to new repository location' (#267) from refactor-update-module-path into main
authz_client / vulnerabilities (push) Successful in 3m12s
authz_client / test (push) Successful in 4m3s
Reviewed-on: #267
2026-01-09 08:44:53 +00:00
argoyle 681afe2626 refactor: update module path to new repository location
authz_client / test (pull_request) Successful in 3m25s
authz_client / vulnerabilities (pull_request) Successful in 3m42s
Remove GitLab CI linter configuration and update module path from 
`gitlab.com/unboundsoftware/shiny/authz_client` to 
`git.unbound.se/shiny/authz_client` in all relevant files. 
These changes reflect a migration to a new hosting service.
2026-01-09 09:28:16 +01:00
argoyle 2e1eb327e0 Merge pull request 'chore(deps): update pre-commit hook golangci/golangci-lint to v2.8.0' (#265) from renovate/golangci-golangci-lint-2.x into main
authz_client / test (push) Successful in 1m1s
authz_client / vulnerabilities (push) Successful in 1m2s
Reviewed-on: #265
2026-01-09 04:11:30 +00:00
renovate 622d907e03 chore(deps): update pre-commit hook golangci/golangci-lint to v2.8.0
authz_client / vulnerabilities (pull_request) Successful in 1m45s
authz_client / test (pull_request) Successful in 1m47s
2026-01-08 21:02:44 +00:00
argoyle 4b38ce4f0f Merge pull request 'chore(deps): update actions/checkout action to v6' (#264) from renovate/actions-checkout-6.x into main
authz_client / test (push) Successful in 3m55s
authz_client / vulnerabilities (push) Successful in 4m13s
Reviewed-on: #264
2026-01-08 19:21:16 +00:00
renovate b82e15c49b chore(deps): update actions/checkout action to v6
authz_client / test (pull_request) Successful in 1m16s
authz_client / vulnerabilities (pull_request) Successful in 1m14s
2026-01-08 19:01:10 +00:00
argoyle f0ea0d7d26 Merge pull request 'chore(deps): update actions/setup-go action to v6' (#263) from renovate/actions-setup-go-6.x into main
authz_client / test (push) Successful in 2m42s
authz_client / vulnerabilities (push) Successful in 3m32s
Reviewed-on: #263
2026-01-08 18:28:51 +00:00
renovate 26de10c2b9 chore(deps): update actions/setup-go action to v6
authz_client / test (pull_request) Successful in 1m53s
authz_client / vulnerabilities (pull_request) Successful in 1m57s
2026-01-08 18:01:11 +00:00
argoyle 3865b1b5f7 Merge pull request 'feat: migrate from GitLab CI to Gitea Actions' (#262) from feat/gitea-actions into main
authz_client / vulnerabilities (push) Successful in 1m58s
authz_client / test (push) Successful in 2m0s
Reviewed-on: #262
2026-01-08 17:59:17 +00:00
argoyle cd84a51f91 feat: migrate from GitLab CI to Gitea Actions
authz_client / test (pull_request) Successful in 1m14s
authz_client / vulnerabilities (pull_request) Successful in 1m23s
2026-01-08 18:33:57 +01:00
Unbound Release eab39dc818 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 524cad9180 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release b339804535 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release d2ed9ed12a chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release f521fb29c9 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 123dd2a4c2 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release c5943b41ec chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 5644b061c0 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 8330219579 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 425013f115 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 7f3b78b000 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release ab8a9809d5 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 9ef9084ffa chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release e48c5b3bb9 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 4421bcfbeb chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 18748ceaad chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 14d32b3b51 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release d571e92a0b chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release d355edd642 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release abd34b334a chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release da73907913 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release becde50685 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release a84a14a0d3 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 707e26b420 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release ffa2eca348 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 76fc782c96 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 4d3147c65c chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 6643990160 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 20d69f9c19 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release d327307539 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 5dce8a0f2b chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
Unbound Release 6f6272cb02 chore(release): prepare for v0.3.2 2025-12-31 21:12:27 +00:00
argoyle 7eddad8d4b Merge branch 'claude-docs' into 'main'
docs: add CLAUDE.md for Claude Code integration

See merge request unboundsoftware/shiny/authz_client!258
2025-12-31 22:10:52 +01:00
argoyle 1fd3ae5123 docs: add CLAUDE.md for Claude Code integration 2025-12-31 22:06:51 +01:00
argoyle 247c04a710 Merge branch 'renovate/golang-1.25.5' into 'main'
chore(deps): update golang:1.25.5 docker digest to ad03ba9

See merge request unboundsoftware/shiny/authz_client!257
2025-12-30 16:01:41 +01:00
Renovate 37f6c63025 chore(deps): update golang:1.25.5 docker digest to ad03ba9 2025-12-30 04:04:50 +00:00
argoyle 215a9ed976 Merge branch 'renovate/golang-1.25.5' into 'main'
chore(deps): update golang:1.25.5 docker digest to 0c27bcf

See merge request unboundsoftware/shiny/authz_client!256
2025-12-09 09:56:00 +01:00
Renovate 006ebd101e chore(deps): update golang:1.25.5 docker digest to 0c27bcf 2025-12-09 02:18:45 +00:00
argoyle 600653518c Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.2

See merge request unboundsoftware/shiny/authz_client!255
2025-12-08 09:49:47 +01:00
Renovate c95cd1c80a chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.2 2025-12-07 17:05:12 +00:00
argoyle 881a6f0e3c Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.1

See merge request unboundsoftware/shiny/authz_client!254
2025-12-04 17:29:56 +01:00
Renovate 84939fa04b chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.1 2025-12-04 15:07:58 +00:00
argoyle 0821cbb6eb Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.0

See merge request unboundsoftware/shiny/authz_client!253
2025-12-04 08:31:19 +01:00
Renovate 0cb8363ab1 chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.0 2025-12-03 20:05:00 +00:00
argoyle 8a440bd28c Merge branch 'renovate/golang-1.x' into 'main'
chore(deps): update golang docker tag to v1.25.5

See merge request unboundsoftware/shiny/authz_client!252
2025-12-02 20:15:25 +01:00
argoyle 13461b43e3 Merge branch 'renovate/go-1.x' into 'main'
chore(deps): update dependency go to v1.25.5

See merge request unboundsoftware/shiny/authz_client!251
2025-12-02 19:31:56 +01:00
Renovate 49100894e9 chore(deps): update golang docker tag to v1.25.5 2025-12-02 18:19:27 +00:00
Renovate 7818f97a7c chore(deps): update dependency go to v1.25.5 2025-12-02 17:17:24 +00:00
argoyle 66c429bde1 Merge branch 'renovate/gitleaks-gitleaks-8.x' into 'main'
chore(deps): update pre-commit hook gitleaks/gitleaks to v8.30.0

See merge request unboundsoftware/shiny/authz_client!250
2025-11-27 00:08:10 +01:00
Renovate 585fa5dfa4 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.30.0 2025-11-26 19:06:23 +00:00
argoyle 82cca9b09c Merge branch 'renovate/gitleaks-gitleaks-8.x' into 'main'
chore(deps): update pre-commit hook gitleaks/gitleaks to v8.29.1

See merge request unboundsoftware/shiny/authz_client!249
2025-11-20 09:26:39 +01:00
Renovate bcbddac138 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.29.1 2025-11-19 22:05:31 +00:00
argoyle e62257d933 Merge branch 'renovate/golang-1.25.4' into 'main'
chore(deps): update golang:1.25.4 docker digest to efe81fa

See merge request unboundsoftware/shiny/authz_client!248
2025-11-18 15:46:41 +01:00
Renovate f45918bac8 chore(deps): update golang:1.25.4 docker digest to efe81fa 2025-11-18 12:05:17 +00:00
argoyle 77ac58202a Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.2

See merge request unboundsoftware/shiny/authz_client!247
2025-11-14 16:25:46 +01:00
Renovate 257a97f191 chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.2 2025-11-14 14:06:05 +00:00
argoyle 32e8127273 Merge branch 'renovate/golang-1.x' into 'main'
chore(deps): update golang docker tag to v1.25.4

See merge request unboundsoftware/shiny/authz_client!246
2025-11-06 07:06:32 +01:00
Renovate 223f65396d chore(deps): update golang docker tag to v1.25.4 2025-11-05 22:18:16 +00:00
argoyle 01d4a4bc9f Merge branch 'renovate/go-1.x' into 'main'
chore(deps): update dependency go to v1.25.4

See merge request unboundsoftware/shiny/authz_client!245
2025-11-05 21:40:35 +01:00
Renovate 1038cff1d9 chore(deps): update dependency go to v1.25.4 2025-11-05 20:16:30 +00:00
argoyle f961bf91f7 Merge branch 'renovate/gitleaks-gitleaks-8.x' into 'main'
chore(deps): update pre-commit hook gitleaks/gitleaks to v8.29.0

See merge request unboundsoftware/shiny/authz_client!244
2025-11-05 08:34:23 +01:00
Renovate 721cb1be91 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.29.0 2025-11-05 02:05:39 +00:00
argoyle 2f570a0638 Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.1

See merge request unboundsoftware/shiny/authz_client!243
2025-11-04 14:13:27 +01:00
argoyle ee52c50e76 Merge branch 'renovate/golang-1.25.3' into 'main'
chore(deps): update golang:1.25.3 docker digest to 9ac0edc

See merge request unboundsoftware/shiny/authz_client!242
2025-11-04 14:13:03 +01:00
Renovate 675ac0338f chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.1 2025-11-04 12:07:17 +00:00
Renovate f708a18960 chore(deps): update golang:1.25.3 docker digest to 9ac0edc 2025-11-04 12:07:15 +00:00
argoyle a8ba5635e3 Merge branch 'test-concurrent-fetch-read-privileges' into 'main'
test: add concurrent fetch and read tests for privileges

See merge request unboundsoftware/shiny/authz_client!240
2025-11-03 12:46:01 +01:00
argoyle 4efc6572ee test: add concurrent fetch and read tests for privileges
Adds multiple tests to verify the thread-safety of the 
Fetch method and the handling of privileges in concurrent 
operations. Tests include concurrent fetching, reading 
privileges, and processing with multiple goroutines. 
Ensures no errors occur during operations and verifies 
privileges are set correctly.
2025-11-03 12:40:14 +01:00
argoyle 05c59fa4a5 Merge branch 'next-release' into 'main'
chore(release): prepare for v0.3.1

See merge request unboundsoftware/shiny/authz_client!236
2025-11-02 22:16:23 +01:00
Unbound Release 52ea18c616 chore(release): prepare for v0.3.1 2025-11-02 22:16:23 +01:00
argoyle 9dd2b5aaa8 Merge branch 'fix/thread-safety-json-unmarshal' into 'main'
fix: change to write lock for thread safety in json unmarshal

See merge request unboundsoftware/shiny/authz_client!239
2025-11-02 22:09:18 +01: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 46e26efe67 Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.0

See merge request unboundsoftware/shiny/authz_client!238
2025-10-29 23:19:58 +01:00
Renovate f65e3868e3 chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.0 2025-10-29 20:05:28 +00:00
argoyle 003407ecaa Merge branch 'renovate/golang-1.25.3' into 'main'
chore(deps): update golang:1.25.3 docker digest to 69d1009

See merge request unboundsoftware/shiny/authz_client!237
2025-10-21 14:24:42 +02:00
Renovate 50849e8682 chore(deps): update golang:1.25.3 docker digest to 69d1009 2025-10-21 10:05:31 +00:00
argoyle 3e8b3d00e5 Merge branch 'ci-add-default-git-cliff-config' into 'main'
ci: add default configuration for git-cliff

See merge request unboundsoftware/shiny/authz_client!235
2025-10-14 11:32:12 +02:00
argoyle a5ac3c3500 ci: add default configuration for git-cliff
Introduce a default configuration file for git-cliff to manage 
changelog generation. This file includes customizable templates 
for the changelog header, body, and footer, and enables parsing 
of commit messages according to the conventional commits 
specification. The changes facilitate easier and standardized 
documentation of project updates and changes.
2025-10-14 11:26:09 +02:00
argoyle 2502c85497 Merge branch 'renovate/golang-1.x' into 'main'
chore(deps): update golang docker tag to v1.25.3

See merge request unboundsoftware/shiny/authz_client!234
2025-10-14 08:55:12 +02:00
argoyle ed60a0ccb3 Merge branch 'renovate/go-1.x' into 'main'
chore(deps): update dependency go to v1.25.3

See merge request unboundsoftware/shiny/authz_client!233
2025-10-14 08:54:53 +02:00
Renovate 047e09823d chore(deps): update golang docker tag to v1.25.3 2025-10-14 00:06:39 +00:00
Renovate a0326a1594 chore(deps): update dependency go to v1.25.3 2025-10-13 22:03:09 +00:00
argoyle fe5a401bfc Merge branch 'renovate/golang-1.x' into 'main'
chore(deps): update golang docker tag to v1.25.2

See merge request unboundsoftware/shiny/authz_client!232
2025-10-08 09:10:12 +02:00
Renovate c12617975f chore(deps): update golang docker tag to v1.25.2 2025-10-07 22:15:29 +00:00
Renovate 64a3a6e533 chore(deps): update dependency go to v1.25.2 2025-10-07 19:16:16 +00:00
Renovate c46753598d chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.23.0 2025-10-02 10:06:38 +00:00
Renovate 30637a081d chore(deps): update golang:1.25.1 docker digest to 12640a4 2025-10-01 14:06:27 +00:00
Renovate 44bebba3c1 chore(deps): update pre-commit hook golangci/golangci-lint to v2.5.0 2025-09-21 20:03:50 +00:00
Renovate 830e1307bd chore(deps): update pre-commit hook lietu/go-pre-commit to v1 2025-09-13 09:17:33 +00:00
Renovate f094014c90 chore(deps): update golang:1.25.1 docker digest to 53f7808 2025-09-08 23:29:32 +00:00
Unbound Release e9ebb2206c chore(release): prepare for v0.3.0 2025-09-06 15:06:27 +02: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
Renovate a1c9ace5ec chore(deps): update golang docker tag to v1.25.1 2025-09-04 08:21:33 +02:00
Renovate 250d017f93 chore(deps): update dependency go to v1.25.1 2025-09-03 19:02:44 +00:00
Renovate f48319ffb0 fix(deps): update module github.com/stretchr/testify to v1.11.1 2025-08-27 12:08:40 +00:00
Renovate 10c3448ec3 fix(deps): update module github.com/stretchr/testify to v1.11.0 2025-08-24 17:05:55 +00:00
Renovate 3e0bb48af7 chore(deps): update golang:1.25.0 docker digest to f6b9e1a 2025-08-22 19:06:15 +00:00
Renovate c9169d5cbc chore(deps): update dependency go to v1.25.0 2025-08-14 14:03:11 +00:00
Renovate e8da7bb3e9 fix(deps): update module github.com/sparetimecoders/goamqp to v0.3.3 2025-08-14 13:08:23 +00:00
Renovate 1755ed37dd chore(deps): update golang docker tag to v1.25.0 2025-08-14 10:01:19 +02:00
Renovate d2faf4bd88 chore(deps): update pre-commit hook golangci/golangci-lint to v2.4.0 2025-08-13 21:05:49 +00:00
Renovate 96001183fb chore(deps): update golang:1.24.6 docker digest to 958bfd1 2025-08-12 23:05:07 +00:00
Renovate f652c92328 chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v6 2025-08-09 20:02:58 +00:00
Renovate 4152e9830f chore(deps): update golang docker tag to v1.24.6 2025-08-07 08:31:48 +02:00
Renovate caafda1f7c chore(deps): update dependency go to v1.24.6 2025-08-06 19:03:34 +00:00
Renovate e2041fe618 chore(deps): update pre-commit hook golangci/golangci-lint to v2.3.1 2025-08-02 22:03:57 +00:00
Renovate a05c89475f chore(deps): update golang:1.24.5 docker digest to 0a156a4 2025-07-22 05:03:23 +00:00
Renovate a028c38a4d chore(deps): update pre-commit hook golangci/golangci-lint to v2.3.0 2025-07-21 15:02:56 +00:00
Renovate 982fb0bb09 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.28.0 2025-07-20 17:01:08 +00:00
Renovate ce344d29bf chore(deps): update pre-commit hook golangci/golangci-lint to v2.2.2 2025-07-11 12:59:18 +00:00
Renovate 4e29b77504 chore(deps): update golang docker tag to v1.24.5 2025-07-09 19:02:31 +00:00
Renovate d2492e98fa chore(deps): update dependency go to v1.24.5 2025-07-08 17:59:36 +00:00
Renovate 35b8148f7f chore(deps): update golang:1.24.4 docker digest to 9f820b6 2025-07-01 06:00:10 +00:00
Renovate 3a9bd8dffe chore(deps): update pre-commit hook golangci/golangci-lint to v2.2.1 2025-06-29 21:58:21 +00:00
Renovate c8b6f33464 chore(deps): update pre-commit hook golangci/golangci-lint to v2.2.0 2025-06-28 20:58:34 +00:00
Renovate ff672b7a81 chore(deps): update golang:1.24.4 docker digest to 3494bbe 2025-06-11 03:07:47 +00:00
Renovate dba9093ed4 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.27.2 2025-06-09 00:59:15 +00:00
Renovate e02917ba5d chore(deps): update pre-commit hook gitleaks/gitleaks to v8.27.1 2025-06-08 02:58:02 +00:00
Renovate 05425c1d5f chore(deps): update golang docker tag to v1.24.4 2025-06-05 21:00:44 +00:00
Renovate b42a60844e chore(deps): update dependency go to v1.24.4 2025-06-05 18:58:53 +00:00
Renovate 72b66efc07 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.27.0 2025-06-01 16:59:16 +00:00
Renovate fb45f1eccc chore(deps): update golang:1.24.3 docker digest to f255a7d 2025-05-22 02:01:48 +00:00
Renovate b10691a7ad chore(deps): update pre-commit hook gitleaks/gitleaks to v8.26.0 2025-05-12 21:59:51 +00:00
Renovate 0677bb1e60 chore(deps): update golang docker tag to v1.24.3 2025-05-06 21:02:20 +00:00
Renovate 3bc038ba17 chore(deps): update dependency go to v1.24.3 2025-05-06 19:00:47 +00:00
Renovate 1c870c3d4e chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.6 2025-05-04 15:59:06 +00:00
argoyle 8b8bf53790 feat(ci): add defaults pipeline template for CI workflow
Add the 'Defaults.gitlab-ci.yml' pipeline template to the CI 
configuration to standardize the build environment across 
projects. This change ensures consistency and improves 
maintainability in the CI process.
2025-04-30 17:00:35 +02:00
Renovate 1f20ead820 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.25.1 2025-04-30 14:00:22 +00:00
Renovate 6b567fce3c chore(deps): update pre-commit hook gitleaks/gitleaks to v8.25.0 2025-04-29 15:00:56 +00:00
Renovate 08000f5e9f chore(deps): update golang:1.24.2 docker digest to bf7899c 2025-04-29 01:09:04 +00:00
Renovate 761bd0d75b chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.5 2025-04-24 19:59:47 +00:00
Renovate 2f7cf19696 chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.4 2025-04-24 18:05:08 +00:00
Renovate 06a017f5a5 chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.2 2025-04-15 14:01:19 +00:00
Renovate 0a5e432071 chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.1 2025-04-12 19:04:36 +00:00
Renovate 957d9229b1 chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.0 2025-04-12 17:58:59 +00:00
Unbound Release 681804c5e4 chore(release): prepare for v0.2.0 2025-04-12 00:37:18 +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
Renovate c7ceee0a14 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.24.3 2025-04-11 14:59:55 +00:00
Renovate 09f0769a3e fix(deps): update module github.com/sparetimecoders/goamqp to v0.3.2 2025-04-09 14:02:50 +00:00
Renovate ae9ac8b449 chore(deps): update golang:1.24.2 docker digest to aebb7df 2025-04-08 06:00:25 +00:00
Renovate 7f251668b2 chore(deps): update golang docker tag to v1.24.2 2025-04-01 18:05:40 +00:00
Renovate 114883aef4 chore(deps): update pre-commit hook golangci/golangci-lint to v2.0.2 2025-03-25 22:03:45 +00:00
Renovate 6c0dbaf903 chore(deps): update pre-commit hook golangci/golangci-lint to v2.0.1 2025-03-24 21:03:49 +00:00
Renovate b0a1757e38 chore(deps): update pre-commit hook golangci/golangci-lint to v2 2025-03-24 14:15:03 +01:00
Renovate d6736b0187 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.24.2 2025-03-22 12:58:32 +00:00
Renovate 668e0dacfb chore(deps): update golang:1.24.1 docker digest to 5ecf333 2025-03-18 03:59:37 +00:00
Renovate 1c2e98a973 chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.8 2025-03-17 20:58:51 +00:00
Renovate 026fe0ab3f chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.7 2025-03-12 00:05:17 +00:00
Renovate 6b15aac9f3 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.22.0 2025-03-11 14:59:15 +00:00
Renovate 001f23eab5 chore(deps): update golang docker tag to v1.24.1 2025-03-04 23:04:59 +00:00
Renovate e3c303b162 chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.6 2025-03-02 23:59:43 +00:00
Renovate 61204541a4 chore(deps): update golang:1.24.0 docker digest to 4a3f101 2025-02-25 05:57:56 +00:00
Renovate fbd579a4f6 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.24.0 2025-02-20 02:59:18 +00:00
Renovate 7a1a0b5941 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.21.0 2025-02-15 14:59:34 +00:00
Renovate d6db4b664c chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.5 2025-02-13 22:00:22 +00:00
Renovate 44a711baa1 chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.4 2025-02-12 22:59:59 +00:00
Renovate 63ae255179 chore(deps): update golang docker tag to v1.24.0 2025-02-12 19:05:47 +00:00
Renovate 24f3184ccc chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.2 2025-02-11 21:59:21 +00:00
argoyle b6f20b7ae0 fix(ci): update go image to amd64 architecture version
Updates the Go image in the CI configuration to use the
amd64 architecture version for better compatibility and
performance. This change ensures consistency across stages
that utilize Go tools, particularly for vulnerability testing.
2025-02-06 19:57:01 +01:00
Renovate c009f3d87c chore(deps): update golang:1.23.6 docker digest to 9271129 2025-02-05 10:04:35 +00:00
Renovate e197f2c7da chore(deps): update golang:1.23.6 docker digest to 958bd2e 2025-02-05 06:59:38 +00:00
Renovate 2655fcb211 chore(deps): update golang docker tag to v1.23.6 2025-02-05 04:00:35 +00:00
Renovate 9fcbdd259b chore(deps): update golang:1.23.5 docker digest to e213430 2025-02-04 10:03:17 +00:00
Renovate ba73d36b91 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.23.3 2025-01-29 15:03:23 +00:00
Renovate 739440046b chore(deps): update pre-commit hook gitleaks/gitleaks to v8.23.2 2025-01-24 15:11:53 +00:00
Renovate 2243597853 chore(deps): update golang:1.23.5 docker digest to 8c10f21 2025-01-22 04:09:09 +00:00
Renovate e9e684949c chore(deps): update golang docker tag to v1.23.5 2025-01-17 01:12:11 +00:00
Renovate a6426f5973 chore(deps): update golang:1.23.4 docker digest to 9820aca 2025-01-15 23:21:39 +00:00
Renovate e29f5b331b chore(deps): update golang:1.23.4 docker digest to 5305905 2025-01-15 19:05:34 +00:00
Renovate e1b2e5a5c1 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.23.1 2025-01-15 13:13:56 +00:00
Renovate 7371d54831 chore(deps): update golang:1.23.4 docker digest to 585103a 2025-01-15 01:14:28 +00:00
Renovate badfe89281 chore(deps): update golang:1.23.4 docker digest to 08e1417 2025-01-14 13:05:51 +00:00
Renovate 17dd541cc6 chore(deps): update golang:1.23.4 docker digest to 3b1a7de 2025-01-14 07:25:53 +00:00
Renovate 4ad0fb4f86 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.23.0 2025-01-13 16:10:17 +00:00
Renovate a53df01028 chore(deps): update pre-commit hook golangci/golangci-lint to v1.63.4 2025-01-03 20:13:05 +00:00
Renovate 622179a6b1 chore(deps): update pre-commit hook golangci/golangci-lint to v1.63.3 2025-01-02 20:05:36 +00:00
Renovate b6b3084ae7 chore(deps): update pre-commit hook golangci/golangci-lint to v1.63.2 2025-01-02 13:06:17 +00:00
Renovate f6a0f478c0 chore(deps): update pre-commit hook golangci/golangci-lint to v1.63.1 2025-01-01 22:05:01 +00:00
Renovate 5cce412515 chore(deps): update pre-commit hook golangci/golangci-lint to v1.63.0 2025-01-01 14:05:42 +00:00
Renovate f9f881614b chore(deps): update pre-commit hook gitleaks/gitleaks to v8.22.1 2024-12-30 17:08:19 +00:00
argoyle a76276787f feat: add timeout configuration to golangci-lint
Sets a timeout of 5 minutes for golangci-lint to improve  
performance and prevent long-running linting processes.  
This change ensures that the linting process completes within  
a reasonable time frame, enhancing the development workflow.
2024-12-28 18:19:19 +01:00
Renovate 619bccdcf0 chore(deps): update golang:1.23.4 docker digest to 7ea4c9d 2024-12-26 04:09:08 +00:00
Renovate 919589a397 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.22.0 2024-12-20 17:10:31 +00:00
Renovate bcf67ea71e chore(deps): update pre-commit hook gitleaks/gitleaks to v8.21.4 2024-12-20 16:06:30 +00:00
Renovate 674117e8ff chore(deps): update pre-commit hook gitleaks/gitleaks to v8.21.3 2024-12-19 23:00:54 +00:00
Renovate 1307fcd993 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.20.0 2024-12-16 15:09:23 +00:00
Renovate aeb92016c8 chore(deps): update golang:1.23.4 docker digest to 7003184 2024-12-12 03:10:58 +00:00
Renovate 53ddd9413a chore(deps): update golang:1.23.4 docker digest to 574185e 2024-12-04 12:06:01 +00:00
Renovate 791703e632 chore(deps): update golang docker tag to v1.23.4 2024-12-04 06:04:45 +00:00
Renovate abec3883c7 chore(deps): update golang:1.23.3 docker digest to 017ec6b 2024-12-03 21:09:03 +00:00
Renovate c78e07cdca chore(deps): update golang:1.23.3 docker digest to 2b01164 2024-12-03 15:03:13 +00:00
Renovate 0b8ef99e8b chore(deps): update golang:1.23.3 docker digest to b4aabba 2024-12-03 12:04:22 +00:00
Renovate 82505437e1 chore(deps): update golang:1.23.3 docker digest to ee5f0ad 2024-12-03 09:01:34 +00:00
Renovate 510790dab3 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.19.0 2024-11-27 17:59:23 +00:00
Renovate 3bbab5a037 chore(deps): update pre-commit hook golangci/golangci-lint to v1.62.2 2024-11-25 14:59:03 +00:00
Renovate 53fbe8d8b1 fix(deps): update module github.com/stretchr/testify to v1.10.0 2024-11-23 12:04:54 +00:00
Renovate 660a58a94c chore(deps): update golang:1.23.3 docker digest to 73f06be 2024-11-15 00:05:13 +00:00
Renovate 0a4c0c7920 chore(deps): update golang:1.23.3 docker digest to c2d828f 2024-11-13 21:05:51 +00:00
Renovate 511fce32e1 chore(deps): update golang:1.23.3 docker digest to 2660218 2024-11-13 12:05:13 +00:00
argoyle 7477dd929e refactor(ci): remove pre-commit job and add new template
Removes the deprecated pre-commit job from the CI configuration.  
Adds a new template to streamline pre-commit tasks with Go. This  
ensures a cleaner pipeline setup and improves maintainability.
2024-11-13 12:52:48 +01:00
Renovate 3b2528e447 chore(deps): update golang:1.23.3 docker digest to b2ca381 2024-11-13 09:00:30 +00:00
Renovate 628d5f68d3 chore(deps): update golang:1.23.3 docker digest to 3694e36 2024-11-13 05:59:23 +00:00
Renovate b810402cea chore(deps): update unbound/pre-commit docker digest to e78425c 2024-11-12 12:04:42 +00:00
Renovate c18735eb92 chore(deps): update golang:1.23.3 docker digest to 8956c08 2024-11-12 08:59:15 +00:00
Renovate b362af8bbe chore(deps): update pre-commit hook golangci/golangci-lint to v1.62.0 2024-11-10 21:04:10 +00:00
Renovate 2ad082150d chore(deps): update unbound/pre-commit docker digest to 596abf5 2024-11-07 12:01:49 +00:00
Renovate a2a06a49c9 chore(deps): update golang docker tag to v1.23.3 2024-11-07 09:01:08 +00:00
Renovate c7765a7838 chore(deps): pin unbound/pre-commit docker tag to 92fce44 2024-11-03 17:57:45 +00:00
Renovate e37c082d0b chore(deps): pin golang docker tag to ad5c126 2024-11-03 16:38:51 +00:00
Renovate fb4f0ebe44 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.21.2 2024-10-28 14:58:36 +00:00
Renovate adc0dbed67 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.21.1 2024-10-18 13:56:56 +00:00
Renovate 43ef782b72 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.21.0 2024-10-15 04:57:24 +00:00
Renovate 7c485ad14d chore(deps): update pre-commit hook gitleaks/gitleaks to v8.20.1 2024-10-07 20:05:37 +00:00
Renovate 70e6001c4a chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v5 2024-10-05 20:03:42 +00:00
Ghost User 002ae561cb chore(release): prepare for v0.1.4 2024-10-05 18:54:54 +00:00
argoyle 3c7787a0eb ci: remove old release job 2024-10-05 11:27:11 +02:00
argoyle 521df4ec4c ci: add release flow 2024-10-05 10:52:06 +02:00
Renovate e347883c05 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.20.0 2024-10-03 16:56:58 +00:00
Renovate 078d6fee28 chore(deps): update golang docker tag to v1.23.2 2024-10-02 02:01:33 +00:00
Renovate 79bd756ddd chore(deps): update pre-commit hook gitleaks/gitleaks to v8.19.3 2024-09-26 16:57:12 +00:00
Renovate ae9e79eec5 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.19.2 2024-09-16 16:58:09 +00:00
Renovate cef1c9d166 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.19.1 2024-09-14 10:59:28 +00:00
Renovate 3d4341dbb3 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.18.0 2024-09-11 10:58:29 +00:00
Renovate 968ee335dd chore(deps): update pre-commit hook golangci/golangci-lint to v1.61.0 2024-09-09 20:00:00 +00:00
Renovate 6b1ada6155 chore(deps): update golang docker tag to v1.23.1 2024-09-06 02:00:59 +00:00
Renovate c4c70ab5f3 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.17.0 2024-08-28 16:57:40 +00:00
Renovate d68ed4e55b fix(deps): update module github.com/sparetimecoders/goamqp to v0.3.1 2024-08-23 10:59:29 +00:00
Renovate 1e66b292fa chore(deps): update pre-commit hook golangci/golangci-lint to v1.60.3 2024-08-22 23:00:54 +00:00
Renovate 81f19bafd9 chore(deps): update pre-commit hook golangci/golangci-lint to v1.60.2 2024-08-20 23:00:07 +00:00
argoyle b3f4330aa4 chore: update golangci-lint to use full version 2024-08-19 21:32:22 +02:00
Renovate f876c2a964 chore(deps): update golang docker tag to v1.23.0 2024-08-14 07:26:47 +00:00
Renovate 01006d5713 chore(deps): update pre-commit hook golangci/golangci-lint to v1.60.1 2024-08-14 01:59:48 +00:00
Renovate 62ee90cb93 chore(deps): update golang docker tag to v1.22.6 2024-08-07 02:00:19 +00:00
Renovate 54e8bbc9a3 chore(deps): update golang docker tag to v1.22.5 2024-07-03 01:58:50 +00:00
Renovate d8fb015d1f chore(deps): update pre-commit hook gitleaks/gitleaks to v8.18.4 2024-06-14 16:57:15 +00:00
Renovate 3c53f6d19e chore(deps): update pre-commit hook golangci/golangci-lint to v1.59.1 2024-06-09 19:57:20 +00:00
Renovate cce56c2fd4 chore(deps): update golang docker tag to v1.22.4 2024-06-04 22:57:59 +00:00
Renovate 8088b2e9c0 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.18.3 2024-06-01 16:56:25 +00:00
Renovate f1ebe5f920 chore(deps): update pre-commit hook golangci/golangci-lint to v1.59.0 2024-05-26 19:57:33 +00:00
Renovate e474981df4 chore(deps): update pre-commit hook golangci/golangci-lint to v1.58.2 2024-05-19 19:58:14 +00:00
Renovate 3519a15cfd chore(deps): update pre-commit hook golangci/golangci-lint to v1.58.1 2024-05-08 20:00:02 +00:00
Renovate ede05d8335 chore(deps): update golang docker tag to v1.22.3 2024-05-07 19:57:26 +00:00
Renovate 2e151d003f chore(deps): update pre-commit hook golangci/golangci-lint to v1.58.0 2024-05-03 19:57:16 +00:00
Renovate 2347345cc9 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.16.0 2024-04-23 16:55:40 +00:00
Renovate 7543e07add chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.15.0 2024-04-16 22:56:13 +00:00
Renovate 1823219b05 chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v4.6.0 2024-04-06 19:56:10 +00:00
Renovate 43b988801b chore(deps): update golang docker tag to v1.22.2 2024-04-03 19:56:26 +00:00
Renovate 1c3e889a6e chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.14.0 2024-04-03 13:54:57 +00:00
Renovate 72d27535f5 chore(deps): update pre-commit hook golangci/golangci-lint to v1.57.2 2024-03-28 20:55:20 +00:00
Renovate 950470c49a chore(deps): update pre-commit hook gitleaks/gitleaks to v8.18.2 2024-03-21 14:55:09 +00:00
argoyle 71d8e85610 chore: add gitleaks to pre-commit setup 2024-03-21 15:15:15 +01:00
Renovate da4ad80ab5 chore(deps): update pre-commit hook golangci/golangci-lint to v1.57.1 2024-03-20 17:55:34 +00:00
Renovate f030c9ec07 chore(deps): update pre-commit hook golangci/golangci-lint to v1.57.0 2024-03-19 23:56:04 +00:00
Renovate d72e3c3422 chore(deps): update golang docker tag to v1.22.1 2024-03-05 20:00:03 +00:00
Renovate afa66d0a6d chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.13.0 2024-03-01 17:55:00 +00:00
Renovate d64fabb1a4 fix(deps): update module github.com/stretchr/testify to v1.9.0 2024-03-01 12:57:55 +00:00
Renovate 529069439c chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.12.0 2024-02-26 21:56:23 +00:00
Renovate cf05e91286 chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v4.5.0 2024-02-26 10:05:36 +00:00
Renovate fd2c013368 chore(deps): update pre-commit hook lietu/go-pre-commit to v0.1.0 2024-02-26 09:56:32 +00:00
Renovate a9123af4ff chore(deps): update pre-commit hook golangci/golangci-lint to v1.56.2 2024-02-26 08:57:02 +00:00
Renovate 8d9920c108 chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.11.0 2024-02-26 07:57:11 +00:00
Renovate 50a4930038 chore(deps): update pre-commit hook devopshq/gitlab-ci-linter to v1.0.6 2024-02-26 06:56:01 +00:00
Renovate 7c2d1e75b2 chore(deps): update node.js to v20 2024-02-23 22:56:15 +00:00
Renovate 9a3a3c9de7 Add renovate.json 2024-02-23 23:00:07 +01:00
argoyle fd862c499b ci: update to Go 1.22.0 2024-02-08 07:43:45 +01:00
argoyle e02b3c92f3 build(deps): bump github.com/sparetimecoders/goamqp from 0.2.1 to 0.3.0
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.2.1 to 0.3.0.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.2.1...v0.3.0)
2024-01-17 05:19:42 +00:00
argoyle 49af247019 ci: update to Go 1.21.6 2024-01-10 14:36:59 +01:00
argoyle 46e1bd284c fix: prohibit concurrent read/write 2023-12-26 18:21:59 +01:00
argoyle 16e5ad4f23 build(deps): bump github.com/sparetimecoders/goamqp from 0.2.0 to 0.2.1
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.2.0...v0.2.1)
2023-12-19 05:19:45 +00:00
argoyle f5c18e4515 ci: update version of Go 2023-12-11 17:31:32 +01:00
argoyle e3c79092c2 ci: update to go 1.21.3 and remove patch level 2023-10-27 14:12:51 +02:00
argoyle 7815c85c92 build(deps): bump github.com/sparetimecoders/goamqp from 0.1.5 to 0.2.0
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.1.5 to 0.2.0.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.1.5...v0.2.0)
2023-10-05 05:19:27 +00:00
argoyle de664d7a05 chore: use 1.21.1 in go.mod for Dependabot 2023-09-27 21:09:56 +02:00
argoyle 67963fcdc1 ci: update to Go 1.21.1 for vulnerabilities 2023-09-08 07:06:55 +02:00
argoyle d3a504ca68 ci: update to Golang 1.21.0 2023-08-30 20:19:14 +02:00
argoyle 233197999f ci: update pre-commit versions 2023-08-30 18:01:12 +02:00
argoyle 1ea2469c77 ci: update to Go 1.20.7 2023-08-07 08:37:15 +02:00
argoyle 775553c2d5 build(deps): bump github.com/sparetimecoders/goamqp from 0.1.4 to 0.1.5
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.1.4 to 0.1.5.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.1.4...v0.1.5)
2023-07-04 05:19:53 +00:00
argoyle 4203f4474f ci: make releases handle multi-line release notes 2023-06-08 16:16:15 +02:00
argoyle cc7de2e5a1 ci: update Go version 2023-06-08 16:12:38 +02:00
argoyle f14aec80d9 ci: update golangci-lint 2023-06-04 16:45:07 +02:00
argoyle cbd358ba85 build(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4)
2023-05-31 05:19:33 +00:00
argoyle df845a7b4b chore: update pre-commit and fix golangci-lint 2023-05-19 10:48:32 +02:00
argoyle d8f6785032 build(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3)
2023-05-19 05:19:34 +00:00
argoyle ff779d9456 build(deps): bump github.com/sparetimecoders/goamqp from 0.1.3 to 0.1.4
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.1.3...v0.1.4)
2023-05-11 05:19:41 +00:00
argoyle eba7784e59 ci: update Go version and fix gitlabci lint 2023-05-04 08:34:40 +02:00
argoyle d022eb8ebd ci: update to Go 1.20.3 2023-04-06 10:26:35 +02:00
argoyle 9c802b1239 ci: update Go verion for vulnerabilities scan 2023-03-09 22:00:21 +01:00
argoyle 2e3bd451df build(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.1...v1.8.2)
2023-02-26 10:22:34 +00:00
argoyle 0608960a02 ci: update to golang 1.20.1 2023-02-26 11:03:49 +01:00
argoyle bbbfb99dd9 ci: change dependabot rebase strategy 2023-01-29 10:52:30 +01:00
argoyle eef42d4b32 ci: update to Go 1.19.5 2023-01-29 10:52:23 +01:00
argoyle d1a9414390 ci: add release handling 2023-01-29 10:52:12 +01:00
argoyle dee3bb5d60 ci: add local module to pre-commit config 2023-01-13 13:39:34 +01:00
argoyle dcbdef35cf ci: add pre-commit and remove those checks from test step 2022-12-28 20:06:28 +01:00
argoyle 1794fcd2ad build(deps): bump github.com/sparetimecoders/goamqp from 0.1.2 to 0.1.3
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.1.2 to 0.1.3.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.1.2...v0.1.3)
2022-11-15 05:19:17 +00:00
argoyle abfeb751b2 chore: replace deprecated ioutil.ReadAll 2022-11-10 10:54:45 +01:00
argoyle 51f0aaf0ca build(deps): bump github.com/sparetimecoders/goamqp from 0.1.1 to 0.1.2
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.1.1...v0.1.2)
2022-10-26 05:19:33 +00:00
argoyle 8604a3568a build(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1)
2022-10-24 05:19:21 +00:00
argoyle fee49889cf fix: run builds with Go 1.19.2 to fix vulnerabilities 2022-10-11 17:59:59 +02:00
argoyle 7e70411553 ci: add vulnerability-check 2022-09-13 14:18:20 +02:00
argoyle 610edd6576 chore: switch to moved goamqp 2022-07-20 17:25:13 +02:00
argoyle 2f232e6850 build(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.5 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.5...v1.8.0)
2022-06-30 05:19:15 +00:00
argoyle be4409a745 build(deps): bump github.com/stretchr/testify from 1.7.4 to 1.7.5
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.4 to 1.7.5.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.4...v1.7.5)
2022-06-24 05:19:11 +00:00
argoyle 83b513ebf8 build(deps): bump github.com/stretchr/testify from 1.7.2 to 1.7.4
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.2 to 1.7.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.2...v1.7.4)
2022-06-21 05:19:14 +00:00
argoyle 51e8d43795 build(deps): bump github.com/stretchr/testify from 1.7.1 to 1.7.2
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.1...v1.7.2)
2022-06-07 05:19:13 +00:00
argoyle e816866e75 build(deps): bump gitlab.com/sparetimecoders/goamqp from 0.4.0 to 0.5.0
Bumps [gitlab.com/sparetimecoders/goamqp](https://gitlab.com/sparetimecoders/goamqp) from 0.4.0 to 0.5.0.
- [Release notes](https://gitlab.com/sparetimecoders/goamqp/tags)
- [Commits](https://gitlab.com/sparetimecoders/goamqp/compare/v0.4.0...v0.5.0)
2022-05-26 05:19:12 +00:00
argoyle ad1bf3cbfa Merge branch 'dependabot-go_modules-github.com-stretchr-testify-1.7.1' into 'main'
build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1

See merge request unboundsoftware/shiny/authz_client!11
2022-03-16 07:29:17 +00:00
argoyle f4e3891f62 build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.0...v1.7.1)
2022-03-16 05:19:33 +00:00
argoyle cf73d6c399 build: add params to codecov 2022-02-20 00:56:58 +01:00
argoyle 74e81114de Merge branch 'dependabot-go_modules-gitlab.com-sparetimecoders-goamqp-0.4.0' into 'main'
chore(deps): bump gitlab.com/sparetimecoders/goamqp from 0.3.2 to 0.4.0

See merge request unboundsoftware/shiny/authz_client!10
2022-02-12 10:27:36 +00:00
argoyle 2299434912 chore(deps): bump gitlab.com/sparetimecoders/goamqp from 0.3.2 to 0.4.0
Bumps [gitlab.com/sparetimecoders/goamqp](https://gitlab.com/sparetimecoders/goamqp) from 0.3.2 to 0.4.0.
- [Release notes](https://gitlab.com/sparetimecoders/goamqp/tags)
- [Commits](https://gitlab.com/sparetimecoders/goamqp/compare/v0.3.2...v0.4.0)
2022-02-12 05:19:39 +00:00
argoyle 3c6ab4bfde Merge branch 'codecov' into 'main'
ci: change to codecov binary instead of bash uploader

See merge request unboundsoftware/shiny/authz_client!9
2021-11-17 05:16:41 +00:00
argoyle a305db2206 ci: change to codecov binary instead of bash uploader 2021-11-17 06:14:49 +01:00
argoyle 6e8b78c6e2 Merge branch 'dependabot' into 'main'
ci: remove dependabot-standalone

See merge request unboundsoftware/shiny/authz_client!8
2021-11-03 17:45:18 +00:00
argoyle 4578694015 ci: remove dependabot-standalone 2021-11-03 18:25:05 +01:00
argoyle dbc4412b9b Merge branch 'fix-pipeline' into 'main'
fix: pipeline

See merge request unboundsoftware/shiny/authz_client!7
2021-10-28 12:56:44 +00:00
argoyle f151464330 fix: pipeline 2021-10-28 14:54:47 +02:00
argoyle bcfa15e4a2 Merge branch 'dependabot-go_modules-github.com-stretchr-testify-1.7.0' into 'main'
chore(deps): bump github.com/stretchr/testify from 1.4.0 to 1.7.0

See merge request unboundsoftware/shiny/authz_client!5
2021-10-26 10:35:08 +00:00
argoyle 41c7e4a3ef chore(deps): bump github.com/stretchr/testify from 1.4.0 to 1.7.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.4.0 to 1.7.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.4.0...v1.7.0)
2021-10-26 12:33:10 +02:00
argoyle 5cdd3bd244 Merge branch 'dependabot-go_modules-gitlab.com-sparetimecoders-goamqp-0.3.2' into 'main'
chore(deps): bump gitlab.com/sparetimecoders/goamqp from 0.3.1 to 0.3.2

See merge request unboundsoftware/shiny/authz_client!6
2021-10-26 09:07:55 +00:00
argoyle 398d267ee5 chore(deps): bump gitlab.com/sparetimecoders/goamqp from 0.3.1 to 0.3.2
Bumps [gitlab.com/sparetimecoders/goamqp](https://gitlab.com/sparetimecoders/goamqp) from 0.3.1 to 0.3.2.
- [Release notes](https://gitlab.com/sparetimecoders/goamqp/tags)
- [Commits](https://gitlab.com/sparetimecoders/goamqp/compare/v0.3.1...v0.3.2)
2021-10-26 05:43:34 +00:00
argoyle 26f8e762c7 Merge branch 'dependabot' into 'main'
chore: add dependabot config

See merge request unboundsoftware/shiny/authz_client!4
2021-10-26 05:22:59 +00:00
argoyle e395518de2 chore: add dependabot config 2021-10-26 07:21:08 +02:00
argoyle 60795d413d Merge branch 'update-goamqp' into 'main'
chore: update to latest version of goamqp

See merge request unboundsoftware/shiny/authz_client!3
2021-05-15 12:44:05 +00:00
argoyle a2164c4beb chore: update to latest version of goamqp 2021-05-15 14:42:19 +02:00
argoyle 90e028b173 Merge branch 'group-imports' into 'main'
chore: group imports

See merge request unboundsoftware/shiny/authz_client!2
2021-05-03 18:54:24 +00:00
argoyle 6ce176b927 chore: group imports 2021-05-03 20:52:15 +02:00
argoyle 48a063eba2 chore: rename master -> main 2021-04-07 09:49:09 +02:00
argoyle 5634c26039 Merge branch 'ci-workflows' into 'master'
chore: add CI workflows

See merge request unboundsoftware/shiny/authz_client!1
2020-11-23 16:43:28 +00:00
argoyle 429f45935a chore: add CI workflows 2020-11-23 17:20:09 +01:00
argoyle 3c36225665 chore: change coverage badge to codecov.io 2020-07-03 21:31:34 +02:00
argoyle f6417140cb chore: simplify pipeline 2020-06-26 20:44:52 +02:00
argoyle fb0273fe3c chore: add codecov upload 2020-04-27 19:27:48 +02:00
argoyle eb147039b6 fix: sort companies before comparing since map-iteration is not stable 2020-04-12 20:46:18 +02:00
argoyle c36ff4fa98 fix: use go mod download 2020-04-12 20:40:08 +02:00
argoyle 965d317a11 fix: update to Go 1.14 to fix test errors 2020-04-12 20:37:16 +02:00
argoyle 376278e2be chore: modify event structure 2020-04-12 20:33:35 +02:00
argoyle e0632f1895 fix: path to repo 2019-12-31 13:00:45 +01:00
argoyle afc14717e3 chore: add tests 2019-12-31 12:58:20 +01:00
20 changed files with 1603 additions and 152 deletions
+85
View File
@@ -0,0 +1,85 @@
name: authz_client
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Run tests
run: go test -race -coverprofile=coverage.txt ./...
- name: Check coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
# Download baseline coverage from main branch (for PRs)
- name: Download baseline coverage
if: gitea.event_name == 'pull_request'
uses: actions/download-artifact@v3
with:
name: coverage-baseline
path: ./baseline
continue-on-error: true
# Compare coverage against baseline (for PRs)
- name: Compare coverage
if: gitea.event_name == 'pull_request'
run: |
CURRENT=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
if [ -f ./baseline/coverage.txt ]; then
BASE=$(go tool cover -func=./baseline/coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
echo "Base coverage: ${BASE}%"
echo "Current coverage: ${CURRENT}%"
if [ "$(echo "$CURRENT < $BASE" | bc -l)" -eq 1 ]; then
echo "::error::Coverage decreased from ${BASE}% to ${CURRENT}%"
exit 1
fi
echo "Coverage maintained or improved: ${BASE}% -> ${CURRENT}%"
else
echo "No baseline coverage found, skipping comparison"
echo "Current coverage: ${CURRENT}%"
fi
# Upload coverage as baseline (only on main)
- name: Upload coverage baseline
if: gitea.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: coverage-baseline
path: coverage.txt
retention-days: 90
# Post coverage to PR comment
- name: Post coverage comment
if: gitea.event_name == 'pull_request'
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ gitea.server_url }}
run: |
COVERAGE=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}')
curl -X POST "${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.pull_request.number }}/comments" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"body\": \"## Coverage Report\n\nTotal coverage: **${COVERAGE}**\"}"
vulnerabilities:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Check vulnerabilities
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
+25
View File
@@ -0,0 +1,25 @@
name: pre-commit
permissions: read-all
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-latest
env:
SKIP: no-commit-to-branch
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- uses: pre-commit/action@v3.0.1
+9
View File
@@ -0,0 +1,9 @@
name: Release
on:
push:
branches: [main]
jobs:
release:
uses: unboundsoftware/shared-workflows/.gitea/workflows/Release.yml@main
+2
View File
@@ -1,2 +1,4 @@
.idea
.claude
/release
coverage.txt
-41
View File
@@ -1,41 +0,0 @@
variables:
GOCACHE: "${CI_PROJECT_DIR}/_go/cache"
before_script:
- mkdir -p ${CI_PROJECT_DIR}/_go/{pkg,bin,cache}
- rm -rf /go/pkg || true
- mkdir -p /go
- ln -s ${CI_PROJECT_DIR}/_go/pkg /go/pkg
- ln -s ${CI_PROJECT_DIR}/_go/bin /go/bin
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- _go
untracked: true
stages:
- deps
- test
deps:
stage: deps
image: golang:1.13
script:
- go get -mod=readonly
test:
stage: test
dependencies:
- deps
image: golang:1.13
script:
- go fmt $(go list ./...)
- go vet $(go list ./...)
- unset "${!CI@}"
- CGO_ENABLED=1 go test -p 1 -mod=readonly -race -coverprofile=.testCoverage.txt -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
- go tool cover -html=.testCoverage.txt -o coverage.html
- go tool cover -func=.testCoverage.txt
artifacts:
paths:
- coverage.html
+22
View File
@@ -0,0 +1,22 @@
version: "2"
run:
allow-parallel-runners: true
linters:
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
+39
View File
@@ -0,0 +1,39 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args:
- --allow-multiple-documents
- id: check-added-large-files
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.24.0
hooks:
- id: commitlint
stages: [ commit-msg ]
additional_dependencies: [ '@commitlint/config-conventional' ]
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-mod-tidy
- id: go-imports
args:
- -local
- gitea.unbound.se/shiny/authz_client
- repo: https://github.com/lietu/go-pre-commit
rev: v1.0.0
hooks:
- id: go-test
- id: gofumpt
- repo: https://github.com/golangci/golangci-lint
rev: v2.11.3
hooks:
- id: golangci-lint-full
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
+13
View File
@@ -0,0 +1,13 @@
# Coverage configuration for go-test-coverage
# https://github.com/vladopajic/go-test-coverage
profile: coverage.txt
threshold:
file: 0
package: 0
total: 0
exclude:
paths:
- _test\.go$
+3
View File
@@ -0,0 +1,3 @@
{
"version": "v0.5.0"
}
+456
View File
@@ -0,0 +1,456 @@
# Changelog
All notable changes to this project will be documented in this file.
## [0.5.0] - 2026-03-12
### 🚀 Features
- *(client)* Add API key authentication for /authz endpoint (#294)
### ⚙️ Miscellaneous Tasks
- *(deps)* Update golang:1.25.5 docker digest to 3a01526 (#271)
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.24.0 (#273)
- *(deps)* Update dependency go to v1.25.6 (#274)
- *(deps)* Update golang docker tag to v1.25.6 (#275)
- Remove GitLab CI configuration
- Add code coverage integration
- *(deps)* Update dependency go to v1.25.7 (#279)
- *(deps)* Update dependency go to v1.26.0 (#280)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.9.0 (#281)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.10.0 (#282)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.10.1 (#283)
- *(deps)* Update dependency go to v1.26.1 (#286)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.1 (#288)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.2 (#290)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.3 (#292)
## [0.4.1] - 2026-01-09
### ⚙️ Miscellaneous Tasks
- *(deps)* Update actions/setup-python action to v6
- Migrate module path to gitea.unbound.se
## [0.4.0] - 2026-01-09
### 🚀 Features
- Migrate from GitLab CI to Gitea Actions
### 🚜 Refactor
- Update module path to new repository location
### 📚 Documentation
- Add CLAUDE.md for Claude Code integration
### 🧪 Testing
- Add concurrent fetch and read tests for privileges
### ⚙️ Miscellaneous Tasks
- *(deps)* Update golang:1.25.3 docker digest to 9ac0edc
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.29.0
- *(deps)* Update dependency go to v1.25.4
- *(deps)* Update golang docker tag to v1.25.4
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.2
- *(deps)* Update golang:1.25.4 docker digest to efe81fa
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.29.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.30.0
- *(deps)* Update dependency go to v1.25.5
- *(deps)* Update golang docker tag to v1.25.5
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.2
- *(deps)* Update golang:1.25.5 docker digest to 0c27bcf
- *(deps)* Update golang:1.25.5 docker digest to ad03ba9
- *(deps)* Update actions/setup-go action to v6
- *(deps)* Update actions/checkout action to v6
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.8.0
- Add pre-commit and release workflows
## [0.3.1] - 2025-11-02
### 🐛 Bug Fixes
- Change to write lock for thread safety in json unmarshal
### ⚙️ Miscellaneous Tasks
- *(deps)* Update golang:1.25.1 docker digest to 53f7808
- *(deps)* Update pre-commit hook lietu/go-pre-commit to v1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.5.0
- *(deps)* Update golang:1.25.1 docker digest to 12640a4
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.23.0
- *(deps)* Update dependency go to v1.25.2
- *(deps)* Update golang docker tag to v1.25.2
- *(deps)* Update dependency go to v1.25.3
- *(deps)* Update golang docker tag to v1.25.3
- Add default configuration for git-cliff
- *(deps)* Update golang:1.25.3 docker digest to 69d1009
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.0
## [0.3.0] - 2025-09-06
### 🚀 Features
- *(ci)* Add defaults pipeline template for CI workflow
- Add salary privilege to privilege management system
### 🐛 Bug Fixes
- *(deps)* Update module github.com/sparetimecoders/goamqp to v0.3.3
- *(deps)* Update module github.com/stretchr/testify to v1.11.0
- *(deps)* Update module github.com/stretchr/testify to v1.11.1
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.2
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.4
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.5
- *(deps)* Update golang:1.24.2 docker digest to bf7899c
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.25.0
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.25.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.6
- *(deps)* Update dependency go to v1.24.3
- *(deps)* Update golang docker tag to v1.24.3
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.26.0
- *(deps)* Update golang:1.24.3 docker digest to f255a7d
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.27.0
- *(deps)* Update dependency go to v1.24.4
- *(deps)* Update golang docker tag to v1.24.4
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.27.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.27.2
- *(deps)* Update golang:1.24.4 docker digest to 3494bbe
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.2.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.2.1
- *(deps)* Update golang:1.24.4 docker digest to 9f820b6
- *(deps)* Update dependency go to v1.24.5
- *(deps)* Update golang docker tag to v1.24.5
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.2.2
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.28.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.3.0
- *(deps)* Update golang:1.24.5 docker digest to 0a156a4
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.3.1
- *(deps)* Update dependency go to v1.24.6
- *(deps)* Update golang docker tag to v1.24.6
- *(deps)* Update pre-commit hook pre-commit/pre-commit-hooks to v6
- *(deps)* Update golang:1.24.6 docker digest to 958bfd1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.4.0
- *(deps)* Update golang docker tag to v1.25.0
- *(deps)* Update dependency go to v1.25.0
- *(deps)* Update golang:1.25.0 docker digest to f6b9e1a
- *(deps)* Update dependency go to v1.25.1
- *(deps)* Update golang docker tag to v1.25.1
## [0.2.0] - 2025-04-11
### 🚀 Features
- Add timeout configuration to golangci-lint
- Add setup method for privilege event consumers
### 🐛 Bug Fixes
- *(deps)* Update module github.com/stretchr/testify to v1.10.0
- *(ci)* Update go image to amd64 architecture version
- *(deps)* Update module github.com/sparetimecoders/goamqp to v0.3.2
### 🚜 Refactor
- *(ci)* Remove pre-commit job and add new template
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook pre-commit/pre-commit-hooks to v5
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.20.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.21.0
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.21.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.21.2
- *(deps)* Pin golang docker tag to ad5c126
- *(deps)* Pin unbound/pre-commit docker tag to 92fce44
- *(deps)* Update golang docker tag to v1.23.3
- *(deps)* Update unbound/pre-commit docker digest to 596abf5
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.62.0
- *(deps)* Update golang:1.23.3 docker digest to 8956c08
- *(deps)* Update unbound/pre-commit docker digest to e78425c
- *(deps)* Update golang:1.23.3 docker digest to 3694e36
- *(deps)* Update golang:1.23.3 docker digest to b2ca381
- *(deps)* Update golang:1.23.3 docker digest to 2660218
- *(deps)* Update golang:1.23.3 docker digest to c2d828f
- *(deps)* Update golang:1.23.3 docker digest to 73f06be
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.62.2
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.19.0
- *(deps)* Update golang:1.23.3 docker digest to ee5f0ad
- *(deps)* Update golang:1.23.3 docker digest to b4aabba
- *(deps)* Update golang:1.23.3 docker digest to 2b01164
- *(deps)* Update golang:1.23.3 docker digest to 017ec6b
- *(deps)* Update golang docker tag to v1.23.4
- *(deps)* Update golang:1.23.4 docker digest to 574185e
- *(deps)* Update golang:1.23.4 docker digest to 7003184
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.20.0
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.21.3
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.21.4
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.22.0
- *(deps)* Update golang:1.23.4 docker digest to 7ea4c9d
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.22.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.63.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.63.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.63.2
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.63.3
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.63.4
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.23.0
- *(deps)* Update golang:1.23.4 docker digest to 3b1a7de
- *(deps)* Update golang:1.23.4 docker digest to 08e1417
- *(deps)* Update golang:1.23.4 docker digest to 585103a
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.23.1
- *(deps)* Update golang:1.23.4 docker digest to 5305905
- *(deps)* Update golang:1.23.4 docker digest to 9820aca
- *(deps)* Update golang docker tag to v1.23.5
- *(deps)* Update golang:1.23.5 docker digest to 8c10f21
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.23.2
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.23.3
- *(deps)* Update golang:1.23.5 docker digest to e213430
- *(deps)* Update golang docker tag to v1.23.6
- *(deps)* Update golang:1.23.6 docker digest to 958bd2e
- *(deps)* Update golang:1.23.6 docker digest to 9271129
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.64.2
- *(deps)* Update golang docker tag to v1.24.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.64.4
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.64.5
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.21.0
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.24.0
- *(deps)* Update golang:1.24.0 docker digest to 4a3f101
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.64.6
- *(deps)* Update golang docker tag to v1.24.1
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.22.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.64.7
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.64.8
- *(deps)* Update golang:1.24.1 docker digest to 5ecf333
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.24.2
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.0.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.0.2
- *(deps)* Update golang docker tag to v1.24.2
- *(deps)* Update golang:1.24.2 docker digest to aebb7df
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.24.3
## [0.1.4] - 2024-10-05
### 🐛 Bug Fixes
- *(deps)* Update module github.com/stretchr/testify to v1.9.0
- *(deps)* Update module github.com/sparetimecoders/goamqp to v0.3.1
### ⚙️ Miscellaneous Tasks
- Update to Go 1.21.6
- Update to Go 1.22.0
- *(deps)* Update node.js to v20
- *(deps)* Update pre-commit hook devopshq/gitlab-ci-linter to v1.0.6
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.11.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.56.2
- *(deps)* Update pre-commit hook lietu/go-pre-commit to v0.1.0
- *(deps)* Update pre-commit hook pre-commit/pre-commit-hooks to v4.5.0
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.12.0
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.13.0
- *(deps)* Update golang docker tag to v1.22.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.57.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.57.1
- Add gitleaks to pre-commit setup
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.18.2
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.57.2
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.14.0
- *(deps)* Update golang docker tag to v1.22.2
- *(deps)* Update pre-commit hook pre-commit/pre-commit-hooks to v4.6.0
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.15.0
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.16.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.58.0
- *(deps)* Update golang docker tag to v1.22.3
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.58.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.58.2
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.59.0
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.18.3
- *(deps)* Update golang docker tag to v1.22.4
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.59.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.18.4
- *(deps)* Update golang docker tag to v1.22.5
- *(deps)* Update golang docker tag to v1.22.6
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.60.1
- *(deps)* Update golang docker tag to v1.23.0
- Update golangci-lint to use full version
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.60.2
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.60.3
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.17.0
- *(deps)* Update golang docker tag to v1.23.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v1.61.0
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.18.0
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.19.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.19.2
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.19.3
- *(deps)* Update golang docker tag to v1.23.2
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.20.0
- Add release flow
- Remove old release job
### Build
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.2.1 to 0.3.0
## [0.1.3] - 2023-12-26
### 🐛 Bug Fixes
- Prohibit concurrent read/write
### ⚙️ Miscellaneous Tasks
- Update Go version
- Make releases handle multi-line release notes
- Update to Go 1.20.7
- Update pre-commit versions
- Update to Golang 1.21.0
- Update to Go 1.21.1 for vulnerabilities
- Use 1.21.1 in go.mod for Dependabot
- Update to go 1.21.3 and remove patch level
- Update version of Go
### Build
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.1.4 to 0.1.5
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.1.5 to 0.2.0
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.2.0 to 0.2.1
## [0.1.2] - 2023-06-04
### ⚙️ Miscellaneous Tasks
- Update pre-commit and fix golangci-lint
- Update golangci-lint
### Build
- *(deps)* Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
- *(deps)* Bump github.com/stretchr/testify from 1.8.3 to 1.8.4
## [0.1.1] - 2023-05-11
### 🐛 Bug Fixes
- Run builds with Go 1.19.2 to fix vulnerabilities
### ⚙️ Miscellaneous Tasks
- Add vulnerability-check
- Replace deprecated ioutil.ReadAll
- Add pre-commit and remove those checks from test step
- Add local module to pre-commit config
- Add release handling
- Update to Go 1.19.5
- Change dependabot rebase strategy
- Update to golang 1.20.1
- Update Go verion for vulnerabilities scan
- Update to Go 1.20.3
- Update Go version and fix gitlabci lint
### Build
- *(deps)* Bump github.com/stretchr/testify from 1.8.0 to 1.8.1
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.1.1 to 0.1.2
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.1.2 to 0.1.3
- *(deps)* Bump github.com/stretchr/testify from 1.8.1 to 1.8.2
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.1.3 to 0.1.4
## [0.1.0] - 2022-07-20
### 🐛 Bug Fixes
- Pipeline
### ⚙️ Miscellaneous Tasks
- Add dependabot config
- *(deps)* Bump gitlab.com/sparetimecoders/goamqp from 0.3.1 to 0.3.2
- *(deps)* Bump github.com/stretchr/testify from 1.4.0 to 1.7.0
- Remove dependabot-standalone
- Change to codecov binary instead of bash uploader
- *(deps)* Bump gitlab.com/sparetimecoders/goamqp from 0.3.2 to 0.4.0
- Switch to moved goamqp
### Build
- Add params to codecov
- *(deps)* Bump github.com/stretchr/testify from 1.7.0 to 1.7.1
- *(deps)* Bump gitlab.com/sparetimecoders/goamqp from 0.4.0 to 0.5.0
- *(deps)* Bump github.com/stretchr/testify from 1.7.1 to 1.7.2
- *(deps)* Bump github.com/stretchr/testify from 1.7.2 to 1.7.4
- *(deps)* Bump github.com/stretchr/testify from 1.7.4 to 1.7.5
- *(deps)* Bump github.com/stretchr/testify from 1.7.5 to 1.8.0
## [0.0.8] - 2021-05-15
### ⚙️ Miscellaneous Tasks
- Add codecov upload
- Simplify pipeline
- Change coverage badge to codecov.io
- Add CI workflows
- Rename master -> main
- Group imports
- Update to latest version of goamqp
## [0.0.7] - 2020-04-12
### 🐛 Bug Fixes
- Update to Go 1.14 to fix test errors
- Use go mod download
- Sort companies before comparing since map-iteration is not stable
## [0.0.6] - 2020-04-12
### 🐛 Bug Fixes
- Path to repo
### ⚙️ Miscellaneous Tasks
- Add tests
- Modify event structure
## [0.0.5] - 2019-12-31
### 🚀 Features
- Add handling of removed privilege
## [0.0.4] - 2019-12-08
### 🚀 Features
- Add name and registration number to event
## [0.0.3] - 2019-11-22
### 🐛 Bug Fixes
- Print unexpected messages
## [0.0.2] - 2019-11-06
### 🚀 Features
- Initial version
### 🐛 Bug Fixes
- Rename module
<!-- generated by git-cliff -->
+46
View File
@@ -0,0 +1,46 @@
# authz_client
Shared Go library for authorization service client integration.
## Shared Documentation
@../docs/claude/architecture.md
@../docs/claude/go-services.md
@../docs/claude/conventions.md
## Library Information
### Purpose
Provides a client for the authz-service, handling privilege management for users across companies. Used by all microservices that need to check user permissions.
### Usage
```go
import client "gitea.unbound.se/shiny/authz_client"
// Create handler with options
handler := client.New(client.WithBaseURL("http://authz-service"))
// Check user privileges
privileges := handler.Get(email, companyID)
if privileges.Invoicing {
// User has invoicing privileges
}
```
### Privileges
The `CompanyPrivileges` struct contains permission flags:
- `Admin` - Administrative access
- `Company` - Company management
- `Consumer` - Consumer/customer access
- `Time` - Time tracking
- `Invoicing` - Invoice management
- `Accounting` - Accounting access
- `Supplier` - Supplier management
- `Salary` - Salary/payroll access
### Event Handling
Implements `goamqp` message handlers to receive privilege update events from the authz-service, keeping the local privilege cache up-to-date.
-2
View File
@@ -1,3 +1 @@
# Shiny authz-client
[![Build Status](https://gitlab.com/unboundsoftware/shiny/authz-client/badges/master/pipeline.svg)](https://gitlab.com/unboundsoftware/shiny/authz-client/commits/master)[![coverage report](https://gitlab.com/unboundsoftware/shiny/authz-client/badges/master/coverage.svg)](https://gitlab.com/unboundsoftware/shiny/authz-client/commits/master)
+94 -56
View File
@@ -3,9 +3,12 @@ package client
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"reflect"
"sync"
"github.com/sparetimecoders/goamqp"
)
// CompanyPrivileges contains the privileges for a combination of email address and company id
@@ -17,36 +20,16 @@ type CompanyPrivileges struct {
Invoicing bool `json:"invoicing"`
Accounting bool `json:"accounting"`
Supplier bool `json:"supplier"`
}
// PrivilegeAdded is the event sent when a new privilege is added
type PrivilegeAdded struct {
Email string `json:"email"`
CompanyID string `json:"companyId"`
Name string `json:"name"`
RegistrationNumber string `json:"registrationNumber"`
Admin bool `json:"admin"`
Company bool `json:"company"`
Consumer bool `json:"consumer"`
Time bool `json:"time"`
Invoicing bool `json:"invoicing"`
Accounting bool `json:"accounting"`
Supplier bool `json:"supplier"`
}
// PrivilegeRemoved is the event sent when a privilege is removed
type PrivilegeRemoved struct {
Email string `json:"email"`
CompanyID string `json:"companyId"`
Name string `json:"name"`
RegistrationNumber string `json:"registrationNumber"`
Salary bool `json:"salary"`
}
// PrivilegeHandler processes PrivilegeAdded-events and fetches the initial set of privileges from an authz-service
type PrivilegeHandler struct {
*sync.RWMutex
client *http.Client
baseURL string
privileges map[string]map[string]CompanyPrivileges
apiKey string
privileges map[string]map[string]*CompanyPrivileges
}
// OptsFunc is used to configure the PrivilegeHandler
@@ -59,12 +42,20 @@ func WithBaseURL(url string) OptsFunc {
}
}
// WithAPIKey sets an API key used as a Bearer token when fetching privileges
func WithAPIKey(key string) OptsFunc {
return func(handler *PrivilegeHandler) {
handler.apiKey = key
}
}
// New creates a new PrivilegeHandler. Pass OptsFuncs to configure.
func New(opts ...OptsFunc) *PrivilegeHandler {
handler := &PrivilegeHandler{
RWMutex: &sync.RWMutex{},
client: &http.Client{},
baseURL: "http://authz-service",
privileges: map[string]map[string]CompanyPrivileges{},
privileges: map[string]map[string]*CompanyPrivileges{},
}
for _, opt := range opts {
opt(handler)
@@ -74,16 +65,27 @@ func New(opts ...OptsFunc) *PrivilegeHandler {
// Fetch the initial set of privileges from an authz-service
func (h *PrivilegeHandler) Fetch() error {
resp, err := h.client.Get(fmt.Sprintf("%s/authz", h.baseURL))
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/authz", h.baseURL), nil)
if err != nil {
return err
}
buff, err := ioutil.ReadAll(resp.Body)
if h.apiKey != "" {
req.Header.Set("Authorization", "Bearer "+h.apiKey)
}
resp, err := h.client.Do(req)
if err != nil {
return err
}
buff, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
h.Lock()
defer h.Unlock()
err = json.Unmarshal(buff, &h.privileges)
if err != nil {
return err
@@ -91,52 +93,86 @@ func (h *PrivilegeHandler) Fetch() error {
return nil
}
func (h *PrivilegeHandler) Setup() []goamqp.Setup {
return []goamqp.Setup{
goamqp.TransientEventStreamConsumer("User.Added", h.Process, UserAdded{}),
goamqp.TransientEventStreamConsumer("User.Removed", h.Process, UserRemoved{}),
goamqp.TransientEventStreamConsumer("Privilege.Added", h.Process, PrivilegeAdded{}),
goamqp.TransientEventStreamConsumer("Privilege.Removed", h.Process, PrivilegeRemoved{}),
}
}
// Process privilege-related events and update the internal state
func (h *PrivilegeHandler) Process(msg interface{}) bool {
func (h *PrivilegeHandler) Process(msg interface{}, _ goamqp.Headers) (interface{}, error) {
h.Lock()
defer h.Unlock()
switch ev := msg.(type) {
case *UserAdded:
if priv, exists := h.privileges[ev.Email]; exists {
priv[ev.CompanyID] = &CompanyPrivileges{}
} else {
h.privileges[ev.Email] = map[string]*CompanyPrivileges{
ev.CompanyID: {},
}
}
return nil, nil
case *UserRemoved:
if priv, exists := h.privileges[ev.Email]; exists {
delete(priv, ev.CompanyID)
}
return nil, nil
case *PrivilegeAdded:
h.setPrivileges(ev)
return true
h.setPrivileges(ev.Email, ev.CompanyID, ev.Privilege, true)
return nil, nil
case *PrivilegeRemoved:
h.removePrivileges(ev)
return true
h.setPrivileges(ev.Email, ev.CompanyID, ev.Privilege, false)
return nil, nil
default:
fmt.Printf("Got unexpected message type (%s): '%+v'\n", reflect.TypeOf(msg).String(), msg)
return false
return nil, fmt.Errorf("unexpected event type: '%s'", reflect.TypeOf(msg))
}
}
func (h *PrivilegeHandler) setPrivileges(ev *PrivilegeAdded) {
if priv, exists := h.privileges[ev.Email]; exists {
priv[ev.CompanyID] = CompanyPrivileges{
Admin: ev.Admin,
Company: ev.Company,
Consumer: ev.Consumer,
Time: ev.Time,
Invoicing: ev.Invoicing,
Accounting: ev.Accounting,
Supplier: ev.Supplier,
func (h *PrivilegeHandler) setPrivileges(email, companyId string, privilege Privilege, set bool) {
if priv, exists := h.privileges[email]; exists {
if c, exists := priv[companyId]; exists {
switch privilege {
case PrivilegeAdmin:
c.Admin = set
case PrivilegeCompany:
c.Company = set
case PrivilegeConsumer:
c.Consumer = set
case PrivilegeTime:
c.Time = set
case PrivilegeInvoicing:
c.Invoicing = set
case PrivilegeAccounting:
c.Accounting = set
case PrivilegeSupplier:
c.Supplier = set
case PrivilegeSalary:
c.Salary = set
}
} else {
priv[companyId] = &CompanyPrivileges{}
h.setPrivileges(email, companyId, privilege, set)
}
} else {
h.privileges[ev.Email] = map[string]CompanyPrivileges{
ev.CompanyID: {},
}
h.setPrivileges(ev)
}
}
func (h *PrivilegeHandler) removePrivileges(ev *PrivilegeRemoved) {
if priv, exists := h.privileges[ev.Email]; exists {
delete(priv, ev.CompanyID)
h.privileges[email] = map[string]*CompanyPrivileges{}
h.setPrivileges(email, companyId, privilege, set)
}
}
// CompaniesByUser return a slice of company ids matching the provided email and predicate func
func (h *PrivilegeHandler) CompaniesByUser(email string, predicate func(privileges CompanyPrivileges) bool) []string {
h.RLock()
defer h.RUnlock()
var result []string
if p, exists := h.privileges[email]; exists {
for k, v := range p {
if predicate(v) {
if predicate(*v) {
result = append(result, k)
}
}
@@ -146,9 +182,11 @@ func (h *PrivilegeHandler) CompaniesByUser(email string, predicate func(privileg
// IsAllowed return true if the provided predicate return true for the privileges matching the provided email and companyID, return false otherwise
func (h *PrivilegeHandler) IsAllowed(email, companyID string, predicate func(privileges CompanyPrivileges) bool) bool {
h.RLock()
defer h.RUnlock()
if p, exists := h.privileges[email]; exists {
if v, exists := p[companyID]; exists {
return predicate(v)
return predicate(*v)
}
}
+516 -43
View File
@@ -2,18 +2,98 @@ package client
import (
"fmt"
"github.com/stretchr/testify/assert"
"net/http"
"net/http/httptest"
"sort"
"sync"
"testing"
"github.com/sparetimecoders/goamqp"
"github.com/stretchr/testify/assert"
)
func TestPrivilegeHandler_Process_InvalidType(t *testing.T) {
handler := New(WithBaseURL("base"))
result := handler.Process("abc")
result, err := handler.Process("abc", goamqp.Headers{})
assert.False(t, result)
assert.Nil(t, result)
assert.EqualError(t, err, "unexpected event type: 'string'")
}
func TestPrivilegeHandler_Process_PrivilegeRemoved(t *testing.T) {
handler := New(WithBaseURL("base"))
result, err := handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeAdmin,
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
assert.Equal(t, []string{"abc-123"}, companies)
result, err = handler.Process(&PrivilegeRemoved{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeAdmin,
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies = handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
assert.Empty(t, companies)
}
func TestPrivilegeHandler_Process_UserAdded_And_UserRemoved(t *testing.T) {
handler := New(WithBaseURL("base"))
result, err := handler.Process(&UserAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
result, err = handler.Process(&UserAdded{
Email: "jim@example.org",
CompanyID: "abc-456",
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return true
})
sort.Strings(companies)
assert.Equal(t, []string{"abc-123", "abc-456"}, companies)
result, err = handler.Process(&UserRemoved{
Email: "jim@example.org",
CompanyID: "abc-123",
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
result, err = handler.Process(&UserRemoved{
Email: "jim@example.org",
CompanyID: "abc-456",
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies = handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return true
})
assert.Empty(t, companies)
}
func TestPrivilegeHandler_GetCompanies_Email_Not_Found(t *testing.T) {
@@ -29,41 +109,48 @@ func TestPrivilegeHandler_GetCompanies_Email_Not_Found(t *testing.T) {
func TestPrivilegeHandler_GetCompanies_No_Companies_Found(t *testing.T) {
handler := New(WithBaseURL("base"))
result := handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Admin: false,
Company: false,
Consumer: false,
Time: false,
Invoicing: false,
Accounting: false,
Supplier: false,
})
assert.True(t, result)
result, err := handler.Process(&UserAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
assert.Empty(t, companies)
companies = handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return true
})
assert.Equal(t, []string{"abc-123"}, companies)
result, err = handler.Process(&UserRemoved{
Email: "jim@example.org",
CompanyID: "abc-123",
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies = handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return true
})
assert.Empty(t, companies)
}
func TestPrivilegeHandler_GetCompanies_Company_With_Company_Access_Found(t *testing.T) {
handler := New(WithBaseURL("base"))
result := handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Admin: false,
Company: true,
Consumer: false,
Time: false,
Invoicing: false,
Accounting: false,
Supplier: false,
})
assert.True(t, result)
result, err := handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeCompany,
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Company
@@ -75,26 +162,128 @@ func TestPrivilegeHandler_GetCompanies_Company_With_Company_Access_Found(t *test
func TestPrivilegeHandler_GetCompanies_Company_With_Admin_Access_Found(t *testing.T) {
handler := New(WithBaseURL("base"))
result := handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Admin: true,
Company: false,
Consumer: false,
Time: false,
Invoicing: false,
Accounting: false,
Supplier: false,
})
assert.True(t, result)
result, err := handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeConsumer,
}, goamqp.Headers{})
assert.Nil(t, result)
assert.NoError(t, err)
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
return privileges.Consumer
})
assert.Equal(t, []string{"abc-123"}, companies)
}
func TestPrivilegeHandler_IsAllowed_Return_False_If_No_Privileges(t *testing.T) {
handler := New(WithBaseURL("base"))
result := handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Company
})
assert.False(t, result)
}
func TestPrivilegeHandler_IsAllowed_Return_True_If_Privilege_Exists(t *testing.T) {
handler := New(WithBaseURL("base"))
_, _ = handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeTime,
}, goamqp.Headers{})
result := handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Time
})
assert.True(t, result)
_, _ = handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeInvoicing,
}, goamqp.Headers{})
result = handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Invoicing
})
assert.True(t, result)
_, _ = handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeAccounting,
}, goamqp.Headers{})
result = handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Accounting
})
assert.True(t, result)
_, _ = handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeSupplier,
}, goamqp.Headers{})
result = handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Supplier
})
assert.True(t, result)
_, _ = handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: "abc-123",
Privilege: PrivilegeSalary,
}, goamqp.Headers{})
result = handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Salary
})
assert.True(t, result)
}
func TestPrivilegeHandler_Fetch_Sends_Authorization_Header_When_APIKey_Set(t *testing.T) {
var receivedAuth string
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
receivedAuth = r.Header.Get("Authorization")
_, _ = w.Write([]byte("{}"))
}))
defer server.Close()
handler := New(
WithBaseURL(server.URL),
WithAPIKey("my-secret-key"),
)
err := handler.Fetch()
assert.NoError(t, err)
assert.Equal(t, "Bearer my-secret-key", receivedAuth)
}
func TestPrivilegeHandler_Fetch_No_Authorization_Header_Without_APIKey(t *testing.T) {
var receivedAuth string
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
receivedAuth = r.Header.Get("Authorization")
_, _ = w.Write([]byte("{}"))
}))
defer server.Close()
handler := New(WithBaseURL(server.URL))
err := handler.Fetch()
assert.NoError(t, err)
assert.Empty(t, receivedAuth)
}
func TestPrivilegeHandler_Fetch_Error_Response(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(500)
@@ -106,7 +295,7 @@ func TestPrivilegeHandler_Fetch_Error_Response(t *testing.T) {
server.Close()
err := handler.Fetch()
assert.EqualError(t, err, fmt.Sprintf("Get http://%s/authz: dial tcp %s: connect: connection refused", baseURL, baseURL))
assert.EqualError(t, err, fmt.Sprintf("Get \"http://%s/authz\": dial tcp %s: connect: connection refused", baseURL, baseURL))
}
func TestPrivilegeHandler_Fetch_Error_Unreadable_Body(t *testing.T) {
@@ -146,7 +335,8 @@ func TestPrivilegeHandler_Fetch_Valid(t *testing.T) {
"time": true,
"invoicing": true,
"accounting": false,
"supplier": false
"supplier": false,
"salary": true
}
}
}`
@@ -160,7 +350,7 @@ func TestPrivilegeHandler_Fetch_Valid(t *testing.T) {
err := handler.Fetch()
assert.NoError(t, err)
expectedPrivileges := map[string]map[string]CompanyPrivileges{
expectedPrivileges := map[string]map[string]*CompanyPrivileges{
"jim@example.org": {
"00010203-0405-4607-8809-0a0b0c0d0e0f": {
Admin: false,
@@ -170,8 +360,291 @@ func TestPrivilegeHandler_Fetch_Valid(t *testing.T) {
Invoicing: true,
Accounting: false,
Supplier: false,
Salary: true,
},
},
}
assert.Equal(t, expectedPrivileges, handler.privileges)
}
func TestPrivilegeHandler_Fetch_Concurrent_Fetches(t *testing.T) {
privileges := `
{
"jim@example.org": {
"00010203-0405-4607-8809-0a0b0c0d0e0f": {
"admin": false,
"company": true,
"consumer": false,
"time": true,
"invoicing": true,
"accounting": false,
"supplier": false,
"salary": true
}
}
}`
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(privileges))
}))
defer server.Close()
baseURL := server.Listener.Addr().String()
handler := New(WithBaseURL(fmt.Sprintf("http://%s", baseURL)))
// Run multiple Fetch calls concurrently to test thread-safety
var wg sync.WaitGroup
errors := make(chan error, 10)
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
defer wg.Done()
if err := handler.Fetch(); err != nil {
errors <- err
}
}()
}
wg.Wait()
close(errors)
// Check no errors occurred
for err := range errors {
assert.NoError(t, err)
}
// Verify privileges were set correctly
expectedPrivileges := map[string]map[string]*CompanyPrivileges{
"jim@example.org": {
"00010203-0405-4607-8809-0a0b0c0d0e0f": {
Admin: false,
Company: true,
Consumer: false,
Time: true,
Invoicing: true,
Accounting: false,
Supplier: false,
Salary: true,
},
},
}
assert.Equal(t, expectedPrivileges, handler.privileges)
}
func TestPrivilegeHandler_Concurrent_Fetch_And_Read(t *testing.T) {
privileges := `
{
"jim@example.org": {
"abc-123": {
"admin": true,
"company": true,
"consumer": false,
"time": false,
"invoicing": false,
"accounting": false,
"supplier": false,
"salary": false
}
}
}`
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(privileges))
}))
defer server.Close()
baseURL := server.Listener.Addr().String()
handler := New(WithBaseURL(fmt.Sprintf("http://%s", baseURL)))
var wg sync.WaitGroup
errors := make(chan error, 100)
// Start multiple Fetch operations
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
defer wg.Done()
if err := handler.Fetch(); err != nil {
errors <- err
}
}()
}
// Concurrently read privileges while Fetch is running
for i := 0; i < 50; i++ {
wg.Add(1)
go func() {
defer wg.Done()
_ = handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
}()
}
// Concurrently check privileges while Fetch is running
for i := 0; i < 50; i++ {
wg.Add(1)
go func() {
defer wg.Done()
_ = handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
}()
}
wg.Wait()
close(errors)
// Check no errors occurred
for err := range errors {
assert.NoError(t, err)
}
// Verify privileges are correct after all concurrent operations
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
assert.Equal(t, []string{"abc-123"}, companies)
isAllowed := handler.IsAllowed("jim@example.org", "abc-123", func(privileges CompanyPrivileges) bool {
return privileges.Admin && privileges.Company
})
assert.True(t, isAllowed)
}
func TestPrivilegeHandler_Concurrent_Process_And_Read(t *testing.T) {
handler := New(WithBaseURL("base"))
var wg sync.WaitGroup
// Concurrently add privileges via Process
for i := 0; i < 100; i++ {
wg.Add(1)
companyID := fmt.Sprintf("company-%d", i%10)
go func(id string) {
defer wg.Done()
_, _ = handler.Process(&PrivilegeAdded{
Email: "jim@example.org",
CompanyID: id,
Privilege: PrivilegeAdmin,
}, goamqp.Headers{})
}(companyID)
}
// Concurrently read privileges while Process is running
for i := 0; i < 100; i++ {
wg.Add(1)
go func() {
defer wg.Done()
_ = handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
}()
}
wg.Wait()
// Verify all companies were added
companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
sort.Strings(companies)
expected := make([]string, 10)
for i := 0; i < 10; i++ {
expected[i] = fmt.Sprintf("company-%d", i)
}
sort.Strings(expected)
assert.Equal(t, expected, companies)
}
func TestPrivilegeHandler_Concurrent_Multiple_Operations(t *testing.T) {
privileges := `
{
"jim@example.org": {
"initial-company": {
"admin": true,
"company": true,
"consumer": false,
"time": false,
"invoicing": false,
"accounting": false,
"supplier": false,
"salary": false
}
}
}`
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(privileges))
}))
defer server.Close()
baseURL := server.Listener.Addr().String()
handler := New(WithBaseURL(fmt.Sprintf("http://%s", baseURL)))
var wg sync.WaitGroup
// Fetch
for i := 0; i < 5; i++ {
wg.Add(1)
go func() {
defer wg.Done()
_ = handler.Fetch()
}()
}
// Process PrivilegeAdded
for i := 0; i < 20; i++ {
wg.Add(1)
go func(idx int) {
defer wg.Done()
_, _ = handler.Process(&PrivilegeAdded{
Email: "jane@example.org",
CompanyID: fmt.Sprintf("company-%d", idx%5),
Privilege: PrivilegeCompany,
}, goamqp.Headers{})
}(i)
}
// CompaniesByUser reads
for i := 0; i < 50; i++ {
wg.Add(1)
email := "jim@example.org"
if i%2 == 0 {
email = "jane@example.org"
}
go func(e string) {
defer wg.Done()
_ = handler.CompaniesByUser(e, func(privileges CompanyPrivileges) bool {
return privileges.Admin || privileges.Company
})
}(email)
}
// IsAllowed reads
for i := 0; i < 50; i++ {
wg.Add(1)
go func() {
defer wg.Done()
_ = handler.IsAllowed("jim@example.org", "initial-company", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
}()
}
wg.Wait()
// Verify final state is consistent
jimCompanies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Admin
})
assert.Contains(t, jimCompanies, "initial-company")
janeCompanies := handler.CompaniesByUser("jane@example.org", func(privileges CompanyPrivileges) bool {
return privileges.Company
})
sort.Strings(janeCompanies)
expectedJane := []string{"company-0", "company-1", "company-2", "company-3", "company-4"}
assert.Equal(t, expectedJane, janeCompanies)
}
+80
View File
@@ -0,0 +1,80 @@
# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.
[changelog]
# template for the changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# template for the changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# remove the leading and trailing s
trim = true
# postprocessors
postprocessors = [
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
]
# render body even when there are no releases to process
# render_always = true
# output file path
# output = "test.md"
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# Replace issue numbers
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
# Check spelling of the commit with https://github.com/crate-ci/typos
# If the spelling is incorrect, it will be automatically fixed.
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
]
# filter out the commits that are not matched by commit parsers
filter_commits = false
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
+64
View File
@@ -0,0 +1,64 @@
package client
// UserAdded is the event sent when a new user is added to a company
type UserAdded struct {
Email string `json:"email"`
CompanyID string `json:"companyId"`
}
// UserRemoved is the event sent when a user is removed from a company
type UserRemoved struct {
Email string `json:"email"`
CompanyID string `json:"companyId"`
}
// Privilege is an enumeration of all available privileges
type Privilege string
const (
PrivilegeAdmin = "ADMIN"
PrivilegeCompany = "COMPANY"
PrivilegeConsumer = "CONSUMER"
PrivilegeTime = "TIME"
PrivilegeInvoicing = "INVOICING"
PrivilegeAccounting = "ACCOUNTING"
PrivilegeSupplier = "SUPPLIER"
PrivilegeSalary = "SALARY"
)
var AllPrivilege = []Privilege{
PrivilegeAdmin,
PrivilegeCompany,
PrivilegeConsumer,
PrivilegeTime,
PrivilegeInvoicing,
PrivilegeAccounting,
PrivilegeSupplier,
PrivilegeSalary,
}
func (e Privilege) IsValid() bool {
switch e {
case PrivilegeAdmin, PrivilegeCompany, PrivilegeConsumer, PrivilegeTime, PrivilegeInvoicing, PrivilegeAccounting, PrivilegeSupplier, PrivilegeSalary:
return true
}
return false
}
func (e Privilege) String() string {
return string(e)
}
// PrivilegeAdded is the event sent when a new privilege is added
type PrivilegeAdded struct {
Email string `json:"email"`
CompanyID string `json:"companyId"`
Privilege Privilege `json:"privilege"`
}
// PrivilegeRemoved is the event sent when a privilege is removed
type PrivilegeRemoved struct {
Email string `json:"email"`
CompanyID string `json:"companyId"`
Privilege Privilege `json:"privilege"`
}
+110
View File
@@ -0,0 +1,110 @@
package client
import "testing"
func TestPrivilege_IsValid(t *testing.T) {
tests := []struct {
name string
e Privilege
want bool
}{
{
name: "Admin",
e: "ADMIN",
want: true,
},
{
name: "Company",
e: "COMPANY",
want: true,
},
{
name: "Consumer",
e: "CONSUMER",
want: true,
},
{
name: "Time",
e: "TIME",
want: true,
},
{
name: "Invoicing",
e: "INVOICING",
want: true,
},
{
name: "Accounting",
e: "ACCOUNTING",
want: true,
},
{
name: "Supplier",
e: "SUPPLIER",
want: true,
},
{
name: "Invalid",
e: "BLUTTI",
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.e.IsValid(); got != tt.want {
t.Errorf("IsValid() = %v, want %v", got, tt.want)
}
})
}
}
func TestPrivilege_String(t *testing.T) {
tests := []struct {
name string
e Privilege
want string
}{
{
name: "Admin",
e: "ADMIN",
want: "ADMIN",
},
{
name: "Company",
e: "COMPANY",
want: "COMPANY",
},
{
name: "Consumer",
e: "CONSUMER",
want: "CONSUMER",
},
{
name: "Time",
e: "TIME",
want: "TIME",
},
{
name: "Invoicing",
e: "INVOICING",
want: "INVOICING",
},
{
name: "Accounting",
e: "ACCOUNTING",
want: "ACCOUNTING",
},
{
name: "Supplier",
e: "SUPPLIER",
want: "SUPPLIER",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.e.String(); got != tt.want {
t.Errorf("String() = %v, want %v", got, tt.want)
}
})
}
}
+17 -3
View File
@@ -1,5 +1,19 @@
module gitlab.com/unboundsoftware/shiny/authz_client
module gitea.unbound.se/shiny/authz_client
go 1.13
go 1.22.12
require github.com/stretchr/testify v1.4.0
toolchain go1.26.1
require (
github.com/sparetimecoders/goamqp v0.3.3
github.com/stretchr/testify v1.11.1
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rabbitmq/amqp091-go v1.10.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+16 -7
View File
@@ -1,11 +1,20 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/sparetimecoders/goamqp v0.3.3 h1:z/nfTPmrjeU/rIVuNOgsVLCimp3WFoNFvS3ZzXRJ6HE=
github.com/sparetimecoders/goamqp v0.3.3/go.mod h1:W9NRCpWLE+Vruv2dcRSbszNil2O826d2Nv6kAkETW5o=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}