Skip to content

Commit 24e8dbe

Browse files
authored
keycloak plugin (#153)
* keycloak plugin skeleton * revert to golangci/golangci-lint-action@v7 * keycloak user & groups * fix keycloak group * add tests * add roles
1 parent f1eb2f6 commit 24e8dbe

File tree

49 files changed

+1861
-890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1861
-890
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
GO_VERSION: "1.24"
2020
GO_RELEASER_VERSION: "v2.8.2"
2121
GO_LANGCI_LINT_VERSION: "v2.0.2"
22-
GO_TESTSUM_VERSION: "1.11.0"
22+
GO_TESTSUM_VERSION: "1.12.1"
2323

2424
jobs:
2525
test:
@@ -37,6 +37,7 @@ jobs:
3737
- "./plugins/fusionauth"
3838
- "./plugins/google"
3939
- "./plugins/jumpcloud"
40+
- "./plugins/keycloak"
4041
- "./plugins/ldap"
4142
- "./plugins/okta"
4243
- "./plugins/openapi"
@@ -126,7 +127,7 @@ jobs:
126127
ssh-add $HOME/.ssh/id_rsa
127128
-
128129
name: Release
129-
uses: goreleaser/goreleaser-action@v5
130+
uses: goreleaser/goreleaser-action@v6
130131
env:
131132
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132133
HOMEBREW_TAP: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,29 @@ builds:
223223
- -X github.com/{{ .Env.ORG }}/{{ .Env.REPO }}/sdk//version.date={{.Date}}
224224
mod_timestamp: "{{ .CommitTimestamp }}"
225225

226+
- id: ds-load-keycloak
227+
main: ./plugins/keycloak/cmd/ds-load-keycloak
228+
binary: ds-load-keycloak
229+
goos:
230+
- darwin
231+
- linux
232+
- windows
233+
goarch:
234+
- amd64
235+
- arm64
236+
env:
237+
- CGO_ENABLED=0
238+
ignore:
239+
- goos: windows
240+
goarch: arm64
241+
ldflags:
242+
- -s
243+
- -w
244+
- -X github.com/{{ .Env.ORG }}/{{ .Env.REPO }}/sdk/common/version.ver={{.Version}}
245+
- -X github.com/{{ .Env.ORG }}/{{ .Env.REPO }}/sdk/common/version.commit={{.ShortCommit}}
246+
- -X github.com/{{ .Env.ORG }}/{{ .Env.REPO }}/sdk//version.date={{.Date}}
247+
mod_timestamp: "{{ .CommitTimestamp }}"
248+
226249
- id: ds-load-ldap
227250
main: ./plugins/ldap/cmd/ds-load-ldap
228251
binary: ds-load-ldap

cli/go.mod

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/aserto-dev/ds-load/cli
22

3-
go 1.23.7
3+
go 1.23.8
44

5-
toolchain go1.24.1
5+
toolchain go1.24.3
66

77
replace github.com/aserto-dev/ds-load/sdk => ../sdk
88

@@ -15,8 +15,8 @@ require (
1515
github.com/pkg/errors v0.9.1
1616
github.com/rs/zerolog v1.34.0
1717
github.com/stretchr/testify v1.10.0
18-
golang.org/x/sync v0.13.0
19-
google.golang.org/grpc v1.71.1
18+
golang.org/x/sync v0.14.0
19+
google.golang.org/grpc v1.72.0
2020
)
2121

2222
require (
@@ -29,6 +29,7 @@ require (
2929
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
3030
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
3131
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a // indirect
32+
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
3233
github.com/golang/protobuf v1.5.4 // indirect
3334
github.com/google/uuid v1.6.0 // indirect
3435
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
@@ -40,12 +41,18 @@ require (
4041
github.com/mattn/go-isatty v0.0.20 // indirect
4142
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
4243
github.com/pmezard/go-difflib v1.0.0 // indirect
43-
github.com/samber/lo v1.49.1 // indirect
44-
golang.org/x/net v0.39.0 // indirect
45-
golang.org/x/sys v0.32.0 // indirect
46-
golang.org/x/text v0.24.0 // indirect
47-
google.golang.org/genproto/googleapis/api v0.0.0-20250409194420-de1ac958c67a // indirect
48-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250409194420-de1ac958c67a // indirect
44+
github.com/samber/lo v1.50.0 // indirect
45+
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
46+
github.com/zeebo/errs v1.4.0 // indirect
47+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
48+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
49+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
50+
golang.org/x/crypto v0.38.0 // indirect
51+
golang.org/x/net v0.40.0 // indirect
52+
golang.org/x/sys v0.33.0 // indirect
53+
golang.org/x/text v0.25.0 // indirect
54+
google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 // indirect
55+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect
4956
google.golang.org/protobuf v1.36.6 // indirect
5057
gopkg.in/yaml.v3 v3.0.1 // indirect
5158
)

cli/go.sum

Lines changed: 34 additions & 66 deletions
Large diffs are not rendered by default.

go.work

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
go 1.23.7
1+
go 1.23.8
2+
3+
toolchain go1.24.3
24

35
use (
46
./cli
@@ -9,6 +11,7 @@ use (
911
./plugins/fusionauth
1012
./plugins/google
1113
./plugins/jumpcloud
14+
./plugins/keycloak
1215
./plugins/ldap
1316
./plugins/okta
1417
./plugins/openapi

makefile

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ EXT_TMP_DIR := ${EXT_DIR}/tmp
1919
GO_VER := 1.24
2020
VAULT_VER := 1.8.12
2121
SVU_VER := 3.1.0
22-
GOTESTSUM_VER := 1.11.0
22+
GOTESTSUM_VER := 1.12.1
2323
GOLANGCI-LINT_VER := 2.0.2
2424
GORELEASER_VER := 2.8.2
2525
BUF_VER := 1.50.0
@@ -68,7 +68,7 @@ lint:
6868
PHONY: go-mod-tidy
6969
go-mod-tidy:
7070
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
71-
@go work edit -json | jq -r '.Use[].DiskPath' | xargs -I{} bash -c 'cd {} && echo "${PWD}/go.mod" && go mod tidy -go 1.23.7 -v && cd -'
71+
@go work edit -json | jq -r '.Use[].DiskPath' | xargs -I{} bash -c 'cd {} && echo "${PWD}/go.mod" && go mod tidy -go 1.23.8 -v && cd -'
7272

7373
.PHONY: test
7474
test:
@@ -138,23 +138,11 @@ install-buf: ${EXT_BIN_DIR}
138138
@${EXT_BIN_DIR}/buf --version
139139

140140
.PHONY: install-svu
141-
install-svu: install-svu-${GOOS}
141+
install-svu: ${EXT_BIN_DIR} ${EXT_TMP_DIR}
142142
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
143-
@chmod +x ${EXT_BIN_DIR}/svu
143+
@GOBIN=${EXT_BIN_DIR} go install github.com/caarlos0/svu/v3@v${SVU_VER}
144144
@${EXT_BIN_DIR}/svu --version
145145

146-
.PHONY: install-svu-darwin
147-
install-svu-darwin: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
148-
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
149-
@gh release download v${SVU_VER} --repo https://github.com/caarlos0/svu --pattern "*darwin_all.tar.gz" --output "${EXT_TMP_DIR}/svu.tar.gz" --clobber
150-
@tar -xvf ${EXT_TMP_DIR}/svu.tar.gz --directory ${EXT_BIN_DIR} svu &> /dev/null
151-
152-
.PHONY: install-svu-linux
153-
install-svu-linux: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
154-
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
155-
@gh release download v${SVU_VER} --repo https://github.com/caarlos0/svu --pattern "*linux_${GOARCH}.tar.gz" --output "${EXT_TMP_DIR}/svu.tar.gz" --clobber
156-
@tar -xvf ${EXT_TMP_DIR}/svu.tar.gz --directory ${EXT_BIN_DIR} svu &> /dev/null
157-
158146
.PHONY: install-gotestsum
159147
install-gotestsum: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
160148
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"

plugins/auth0/go.mod

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module github.com/aserto-dev/ds-load/plugins/auth0
22

3-
go 1.23.7
3+
go 1.23.8
44

5-
toolchain go1.24.1
5+
toolchain go1.24.3
66

77
replace github.com/aserto-dev/ds-load/sdk => ../../sdk
88

99
require (
1010
github.com/alecthomas/kong v1.10.0
1111
github.com/aserto-dev/ds-load/sdk v0.0.0-20250408143332-e8965667fcc0
12-
github.com/auth0/go-auth0 v1.19.0
12+
github.com/auth0/go-auth0 v1.20.0
1313
github.com/pkg/errors v0.9.1
14-
github.com/samber/lo v1.49.1
14+
github.com/samber/lo v1.50.0
1515
)
1616

1717
require (
@@ -22,26 +22,38 @@ require (
2222
github.com/PuerkitoBio/rehttp v1.4.0 // indirect
2323
github.com/aserto-dev/go-directory v0.33.10 // indirect
2424
github.com/aserto-dev/logger v0.0.9 // indirect
25+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
2526
github.com/dongri/phonenumber v0.1.12 // indirect
27+
github.com/goccy/go-json v0.10.5 // indirect
2628
github.com/google/uuid v1.6.0 // indirect
2729
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
2830
github.com/huandu/xstrings v1.5.0 // indirect
31+
github.com/lestrrat-go/blackmagic v1.0.3 // indirect
32+
github.com/lestrrat-go/httpcc v1.0.1 // indirect
33+
github.com/lestrrat-go/httprc v1.0.6 // indirect
34+
github.com/lestrrat-go/iter v1.0.2 // indirect
35+
github.com/lestrrat-go/jwx/v2 v2.1.6 // indirect
36+
github.com/lestrrat-go/option v1.0.1 // indirect
2937
github.com/mattn/go-colorable v0.1.14 // indirect
3038
github.com/mattn/go-isatty v0.0.20 // indirect
3139
github.com/mitchellh/copystructure v1.2.0 // indirect
3240
github.com/mitchellh/reflectwalk v1.0.2 // indirect
3341
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
3442
github.com/rs/zerolog v1.34.0 // indirect
43+
github.com/segmentio/asm v1.2.0 // indirect
3544
github.com/shopspring/decimal v1.4.0 // indirect
3645
github.com/spf13/cast v1.7.1 // indirect
37-
golang.org/x/crypto v0.37.0 // indirect
38-
golang.org/x/net v0.39.0 // indirect
39-
golang.org/x/oauth2 v0.29.0 // indirect
40-
golang.org/x/sys v0.32.0 // indirect
41-
golang.org/x/text v0.24.0 // indirect
42-
google.golang.org/genproto/googleapis/api v0.0.0-20250409194420-de1ac958c67a // indirect
43-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250409194420-de1ac958c67a // indirect
44-
google.golang.org/grpc v1.71.1 // indirect
46+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
47+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
48+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
49+
golang.org/x/crypto v0.38.0 // indirect
50+
golang.org/x/net v0.40.0 // indirect
51+
golang.org/x/oauth2 v0.30.0 // indirect
52+
golang.org/x/sys v0.33.0 // indirect
53+
golang.org/x/text v0.25.0 // indirect
54+
google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 // indirect
55+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect
56+
google.golang.org/grpc v1.72.0 // indirect
4557
google.golang.org/protobuf v1.36.6 // indirect
4658
gopkg.in/yaml.v3 v3.0.1 // indirect
4759
)

0 commit comments

Comments
 (0)