Skip to content

Commit 80c5ae7

Browse files
committed
Fix invalid endpoints in user service.
1 parent 1912e65 commit 80c5ae7

File tree

2 files changed

+97
-18
lines changed

2 files changed

+97
-18
lines changed

Gopkg.lock

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

keycloak/user_service.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (us *UserService) Delete(ctx context.Context, realm string, userID string)
137137
func (us *UserService) Impersonate(ctx context.Context, realm string, userID string) (AttributeMap, error) {
138138

139139
// nolint: goconst
140-
path := "/{realm}/users/{id}/impersonation"
140+
path := "/realms/{realm}/users/{id}/impersonation"
141141

142142
a := AttributeMap{}
143143

@@ -174,7 +174,7 @@ func (us *UserService) Count(ctx context.Context, realm string) (uint32, error)
174174
func (us *UserService) GetGroups(ctx context.Context, realm string, userID string) ([]GroupRepresentation, error) {
175175

176176
// nolint: goconst
177-
path := "/{realm}/users/{id}/groups"
177+
path := "/realms/{realm}/users/{id}/groups"
178178

179179
var groups []GroupRepresentation
180180

@@ -193,7 +193,7 @@ func (us *UserService) GetGroups(ctx context.Context, realm string, userID strin
193193
func (us *UserService) GetConsents(ctx context.Context, realm string, userID string) (AttributeMap, error) {
194194

195195
// nolint: goconst
196-
path := "/{realm}/users/{id}/consents"
196+
path := "/realms/{realm}/users/{id}/consents"
197197

198198
var consents AttributeMap
199199

@@ -212,7 +212,7 @@ func (us *UserService) GetConsents(ctx context.Context, realm string, userID str
212212
func (us *UserService) RevokeClientConsents(ctx context.Context, realm string, userID string, clientID string) error {
213213

214214
// nolint: goconst
215-
path := "/{realm}/users/{id}/consents/{client}"
215+
path := "/realms/{realm}/users/{id}/consents/{client}"
216216

217217
_, err := us.client.newRequest(ctx).
218218
SetPathParams(map[string]string{
@@ -229,7 +229,7 @@ func (us *UserService) RevokeClientConsents(ctx context.Context, realm string, u
229229
func (us *UserService) DisableCredentials(ctx context.Context, realm string, userID string, credentialTypes []string) error {
230230

231231
// nolint: goconst
232-
path := "/{realm}/users/{id}/disable-credential-types"
232+
path := "/realms/{realm}/users/{id}/disable-credential-types"
233233

234234
_, err := us.client.newRequest(ctx).
235235
SetPathParams(map[string]string{
@@ -245,7 +245,7 @@ func (us *UserService) DisableCredentials(ctx context.Context, realm string, use
245245
func (us *UserService) AddGroup(ctx context.Context, realm string, userID string, groupID string) error {
246246

247247
// nolint: goconst
248-
path := "/{realm}/users/{id}/groups/{groupId}"
248+
path := "/realms/{realm}/users/{id}/groups/{groupId}"
249249

250250
_, err := us.client.newRequest(ctx).
251251
SetPathParams(map[string]string{
@@ -262,7 +262,7 @@ func (us *UserService) AddGroup(ctx context.Context, realm string, userID string
262262
func (us *UserService) RemoveGroup(ctx context.Context, realm string, userID string, groupID string) error {
263263

264264
// nolint: goconst
265-
path := "/{realm}/users/{id}/groups/{groupId}"
265+
path := "/realms/{realm}/users/{id}/groups/{groupId}"
266266

267267
_, err := us.client.newRequest(ctx).
268268
SetPathParams(map[string]string{
@@ -278,7 +278,7 @@ func (us *UserService) RemoveGroup(ctx context.Context, realm string, userID str
278278
// Logout revokes all user sessions
279279
func (us *UserService) Logout(ctx context.Context, realm string, userID string) error {
280280

281-
path := "/{realm}/users/{id}/logout"
281+
path := "/realms/{realm}/users/{id}/logout"
282282

283283
_, err := us.client.newRequest(ctx).
284284
SetPathParams(map[string]string{
@@ -294,7 +294,7 @@ func (us *UserService) Logout(ctx context.Context, realm string, userID string)
294294
func (us *UserService) GetSessions(ctx context.Context, realm string, userID string) ([]UserSessionRepresentation, error) {
295295

296296
// nolint: goconst
297-
path := "/{realm}/users/{id}/sessions"
297+
path := "/realms/{realm}/users/{id}/sessions"
298298

299299
var sessions []UserSessionRepresentation
300300

@@ -313,7 +313,7 @@ func (us *UserService) GetSessions(ctx context.Context, realm string, userID str
313313
func (us *UserService) GetOfflineSessions(ctx context.Context, realm string, userID string, clientID string) ([]UserSessionRepresentation, error) {
314314

315315
// nolint: goconst
316-
path := "/{realm}/users/{id}/offline-sessions/{clientId}"
316+
path := "/realms/{realm}/users/{id}/offline-sessions/{clientId}"
317317

318318
var sessions []UserSessionRepresentation
319319

@@ -333,7 +333,7 @@ func (us *UserService) GetOfflineSessions(ctx context.Context, realm string, use
333333
func (us *UserService) ResetPassword(ctx context.Context, realm string, userID string, tempPassword *CredentialRepresentation) error {
334334

335335
// nolint: goconst
336-
path := "/{realm}/users/{id}/reset-password"
336+
path := "/realms/{realm}/users/{id}/reset-password"
337337

338338
_, err := us.client.newRequest(ctx).
339339
SetPathParams(map[string]string{

0 commit comments

Comments
 (0)