Skip to content

events: fix group membership changes with OSS audit middleware - #26477

Merged
dominic-r merged 1 commit into
mainfrom
dominic/fix-audit-m2m-kwargs
Sep 28, 2026
Merged

dominic-r merged 1 commit into
mainfrom
dominic/fix-audit-m2m-kwargs

Conversation

@dominic-r

Copy link
Copy Markdown
Member

With only the OSS audit middleware installed, adding or removing a user from a group crashes while logging the change. The handler defaults thread_kwargs to None, then tries to unpack it with **thread_kwargs:

File "authentik/events/middleware.py", line 252, in m2m_changed_handler
    EventNewThread(
    ~~~~~~~~~~~~~~^
        EventAction.MODEL_UPDATED,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        **thread_kwargs,
        ^^^^^^^^^^^^^^^^
    ).run()
    ^
TypeError: authentik.events.middleware.EventNewThread() argument after ** must be a mapping, not NoneType

Use an empty dictionary when no extra audit fields are supplied. The enterprise middleware already passes a dictionary, which is why it doesn't hit this error.

@dominic-r
dominic-r requested a review from a team as a code owner September 28, 2026 00:21
@netlify

netlify Bot commented Sep 28, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 38005b8
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ab9b2f1a5fb250007451d7e
😎 Deploy Preview https://deploy-preview-26477--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 Sep 28, 2026 •

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4585 1 4584 14
View the top 1 failed test(s) by shortest run time
1000-captcha.test.ts::CAPTCHA stage › Solving the hCaptcha challenge advances the flow
Stack Traces | 89.3s run time
hCaptcha renders its own frame

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Playwright e2e

Download this run's HTML report, traces and server logs, then open the report:

gh run download 36361901090 -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-38005b83ad48116e0d3729864c4aca43626adca1
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-38005b83ad48116e0d3729864c4aca43626adca1

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

@dominic-r
dominic-r requested a review from BeryJu September 28, 2026 00:55
@rissson rissson added the backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 label Sep 28, 2026
@dominic-r
dominic-r merged commit a42d1b9 into main Sep 28, 2026
145 of 146 checks passed
@dominic-r
dominic-r deleted the dominic/fix-audit-m2m-kwargs branch September 28, 2026 12:58
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Sep 28, 2026
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #26504

BeryJu pushed a commit that referenced this pull request Sep 28, 2026
…y-pick #26477 to version-2026.8) (#26504)

events: fix group membership changes with OSS audit middleware (#26477)

events: handle missing audit fields in membership changes

Co-authored-by: Dominic Roy <[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

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants