Repository navigation
enterprise/requests: record requester and reviewer notes on events - #27285
Conversation
The access request events only referenced the request, so the notes a requester entered in the request flow and the notes reviewers left on an approval or denial never reached the event log. The request is created with auditing suppressed, so the requester's notes were not in any event at all. access_request_created now carries requester_data. The approved and denied events carry every reviewer's decision with its notes, so earlier approvers of a multi-reviewer rule are kept too. The approved, denied and revoked events also resolve their targets to the application or entitlement instead of the bare policy binding model. Closes: #27185
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27285 +/- ##
=======================================
Coverage 92.48% 92.49%
=======================================
Files 1197 1197
Lines 81116 81153 +37
Branches 4497 4497
=======================================
+ Hits 75017 75059 +42
+ Misses 6033 6028 -5
Partials 66 66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Playwright e2eDownload this run's HTML report and traces, then open the report: gh run download 40803314995 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-reportInstallation instructionsInstructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-8c6c90ad58bd1789853df4dda07171ec0a0e28ea
# Distroless image: AUTHENTIK_TAG=gh-8c6c90ad58bd1789853df4dda07171ec0a0e28ea-distroless
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-8c6c90ad58bd1789853df4dda07171ec0a0e28ea
# Distroless image: tag: gh-8c6c90ad58bd1789853df4dda07171ec0a0e28ea-distrolessAfterwards, run the upgrade commands from the latest release notes. |
|
|
…herry-pick #27285 to version-2026.8) (#27334) * Cherry-pick #27285 to version-2026.8 (with conflicts) This cherry-pick has conflicts that need manual resolution. Original PR: #27285 Original commit: dbf9cc2 * fix Signed-off-by: Jens Langhammer <[email protected]> --------- Signed-off-by: Jens Langhammer <[email protected]> Co-authored-by: Dominic Roy <[email protected]> Co-authored-by: Jens L. <[email protected]>
Details
What does this PR change?
The access request events now carry the notes they were missing:
access_request_createdincludesrequester_data, the prompt data the requester entered in the request flow.access_request_approvedandaccess_request_deniedincludeapprovals: every reviewer's decision so far, with the reviewer, the status and their notes. For a rule that needs more than one reviewer, this keeps the notes of the earlier approvers next to the reviewer who finalized the request.access_request_approved,access_request_deniedandaccess_request_revokednow list the requested application or entitlement as their target. Before, they listed the bare policy binding model (PolicyBindingModel <uuid>), unlikeaccess_request_created.Event context is cleansed as usual, so keys such as
passwordare masked in the event.Why is this change needed?
The events were built with
model=self, which the event log stores only as a reference to the request (app, model name, primary key and name). The notes on the request were never copied into the event. The request is also created with auditing suppressed, so the requester's notes were not in any event at all. The reviewer's notes only showed up in the generic audit diffs for the request and the approval, not in the access request events.One gap remains: an approval that doesn't finalize the request, such as the first of two required approvals, still has no access request event of its own. Its notes are in the generic
model_createdaudit event for the approval, and inapprovalsonce the request is approved or denied. A dedicated event would need a new event action, which doesn't belong in a fix that gets backported.How was this tested?
Added tests that run the request flow with a prompt stage and check that the created event carries the requester's answer, that the approved event carries the reviewer's notes and names the application, that a denial after an earlier approval carries both reviewers' notes in order, and that the revoked event names the application. They fail without the change.
Before the change, a request created with requester notes, approved by two reviewers who both left notes, and then revoked produced access request events with no notes at all, and the approved and revoked events named the policy binding model instead of the application.
The source change applies cleanly to
version-2026.8. The test file conflicts there only on theFlowTestCaseimport, which #26988 renamed onmain.Linked issues
Closes #27185
Checklist
make all)make docs)