From b49f5be2971d53f8ffbb5df1e9dca42c5311afbf Mon Sep 17 00:00:00 2001 From: Roxana Meixner Date: Wed, 19 Jun 2024 15:14:07 +0200 Subject: [PATCH] upgrade Nerzal/gocloak to v13 --- auth/auth.go | 2 +- auth/auth_test.go | 2 +- auth/example_test.go | 2 +- auth/jwt_test.go | 2 +- client/keycloakJWTReceiverCachedInMemory.go | 2 +- client/keycloakJWTReceiverCachedInMemory_test.go | 2 +- client/keycloakRepository.go | 2 +- go.mod | 3 +-- go.sum | 6 ++---- 9 files changed, 10 insertions(+), 13 deletions(-) diff --git a/auth/auth.go b/auth/auth.go index 58ecafa..0d7f96b 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -11,7 +11,7 @@ import ( "net/url" "strings" - "github.com/Nerzal/gocloak/v12" + "github.com/Nerzal/gocloak/v13" "github.com/golang-jwt/jwt/v5" ) diff --git a/auth/auth_test.go b/auth/auth_test.go index 29f2737..48fd71f 100644 --- a/auth/auth_test.go +++ b/auth/auth_test.go @@ -87,7 +87,7 @@ func TestParseJWT(t *testing.T) { userContext, err := authorizer.ParseJWT(context.Background(), expiredToken) assert.ErrorContains(t, err, "validation of token failed") - assert.ErrorContains(t, err, "Token is expired") + assert.ErrorContains(t, err, "token is expired") assert.Zero(t, userContext) }) diff --git a/auth/example_test.go b/auth/example_test.go index e09a4d2..21b6bbf 100644 --- a/auth/example_test.go +++ b/auth/example_test.go @@ -17,7 +17,7 @@ import ( "net/http" "net/http/httptest" - "github.com/Nerzal/gocloak/v12" + "github.com/Nerzal/gocloak/v13" "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt/v5" "github.com/jarcoal/httpmock" diff --git a/auth/jwt_test.go b/auth/jwt_test.go index 225e420..67c0eae 100644 --- a/auth/jwt_test.go +++ b/auth/jwt_test.go @@ -15,7 +15,7 @@ import ( "os" "testing" - "github.com/Nerzal/gocloak/v12" + "github.com/Nerzal/gocloak/v13" "github.com/golang-jwt/jwt/v5" "github.com/jarcoal/httpmock" "github.com/samber/lo" diff --git a/client/keycloakJWTReceiverCachedInMemory.go b/client/keycloakJWTReceiverCachedInMemory.go index 9a6896d..36a7a91 100644 --- a/client/keycloakJWTReceiverCachedInMemory.go +++ b/client/keycloakJWTReceiverCachedInMemory.go @@ -8,7 +8,7 @@ import ( "fmt" "sync" - "github.com/Nerzal/gocloak/v12" + "github.com/Nerzal/gocloak/v13" "github.com/golang-jwt/jwt/v5" "github.com/rs/zerolog/log" ) diff --git a/client/keycloakJWTReceiverCachedInMemory_test.go b/client/keycloakJWTReceiverCachedInMemory_test.go index 8fcff88..c8a23da 100644 --- a/client/keycloakJWTReceiverCachedInMemory_test.go +++ b/client/keycloakJWTReceiverCachedInMemory_test.go @@ -7,7 +7,7 @@ package client import ( "testing" - "github.com/Nerzal/gocloak/v12" + "github.com/Nerzal/gocloak/v13" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/client/keycloakRepository.go b/client/keycloakRepository.go index 3cb4cce..9ccdeb5 100644 --- a/client/keycloakRepository.go +++ b/client/keycloakRepository.go @@ -7,7 +7,7 @@ package client import ( "context" - "github.com/Nerzal/gocloak/v12" + "github.com/Nerzal/gocloak/v13" ) type IKeycloakRepository interface { diff --git a/go.mod b/go.mod index f0f8c97..22b6c7a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/greenbone/keycloak-client-golang go 1.22 require ( - github.com/Nerzal/gocloak/v12 v12.0.0 + github.com/Nerzal/gocloak/v13 v13.9.0 github.com/gin-gonic/gin v1.10.0 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/jarcoal/httpmock v1.3.1 @@ -25,7 +25,6 @@ require ( github.com/go-playground/validator/v10 v10.22.0 // indirect github.com/go-resty/resty/v2 v2.13.1 // indirect github.com/goccy/go-json v0.10.3 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect diff --git a/go.sum b/go.sum index 7ff71af..f65f8bb 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Nerzal/gocloak/v12 v12.0.0 h1:oOddyLpf+CxdGHFx5bABn4yCAtIGDwJkvJP4hFSospY= -github.com/Nerzal/gocloak/v12 v12.0.0/go.mod h1:EAIc7luf3+dwMMHNWC9/X9vAA+KZJl5qfSWDIu7IlSs= +github.com/Nerzal/gocloak/v13 v13.9.0 h1:YWsJsdM5b0yhM2Ba3MLydiOlujkBry4TtdzfIzSVZhw= +github.com/Nerzal/gocloak/v13 v13.9.0/go.mod h1:YYuDcXZ7K2zKECyVP7pPqjKxx2AzYSpKDj8d6GuyM10= github.com/bytedance/sonic v1.11.8 h1:Zw/j1KfiS+OYTi9lyB3bb0CFxPJVkM17k1wyDG32LRA= github.com/bytedance/sonic v1.11.8/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= @@ -31,8 +31,6 @@ github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96 github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=