Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerzal committed Nov 5, 2024
1 parent d348b9f commit 93f22a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func makeURL(path ...string) string {
return strings.Join(path, urlSeparator)
}

// Compares the provided version against the current version of the Keycloak server.
// compareVersions compares the provided version against the current version of the Keycloak server.
// Current version is fetched from the serverinfo if not already set.
//
// Returns:
Expand All @@ -63,15 +63,15 @@ func makeURL(path ...string) string {
// 0 if the provided version is equal to the server version
//
// 1 if the provided version is higher than the server version
func (g *GoCloak) compareVersions(v, token string, ctx context.Context) (int, error) {
func (g *GoCloak) compareVersions(ctx context.Context, v, token string) (int, error) {
curVersion := g.Config.version
if curVersion == "" {
curV, err := g.getServerVersion(ctx, token)
if err != nil {
return 0, err
}

curVersion = curV
curVersion = curV //nolint
}

curVersion = "v" + g.Config.version
Expand Down Expand Up @@ -3590,7 +3590,7 @@ func (g *GoCloak) GetPolicies(ctx context.Context, token, realm, idOfClient stri
return nil, errors.Wrap(err, errMessage)
}

compResult, err := g.compareVersions("20.0.0", token, ctx)
compResult, err := g.compareVersions(ctx, "20.0.0", token)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -3622,7 +3622,7 @@ func (g *GoCloak) CreatePolicy(ctx context.Context, token, realm, idOfClient str
return nil, errors.New("type of a policy required")
}

compResult, err := g.compareVersions("20.0.0", token, ctx)
compResult, err := g.compareVersions(ctx, "20.0.0", token)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -3655,7 +3655,7 @@ func (g *GoCloak) UpdatePolicy(ctx context.Context, token, realm, idOfClient str
return errors.New("ID of a policy required")
}

compResult, err := g.compareVersions("20.0.0", token, ctx)
compResult, err := g.compareVersions(ctx, "20.0.0", token)
if err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,7 @@ type RequiredActionProviderRepresentation struct {
ProviderID *string `json:"providerId,omitempty"`
}

// UnregisteredRequiredActionProviderRepresentation is a representation of unregistered required actions.
type UnregisteredRequiredActionProviderRepresentation struct {
Name *string `json:"name,omitempty"`
ProviderID *string `json:"providerId,omitempty"`
Expand Down

0 comments on commit 93f22a1

Please sign in to comment.