Skip to content

Commit 77d3ec8

Browse files
committed
some fixes
1 parent 42b4cfb commit 77d3ec8

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ linters:
1313
linters-settings:
1414
misspell:
1515
locale: US
16-
golint:
17-
min-confidence: 0
18-
govet:
19-
check-shadowing: false
2016
goimports:
2117
local-prefixes: github.com/Nerzal/gocloak
2218
gocognit:

client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func makeURL(path ...string) string {
6666
func (g *GoCloak) compareVersions(v, token string, ctx context.Context) (int, error) {
6767
curVersion := g.Config.version
6868
if curVersion == "" {
69-
curV, err := g.getServerVersion(ctx, token);
69+
curV, err := g.getServerVersion(ctx, token)
7070
if err != nil {
7171
return 0, err
7272
}
@@ -75,7 +75,7 @@ func (g *GoCloak) compareVersions(v, token string, ctx context.Context) (int, er
7575
}
7676

7777
curVersion = "v" + g.Config.version
78-
if (v[0] != 'v') {
78+
if v[0] != 'v' {
7979
v = "v" + v
8080
}
8181

@@ -777,7 +777,7 @@ func (g *GoCloak) ExecuteActionsEmail(ctx context.Context, token, realm string,
777777

778778
// SendVerifyEmail sends a verification e-mail to a user.
779779
func (g *GoCloak) SendVerifyEmail(ctx context.Context, token, userID, realm string, params ...SendVerificationMailParams) error {
780-
const errMessage = "could not execute actions email"
780+
const errMessage = "failed to send verify email"
781781

782782
queryParams := map[string]string{}
783783
if params != nil {

client_test.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,7 +2639,7 @@ func Test_SendVerifyEmail(t *testing.T) {
26392639
cfg.GoCloak.Realm,
26402640
params)
26412641
if err != nil {
2642-
if err.Error() == "500 Internal Server Error: Failed to send verify email" {
2642+
if err.Error() == "500 Internal Server Error: Failed to send execute actions email" {
26432643
return
26442644
}
26452645
require.NoError(t, err, "SendVerifyEmail failed")
@@ -6641,14 +6641,13 @@ func Test_ImportIdentityProviderConfig(t *testing.T) {
66416641
require.NoError(t, err, "ImportIdentityProviderConfig failed")
66426642

66436643
expected := map[string]string{
6644-
"userInfoUrl": "https://openidconnect.googleapis.com/v1/userinfo",
6645-
"validateSignature": "true",
6646-
"tokenUrl": "https://oauth2.googleapis.com/token",
6647-
"authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth",
6648-
"jwksUrl": "https://www.googleapis.com/oauth2/v3/certs",
6649-
"issuer": "https://accounts.google.com",
6650-
"useJwksUrl": "true",
6651-
"metadataDescriptorUrl": "https://accounts.google.com/.well-known/openid-configuration",
6644+
"userInfoUrl": "https://openidconnect.googleapis.com/v1/userinfo",
6645+
"validateSignature": "true",
6646+
"tokenUrl": "https://oauth2.googleapis.com/token",
6647+
"authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth",
6648+
"jwksUrl": "https://www.googleapis.com/oauth2/v3/certs",
6649+
"issuer": "https://accounts.google.com",
6650+
"useJwksUrl": "true",
66526651
}
66536652

66546653
require.Len(
@@ -6723,7 +6722,6 @@ E8go1LcvbfHNyknHu2sptnRq55fHZSHr18vVsQRfDYMG</ds:X509Certificate>
67236722
"loginHint": "false",
67246723
"enabledFromMetadata": "true",
67256724
"idpEntityId": "https://accounts.google.com/o/saml2?idpid=C01unc9st",
6726-
"syncMode": "LEGACY",
67276725
}
67286726

67296727
require.Len(

gocloak_iface.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)