Repository navigation
Description
Area
admin/ui
Describe the bug
The "Admin events" tabs of several objects in the Admin Console query the admin events by a single resourcePath that does not match the paths under which the events are recorded. As a result, events of the object are missing, or the filter can't be served by an index.
Admin events are recorded under the request path, so events of an object and of its sub-resources are stored under paths like clients/<id>, clients/<id>/protocol-mappers/models/<id>, groups/<id>/role-mappings/realm or identity-provider/instances/<alias>/mappers/<id>. The tabs use the following filters:
- Client:
clients/<id>without a wildcard, so only the events of the client itself are shown and not those of its protocol mappers, roles, scope mappings etc. - Client scope:
*client-scopes/<id>with a leading wildcard, which can't use an index onRESOURCE_PATHand doesn't match sub-resources like protocol mappers. - Realm role and client role:
roles-by-id/<id>is used for both, but client roles are modified viaclients/<id>/roles/<name>, so no events are shown for client roles. - Identity provider, group, organization and user tabs: events of sub-resources (mappers, role mappings, permissions, invitations, ...) are not shown.
Related problems that need separate changes are tracked in separate issues:
- Realm role Admin events tab misses create event and events recorded by role name #55122: the create event of a realm role is recorded as
roles/<name>and is not shown on the realm role tab. - Create event of organization group is recorded without the group id #55123: the create event of an organization group is recorded without the group id.
- No admin event is recorded when an identity provider is linked to an organization #55124: linking an identity provider to an organization doesn't record an admin event.
The missing events also explain a user report where the client events list showed only a single entry although the database contained more.
Filters without a leading wildcard are a prerequisite for an index on (REALM_ID, RESOURCE_PATH) to be usable, which would be tracked separately.
Version
main
Regression
- The issue is a regression
Expected behavior
The "Admin events" tab of an object lists the events of the object and of its sub-resources, and only those. Names that are a prefix of other names (client roles, identity provider aliases) must not show events of other objects.
Actual behavior
Events of sub-resources are missing, client roles show no events, and the client scope filter uses a leading wildcard.
How to Reproduce?
- Create a realm and enable admin events.
- Create a client and add a protocol mapper to it.
- Open the client, then Events, then Admin events.
- Only the "CLIENT CREATE" event is shown, the "PROTOCOL_MAPPER CREATE" event is missing.
The same applies to client scopes (protocol mappers), client roles (any change), identity providers (mappers), groups (role mappings), and users.
Anything else?
The REST endpoint accepts a single resourcePath, so a fix that keeps the backend backwards compatible needs to send one request per path pattern (the object itself, and the object plus /*) and merge the results in the UI. A future backend improvement could accept multiple resourcePath values.
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fieldsOpen
Activity
Address review of admin events tabs for sub-resources
Show invitations with membership events and drop paths without events