Skip to content

Commit 8592fa1

Browse files
authored
Merge pull request #48 from federated-catalogue-enhancements-2026/merge-to-upstream/CAT-FR-Fix-realm-and-notes
Enhancement [CAT-FR-Fix] Correct Keycloak realm and clarify user management autho…
2 parents c90f686 + 8c095b1 commit 8592fa1

2 files changed

Lines changed: 35 additions & 16 deletions

File tree

federated-catalogue/src/docs/architecture/chapters/05_building_block_view.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,25 @@ Additionally, five predefined task-specific composite roles are available:
269269

270270
Participant and user management endpoints continue to use the legacy roles directly (Ro-MU-CA, Ro-MU-A, Ro-PA-A).
271271

272+
===== User Management and the Keycloak Admin Console
273+
274+
User management is governed by two distinct authorization layers:
275+
276+
[options="header",cols="1,2,2"]
277+
|===
278+
| Layer | Authenticated identity | Required roles
279+
| Catalogue user/participant API (`/users`, `/participants`) | the catalogue's `federated-catalogue` Keycloak *service account* | `realm-management` roles held by the service account (`view-users`, `query-users`, `manage-users`)
280+
| Embedded Keycloak Admin Console (the admin UI's user-management iframe) | the *logged-in human user* | the same `realm-management` roles, held by the **user** directly
281+
|===
282+
283+
The catalogue's own user-management endpoints are reached with the catalogue client roles above (`Ro-MU-CA`, `Ro-MU-A`, `Ro-PA-A`); the catalogue server then calls the Keycloak Admin API through its service account, which carries the `realm-management` roles.
284+
285+
Note that `ADMIN_ALL` gates the `/admin/**` dashboard endpoints but **does not** authorize user- or participant-management — those require one of `Ro-MU-CA`, `Ro-MU-A`, or `Ro-PA-A` directly. `Ro-MU-CA` (Catalogue Administrator) is the composite that bundles `Ro-MU-A`, `Ro-PA-A`, `Ro-AS-A`, *and* `ADMIN_ALL`, so a Catalogue Administrator can drive both the dashboard and user management; a user holding only `ADMIN_ALL` is rejected from the user-management endpoints.
286+
287+
The user-management page additionally embeds the Keycloak Admin Console in an iframe. That console authenticates as the human user, not the service account, so a user must hold the `realm-management` roles (`view-users`, `query-users`, `manage-users`) on `federated-catalogue-realm` to view or manage users through it.
288+
289+
NOTE: The catalogue client roles (`Ro-MU-CA`, `Ro-MU-A`, `Ro-PA-A`) and the Keycloak `realm-management` roles are independent. Holding only a catalogue role authorizes the catalogue's user-management API but not the embedded Admin Console; the user sees an empty or forbidden console until granted the `realm-management` roles.
290+
272291
==== Core Services (fc-service-core)
273292

274293
The Core Services receive calls from the service component and provide the building blocks to support the flows for the different operations.

federated-catalogue/src/docs/architecture/chapters/06_runtime_view.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Anonymous users cannot request Participant information directly. Logged-in users
7575
API ->> + Parti: getParticipants(offset, limit)
7676
Parti -->> + PartiDao: search(offset, limit)
7777
78-
PartiDao -->> + Keycloak: GET /realms/gaia-x/groups
78+
PartiDao -->> + Keycloak: GET /realms/federated-catalogue-realm/groups
7979
Keycloak -->> - PartiDao: Groups
8080
8181
PartiDao ->> PartiDao: fromGroupRepo(group): ParticipantMetaData
@@ -107,7 +107,7 @@ sequenceDiagram
107107
Portal ->> + ParticipantController: GET /participants/{partID}
108108
ParticipantController ->> + ParticipantsService: getParticipant(partID)
109109
ParticipantsService ->> + ParticipantDao: select(partID)
110-
ParticipantDao ->> + Keycloak: GET /realms/gaia-x/groups/{partID}
110+
ParticipantDao ->> + Keycloak: GET /realms/federated-catalogue-realm/groups/{partID}
111111
Keycloak -->> - ParticipantDao: group
112112
ParticipantDao ->> ParticipantDao: fromGroupRepo(group): participant
113113
ParticipantDao -->> - ParticipantsService: participant
@@ -181,7 +181,7 @@ sequenceDiagram
181181
AssetStore -->> - ParticipantsService: [Ok, if no exception]
182182
ParticipantsService ->> + ParticipantDao: create(participant)
183183
ParticipantDao ->> ParticipantDao: toGroupRepo(participant):group
184-
ParticipantDao ->> + Keycloak: POST /realms/gaia-x/groups
184+
ParticipantDao ->> + Keycloak: POST /realms/federated-catalogue-realm/groups
185185
Keycloak -->> - ParticipantDao: 201 CREATED (ParticipantMetaData)
186186
ParticipantDao -->> - ParticipantsService: ParticipantMetaData
187187
ParticipantsService -->> - ParticipantController: ParticipantMetaData
@@ -221,7 +221,7 @@ sequenceDiagram
221221
ParticipantController ->> + ParticipantsService: updateParticipant (partID, asset)
222222
ParticipantsService ->> ParticipantsService: checkAccess [updated.participantId == user.participantId]
223223
ParticipantsService ->> + ParticipantDao: select(partID)
224-
ParticipantDao ->> + Keycloak: GET /realms/gaia-x/groups/{partID}
224+
ParticipantDao ->> + Keycloak: GET /realms/federated-catalogue-realm/groups/{partID}
225225
Keycloak -->> - ParticipantDao: group
226226
ParticipantDao ->> ParticipantDao: fromGroupRepo(group): Participant
227227
ParticipantDao -->> - ParticipantsService: Participant
@@ -233,7 +233,7 @@ sequenceDiagram
233233
AssetStore -->> - ParticipantsService: ''
234234
ParticipantsService --> + ParticipantDao: update(Participant)
235235
ParticipantDao -->> ParticipantDao: toGroupRepo(Participant): group
236-
ParticipantDao ->> + Keycloak: PUT /realms/gaia-x/groups/{partID}{group}
236+
ParticipantDao ->> + Keycloak: PUT /realms/federated-catalogue-realm/groups/{partID}{group}
237237
Keycloak -->> - ParticipantDao: 200 OK
238238
ParticipantDao -->> - ParticipantsService: updated
239239
ParticipantsService -->> - ParticipantController: updated
@@ -273,7 +273,7 @@ Notes:
273273
Parti ->> Parti: Ro-MU-A in User.Roles
274274
Parti ->> Parti: Participant = User.Participant
275275
276-
Parti ->> + Keycloak: GET /realms/gaia-x/groups/{partID}
276+
Parti ->> + Keycloak: GET /realms/federated-catalogue-realm/groups/{partID}
277277
Keycloak -->> - Parti: Participant
278278
279279
Parti ->> + AssetStore: getById(participantAssetId)
@@ -286,7 +286,7 @@ Notes:
286286
Note over AssetStore: AssetDeletedEvent is published before commit;<br/>ValidationResultCleanupListener cascades removal of validation results<br/>and ProvenanceCleanupListener cascades removal of provenance credentials —<br/>see _validation_result_storage.
287287
AssetStore -->> - Parti: Null
288288
289-
Parti ->> + Keycloak: DELETE /realms/gaia-x/groups/{partID}
289+
Parti ->> + Keycloak: DELETE /realms/federated-catalogue-realm/groups/{partID}
290290
Keycloak -->> - Parti: Participant
291291
292292
Parti -->> - API: Participant
@@ -315,7 +315,7 @@ sequenceDiagram
315315
API ->> + service: getUsers(partId)
316316
service ->> service: Ro-MU-CA|Ro-Pa-A|Ro-MU-A in User.Roles
317317
service -->> + dao: selectUsers(partId)
318-
dao -->> + keycloak: GET /realms/gaia-x/groups/{partId}/users
318+
dao -->> + keycloak: GET /realms/federated-catalogue-realm/groups/{partId}/users
319319
keycloak -->> - dao: UserRepresentations
320320
dao -->> - service: UserProfiles
321321
service -->> - API:UserProfiles
@@ -344,7 +344,7 @@ sequenceDiagram
344344
User ->> + API:GET /users/{userId}
345345
API ->> + service: getUser(userId)
346346
service -->> + dao: select(userId)
347-
dao -->> + keycloak: GET /realms/gaia-x/users/{userId}
347+
dao -->> + keycloak: GET /realms/federated-catalogue-realm/users/{userId}
348348
keycloak -->> - dao: UserRepresentation
349349
dao -->> - service: UserProfile
350350
service ->> service: (Ro-MU-CA in User.Roles) or <br>(Ro-Pa-A or Ro-MU-A in User.Roles and RequestedUser.Participant == User.Participant)
@@ -376,7 +376,7 @@ sequenceDiagram
376376
API ->> + service: addUser(user)
377377
service ->> service: Ro-MU-CA|Ro-Pa-A|Ro-MU-A in User.Roles
378378
service -->> + dao: create(user)
379-
dao -->> + keycloak: POST /realms/gaia-x/groups/{partId}/users
379+
dao -->> + keycloak: POST /realms/federated-catalogue-realm/groups/{partId}/users
380380
keycloak -->> - dao: UserRepresentation
381381
dao -->> - service: UserProfile
382382
service -->> - API: UserProfile
@@ -411,7 +411,7 @@ sequenceDiagram
411411
service ->> service: Ro-MU-CA|Ro-Pa-A|Ro-MU-A in User.Roles
412412
413413
service -->> + dao: select(userId)
414-
dao -->> + keycloak: GET /realms/gaia-x/groups/{partId}/users/{id}
414+
dao -->> + keycloak: GET /realms/federated-catalogue-realm/groups/{partId}/users/{id}
415415
keycloak -->> - dao: UserRepresentation
416416
dao -->> - service: UserProfile
417417
@@ -420,7 +420,7 @@ sequenceDiagram
420420
end
421421
422422
service ->> + dao: update(userId, user)
423-
dao -->> + keycloak: PUT /realms/gaia-x/groups/{partId}/users
423+
dao -->> + keycloak: PUT /realms/federated-catalogue-realm/groups/{partId}/users
424424
keycloak -->> - dao: UserRepresentation
425425
426426
dao -->> - service: UserProfile
@@ -460,7 +460,7 @@ sequenceDiagram
460460
API ->> + service: updateUser(userId,user)
461461
service ->> service: Ro-MU-CA|Ro-Pa-A|Ro-MU-A in User.Roles
462462
service -->> + dao: select(userId)
463-
dao -->> + keycloak: GET /realms/gaia-x/groups/{partId}/users/{id}
463+
dao -->> + keycloak: GET /realms/federated-catalogue-realm/groups/{partId}/users/{id}
464464
keycloak -->> - dao: UserRepresentation
465465
dao -->> - service: UserProfile
466466
@@ -469,7 +469,7 @@ sequenceDiagram
469469
end
470470
471471
service ->> + dao: updateRoles(userId, roles)
472-
dao -->> + keycloak: PUT /realms/gaia-x/groups/{partId}/users
472+
dao -->> + keycloak: PUT /realms/federated-catalogue-realm/groups/{partId}/users
473473
keycloak -->> - dao: UserRepresentation
474474
475475
dao -->> - service: UserProfile
@@ -499,7 +499,7 @@ sequenceDiagram
499499
500500
API ->> + service: deleteUser(userId)
501501
service -->> + dao: select(userId)
502-
dao -->> + keycloak: GET /realms/gaia-x/groups/{partId}/users/{id}
502+
dao -->> + keycloak: GET /realms/federated-catalogue-realm/groups/{partId}/users/{id}
503503
keycloak -->> - dao: UserRepresentation
504504
dao -->> - service: UserProfile
505505
@@ -508,7 +508,7 @@ sequenceDiagram
508508
end
509509
510510
service ->> + dao: delete(userId)
511-
dao -->> + keycloak: DELETE /realms/gaia-x/groups/{partId}/users/{id}
511+
dao -->> + keycloak: DELETE /realms/federated-catalogue-realm/groups/{partId}/users/{id}
512512
keycloak -->> - dao: UserRepresentation
513513
514514
dao -->> - service: UserProfile

0 commit comments

Comments
 (0)