From 5fe2e2c15033e2440e9eb1bbf2e48b45d76d3989 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 10:38:21 +0100 Subject: [PATCH 01/12] Feature: #321 ComponentConfig now is a map[string]string to generalize it's usage --- model_test.go | 1 - models.go | 21 +++++++-------------- run-tests.sh | 4 ++-- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/model_test.go b/model_test.go index 88458df4..92fd334f 100644 --- a/model_test.go +++ b/model_test.go @@ -222,7 +222,6 @@ func TestStringerOmitEmpty(t *testing.T) { &gocloak.User{}, &gocloak.SetPasswordRequest{}, &gocloak.Component{}, - &gocloak.ComponentConfig{}, &gocloak.KeyStoreConfig{}, &gocloak.ActiveKeys{}, &gocloak.Key{}, diff --git a/models.go b/models.go index 81d23581..1bc32ce2 100644 --- a/models.go +++ b/models.go @@ -197,19 +197,13 @@ type SetPasswordRequest struct { // Component is a component type Component struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ProviderID *string `json:"providerId,omitempty"` - ProviderType *string `json:"providerType,omitempty"` - ParentID *string `json:"parentId,omitempty"` - ComponentConfig *ComponentConfig `json:"config,omitempty"` - SubType *string `json:"subType,omitempty"` -} - -// ComponentConfig is a componentconfig -type ComponentConfig struct { - Priority *[]string `json:"priority,omitempty"` - Algorithm *[]string `json:"algorithm,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ProviderID *string `json:"providerId,omitempty"` + ProviderType *string `json:"providerType,omitempty"` + ParentID *string `json:"parentId,omitempty"` + ComponentConfig *map[string]string `json:"config,omitempty"` + SubType *string `json:"subType,omitempty"` } // KeyStoreConfig holds the keyStoreConfig @@ -1251,7 +1245,6 @@ func (v *RetrospecTokenResult) String() string { return pre func (v *User) String() string { return prettyStringStruct(v) } func (v *SetPasswordRequest) String() string { return prettyStringStruct(v) } func (v *Component) String() string { return prettyStringStruct(v) } -func (v *ComponentConfig) String() string { return prettyStringStruct(v) } func (v *KeyStoreConfig) String() string { return prettyStringStruct(v) } func (v *ActiveKeys) String() string { return prettyStringStruct(v) } func (v *Key) String() string { return prettyStringStruct(v) } diff --git a/run-tests.sh b/run-tests.sh index 9bb7dc51..14d31e33 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash docker-compose down docker-compose up -d -sleep 10 +sleep 30 ARGS=() if [ $# -gt 0 ]; then From fda479b18048ee3e82d18522ca51461897e47022 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 10:48:28 +0100 Subject: [PATCH 02/12] changed module name --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 02cbd14c..9e6fa632 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/Nerzal/gocloak/v10 +module github.com/doktormerlin/gocloak/v10 go 1.15 From 1e86aa5cca123f06b7dd68c93c2f5aa0b8d73fad Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 10:51:37 +0100 Subject: [PATCH 03/12] changed all nerzal to doktormerlin --- .github/workflows/go.yml | 2 +- .golangci.yml | 2 +- README.md | 30 +++++++++++++++--------------- client.go | 2 +- client_benchmark_test.go | 2 +- client_test.go | 2 +- model_test.go | 2 +- utils_test.go | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9dd3440f..b6c225f5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -56,4 +56,4 @@ jobs: # Updating go report card for main branch only - name: GoReportCard if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: curl --fail --request POST "https://goreportcard.com/checks" --data "repo=github.com/Nerzal/gocloak" + run: curl --fail --request POST "https://goreportcard.com/checks" --data "repo=github.com/doktormerlin/gocloak" diff --git a/.golangci.yml b/.golangci.yml index 5922af33..880bba6c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,7 +24,7 @@ linters-settings: govet: check-shadowing: false goimports: - local-prefixes: github.com/Nerzal/gocloak + local-prefixes: github.com/doktormerlin/gocloak gocognit: min-complexity: 15 gocyclo: diff --git a/README.md b/README.md index 7093c950..32c290d0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # gocloak -[![codebeat badge](https://codebeat.co/badges/18a37f35-6a95-4e40-9e78-272233892332)](https://codebeat.co/projects/github-com-nerzal-gocloak-main) -[![Go Report Card](https://goreportcard.com/badge/github.com/Nerzal/gocloak)](https://goreportcard.com/report/github.com/Nerzal/gocloak) -[![Go Doc](https://godoc.org/github.com/Nerzal/gocloak?status.svg)](https://godoc.org/github.com/Nerzal/gocloak) -[![Build Status](https://github.com/Nerzal/gocloak/workflows/Tests/badge.svg)](https://github.com/Nerzal/gocloak/actions?query=branch%3Amain+event%3Apush) -[![GitHub release](https://img.shields.io/github/tag/Nerzal/gocloak.svg)](https://GitHub.com/Nerzal/gocloak/releases/) -[![codecov](https://codecov.io/gh/Nerzal/gocloak/branch/master/graph/badge.svg)](https://codecov.io/gh/Nerzal/gocloak) -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNerzal%2Fgocloak.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FNerzal%2Fgocloak?ref=badge_shield) +[![codebeat badge](https://codebeat.co/badges/18a37f35-6a95-4e40-9e78-272233892332)](https://codebeat.co/projects/github-com-doktormerlin-gocloak-main) +[![Go Report Card](https://goreportcard.com/badge/github.com/doktormerlin/gocloak)](https://goreportcard.com/report/github.com/doktormerlin/gocloak) +[![Go Doc](https://godoc.org/github.com/doktormerlin/gocloak?status.svg)](https://godoc.org/github.com/doktormerlin/gocloak) +[![Build Status](https://github.com/doktormerlin/gocloak/workflows/Tests/badge.svg)](https://github.com/doktormerlin/gocloak/actions?query=branch%3Amain+event%3Apush) +[![GitHub release](https://img.shields.io/github/tag/doktormerlin/gocloak.svg)](https://GitHub.com/doktormerlin/gocloak/releases/) +[![codecov](https://codecov.io/gh/doktormerlin/gocloak/branch/master/graph/badge.svg)](https://codecov.io/gh/doktormerlin/gocloak) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak?ref=badge_shield) Golang Keycloak API Package @@ -14,13 +14,13 @@ This client is based on: [go-keycloak](https://github.com/PhilippHeuer/go-keyclo For Questions either raise an issue, or come to the [gopher-slack](https://invite.slack.golangbridge.org/) into the channel [#gocloak](https://gophers.slack.com/app_redirect?channel=gocloak) -If u are using the echo framework have a look at [gocloak-echo](https://github.com/Nerzal/gocloak-echo) +If u are using the echo framework have a look at [gocloak-echo](https://github.com/doktormerlin/gocloak-echo) -Benchmarks can be found [here](https://nerzal.github.io/gocloak/dev/bench/) +Benchmarks can be found [here](https://doktormerlin.github.io/gocloak/dev/bench/) ## Contribution -(WIP) +(WIP) ## Changelog @@ -65,7 +65,7 @@ Bugfix: #305 Fix function signature of LoginClientTokenExchange function #### V9.0.1 Breaking changes were introduced in #285 -See: https://github.com/Nerzal/gocloak/pull/285/files +See: https://github.com/doktormerlin/gocloak/pull/285/files New Features: - #301 adding APIs handler to fetch policy resources @@ -116,7 +116,7 @@ There are several backward incompatible changes There is only one change, but it's backward incompatible: -- Wrap Errors and use APIError struct to also provide the httpstatus code. ([#146](https://github.com/Nerzal/gocloak/pull/146)) +- Wrap Errors and use APIError struct to also provide the httpstatus code. ([#146](https://github.com/doktormerlin/gocloak/pull/146)) ### v4 @@ -130,13 +130,13 @@ There are a lot of backward incompatible changes: ### Installation ```shell -go get github.com/Nerzal/10 +go get github.com/doktormerlin/10 ``` ### Importing ```go - import "github.com/Nerzal/gocloak/v10" + import "github.com/doktormerlin/gocloak/v10" ``` ### Create New User @@ -564,7 +564,7 @@ Note that empty parameters are not included, because of the use of ```omitempty` ## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNerzal%2Fgocloak.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FNerzal%2Fgocloak?ref=badge_large) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak?ref=badge_large) ## Related Projects diff --git a/client.go b/client.go index 71c0319f..d2c45341 100644 --- a/client.go +++ b/client.go @@ -17,7 +17,7 @@ import ( "github.com/pkg/errors" "github.com/segmentio/ksuid" - "github.com/Nerzal/gocloak/v10/pkg/jwx" + "github.com/doktormerlin/gocloak/v10/pkg/jwx" ) type gocloak struct { diff --git a/client_benchmark_test.go b/client_benchmark_test.go index c5265097..2cc45158 100644 --- a/client_benchmark_test.go +++ b/client_benchmark_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/Nerzal/gocloak/v10" + "github.com/doktormerlin/gocloak/v10" "github.com/stretchr/testify/assert" ) diff --git a/client_test.go b/client_test.go index 45d0f09c..a0f4b03e 100644 --- a/client_test.go +++ b/client_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/pkcs12" - "github.com/Nerzal/gocloak/v10" + "github.com/doktormerlin/gocloak/v10" ) type configAdmin struct { diff --git a/model_test.go b/model_test.go index 92fd334f..6aba6701 100644 --- a/model_test.go +++ b/model_test.go @@ -5,7 +5,7 @@ import ( "errors" "testing" - "github.com/Nerzal/gocloak/v10" + "github.com/doktormerlin/gocloak/v10" "github.com/stretchr/testify/assert" ) diff --git a/utils_test.go b/utils_test.go index c1db3faf..f0258061 100644 --- a/utils_test.go +++ b/utils_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/Nerzal/gocloak/v10" + "github.com/doktormerlin/gocloak/v10" ) func TestStringP(t *testing.T) { From a7a23728877a70c591d32037a66b62b9941bebb6 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 10:53:41 +0100 Subject: [PATCH 04/12] added replacement directive --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 9e6fa632..a1a95645 100644 --- a/go.mod +++ b/go.mod @@ -13,3 +13,5 @@ require ( golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) + +replace github.com/Nerzal/gocloak/v10 => github.com/doktormerlin/gocloak/v10 \ No newline at end of file From d2759a445e1d392092839e18856e1110aa690b83 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 10:54:17 +0100 Subject: [PATCH 05/12] Added newline to end of file --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a1a95645..73021cac 100644 --- a/go.mod +++ b/go.mod @@ -14,4 +14,4 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -replace github.com/Nerzal/gocloak/v10 => github.com/doktormerlin/gocloak/v10 \ No newline at end of file +replace github.com/Nerzal/gocloak/v10 => github.com/doktormerlin/gocloak/v10 From 33346142daf969736ae66bee837e22c23b0450f6 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 11:01:38 +0100 Subject: [PATCH 06/12] removed replacement directive --- go.mod | 2 -- go.sum | 21 --------------------- 2 files changed, 23 deletions(-) diff --git a/go.mod b/go.mod index 73021cac..9e6fa632 100644 --- a/go.mod +++ b/go.mod @@ -13,5 +13,3 @@ require ( golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) - -replace github.com/Nerzal/gocloak/v10 => github.com/doktormerlin/gocloak/v10 diff --git a/go.sum b/go.sum index 1a7b4fd5..08d51aa9 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ 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/go-resty/resty/v2 v2.3.0 h1:JOOeAvjSlapTT92p8xiS19Zxev1neGikoHsXJeOq8So= -github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= github.com/go-resty/resty/v2 v2.6.0 h1:joIR5PNLM2EFqqESUjCMGXrWmXNHEU9CEiK813oKYS4= github.com/go-resty/resty/v2 v2.6.0/go.mod h1:PwvJS6hvaPkjtjNg9ph+VrSD92bi5Zq73w/BIH7cC3Q= github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= @@ -12,47 +10,28 @@ 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/segmentio/ksuid v1.0.3 h1:FoResxvleQwYiPAVKe1tMUlEirodZqlqglIuFsdDntY= -github.com/segmentio/ksuid v1.0.3/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b h1:eB48h3HiRycXNy8E0Gf5e0hv7YT6Kt14L/D73G1fuwo= golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From fa984045ea35b6efc06b19e7eab3afb767dd9db7 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 13:00:25 +0100 Subject: [PATCH 07/12] map[string]string now map[string][]string in ComponentConfig --- models.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/models.go b/models.go index 1bc32ce2..5c8d5d38 100644 --- a/models.go +++ b/models.go @@ -197,13 +197,13 @@ type SetPasswordRequest struct { // Component is a component type Component struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ProviderID *string `json:"providerId,omitempty"` - ProviderType *string `json:"providerType,omitempty"` - ParentID *string `json:"parentId,omitempty"` - ComponentConfig *map[string]string `json:"config,omitempty"` - SubType *string `json:"subType,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ProviderID *string `json:"providerId,omitempty"` + ProviderType *string `json:"providerType,omitempty"` + ParentID *string `json:"parentId,omitempty"` + ComponentConfig *map[string][]string `json:"config,omitempty"` + SubType *string `json:"subType,omitempty"` } // KeyStoreConfig holds the keyStoreConfig From 588bf1d0b57a38fc06b3467384e714045bda18a7 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 14:22:29 +0100 Subject: [PATCH 08/12] Changed ComponentConfig to be a map[string][]string instead of its own struct --- model_test.go | 1 - models.go | 21 +++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/model_test.go b/model_test.go index 88458df4..92fd334f 100644 --- a/model_test.go +++ b/model_test.go @@ -222,7 +222,6 @@ func TestStringerOmitEmpty(t *testing.T) { &gocloak.User{}, &gocloak.SetPasswordRequest{}, &gocloak.Component{}, - &gocloak.ComponentConfig{}, &gocloak.KeyStoreConfig{}, &gocloak.ActiveKeys{}, &gocloak.Key{}, diff --git a/models.go b/models.go index 81d23581..5c8d5d38 100644 --- a/models.go +++ b/models.go @@ -197,19 +197,13 @@ type SetPasswordRequest struct { // Component is a component type Component struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ProviderID *string `json:"providerId,omitempty"` - ProviderType *string `json:"providerType,omitempty"` - ParentID *string `json:"parentId,omitempty"` - ComponentConfig *ComponentConfig `json:"config,omitempty"` - SubType *string `json:"subType,omitempty"` -} - -// ComponentConfig is a componentconfig -type ComponentConfig struct { - Priority *[]string `json:"priority,omitempty"` - Algorithm *[]string `json:"algorithm,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ProviderID *string `json:"providerId,omitempty"` + ProviderType *string `json:"providerType,omitempty"` + ParentID *string `json:"parentId,omitempty"` + ComponentConfig *map[string][]string `json:"config,omitempty"` + SubType *string `json:"subType,omitempty"` } // KeyStoreConfig holds the keyStoreConfig @@ -1251,7 +1245,6 @@ func (v *RetrospecTokenResult) String() string { return pre func (v *User) String() string { return prettyStringStruct(v) } func (v *SetPasswordRequest) String() string { return prettyStringStruct(v) } func (v *Component) String() string { return prettyStringStruct(v) } -func (v *ComponentConfig) String() string { return prettyStringStruct(v) } func (v *KeyStoreConfig) String() string { return prettyStringStruct(v) } func (v *ActiveKeys) String() string { return prettyStringStruct(v) } func (v *Key) String() string { return prettyStringStruct(v) } From 87a4153f8c391a664c09ad87150a183db5b3477b Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 14:55:08 +0100 Subject: [PATCH 09/12] Fixed issues caused by renaming. Go and forking just doesnt go well together --- .github/workflows/go.yml | 2 +- .golangci.yml | 2 +- README.md | 30 +++++++++++++++--------------- client.go | 2 +- client_benchmark_test.go | 2 +- client_test.go | 2 +- go.mod | 2 +- model_test.go | 2 +- utils_test.go | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b6c225f5..9dd3440f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -56,4 +56,4 @@ jobs: # Updating go report card for main branch only - name: GoReportCard if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: curl --fail --request POST "https://goreportcard.com/checks" --data "repo=github.com/doktormerlin/gocloak" + run: curl --fail --request POST "https://goreportcard.com/checks" --data "repo=github.com/Nerzal/gocloak" diff --git a/.golangci.yml b/.golangci.yml index 880bba6c..5922af33 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,7 +24,7 @@ linters-settings: govet: check-shadowing: false goimports: - local-prefixes: github.com/doktormerlin/gocloak + local-prefixes: github.com/Nerzal/gocloak gocognit: min-complexity: 15 gocyclo: diff --git a/README.md b/README.md index 32c290d0..79db8edf 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # gocloak -[![codebeat badge](https://codebeat.co/badges/18a37f35-6a95-4e40-9e78-272233892332)](https://codebeat.co/projects/github-com-doktormerlin-gocloak-main) -[![Go Report Card](https://goreportcard.com/badge/github.com/doktormerlin/gocloak)](https://goreportcard.com/report/github.com/doktormerlin/gocloak) -[![Go Doc](https://godoc.org/github.com/doktormerlin/gocloak?status.svg)](https://godoc.org/github.com/doktormerlin/gocloak) -[![Build Status](https://github.com/doktormerlin/gocloak/workflows/Tests/badge.svg)](https://github.com/doktormerlin/gocloak/actions?query=branch%3Amain+event%3Apush) -[![GitHub release](https://img.shields.io/github/tag/doktormerlin/gocloak.svg)](https://GitHub.com/doktormerlin/gocloak/releases/) -[![codecov](https://codecov.io/gh/doktormerlin/gocloak/branch/master/graph/badge.svg)](https://codecov.io/gh/doktormerlin/gocloak) -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak?ref=badge_shield) +[![codebeat badge](https://codebeat.co/badges/18a37f35-6a95-4e40-9e78-272233892332)](https://codebeat.co/projects/github-com-Nerzal-gocloak-main) +[![Go Report Card](https://goreportcard.com/badge/github.com/Nerzal/gocloak)](https://goreportcard.com/report/github.com/Nerzal/gocloak) +[![Go Doc](https://godoc.org/github.com/Nerzal/gocloak?status.svg)](https://godoc.org/github.com/Nerzal/gocloak) +[![Build Status](https://github.com/Nerzal/gocloak/workflows/Tests/badge.svg)](https://github.com/Nerzal/gocloak/actions?query=branch%3Amain+event%3Apush) +[![GitHub release](https://img.shields.io/github/tag/Nerzal/gocloak.svg)](https://GitHub.com/Nerzal/gocloak/releases/) +[![codecov](https://codecov.io/gh/Nerzal/gocloak/branch/master/graph/badge.svg)](https://codecov.io/gh/Nerzal/gocloak) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNerzal%2Fgocloak.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FNerzal%2Fgocloak?ref=badge_shield) Golang Keycloak API Package @@ -14,13 +14,13 @@ This client is based on: [go-keycloak](https://github.com/PhilippHeuer/go-keyclo For Questions either raise an issue, or come to the [gopher-slack](https://invite.slack.golangbridge.org/) into the channel [#gocloak](https://gophers.slack.com/app_redirect?channel=gocloak) -If u are using the echo framework have a look at [gocloak-echo](https://github.com/doktormerlin/gocloak-echo) +If u are using the echo framework have a look at [gocloak-echo](https://github.com/Nerzal/gocloak-echo) -Benchmarks can be found [here](https://doktormerlin.github.io/gocloak/dev/bench/) +Benchmarks can be found [here](https://Nerzal.github.io/gocloak/dev/bench/) ## Contribution -(WIP) +(WIP) ## Changelog @@ -65,7 +65,7 @@ Bugfix: #305 Fix function signature of LoginClientTokenExchange function #### V9.0.1 Breaking changes were introduced in #285 -See: https://github.com/doktormerlin/gocloak/pull/285/files +See: https://github.com/Nerzal/gocloak/pull/285/files New Features: - #301 adding APIs handler to fetch policy resources @@ -116,7 +116,7 @@ There are several backward incompatible changes There is only one change, but it's backward incompatible: -- Wrap Errors and use APIError struct to also provide the httpstatus code. ([#146](https://github.com/doktormerlin/gocloak/pull/146)) +- Wrap Errors and use APIError struct to also provide the httpstatus code. ([#146](https://github.com/Nerzal/gocloak/pull/146)) ### v4 @@ -130,13 +130,13 @@ There are a lot of backward incompatible changes: ### Installation ```shell -go get github.com/doktormerlin/10 +go get github.com/Nerzal/10 ``` ### Importing ```go - import "github.com/doktormerlin/gocloak/v10" + import "github.com/Nerzal/gocloak/v10" ``` ### Create New User @@ -564,7 +564,7 @@ Note that empty parameters are not included, because of the use of ```omitempty` ## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdoktormerlin%2Fgocloak?ref=badge_large) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNerzal%2Fgocloak.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FNerzal%2Fgocloak?ref=badge_large) ## Related Projects diff --git a/client.go b/client.go index d2c45341..71c0319f 100644 --- a/client.go +++ b/client.go @@ -17,7 +17,7 @@ import ( "github.com/pkg/errors" "github.com/segmentio/ksuid" - "github.com/doktormerlin/gocloak/v10/pkg/jwx" + "github.com/Nerzal/gocloak/v10/pkg/jwx" ) type gocloak struct { diff --git a/client_benchmark_test.go b/client_benchmark_test.go index 2cc45158..c5265097 100644 --- a/client_benchmark_test.go +++ b/client_benchmark_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/doktormerlin/gocloak/v10" + "github.com/Nerzal/gocloak/v10" "github.com/stretchr/testify/assert" ) diff --git a/client_test.go b/client_test.go index a0f4b03e..45d0f09c 100644 --- a/client_test.go +++ b/client_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/pkcs12" - "github.com/doktormerlin/gocloak/v10" + "github.com/Nerzal/gocloak/v10" ) type configAdmin struct { diff --git a/go.mod b/go.mod index 9e6fa632..02cbd14c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/doktormerlin/gocloak/v10 +module github.com/Nerzal/gocloak/v10 go 1.15 diff --git a/model_test.go b/model_test.go index 6aba6701..92fd334f 100644 --- a/model_test.go +++ b/model_test.go @@ -5,7 +5,7 @@ import ( "errors" "testing" - "github.com/doktormerlin/gocloak/v10" + "github.com/Nerzal/gocloak/v10" "github.com/stretchr/testify/assert" ) diff --git a/utils_test.go b/utils_test.go index f0258061..c1db3faf 100644 --- a/utils_test.go +++ b/utils_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/doktormerlin/gocloak/v10" + "github.com/Nerzal/gocloak/v10" ) func TestStringP(t *testing.T) { From 48f6a65efc6fc88573dc8029521996a8ec5690bc Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 14:57:02 +0100 Subject: [PATCH 10/12] Renamed some stuff from Nerzal to nerzal --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79db8edf..7093c950 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gocloak -[![codebeat badge](https://codebeat.co/badges/18a37f35-6a95-4e40-9e78-272233892332)](https://codebeat.co/projects/github-com-Nerzal-gocloak-main) +[![codebeat badge](https://codebeat.co/badges/18a37f35-6a95-4e40-9e78-272233892332)](https://codebeat.co/projects/github-com-nerzal-gocloak-main) [![Go Report Card](https://goreportcard.com/badge/github.com/Nerzal/gocloak)](https://goreportcard.com/report/github.com/Nerzal/gocloak) [![Go Doc](https://godoc.org/github.com/Nerzal/gocloak?status.svg)](https://godoc.org/github.com/Nerzal/gocloak) [![Build Status](https://github.com/Nerzal/gocloak/workflows/Tests/badge.svg)](https://github.com/Nerzal/gocloak/actions?query=branch%3Amain+event%3Apush) @@ -16,7 +16,7 @@ For Questions either raise an issue, or come to the [gopher-slack](https://invit If u are using the echo framework have a look at [gocloak-echo](https://github.com/Nerzal/gocloak-echo) -Benchmarks can be found [here](https://Nerzal.github.io/gocloak/dev/bench/) +Benchmarks can be found [here](https://nerzal.github.io/gocloak/dev/bench/) ## Contribution From df2af3348c037561f638fb1dcfe896781e1f47de Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Fri, 19 Nov 2021 14:58:51 +0100 Subject: [PATCH 11/12] tests sleeping 10 seconds again --- run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tests.sh b/run-tests.sh index 14d31e33..5ae01e5c 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -3,7 +3,7 @@ docker-compose down docker-compose up -d -sleep 30 +sleep 10 ARGS=() if [ $# -gt 0 ]; then From 89825f54542f2c9ab1cd1eb72aee54b583479461 Mon Sep 17 00:00:00 2001 From: merl_umlaut Date: Mon, 3 Jan 2022 09:26:17 +0100 Subject: [PATCH 12/12] reverted tests --- run-tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 5ae01e5c..ed2de6ce 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh docker-compose down docker-compose up -d @@ -13,4 +13,4 @@ fi go test -failfast -race -cover -coverprofile=coverage.out -covermode=atomic -p 10 -cpu 1,2 -bench . -benchmem ${ARGS[@]} -docker-compose down +docker-compose down \ No newline at end of file