79 Commits

Author SHA1 Message Date
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
7 changed files with 94 additions and 58 deletions
+4 -16
View File
@@ -2,27 +2,15 @@ include:
- template: 'Workflows/MergeRequest-Pipelines.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.24.2@sha256:aebb7dfe0e8da97fd4e22f95d2162cc6948f772fa947a00659634ece26cadb5a
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 +30,7 @@ test:
vulnerabilities:
stage: test
image: golang:1.23.2
image: amd64/golang:1.24.2@sha256:aebb7dfe0e8da97fd4e22f95d2162cc6948f772fa947a00659634ece26cadb5a
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: v5.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.0.2
hooks:
- id: golangci-lint-full
- repo: https://github.com/gitleaks/gitleaks
rev: v8.20.0
rev: v8.24.3
hooks:
- id: gitleaks
+48 -31
View File
@@ -2,6 +2,23 @@
All notable changes to this project will be documented in this file.
## [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 +26,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
@@ -18,16 +39,18 @@ All notable changes to this project will be documented in this file.
- 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
@@ -40,30 +63,32 @@ All notable changes to this project will be documented in this file.
- 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
@@ -78,28 +103,13 @@ All notable changes to this project will be documented in this file.
- 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 +119,13 @@ 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
+9
View File
@@ -75,6 +75,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) {
+5 -3
View File
@@ -1,10 +1,12 @@
module gitlab.com/unboundsoftware/shiny/authz_client
go 1.21
go 1.22.12
toolchain go1.24.2
require (
github.com/sparetimecoders/goamqp v0.3.1
github.com/stretchr/testify v1.9.0
github.com/sparetimecoders/goamqp v0.3.2
github.com/stretchr/testify v1.10.0
)
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.2 h1:XdlyUBAJS5RcURw+SnnPjPJJuofddZwQsjAf05VPXvI=
github.com/sparetimecoders/goamqp v0.3.2/go.mod h1:W9NRCpWLE+Vruv2dcRSbszNil2O826d2Nv6kAkETW5o=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
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=