Skip to content

[Cherry-pick to branch-1.3] [#12885] fix(audit): Include role names in role assignment logs (#12886) - #12898

Merged
roryqi merged 1 commit into
branch-1.3from
cherry-pick-8e25f016-to-branch-1.3
Sep 4, 2026
Merged

[Cherry-pick to branch-1.3] [#12885] fix(audit): Include role names in role assignment logs (#12886)#12898
roryqi merged 1 commit into
branch-1.3from
cherry-pick-8e25f016-to-branch-1.3

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Cherry-pick Information:

  • Original commit: 8e25f01
  • Target branch: branch-1.3
  • Status: ✅ Clean cherry-pick (no conflicts)

### What changes were proposed in this pull request?

Add the affected role names to the audit `customInfo` for:

- `GRANT_USER_ROLES`
- `REVOKE_USER_ROLES`
- `GRANT_GROUP_ROLES`
- `REVOKE_GROUP_ROLES`

Both successful and failed operations now record `roleNames`. A shared
helper keeps the audit field formatting consistent.

### Why are the changes needed?

Role assignment audit entries currently identify the user or group but
omit the roles that were granted or revoked. This prevents access
reviews from reconstructing which permissions were changed.

Fix: #12885

### Does this PR introduce _any_ user-facing change?

Yes. Role assignment audit entries now include the affected roles in
`customInfo`, for example:

`{roleNames=reader,admin}`

### How was this patch tested?

- `./gradlew :core:spotlessApply`
- `./gradlew :core:test --tests
org.apache.gravitino.listener.api.event.TestUserEvent --tests
org.apache.gravitino.listener.api.event.TestGroupEvent --tests
org.apache.gravitino.audit.v2.TestSimpleAuditLogV2`
@github-actions github-actions Bot added the cherry-pick Automatically opened cherry-pick PR label Sep 3, 2026
@github-actions
github-actions Bot requested a review from jerryshao September 3, 2026 15:19
@roryqi
roryqi merged commit 8c1e08c into branch-1.3 Sep 4, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick Automatically opened cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant