lib/sync/outgoing: store sync settings in database#17630
Conversation
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #17630 +/- ##
==========================================
- Coverage 92.92% 92.88% -0.05%
==========================================
Files 868 868
Lines 47913 47915 +2
==========================================
- Hits 44525 44506 -19
- Misses 3388 3409 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-eaf8ee78b9856195df5ac7e334bf78a1a596d2d1
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-eaf8ee78b9856195df5ac7e334bf78a1a596d2d1Afterwards, run the upgrade commands from the latest release notes. |
| label=${msg("Page timeout")} | ||
| input-hint="code" | ||
| required | ||
| value="${ifDefined(this.instance?.syncPageTimeout ?? "minutes=30")}" |
There was a problem hiding this comment.
| value="${ifDefined(this.instance?.syncPageTimeout ?? "minutes=30")}" | |
| value="${this.instance?.syncPageTimeout ?? "minutes=30"}" |
kensternberg-authentik
left a comment
There was a problem hiding this comment.
These changes are routine. I made a suggestion, though, to make maintenance easier in the future.
| </p> | ||
| </ak-form-element-horizontal> | ||
| </div> | ||
| </ak-form-group> |
There was a problem hiding this comment.
Suggestion: All three of these blocks are exactly the same (with one caveat: the identity of the object passed in changes, although the API for these two fields is consistent), and are subject to both shotgun revision (having to touch all three if any of these fields change) and last line effect (that caveat means cutting and pasting them, and then editing them, can lead to errors because familiarity with the task can breed neglect).
So:
Create ./admin/providers/common/syncSettingsControls.ts and put:
import { SCIMProvider } from "@goauthentik/api";
import { msg } from "@lit/localize";
import { html } from "lit";
import { ifDefined } from "lit/directives/if-defined.js";
import "#components/ak-number-input";
import "#elements/utils/TimeDeltaHelp";
import "#components/ak-text-input";
// This should work for all of them, since they implement the same API for these two fields. If not,
// come back and we'll pick a more forceful implementation;
type SyncSettings = Pick<SCIMProvider, "syncPageSize" | "syncPageTimeout">;
function syncSettingsControls<T extends SyncSettings>(instance: T | undefined) {
return html`
<ak-form-group label="${msg("Sync settings")}">
<div class="pf-c-form">
<ak-number-input
label=${msg("Page size")}
required
name="pageSize"
value="${instance?.syncPageSize ?? 100}"
help=${msg("Controls the number of objects synced in a single task.")}
></ak-number-input>
<ak-text-input
name="syncPageTimeout"
label=${msg("Page timeout")}
input-hint="code"
required
value="${ifDefined(instance?.syncPageTimeout ?? "minutes=30")}"
.bighelp=${html`<p class="pf-c-form__helper-text">
${msg("Timeout for synchronization of a single page.")}
</p>
<ak-utils-time-delta-help></ak-utils-time-delta-help>`}
>
</ak-text-input>
</div>
</ak-form-group>
`;
}
Then you can import this chunk into the three forms and replace all of that toil with:
${syncSettingsControls(this.instance)
... or ...
${syncSettingsControls(provider)}
* main: website: bump the eslint group in /website with 3 updates (#17601) web: bump hono from 4.9.12 to 4.10.2 in /web (#17653) web: bump @types/node from 24.9.0 to 24.9.1 in /packages/esbuild-plugin-live-reload (#17616) core: bump goauthentik.io/api/v3 from 3.2025100.25 to 3.2025120.1 (#17613) website: bump @types/node from 24.9.0 to 24.9.1 in /website (#17612) web: bump vite from 7.1.10 to 7.1.11 in /web (#17604) lib/sync/outgoing: store sync settings in database (#17630)
Details
REPLACE ME
Checklist
ak test authentik/)make lint-fix)If an API change has been made
make gen-build)If changes to the frontend have been made
make web)If applicable
make docs)