Repository navigation
web/admin: fix ldap source parent group form - #26421
Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
165bdc3 to
6b40760
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
kensternberg-authentik
left a comment
There was a problem hiding this comment.
Approved because my complaints aren't blockers, just... something on which to meditate.
|
|
||
| <ak-switch-input | ||
| name="enabled" | ||
| name=${"enabled" satisfies keyof LDAPSourceRequest} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
* 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) ...
* 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) ...
* 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) ...
…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) ...
…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) ...
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 expectssyncParentGroup. This PR corrects the field name so selecting, changing, and clearing the parent group are saved correctly.It also:
LDAPSourceRequest, removing the existing request-type cast.keyof LDAPSourceRequestso similar naming mistakes produce TypeScript errors.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:
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.