Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/keycloak/keycloak.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Client interface {
CreateUser(context.Context, string, string, gocloak.User) (string, error)
SetPassword(context.Context, string, string, string, string, bool) error
UpdateUser(context.Context, string, string, gocloak.User) error
DeleteUser(context.Context, string, string, string) error
GetClientRole(ctx context.Context, token string, realm string, idOfClient string, roleName string) (*gocloak.Role, error)
AddClientRolesToUser(ctx context.Context, token string, realm string, idOfClient string, userID string, roles []gocloak.Role) error
GetGroups(ctx context.Context, token string, realm string, params gocloak.GetGroupsParams) ([]*gocloak.Group, error)
Expand Down Expand Up @@ -208,6 +209,12 @@ func (h *Helper) SetPassword(realm, userID, password string) error {
return h.Client.SetPassword(ctx, h.Token, userID, realm, password, false)
}

func (h *Helper) DeleteUser(realm, userID string) error {
ctx, cancel := context.WithTimeout(wait.CtxSeconds(10))
defer cancel()
return h.Client.DeleteUser(ctx, h.Token, realm, userID)
}

func (h *Helper) UpdateUser(realm string, user gocloak.User) error {
ctx, cancel := context.WithTimeout(wait.CtxSeconds(10))
defer cancel()
Expand Down
Loading