Skip to content

web/admin: fix ldap source parent group form - #26421

Merged
jsachs merged 14 commits into
goauthentik:mainfrom
jsachs:bug/ldap-parent-group-form
Nov 5, 2026
Merged

jsachs merged 14 commits into
goauthentik:mainfrom
jsachs:bug/ldap-parent-group-form

Conversation

@jsachs

@jsachs jsachs commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Details

What does this PR change?

Fixes persistence of the Additional Parent Group setting when creating or editing an LDAP source.
The form submitted the selected group as additionalParentGroup, but the generated API client expects syncParentGroup. This PR corrects the field name so selecting, changing, and clearing the parent group are saved correctly.
It also:

  • Types the LDAP form’s submission data and endpoints using LDAPSourceRequest, removing the existing request-type cast.
  • Checks submitted LDAP field names against keyof LDAPSourceRequest so similar naming mistakes produce TypeScript errors.
  • Adds browser regression coverage for LDAP source configuration persistence.
  • Updates shared test helpers to reliably interact with switches and legacy form controls across shadow roots.

Why is this change needed?

The generated API client silently omits unrecognized properties. As a result, the form appeared to save successfully, but changes to Additional Parent Group were discarded. Reopening the editor showed the previous value—or an empty field—rather than the selected group.
Correcting the submitted field name restores the expected behavior, while compile-time field-name checks help prevent similar regressions.

How was this tested?

Added a Playwright browser regression test in web/test/browser/650-sources.test.ts that:

  1. Creates two parent groups through the Admin interface.
  2. Creates an LDAP source with a parent group and non-default settings.
  3. Reopens the editor and verifies that the parent group, user path, additional user DN, and disabled switches persisted.
  4. Changes the parent group and other settings, saves, and verifies them after reopening.
  5. Clears the parent group and confirms it remains cleared after reopening.

Linked issues

Partially addresses #26278, specifically “Additional Parent Group” does not persist for LDAP sources. The matching-mode and cross-source identification problems remain open.

@netlify

netlify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 3985084
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6aebae7e6a825ab3020312ff
😎 Deploy Preview https://deploy-preview-26421--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.

@jsachs
jsachs force-pushed the bug/ldap-parent-group-form branch from 165bdc3 to 6b40760 Compare September 24, 2026 21:40
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.96%. Comparing base (b9e1016) to head (3985084).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26421      +/-   ##
==========================================
- Coverage   93.00%   92.96%   -0.05%     
==========================================
  Files        1226     1227       +1     
  Lines       85284    85319      +35     
  Branches     4894     4894              
==========================================
- Hits        79322    79313       -9     
- Misses       5875     5919      +44     
  Partials       87       87              
Flag Coverage Δ
conformance 30.55% <ø> (-0.02%) ⬇️
e2e 35.28% <ø> (-0.02%) ⬇️
integration 27.71% <ø> (-0.33%) ⬇️
rust 51.12% <ø> (ø)
unit 94.52% <ø> (-0.02%) ⬇️
unit-migrate 94.53% <ø> (-0.02%) ⬇️

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.

@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 3985084
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6aebae7edc0b5327dd56833b
😎 Deploy Preview https://deploy-preview-26421--authentik-storybook.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.

@jsachs
jsachs marked this pull request as ready for review September 29, 2026 10:37
@jsachs
jsachs requested a review from a team as a code owner September 29, 2026 10:37
@BeryJu BeryJu changed the title bug: ldap parent group form web/admin: fix ldap parent group form Sep 29, 2026
@BeryJu BeryJu changed the title web/admin: fix ldap parent group form web/admin: fix ldap source parent group form Sep 29, 2026

@kensternberg-authentik kensternberg-authentik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved because my complaints aren't blockers, just... something on which to meditate.


<ak-switch-input
name="enabled"
name=${"enabled" satisfies keyof LDAPSourceRequest}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, I dunno. This feels like a lot of work for not a lot of benefit, all these satisfies... clauses.

Consider this: put a new method on Form itself:

protected f = <K extends keyof D & string>(name: K): K => name;

Now you can replace all of these with name=${this.f("enabled")} and the typechecker will still validate that you listed a fieldname from a field the Form is bound to for the current type without having to get all repetitious.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, feels tidier. lmk if this feels right to you--I let Claude write some docstrings calling out the limited pitfalls.

Replace the repeated `"x" satisfies keyof LDAPSourceRequest` clauses in
LDAPSourceForm with `this.field("x")`, which checks field names against
the form's submitted data type `D`.

Forms should pass their `*Request` type as `D` before adopting it: the
default (the model type) includes read-only fields like `pk` and omits
write-only fields like passwords and secrets.
@netlify

netlify Bot commented Nov 4, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 3985084
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6aebae7edbb6eadf86c0c4da
😎 Deploy Preview https://deploy-preview-26421--authentik-integrations.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.

@jsachs
jsachs merged commit 41e8fda into goauthentik:main Nov 5, 2026
163 checks passed
@jsachs
jsachs deleted the bug/ldap-parent-group-form branch November 5, 2026 14:28
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
* main: (313 commits)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  providers/oauth2: sign tokens with ML-DSA keys (#27172)
  sources/oauth: verify ML-DSA signed tokens (#27170)
  web: bump postcss from 8.5.18 to 8.5.32 in /website (#27602)
  web: bump postcss from 8.5.16 to 8.5.32 in /web (#27604)
  web/element: fix missing line break between elapsed time and displayed time. (#27624)
  web/elements: rename ak-codemirror to ak-code-editor (#27406)
  website/integrations: add Google Cloud Workforce Identity Federation guide (#27571)
  root: test that FIPS mode refuses non-approved algorithms (#27536)
  web: bump nanoid from 3.3.16 to 3.3.20 in /website (#27599)
  web: bump baseline-browser-mapping from 2.10.43 to 2.11.35 in /website (#27600)
  web: bump mermaid from 11.16.1 to 11.17.2 in /web (#27603)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
* main: (1729 commits)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  providers/oauth2: sign tokens with ML-DSA keys (#27172)
  sources/oauth: verify ML-DSA signed tokens (#27170)
  web: bump postcss from 8.5.18 to 8.5.32 in /website (#27602)
  web: bump postcss from 8.5.16 to 8.5.32 in /web (#27604)
  web/element: fix missing line break between elapsed time and displayed time. (#27624)
  web/elements: rename ak-codemirror to ak-code-editor (#27406)
  website/integrations: add Google Cloud Workforce Identity Federation guide (#27571)
  root: test that FIPS mode refuses non-approved algorithms (#27536)
  web: bump nanoid from 3.3.16 to 3.3.20 in /website (#27599)
  web: bump baseline-browser-mapping from 2.10.43 to 2.11.35 in /website (#27600)
  web: bump mermaid from 11.16.1 to 11.17.2 in /web (#27603)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
* main: (28 commits)
  events: bundle DB-IP Lite GeoIP databases instead of MaxMind GeoLite2 (#27102)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  providers/oauth2: sign tokens with ML-DSA keys (#27172)
  sources/oauth: verify ML-DSA signed tokens (#27170)
  web: bump postcss from 8.5.18 to 8.5.32 in /website (#27602)
  web: bump postcss from 8.5.16 to 8.5.32 in /web (#27604)
  web/element: fix missing line break between elapsed time and displayed time. (#27624)
  web/elements: rename ak-codemirror to ak-code-editor (#27406)
  website/integrations: add Google Cloud Workforce Identity Federation guide (#27571)
  root: test that FIPS mode refuses non-approved algorithms (#27536)
  web: bump nanoid from 3.3.16 to 3.3.20 in /website (#27599)
  web: bump baseline-browser-mapping from 2.10.43 to 2.11.35 in /website (#27600)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
…b-controller' into web/admin/breadcrumb-controller

* refs/remotes/origin/web/admin/breadcrumb-controller: (214 commits)
  The updated format for crumbs required an update to the unit tests.
  web/admin: Add a Breadcrumb context manager to the navigation suite
  Adding the Breadcrumbs visual component.
  Revised naming code to track certain features.
  web/elements: vendor sidebar and add icons (#27289)
  providers/oauth2: don't set state in responses if not supplied (#9735)
  web/elements: expansion visual hierarchy (#27562)
  providers/oauth2: accept ML-DSA keys for DPoP (#27174)
  website/docs: draft 2026.11 release notes (#26814)
  sources/ldap: store the directory date when resetting a password (#27578)
  events: bundle DB-IP Lite GeoIP databases instead of MaxMind GeoLite2 (#27102)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
…k-controller

* web/admin/breadcrumb-controller: (215 commits)
  Changes requested by reviewer (@GirlBossRush).
  The updated format for crumbs required an update to the unit tests.
  web/admin: Add a Breadcrumb context manager to the navigation suite
  Adding the Breadcrumbs visual component.
  Revised naming code to track certain features.
  web/elements: vendor sidebar and add icons (#27289)
  providers/oauth2: don't set state in responses if not supplied (#9735)
  web/elements: expansion visual hierarchy (#27562)
  providers/oauth2: accept ML-DSA keys for DPoP (#27174)
  website/docs: draft 2026.11 release notes (#26814)
  sources/ldap: store the directory date when resetting a password (#27578)
  events: bundle DB-IP Lite GeoIP databases instead of MaxMind GeoLite2 (#27102)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants