Skip to content

Commit

Permalink
err msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
bsoniam committed Sep 3, 2019
1 parent 40c34d9 commit 8b8da54
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions configs/keycloak_bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ event-basic-auth-token: "superpasswordverylongandstrong"


# Keycloak configs
keycloak-api-uri: http://localhost:8081
keycloak-oidc-uri: http://localhost:8081
keycloak-api-uri: http://localhost:8080
keycloak-oidc-uri: http://localhost:8080
keycloak-timeout: 5s

# DB Audit RW
Expand Down
2 changes: 2 additions & 0 deletions internal/keycloakb/errormessages.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ const (
Response = "response"
ListOfRealms = "listOfRealms"
Groups = "groups"
ClientId = "clientId"
RedirectURI = "redirectURI"
)
3 changes: 1 addition & 2 deletions internal/keycloakb/eventsdbmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"strings"

"github.com/cloudtrust/common-service/database"

api "github.com/cloudtrust/keycloak-bridge/api/events"
)

Expand Down Expand Up @@ -146,7 +145,7 @@ func (cm *eventsDBModule) GetLastConnection(_ context.Context, realmName string)
func (cm *eventsDBModule) GetTotalConnectionsCount(_ context.Context, realmName string, durationLabel string) (int64, error) {
var matched, err = regexp.MatchString(`^\d+ [A-Za-z]+$`, durationLabel)
if !matched || err != nil {
return 0, errors.New("invalidParameter.durationLabel")
return 0, errors.New(MsgErrInvalidParam + "." + DurationLabel)
}
var res = int64(0)
var row = cm.db.QueryRow(strings.ReplaceAll(selectConnectionsCount, "##INTERVAL##", durationLabel), realmName)
Expand Down
2 changes: 1 addition & 1 deletion pkg/management/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ func (c *component) UpdateRealmCustomConfiguration(ctx context.Context, realmNam
if !match {
return http.Error{
Status: 400,
Message: "invalidClientIDOrRedirectURI",
Message: internal.MsgErrInvalidParam + "." + internal.ClientId + "Or" + internal.RedirectURI,
}
}
// transform customConfig object into JSON string
Expand Down

0 comments on commit 8b8da54

Please sign in to comment.