Skip to content

enterprise/requests: record requester and reviewer notes on events - #27285

Merged
BeryJu merged 2 commits into
mainfrom
dominic/requests-event-notes
Oct 29, 2026
Merged

BeryJu merged 2 commits into
mainfrom
dominic/requests-event-notes

Conversation

@dominic-r

Copy link
Copy Markdown
Member

Details

What does this PR change?

The access request events now carry the notes they were missing:

  • access_request_created includes requester_data, the prompt data the requester entered in the request flow.
  • access_request_approved and access_request_denied include approvals: 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_denied and access_request_revoked now list the requested application or entitlement as their target. Before, they listed the bare policy binding model (PolicyBindingModel <uuid>), unlike access_request_created.

Event context is cleansed as usual, so keys such as password are 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_created audit event for the approval, and in approvals once 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 the FlowTestCase import, which #26988 renamed on main.

Linked issues

Closes #27185


Checklist

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)
  • I have read the AI usage policy.

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
@dominic-r dominic-r added area:backend backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 labels Oct 27, 2026
@dominic-r
dominic-r requested a review from a team as a code owner October 27, 2026 23:01
@dominic-r dominic-r self-assigned this Oct 27, 2026
@netlify

netlify Bot commented Oct 27, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit a00ed5b
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ae12d2e4e468318500dbe79
😎 Deploy Preview https://deploy-preview-27285--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.49%. Comparing base (98c4b28) to head (8c6c90a).
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
conformance 31.14% <0.00%> (ø)
e2e 36.01% <0.00%> (+<0.01%) ⬆️
integration 28.62% <0.00%> (+<0.01%) ⬆️
rust 45.98% <ø> (ø)
unit 94.13% <100.00%> (+<0.01%) ⬆️
unit-migrate 94.13% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Playwright e2e

Download 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-report

Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

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)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

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-distroless

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu
BeryJu merged commit dbf9cc2 into main Oct 29, 2026
171 checks passed
@BeryJu
BeryJu deleted the dominic/requests-event-notes branch October 29, 2026 12:05
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

⚠️ Cherry-pick to version-2026.8 has conflicts: #27334

dominic-r added a commit that referenced this pull request Nov 6, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

access requests - requester/reviewer notes don't appear in event logs

2 participants