124 Commits

Author SHA1 Message Date
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
9 changed files with 125 additions and 74 deletions
+6 -16
View File
@@ -1,28 +1,18 @@
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
- project: unboundsoftware/ci-templates
file: Defaults.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Release.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Pre-Commit-Go.gitlab-ci.yml
image: golang:1.23.2
image: amd64/golang:1.25.1@sha256:70de49a6a9bfd1bde2b332fde29d04a8cc65047464fa97ddb94251b05e572bc0
stages:
- deps
- test
run-pre-commit:
stage: .pre
image: unbound/pre-commit
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
- key:
files:
- .pre-commit-config.yaml
paths:
- ${PRE_COMMIT_HOME}
script:
- pre-commit run --all-files
deps:
stage: deps
script:
@@ -42,7 +32,7 @@ test:
vulnerabilities:
stage: test
image: golang:1.23.2
image: amd64/golang:1.25.1@sha256:70de49a6a9bfd1bde2b332fde29d04a8cc65047464fa97ddb94251b05e572bc0
script:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
+20
View File
@@ -1,2 +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$
+4 -4
View File
@@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -18,7 +18,7 @@ repos:
- --project
- unboundsoftware/shiny/authz_client
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.18.0
rev: v9.22.0
hooks:
- id: commitlint
stages: [ commit-msg ]
@@ -37,10 +37,10 @@ repos:
- id: go-test
- id: gofumpt
- repo: https://github.com/golangci/golangci-lint
rev: v1.61.0
rev: v2.4.0
hooks:
- id: golangci-lint-full
- repo: https://github.com/gitleaks/gitleaks
rev: v8.20.0
rev: v8.28.0
hooks:
- id: gitleaks
+56 -45
View File
@@ -1,7 +1,31 @@
# Changelog
## [0.3.0] - 2025-09-06
All notable changes to this project will be documented in this file.
### 🚀 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
## [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
## [0.1.4] - 2024-10-05
### 🐛 Bug Fixes
@@ -9,6 +33,10 @@ All notable changes to this project will be documented in this file.
- *(deps)* Update module github.com/stretchr/testify to v1.9.0
- *(deps)* Update module github.com/sparetimecoders/goamqp to v0.3.1
### 💼 Other
- *(deps)* Bump github.com/sparetimecoders/goamqp from 0.2.1 to 0.3.0
### ⚙️ Miscellaneous Tasks
- Update to Go 1.21.6
@@ -17,17 +45,18 @@ All notable changes to this project will be documented in this file.
- Update golangci-lint to use full version
- 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
### 💼 Other
- *(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
### ⚙️ Miscellaneous Tasks
- Update Go version
@@ -39,31 +68,31 @@ All notable changes to this project will be documented in this file.
- 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
### 💼 Other
- *(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
### ⚙️ 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
### 💼 Other
- *(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
### ⚙️ Miscellaneous Tasks
- Add vulnerability-check
@@ -77,29 +106,13 @@ All notable changes to this project will be documented in this file.
- 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
- Remove dependabot-standalone
- Change to codecov binary instead of bash uploader
- Switch to moved goamqp
### Build
### 💼 Other
- Add params to codecov
- *(deps)* Bump github.com/stretchr/testify from 1.7.0 to 1.7.1
@@ -109,6 +122,12 @@ All notable changes to this project will be documented in this file.
- *(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
### ⚙️ Miscellaneous Tasks
- Add dependabot config
- Remove dependabot-standalone
- Change to codecov binary instead of bash uploader
- Switch to moved goamqp
## [0.0.8] - 2021-05-15
### ⚙️ Miscellaneous Tasks
@@ -120,7 +139,6 @@ All notable changes to this project will be documented in this file.
- Rename master -> main
- Group imports
- Update to latest version of goamqp
## [0.0.7] - 2020-04-12
### 🐛 Bug Fixes
@@ -128,7 +146,6 @@ All notable changes to this project will be documented in this file.
- 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
@@ -139,25 +156,21 @@ All notable changes to this project will be documented in this file.
- 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
@@ -167,5 +180,3 @@ All notable changes to this project will be documented in this file.
### 🐛 Bug Fixes
- Rename module
<!-- generated by git-cliff -->
+12
View File
@@ -20,6 +20,7 @@ type CompanyPrivileges struct {
Invoicing bool `json:"invoicing"`
Accounting bool `json:"accounting"`
Supplier bool `json:"supplier"`
Salary bool `json:"salary"`
}
// PrivilegeHandler processes PrivilegeAdded-events and fetches the initial set of privileges from an authz-service
@@ -75,6 +76,15 @@ 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{}, _ goamqp.Headers) (interface{}, error) {
switch ev := msg.(type) {
@@ -130,6 +140,8 @@ func (h *PrivilegeHandler) setPrivileges(email, companyId string, privilege Priv
c.Accounting = set
case PrivilegeSupplier:
c.Supplier = set
case PrivilegeSalary:
c.Salary = set
}
} else {
priv[companyId] = &CompanyPrivileges{}
+15 -1
View File
@@ -236,6 +236,18 @@ func TestPrivilegeHandler_IsAllowed_Return_True_If_Privilege_Exists(t *testing.T
})
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_Error_Response(t *testing.T) {
@@ -289,7 +301,8 @@ func TestPrivilegeHandler_Fetch_Valid(t *testing.T) {
"time": true,
"invoicing": true,
"accounting": false,
"supplier": false
"supplier": false,
"salary": true
}
}
}`
@@ -313,6 +326,7 @@ func TestPrivilegeHandler_Fetch_Valid(t *testing.T) {
Invoicing: true,
Accounting: false,
Supplier: false,
Salary: true,
},
},
}
+3 -1
View File
@@ -23,6 +23,7 @@ const (
PrivilegeInvoicing = "INVOICING"
PrivilegeAccounting = "ACCOUNTING"
PrivilegeSupplier = "SUPPLIER"
PrivilegeSalary = "SALARY"
)
var AllPrivilege = []Privilege{
@@ -33,11 +34,12 @@ var AllPrivilege = []Privilege{
PrivilegeInvoicing,
PrivilegeAccounting,
PrivilegeSupplier,
PrivilegeSalary,
}
func (e Privilege) IsValid() bool {
switch e {
case PrivilegeAdmin, PrivilegeCompany, PrivilegeConsumer, PrivilegeTime, PrivilegeInvoicing, PrivilegeAccounting, PrivilegeSupplier:
case PrivilegeAdmin, PrivilegeCompany, PrivilegeConsumer, PrivilegeTime, PrivilegeInvoicing, PrivilegeAccounting, PrivilegeSupplier, PrivilegeSalary:
return true
}
return false
+5 -3
View File
@@ -1,10 +1,12 @@
module gitlab.com/unboundsoftware/shiny/authz_client
go 1.21
go 1.22.12
toolchain go1.25.1
require (
github.com/sparetimecoders/goamqp v0.3.1
github.com/stretchr/testify v1.9.0
github.com/sparetimecoders/goamqp v0.3.3
github.com/stretchr/testify v1.11.1
)
require (
+4 -4
View File
@@ -8,10 +8,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
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.1 h1:NCzdyAz84G679HlO+ivhyoI1aMgXEe3qfqpn4EChu1s=
github.com/sparetimecoders/goamqp v0.3.1/go.mod h1:PjkgrmsuMVgRbiQDTLs0pCWYrcQgqcUee38JjCDZdlk=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
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=