Repository navigation
Record admin events for organization identity provider links - #55147
Conversation
|
The parent issue is still in triage status; I first need input from the owning team. Please do not create PRs from issues that have that label. |
There was a problem hiding this comment.
Thanks for the PR @akasakariko. In general it looks ok to me.
One thing worth considering: the CREATE event's representation is inconsistent with the UPDATE event's, and with how representation() is used everywhere else in the codebase.
For addIdentityProvider, the stored representation is just the raw submitted id/alias string, serialized as a bare JSON string, e.g. "my-identity-provider" or "3fa85f64-5717-4562-b3fc-2c963f66afa6" depending on whether the caller passed an alias or an internal id.
For updateIdentityProviderLink, the stored representation is the full OrganizationIdentityProviderLinkRepresentation, e.g. {"autoMembership":true,"membershipType":"MANAGED"}.
So a reviewer looking at the organization's admin events tab sees a structured config object for updates, but just an opaque identifier for the initial link with no indication of the autoMembership/membershipType values the link actually got (which default to true/UNMANAGED when not specified elsewhere, e.g. for the default-config case). That's also a departure from how other CREATE events in this codebase log representations (OrganizationsResource, OrganizationMemberResource, etc. all log the created resource's representation, not a plain id).
I think it makes sense for the CREATE case to log the resulting link representation (alias + autoMembership + membershipType) instead of the bare submitted id? That would make the two events symmetric and give a complete picture of the link that was created, not just what was passed in.
Separately, it'd be good to add a representation assertion for the CREATE event in the test, since right now only operationType/resourceType/resourcePath are checked for it.
Closes keycloak#55124 Signed-off-by: akasakariko <148060537+akasakariko@users.noreply.github.com>
7e42fe6 to
117c7bd
Compare
|
@sguilhen Addressed in 117c7bd CREATE now records a JSON object containing the resolved Extended The new assertion fails against the previous implementation and passes with this fix Validation: 59 organization tests passed; 1294 services tests, 0 failures, 0 errors, 2 existing skips; Spotless and the base suite check passed |
|
@akasakariko thanks for updating the PR. Can you switch it from draft to regular PR? |
|
@sguilhen Done, it is now a regular PR and ready for review |
Closes #55124
Use the resolved identity provider alias and persisted association settings so links created by alias or internal ID have the same complete audit trail
The organization tab filtering changes remain tracked in #55120
The CREATE representation assertion fails against the previous implementation and passes with this fix