Skip to content

Commit

Permalink
Merge 0b3f7bd into ee02f6e
Browse files Browse the repository at this point in the history
  • Loading branch information
harture committed Jan 23, 2020
2 parents ee02f6e + 0b3f7bd commit d550bf4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
9 changes: 8 additions & 1 deletion api/management/swagger-api_management.yaml
Expand Up @@ -28,7 +28,7 @@ paths:
schema:
type: array
items:
type: string
$ref: '#/components/schemas/Actions'
/realms/{realm}:
get:
tags:
Expand Down Expand Up @@ -939,6 +939,13 @@ paths:
description: invalid information provided (invalid client identifier or redirect URI not allowed for this client)
components:
schemas:
Actions:
type: object
properties:
name:
type: string
scope:
type: string
Realm:
type: object
properties:
Expand Down
26 changes: 17 additions & 9 deletions internal/keycloakb/configdbmodule.go
Expand Up @@ -125,22 +125,30 @@ func (c *configurationDBModule) scanAuthorization(scanner Scanner) (dto.Authoriz
realmID string
groupName string
action string
targetGroupName string
targetRealmID string
targetRealmID sql.NullString
targetGroupName sql.NullString
)

err := scanner.Scan(&realmID, &groupName, &action, &targetRealmID, &targetGroupName)
if err != nil {
return dto.Authorization{}, err
}

return dto.Authorization{
RealmID: &realmID,
GroupName: &groupName,
Action: &action,
TargetRealmID: &targetRealmID,
TargetGroupName: &targetGroupName,
}, nil
var authz = dto.Authorization{
RealmID: &realmID,
GroupName: &groupName,
Action: &action,
}

if targetRealmID.Valid {
authz.TargetRealmID = &targetRealmID.String
}

if targetGroupName.Valid {
authz.TargetGroupName = &targetGroupName.String
}

return authz, nil
}

func nullableString(value *string) interface{} {
Expand Down

0 comments on commit d550bf4

Please sign in to comment.