- Suggest the keywords and builtins Monaco highlights Python with
- Suggest names already in the expression, found with Monaco's tokenizer
- Add block snippets
- Indent Python by four spaces
Expressions are the body of a function the server wraps them in, so the
context variables are not known here yet.
- Run Monaco's CSS language service on the page for suggestions, hovers and validation
- Load each language's service with the first editor that uses it
- Add the suggestion widget, hovers and snippets
Monaco's own CSS entry point starts a worker whose setup loads every editor
feature, including the ones the editor leaves out.
- Replace CodeMirror with Monaco, imported once the editor is shown
- Pick Monaco's editing features instead of loading all of them
- Add the One Dark theme, vendored from azemoh/vscode-onedark (MIT)
- Hold the field's height until the editor loads
- Follow changes to `mode`, `readonly` and `disabled`
- Honor `readonly`, which the CodeMirror element ignored
Co-authored-by: Dominic R <[email protected]>
Name the element after what it is, not the library behind it, ahead of
replacing CodeMirror.
- Rename `<ak-codemirror>` to `<ak-code-editor>`
- Move `#elements/CodeMirror` to `#elements/CodeEditor`
- Rename `CodeMirrorMode` and the source helpers to match
Co-authored-by: Dominic R <[email protected]>
* adding google cloud integration documentation
* integrations: touch up
---------
Co-authored-by: Dominic R <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
## Description
This commit adds a little CSS to ensure the toggle group is centered on the PolicyBindingForms.
The rule that “child components should not enforce their position or dimension; leave that to the client code to make those decisions” can sometimes make for awkward fits; in this case, a flex-wrapper to ensure centering.
The toggle group is also used in:
- ProxyProviderForm
- Ak-Application-Wizard-Edit-Binding-Steps
- BlueprintForm
- BlueprintImportForm
I have checked all five locations (the above, and PolicyBindingForms), and the toggle group is now centered in the Form in all cases.
Closes \#27357
* move Initial Permissions to Customization
* fix get_perms() for superusers with an object
Due to shortcuts this doesn't actually ever run, but fixing it anyway
* validate blueprint permissions against the database
* add custom permissions
* log permission assignments
* route API authorization through one decision point per phase
* add permission checks
* add field rules to permission checks
* let permission checks alter responses
* web: manage custom permissions
* web: manage permission checks
* website: document custom permissions and permission checks
* `make gen`
* Docs changes
* website/docs: cleanup
* fix typo in the custom permissions flag help
* format custom permission help text
* reword docs
* select list items by `[pk=...]` in field rule paths
* prefix permission check function names with `RBAC_FUNC_`
* trace `visible_objects`
* inline test helpers
* check the custom permissions flag first
* fixup! Merge branch 'main' into rbac/custom-permissions
* fixup! fixup! Merge branch 'main' into rbac/custom-permissions
---------
Co-authored-by: Dewi Roberts <[email protected]>
Co-authored-by: Dominic R <[email protected]>
* root: fix translations that never took effect
* remove `format_map`s in favor of just `format`
* fixup! Merge branch 'main' into core/fix-translations
Confirming the "Select users" dialog replaced the pending list in the
"Assign Additional Users" form, so a second visit to the dialog dropped
the users picked in the first. Each confirm now merges its selection into
the pending list by primary key. The role assignment path shares the form.
The "Simple group" browser test now picks two users in separate visits to
the selection dialog and asserts both are members after assignment.
Fixes#27277
Every AKElement built its own CSSStyleSheet from the brand's custom CSS,
so a page with N elements parsed the brand CSS N times and held N
copies. Lit's sheet cache never hit because createCSSResult wraps the
string in a new strings array each call. This hurts most when the brand
CSS inlines a font or image.
Build the sheet once and have every element and nested shadow root
adopt it. The cache is keyed on the CSS text so a re-read server
context, as injectBrand does in tests, still gets a matching sheet.
* core: store passwords as authenticator devices
* core: address review feedback on password devices
* core: merge password device migration branches
* core: linearize password migrations and repair downgrade order
* core: simplify staged password accessors and saves
* core: update only the hash during password rehashing
* core: cover staged password writes and rollback
* stages/password: clarify device exclusions and verify single SSF events
* stages/user_write: persist password-only changes
* stages/user_write: format the password change snapshot
* core: load password dates with the user list
* core: return explicitly after saving a password device
* core: isolate password storage and preserve Django save semantics
* core: load password devices with nested user lists
* stages/password: regenerate the complete device schema in the base layer
* core: write passwords through the password device
Drop the PasswordUser adapter that staged password writes on the user
until save(). Callers now use PasswordDevice.set_password(),
set_password_from_hash() and set_unusable_password(), which write the
device immediately and then save the user, so outgoing sync and the
policy cache still see password changes.
User keeps read-only password and password_change_date properties
because property mappings (including the Google Workspace and Entra
system blueprints) and Django's session hash read them. Django's
password writes on User now raise instead of assigning the property, so
create_user(), `ak changepassword` and guardian's anonymous user go
through the device or skip the password.
The data migration copies passwords in Python with chunked_queryset and
skips unusable passwords, since a user without a device has no usable
password. It no longer copies passwords back on downgrade; the legacy
columns stay in place until a later release.
* sources/ldap: set password through PasswordDevice in AD error test
* web/elements: keep dialog messages after the dialog closes
A dialog's messages render in its own container, above the modal backdrop.
Closing the dialog removed them, along with confirmations shown on submit.
- Move a closing dialog's messages to the next container: the dialog below, or the page
- Add `findMessageContainer()`, shared with `showMessage()`
* web/elements: remove the unused ak-message event listener
Every message container listened on `window` for `ak-message`, and never
stopped. Nothing dispatches the event. The listener kept each closed dialog's
container in memory.
- Remove the listener from `MessageContainer`
- Remove `AKMessageEvent`
* stages/authenticator_webauthn: don't offer signature algorithms OpenSSL can't verify, fixes WebAuthn under FIPS
* note fips mode enabled in error logs
* just make fips compatibility a static list
---------
Co-authored-by: Dewi Roberts <[email protected]>
Configure cspell to not print its progress messages (thousands and thousands of lines of files checked), as that obscured any actual error messages, but also ensure that it does display a summary message at the end of its run for auditing purposes.
* root: clear in-memory caches after test fixture setup
The first test's setup creates the test database, and its migrations
fill the system settings cache. When that takes longer than the cache
timeout, the test starts on a stale entry whose refresh runs on a
background thread. That thread's connection cannot see the test's
uncommitted writes, so the refresh undoes flags the test patched.
* Apply suggestion from @BeryJu
Signed-off-by: Jens L. <[email protected]>
* sigh
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens L. <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens L. <[email protected]>
In cached bind mode the refresh rebuilt the provider instance but kept
the previous session binder's direct binder, and that binder reads the
bind flow, the unbind flow, MFA support and the base DN from the
instance it was built with. A change to any of them on the provider
never reached a running outpost: it carried on executing the old bind
flow until the process was restarted, while the refresh log said the
new flow had been loaded. The cached results survived the refresh too,
so a bind refused under the old settings stayed refused, and one
accepted stayed accepted, for the life of its entry.
The direct binder is now always built from the new instance. The
session cache is carried over only when the settings that decide a
bind's outcome are unchanged; when one of them changes, the old cache
is stopped and a fresh one started, so every pair of credentials runs
the new flow once more and is cached again under it. The five-minute
refresh keeps the cache in the ordinary case; the cost lands only when
an administrator changed something, which is what the change was for.
Also fixes the comment on the caching line, which said the opposite of
what the code does: a result is cached whenever the bind itself
completed, refusals included; only a transport error is left uncached.
Tests: a refresh with unchanged settings keeps the cached sessions; a
changed bind flow, unbind flow, MFA setting or base DN discards them,
refusals included; and the direct binder answers for the new instance's
base DN after a refresh. The last two fail on the previous code.
Co-authored-by: Jens L. <[email protected]>
* website/docs: document next actions on login
* website/docs: clarify required-action scope and recovery
* website/docs: explain required-action redirect limits
* website/docs: explain assigning next actions in user attributes
* website/docs: locate the advanced attributes editor
* website/docs: rename next actions to required actions
Actions now apply on the user's next request rather than at their next
login, and the user resumes the page or flow they were in afterwards.
Flows that redirect or send the user to a source can't be used, since
the action flow has to finish on its own.
* website/docs: document what required actions don't cover
* stages/user_login: restrict sessions with next actions
* core: return a fixed next-action validation error
* stages/user_login: keep malformed next actions restricted
* stages/user_login: preserve required flow plans on direct entry
* stages/user_login: preserve attribute updates during action completion
* stages/user_login: enforce next actions when adding an account
* stages/user_login: reuse Django routing for restricted sessions
* core: verify delegated next-action permissions
* stages/user_login: resolve required flows with Django in_bulk
* core: simplify next-action audit handling
* stages/redirect: retain required-action completion across flow handoffs
* stages/user_login: remove redundant next-action tests
* enterprise: own required-action enforcement and validation
* enterprise: simplify next-action audit changes
* stages/redirect: make cooperative initialization explicit
* core, enterprise, web: enforce required actions on every request
Review asked for three changes: pause and resume flows the way the
Source stage does instead of splicing a completion stage into other
flows, apply actions to sessions that already exist, and a clearer name.
The middleware now reads goauthentik.io/user/required-actions on every
authenticated request, so an action added to a logged-in user applies on
their next request and the User Login stage needs no hook. Starting an
action suspends what the user was doing: a flow in progress is kept on
the action's completion stage and restored afterwards, and any other
page is opened again. The Redirect stage hook is gone, so an action flow
can no longer hand off to another flow.
The set and removed events are dropped because the user's model_updated
event already records the attribute change. Validation only runs when
the value changes, so a deleted flow doesn't block unrelated edits.
* enterprise/required_actions: tighten validation and resumed requests
Reject flows that a logged-in user can never plan, such as the
unauthenticated recovery and enrollment flows, which would otherwise
lock the user out. Keep the body of a suspended POST in the session,
as the login redirect does, so a SAML POST binding still works once the
actions are done. Complete the action for the plan's pending user, so a
plan restored in another browser from an email link doesn't fail.
* set the pending user on action plans
Otherwise an Email stage can fail with "No pending user." and leave
the user stuck.
---------
Co-authored-by: Simonyi Gergő <[email protected]>
* web/elements: formalize the timestamp display
## What
Update the timestamp display so that each component is labled, each feature has an external control made available through CSS custom properties.
The non-standard “true” default of “show-elapsed” has been reversed; it is now “hide-elapsed” and is treated correctly as a standard boolean attribute. The one place where this mattered has been updated correctly.
* Move constant to be, y'know, a constant.
* Potential fix for pull request finding 'Implicit operand conversion'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Ken Sternberg <[email protected]>
* web/elements: introduce the crontab component
## What
Provide a component that provides a textual representation for crontab entries.
## Why
Because I hate trying to interpret those things, and I can’t imagine I’m the only one.
* web/elements: formalize the timestamp display
## What
Update the timestamp display so that each component is labled, each feature has an external control made available through CSS custom properties.
The non-standard “true” default of “show-elapsed” has been reversed; it is now “hide-elapsed” and is treated correctly as a standard boolean attribute. The one place where this mattered has been updated correctly.
* Move constant to be, y'know, a constant.
* Potential fix for pull request finding 'Implicit operand conversion'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Ken Sternberg <[email protected]>
* web/elements: introduce the crontab component
## What
Provide a component that provides a textual representation for crontab entries.
## Why
Because I hate trying to interpret those things, and I can’t imagine I’m the only one.
* Spellcheckers.
* web/elements: introduce the crontab component
## What
Provide a component that provides a textual representation for crontab entries.
## Why
Because I hate trying to interpret those things, and I can’t imagine I’m the only one.
---------
Signed-off-by: Ken Sternberg <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* web/elements: formalize the timestamp display
## What
Update the timestamp display so that each component is labled, each feature has an external control made available through CSS custom properties.
The non-standard “true” default of “show-elapsed” has been reversed; it is now “hide-elapsed” and is treated correctly as a standard boolean attribute. The one place where this mattered has been updated correctly.
* Move constant to be, y'know, a constant.
* Potential fix for pull request finding 'Implicit operand conversion'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Ken Sternberg <[email protected]>
* web/elements: formalize the timestamp display
## What
Update the timestamp display so that each component is labled, each feature has an external control made available through CSS custom properties.
The non-standard “true” default of “show-elapsed” has been reversed; it is now “hide-elapsed” and is treated correctly as a standard boolean attribute. The one place where this mattered has been updated correctly.
* Move constant to be, y'know, a constant.
* Potential fix for pull request finding 'Implicit operand conversion'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Ken Sternberg <[email protected]>
* Spellcheckers.
---------
Signed-off-by: Ken Sternberg <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* server, lifecycle: drop idle upstream connections before uvicorn does
The server kept idle connections to uvicorn pooled for a minute, but
uvicorn closes them after gunicorn's keepalive of 2 seconds. A request
that reused a connection uvicorn was closing got reset after it was
sent, and the client received a 503 "authentik starting".
Drop idle connections a second before uvicorn's keep-alive runs out.
Raising gunicorn's keepalive above the pool timeout would also work,
but uvicorn before 0.53 keeps a connection open after a request with
`Connection: Close` and silently drops the next request on it, so on
2026.8 a longer keepalive would leave that connection in the pool for
a minute instead of 2 seconds.
* server, lifecycle: raise uvicorn keep-alive to 5 seconds
* outposts: only write changed service account permissions
Closes: #26924
* outposts: add API endpoint to rebuild service account permissions
Saving an outpost no longer deletes and recreates every permission of
its service account, which was useful when troubleshooting a desync.
POST /outposts/instances/{uuid}/rebuild_permissions/ does that full
rebuild explicitly and requires permission to change the outpost.
* outposts: test that a missing permission keeps existing ones
* outposts: type and rename existing permission sets in build_user_permissions
* outposts/proxy: honor X-Forwarded-Host in envoy forward auth
The envoy handler built the post-login redirect from the raw Host
header, while the outpost picks the application with the ak-axum Host
extractor, which uses X-Forwarded-Host from trusted proxies. When a
front proxy rewrote :authority to an internal name, users landed on
that internal host after login. The Go outpost replaced the host with
X-Forwarded-Host for trusted proxies, so this broke in the Rust
rewrite.
Use the same extractor for the redirect target. Untrusted peers still
cannot pick the redirect host.
Closes: #26867
* outposts/proxy: drop envoy handler tests that repeat ak-axum coverage
* outposts/proxy: test that envoy forward auth uses the forwarded host
The envoy_forward_target unit tests pass a host string directly, so
they still pass if handle_envoy goes back to reading the raw Host
header. Drive the handler through host_middleware with a trusted
proxy instead. The untrusted-peer case stays out because ak-axum's
Host extractor tests already cover it.
The server passed hop-by-hop headers such as `Connection` through to
uvicorn. They describe the client's connection to the server, and
RFC 9110 requires proxies to remove them, as the Go server's reverse
proxy did. Passing `Connection: Close` on made uvicorn before 0.53
keep the upstream connection open and silently drop the next request
sent on it, which uvicorn 0.53 and hyper 1.12 now avoid.
Remove them, and the headers `Connection` names, before adding our own
forwarding headers. WebSocket upgrades keep them for the handshake.
review_attested was defined with object lifecycle management but never
emitted, so a reviewer's note on an access review reached no review
event. Submitting a review now records review_attested for the
reviewer, with the note and the reviewed object.
When a remote system answered 409 and the provider couldn't link the
existing object, ObjectExistsSyncException escaped the sync task. The
task failed with an error that named no object and said nothing about
how to resolve it, the rest of the page was never synced, and the full
sync failed before it synced groups and cleaned up. SCIM made it worse:
a search response that wasn't a ListResponse raised AttributeError and
hid the conflict.
Full, direct, delete, and membership sync now log a warning with the
object and the remote system's response, and continue. A conflict also
says what to change. Errors that don't belong to one object, from
discovery or cleanup, end the full sync with a task error, as StopSync
already did.
Several errors could not reach that log. StopSync never set the
response that str() reads, so printing it raised AttributeError, and
Google Workspace passed two arguments to exceptions that take one, so
every 400 raised TypeError. Entra ID turned every Graph error into
StopSync before checking its status, so its conflict and re-create
handling never ran. It now maps 400, 404, and 409 like the other
providers, keeps Graph's error message, and no longer compares
odata_count, which Graph only returns when a count is requested.
Linking after a conflict now only links the matching object. SCIM
checks the returned userName or displayName, since some servers ignore
the filter, and Google Workspace checks the primary address, so an
address held by another kind of object or an alias is reported instead
of linked. Removing a member who is already gone counts as done.
Closes: #26904
With authentik under AUTHENTIK_WEB__PATH, outposts could not reach it:
- The RAC outpost built its session websocket URL from the API client's
scheme and host only, so it dialed /ws/outpost_rac/... and got a 404,
while the control websocket already kept the path. Both now go
through one dialer, which also gives the session websocket the unix
socket support and query parameters of the control websocket.
- The API base was the path of AUTHENTIK_HOST with "api/v3" appended, so
a path without a trailing slash, such as /authentik, became
/authentikapi/v3. The websockets already joined the path correctly.
- The default outpost config, which the admin interface pre-fills for
new outposts, set authentik_host to the server root.
Closes: #26803
Some URLs were built from the page's origin instead of the web base
path, so with authentik under AUTHENTIK_WEB__PATH they pointed outside
of authentik: the RAC tunnel websocket, the flow "Execute" buttons,
invitation links, the AUTHENTIK_HOST shown in the outpost deployment
info, and the event map, about dialog and email preview assets. The RAC
websocket also missed the session cookie, which is scoped to the web
path, so authentik refused it even where a proxy rewrote the path.
Closes: #26803
* website/docs: document exchanging a token for a SAML response
* Update website/docs/add-secure-apps/providers/oauth2/token_exchange.mdx
Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Dominic Roy <[email protected]>
---------
Signed-off-by: Dominic Roy <[email protected]>
Co-authored-by: Jens L. <[email protected]>
* fix(server): quiet health_live warn when upstream socket not ready
Before the Unix socket exists, health_live (and the analogous path in
the worker) called the upstream via hyper_util's legacy Client. A
connect failure with ENOENT (No such file or directory) was logged at
warn level, producing false-positive production warnings from the
in-process healthcheck during every normal startup.
Add a small helper that walks the error's
source chain looking for an with .
In (server and worker), use it to downgrade that
specific case to ; all other connect/request failures continue
to log at so real outages remain visible.
The fix still returns Err so the health endpoint correctly reports
not-live until the socket is up — it only adjusts the log level for
the expected startup race.
Signed-off-by: hippi345 <[email protected]>
* fix(server): suppress AppError warn for health_live on startup ENOENT
When the upstream Unix socket does not yet exist, the health_live
handler in src/server/core.rs used to call server.health_live().await?
which converted the eyre::Report into AppError. AppError::into_response
unconditionally logs warn!(err = ?self.0, "error occurred"), producing a
second spurious warning on top of the one already silenced in the client
layer.
Replace the await? with an explicit match. A Connect/NotFound error
(socket not ready) is now logged at debug and the handler returns
SERVICE_UNAVAILABLE directly, bypassing AppError entirely. All other
errors continue to log at warn and return SERVICE_UNAVAILABLE; no error
is silently swallowed.
Apply the same debug/warn split to the worker healthcheck handler
(src/worker/healthcheck.rs), which also logged warn unconditionally in
its Err arm. Expose is_connect_not_found as pub(crate) in both
server/mod.rs and worker/mod.rs so the respective handler files can
import it.
Signed-off-by: hippi345 <[email protected]>
* dedupe
Signed-off-by: Jens Langhammer <[email protected]>
* format
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: hippi345 <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens L. <[email protected]>
* blueprints: reapply when `!Env` or `!File` values change
The values are keyed with the secret key before they go into the hash, since
the hash is visible in the API and a plain hash of a short secret could be
guessed. Blueprints without these tags keep their current hash.
Closes: #26925
* website/docs: note that blueprints reapply when `!Env` or `!File` values change
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
Describe when the SCIM, Google Workspace, and Entra ID providers link
an object that already exists in the remote system, what the sync task
logs when they can't, and how to resolve the conflict.
* inital attempt to support ldap account expiration
* prefer MicrosoftActiveDirectory helpers
* sources/ldap: extract account status aggregation from user sync
* never let continuous login block the final redirect
The final redirect awaits continuous-login orchestration and the exit
bookkeeping before navigating, so any error or hang there leaves the
page on the spinner after the server has already finished the flow.
In Google's Android account setup WebView, localStorage is null and
the orchestrator throws (#23660, #26267).
- Catch and log orchestration errors in RedirectStage, then always
navigate.
- Return a copy from discoverTabs(). waitForTabExit() rediscovers
while the leader iterates the live Set, and entries re-added during
for...of are visited again, so a follower that never exits was
resumed forever.
- Resolve the wait when rediscovery rejects in the timer callback, and
release the tab lock in a finally block.
* web/flow: elect continuous-login resume leader with a Web Lock
Replace the hand-rolled localStorage lock — a non-atomic check-then-set
guarded by a tab-liveness heuristic — with navigator.locks. `ifAvailable`
gives immediate leader election with no double-leader race, and the
browser releases the lock on navigation or close, so there is no stale
lock to reap and no manual cleanup.
* web/test: cover continuous-login multi-tab resume
Drive two real tabs in one browser context: authenticate in the leader
and assert the follower leaves the identification stage on its own. The
global flag is enabled in beforeAll and restored in afterAll; the file
carries the highest numeric prefix and runs serially so it does not race
the parallel login suite.
* Refine comments.
* web/test: align continuous-login e2e with suite conventions
Move the global-flag toggle into an e2e/ helper (setInstanceFlag) so the
test stops hand-constructing fixtures inline, and confirm the settings
save through its success toast instead of matching the settings network
response — keeping the flow on the UI like the rest of the suite.
* web/test: pad the continuous-login visibility assertions
* web/flow: rework continuous-login unit tests around the Web Lock
* web/test: wait for each tab to see the continuous-login flag
* web: share server-context document readers via @goauthentik/core/document
* web/flow: share a brand injection helper across continuous-login tests
* Clean up comment.
---------
Co-authored-by: Teffen Ellis <[email protected]>
Co-authored-by: Teffen Ellis <[email protected]>
When gunicorn recycles a worker after max_requests, the worker closes its
idle keep-alive connections. A request the server had already sent on one
of those pooled connections failed with a connection reset or broken pipe,
and was answered with a 503 "authentik starting" even though gunicorn was
healthy.
Retry such requests once on a new connection when they are safe (GET,
HEAD, OPTIONS, TRACE) and have no body, as Go's net/http transport did
for the previous server, and log upstream errors that still end in a 503.
Fixes#26274
Claude-Session: https://claude.ai/code/session_01WX2DCUMd7PSr17cXK69vQF
* flows: count cache keys in the database
* fix lint
* flows: count cache entries without extending the cache backend
* packages/django-postgres-cache, flows: add keys_count to the cache backend
keys() is already a method of our backend rather than Django's cache
API, so counting belongs next to it instead of in a direct CacheEntry
query in the flow API. Both methods share one filter, so a count always
matches the length of the key list for the same pattern and version.
* packages/django-postgres-cache: type keys_count test against DatabaseCache
* web/elements: prevent wizard double submission
Ignore Next while a step is saving and disable the button meanwhile, so
a second activation can't post the form again. Clear the busy state when
the save fails.
The provider tests' verification searched the table while the wizard was
still open. The modal kept the search field inert, so its Enter went to
the focused Create button and submitted the form a second time. Wait for
the wizard to close first.
Pad each byte in IDGenerator.randomID so IDs have the requested length.
* web/element: remove license & capabilities requirements from SidebarItem
This commit moves the “isLicensed” and “canEnterprise” checks in SidebarItem and instead decorates the SidebarEntries collection with additional flags and values to support holding the information entirely within the Admin UI.
SidebarItem takes two additional attributes: `notice`, which is where the “Enterprise Only” message goes, and `pathoverride`, which will override the default path if provided. This is hardly an elegant way to go around it, but it preserves the original `entries` tree, producing a new tree and not mutating the original. With this, SidebarItem (and Sidebar itself!) is completely generic and no longer needs to know anything at all about licensing or enterprise capability.
The CSS for SidebarItem has been modified: it’s just `notice` not `enterprise-ntice` now. Fit for any purpose under the sun.
A new function, `resolveSidebarEntries`, completely centralizes the logic for “do we even show Enterprise features” and “if the user isn’t licensed, decorate them with ‘enterprise only’ markers”; it contains the logic dictating, for each element in the SidebarEntries tree, if the instance isLicensed and canEnterprise; it filters out entries that are enterprise-only when the instance does not support enterprise features, then generates the new tree, decorating the `attributes` field with the “Enterprise only” message and path override as required. These generic features are passed to SidebarItem.
`ak-interface-admin` then needed only to <s>rip out</s> modify the navigationEntries method to use the `resolveSidebarEntries` function, and remove the redundant check for enterprise-only features in the palette-generator, since those features will not be present after the resolver does its magic.
Also: A couple of tests.
* web/admin: hide enterprise notices until the license summary loads
* web/admin: Make Sidebar a wholly coherent and independent entity
This commit revises how Sidebar works.
I introduce a new type that the Sidebar understands: `SidebarItem`:
``` javascript
export interface SidebarItem {
label: string;
key: string;
expanded?: boolean;
path?: string | null;
notice?: string | TemplateResult | null;
children?: SidebarItem[];
}
```
This type is meant to drive the Sidebar alone, independent of the needs of any client code (although it is, obviously, good enough to support ak-interface-admin).
I revise `Sidebar` to be the whole component; no SidebarItem renderer, no slots. The container into which it is rendered is the client code’s responsibility. There are two levels of rendering: the Groups and the Items, and right now they’re only distinguished by “Does it have children?” There were four renderers in SidebarItem, and two of them are gone since they were unused.
I have deliberately left room to revise this again so that a second-level can support a path *and* children. I have an idea for what to do with it.
The CSS has entirely been brought in to handle a single sidebar.
This is entirely in a controller now; it only needs to be included to do its magic, and it works quite well. I have also revised the very long function names in `expansion.ts` and treat the entire file as a single namespace. The names are shorter and more readable, and can be imported with the `* as SidebarExpansion` syntax to support the full namespace.
This makes Sidebar Session Persistence swappable with a Sidebar Device Persistence (using `localStorage`), should we so desire.
Functions in `expansion` that no one was using have been deleted. YAGNI forever.
*`sidebarEntries.ts`*
The navigation folder is split: the `Entries` file was always meant to be an easy-to-find collection of all the *Entries*, and nothing more, the Entries themselves were meant to be easily editable and fit within a visually informative table. All the tooling cluttered that. With one exception, all tooling has been mooved to the `Tools` file. That exception is a tool, *here*, that will either hand you a “plain” SidebarEntries, or a “can enterprise” SidebarEntries, based on a flag. That logic does not belong in the Interface file.
*`sidebarTools.ts`*
Contains two separate units: one converts the `SidebarEntries` collection into a `SidebarItems` collection fit for sending to the Sidebar. The others (a) assists the Interface in finding the right key to send to the Sidebar for the current path, and (b) assists the header in filling out the page title.
Due to some of the needs in the Interface, `resolveSidebarItems` is an `ExtendedSidebarItem`; it has extra fields to help the CommandPalette. The shape passed to Sidebar is an unchanged `SidebarItem`.
The palette code is revised to understand the new `ExtendedSidebarItem` format.
The `ak-page-navbar` and `ak-sidebar` calls have been revised to take the new format. The values are derived at the beginning of the `render()` function to avoid multiple calls to the resolvers.
* web/admin: drop redundant children fallback in sidebar resolver
* web/elements: separate the enterprise notice from the sidebar link label
---------
Co-authored-by: Teffen Ellis <[email protected]>
* web/elements: rebuild ak-checkbox-group as a form-associated element
ak-checkbox-group now extends FormAssociatedElement instead of the
deprecated AKControlElement, and is form-associated whether or not it has a
name.
`value` is the host's selection and `values` holds the user's choices. A
custom hasChanged compares the two selections as sets of names. Most call
sites compute `value` with map/filter on every render, so a new array with
the same names keeps the user's choices and different names replace them.
This replaces the "apply value on first update only" flag and drops the
write-back into `value`.
The change and input events now reach the host's ancestors. The old
connectedCallback stopped every change and input event on the element,
including its own, and re-added those listeners on each reconnect. Native
input events stop at the checkbox instead.
Form association brings form.elements membership, one FormData entry per
chosen option, formResetCallback restoring the host's value, and a missing
value reported on the first checkbox when `required`. Checkboxes bind
`.checked`, so a reset updates boxes the user already toggled.
* web/elements: return early from ak-checkbox-group validity sync
* web/element: Move the SidebarVersion out of Elements.
# What
This commit moves the SidebarVersion element, which yes shows the version information in the sidebar. The component is moved into Admin, and the Sidebar now provides an active slot for it. Since it is now indpendent of and never even mentions “Sidebar” on its own, it’s now renamed `VersionDetails`.
# Why
SidebarVersion uses WithLicenseSummary, which has knowledge of the API. The long-term goal of the Elements is to extract from it every element that does *not* need to know about the API, and this was one of the first things I encountered while working on the SidebarIcons project.
# Details
SidebarVersion had a lot of aria that wasn’t necessary. The `aria-labels` overrode much of the text, so the user would hear that there was version information available, but would never actually hear the version information. Headers inside a button would get discarded by some screen-readers because that doesn’t make sense inside a button. Buttons can only contain “inline” content, so using `<span>` and then styling them to be block is the correct way to make sure the information remains accessible while meeting the expected layout.
`aria-controls` in the Interface pointed at nothing, because it was referencing an `id` that doesn’t cross a shadow-root. I’ve changed the target, so at least now that’s going to the right place.
The PFNav and PFAvatar imports were never used inside SidebarVersion. They’ve been removed.
The hover styling has been moved into SidebarVersion explicitly.
VersionDetails is now slotted into the Sidebar so it is visible in the Admin lightDOM, and in consequence it no longer needs its `exportparts`.
`@patterfly-element/pfe-core` has been a part of our product since we included some of the elements into our base, notably the original Tooltips. This only makes it explicit that we use it.
The check-for-undefined in the VersionDetails renderer did nothing; we already check if `this.version` is defined, and if it is, `versionCurrent` is not allowed to be null or undefined. If the type and the behavior don’t coincide, that’s a problem for the back-end team. 😈
Since we’re exposing `[part]` names for styleability, I’ve changed the class names inside VersionDetails into `[part~=]` selectors. We’re not performance-bound, and it reduced the clutter.
* Replace aria wayfinders used for testing with Open UI Automation identifiers.
* web/test: locate the about button by role and name
---------
Co-authored-by: Teffen Ellis <[email protected]>
* web/elements: rebuild ak-array-input as a form-associated element
ak-array-input now extends FormAssociatedElement instead of the deprecated
AKControlElement.
`items` becomes a plain reactive property. Lit's identity check decides
when the host's list replaces the rows, so re-rendering with the same array
keeps the user's edits and a fresh fetch replaces them. A custom hasChanged
treats two empty lists as equal for hosts that pass `items ?? []`. This
replaces the JSON comparison from the previous commit.
The user's edits live in a `rows` state with keys assigned once per row.
Rows report their value through their change event instead of the element
scraping every row from the DOM. Row change events stop at the array
input, which dispatches one change per edit.
Form association brings form.elements membership, a JSON form value,
formResetCallback restoring the host's items, and native validity: with
`validate`, an invalid row sets a custom error anchored on that row, and
`required` reports a missing value when the list is empty. The element
implements SettlingFormField, so Form.submit() waits for the rows to render.
Footer link and OAuth2 redirect URI rows delegate focus, so a new row's
first control is focused after "Add entry".
* web/elements: match ak-array-input validity sync to the other form-associated elements
Radio, ak-codemirror and ak-search-select each keep a #syncValidity() that
sets the form value, builds the flags and message, and calls
internals.setValidity() once.
* web/elements: return early from ak-array-input validity sync
* web/admin: Simplify sidebar entries handling
This commit streamlines how sidebar entries are generated and validated. The `entries` field was only being used as a signal to `requestUpdate()`; the actual entries were being generated on the fly in `get navigateEntries()`.
We already had functions to generate the base entries and the enterprise entries, and putting the “just base or base + enterprise” function into the `sidebar.ts` file reduced the `navigateEntries` to two lines, and separates the “canEnterprise” from “what does that mean for sidebar” nicely.
@GirlBossRush, there’s a `validateRoutes` function in `./src/admin/navigation/sidebar.ts` that I tried to make into a unit test, but I could not get to run under Vitest, mostly because `Routes.ts` has exactly one side-effect import and Vitest cannot handle that. I didn’t want to make it a browser test, however. Any suggestions?
* That side effect infected downstream tests. Darnit.
* Formatter opinions.
* Moving the load of the AdminOverviewPage to the entrypoint. The idea is to have the dashboard as live as possible as early as possible. Putting into Routes made Routes into a browser-only feature, and it could not be unit tested without this move.
* The test exists and passes.
* web/sidebar: move route validation into the unit test
---------
Co-authored-by: Teffen Ellis <[email protected]>
* web: move stylesheets into per-interface folders
Groups the entrypoints and flow stylesheets under styles/if/{authenticated,flow,shared}. Renames and path updates only.
* web/flow: widen login card and align breakpoints
Bumps the card width from 35rem to 36.25rem (matching the small dialog), raises the background-image height cutoff to 27.5rem, and makes the small/large media queries use <= and > consistently so no viewport size matches both.
* web/flow: add FlowMeta type and default flow metadata
* core: extract loading spinner template
Also makes the spinner's aria-valuetext translatable.
* web/flow: render loading overlays from server-provided slots
The flow template now ships card and viewport overlays as slotted light DOM, replacing ak-loading-overlay. The executor only exposes their slots while a challenge is reloading, and overlay.css picks which one is visible per layout and viewport size.
* Add docs
* Update website/integrations/development/claude-code/index.mdx
Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Dewi Roberts <[email protected]>
* Update website/docs/endpoint-devices/authentik-agent/device-authentication/cli-app-authentication/index.mdx
Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Dewi Roberts <[email protected]>
* Changes based on Jens' feedback
* website/docs: cleanup
---------
Signed-off-by: Dewi Roberts <[email protected]>
Co-authored-by: Jens L. <[email protected]>
Co-authored-by: Dominic R <[email protected]>
* website/integrations: add filex
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* filex: clean up
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Dominic R <[email protected]>
Render <ak-mdx> with content that calls a probe from an expression and
from an ESM export, and assert the probe never runs, while Markdown
still renders.
Co-authored-by: Teffen Ellis <[email protected]>
* root: require Node.js 24.22.1
Raise the minimum Node.js version to the 24.22.1 security release
across `.nvmrc`, `engines.node`, and `devEngines.runtime`.
https://nodejs.org/en/blog/release/v24.22.1
* lifecycle/container, website: bump node images to 26.12.1
Pin both build images to the 26.12.1 security release. The server
image previously floated on the `26-trixie-slim` tag.
https://nodejs.org/en/blog/release/v26.12.1
* ci: fix stale setup-node version comments
The pinned commit is already v7.1.0 (#26852, #26854).
* scripts/node: support || and ^ ranges in lint-runtime
Check versions against every `||`-separated comparator instead of a single `>=` or exact pin.
* root: exclude unpatched Node.js 25 and 26 releases
Narrow the engines range to `^24.22.1 || >=26.12.1`. The previous
`>=24.22.1` also accepted 26.12.0 and every 25.x release.
* update 1
Signed-off-by: Henry <[email protected]>
* info
* rename + title on info section
* website/docs: !
---------
Signed-off-by: Henry <[email protected]>
Co-authored-by: Dominic R <[email protected]>
* lifecycle/container: build the server image distroless
* redo
* wip
* shorter comment
* update base images from fips#178
Co-authored-by: Emil Burzo <[email protected]>
Signed-off-by: Emil Burzo <[email protected]>
* non-PR fips image
---------
Signed-off-by: Emil Burzo <[email protected]>
Set `importFileExtension` so the generator emits Node-resolvable
relative imports, and switch the client to `nodenext` module
resolution in place of the bundler-only workaround.
* web/elements: show the table loading state until the first response
Since #26423 dropped the visibility check from renderRows, a table whose
first fetch is deferred until it scrolls into view rendered its empty
state, including the empty state's own create button, until that fetch
started. Render the loading state whenever there's no data yet, which is
what #26423 describes, while still not reverting to it once data exists.
* web/elements: rerun a table fetch requested while one is in flight
Table.fetch() returned early while a request was in flight, so a search
typed during the first load was silently dropped: the box showed the
query while the table kept the unfiltered results. Queue the request
instead and run it once the in-flight one settles, with whatever
parameters are current by then. Repeated requests collapse into one
follow-up.
* web/e2e: filter search selects for plain-text patterns
selectSearchValue only typed a filter for string patterns, so a RegExp
like /default-authentication-flow/ searched the picker's first page of
options. Once a dev instance accumulates enough test flows, the stock
defaults drop off that page and unrelated provider and brand tests fail.
Type the pattern's text as a filter when it's plain, and fall back to
the unfiltered list for options the server doesn't search, such as the
blank choice.
* Format.
* providers/saml: add configurable assertion encryption algorithm
* update to main and add docs
* show only when encryption certificate is set, update help text
* default to aes256-gcm
* update wording
* update
* Docs tidy
* feedback
---------
Co-authored-by: Dewi Roberts <[email protected]>
Form.submit() became async in #26566 and now awaits settleFormFields()
before serializing. That gives the host form a chance to re-render first,
and Lit re-assigns array property bindings on every render, so
`.items=${settings.footerLinks}` reset the list to the server's copy and
the PUT went out with stale values.
The items setter now ignores a list whose contents match the one the
parent last assigned.
This also fixes a long-standing keying bug. The setter's map callback had
its arguments swapped, so every row got a fresh key on each change and
`repeat` rebuilt it. Clicking from one field into another in the same row
sent the next keystrokes into a detached input. Edits, adds and deletes now
operate on the keyed list directly, and delete removes the clicked row by
key instead of by index.
* web: namespace storage keys and migrate legacy values
Split #common/storage into an accessor and shared types, and require
storage keys to use the ak: prefix via a PersistenceKey type. Values
under the old remember-me and library view mode keys are moved to the
new keys on load, so returning users keep their remembered username and
layout. The migrations are marked for removal in 2027.2 (#27036).
Remove ShowHintController, which has had no users since #21781.
* web/flow: fix remember-me being cleared by CSRF token rotation
The remembered username was keyed to a session ID derived from the CSRF
token, and cleared whenever the two didn't match. Django rotates the
CSRF token on every successful login, so the check failed on every
later visit and the username was always forgotten. Drop the check, so
the username is only cleared by switching the toggle off or following
"Not you?", and discard the session ID left by earlier versions.
Co-authored-by: Shawn O'Dell <[email protected]>
* web/flow: bind remember-me keystroke listener for returning users
The remember-me input listener was only attached from the toggle's change
handler, so a returning user, who arrives with the switch already checked,
never had it bound. A different user on the same device could type and
submit their own username without it ever reaching localStorage, leaving
the previous username prefilled forever, and auto-submitted in
identification-only flows.
Track whether the feature is on, seeded from the persisted value, and
reconcile the listener when the controller connects and after each update.
The stage adds the controller after it has rendered, so a further update
isn't guaranteed. Cancel a pending keystroke write when the listener is
detached, so switching the toggle off can't be undone by a write queued in
the same frame. Disconnect the controller before the stage removes it,
since removeController doesn't notify it and the listener would otherwise
keep recording after the server turns remember-me off.
Co-authored-by: Shawn O'Dell <[email protected]>
* web/flow: respect the remember-me toggle when auto-submitting
canAutoSubmit only checked whether a username was remembered when the
page loaded, so a returning user who switched the toggle off was kept
from being auto-submitted only by the one-shot attempt counter. Also
require the feature to still be on. Checking only the live toggle state
would instead auto-submit first-time visitors as soon as they opted in.
* web/e2e: wait for the login flow before running browser tests
The API answers before the worker has applied the default blueprints.
Until then `/` redirects to an authentication flow that doesn't exist
yet and 404s, so the availability check could fail on a slow start and
skip the whole suite. Poll until the redirect chain resolves, and run
the setup steps serially so the login step waits on it too.
---------
Co-authored-by: Teffen Ellis <[email protected]>
## What
This commit removes the generation of the seven categories from the Theme build:
- `./color.css`
- `./typography.css`
- `./spacing.css`
- `./shape.css`
- `./shadow.css`
- `./motion.css`
- `./z-index.css`
And correspondingly:
- The exports are removed from `package.json`
- The documentation has been updated to remove the reference to the category files
- Bumps the major version number to reflect that this is a major change, even if we have no one who uses the removed feature.
## Why
Mostly because we’re not using it, and we don’t know anyone else who is. Lines of code we run with every build, that builds tools we never use, is a liability in terms of maintenance, performance, test time, and code quality. These files are generated through regular expressions over the generated CSS, which is notoriously fragile; a change in the Styleframe output would require corresponding changes to the parser. There are no tests to validate the parser output.
If we need them back someday, (a) they’re still there, and still categorized, in the DTCG (Design Token Community Group) files and can be extracted at any time and (b) the original code is still in the git history, there for as long as the repo lasts.
Practically, *we* don’t even use the categories in Patternfly SASS files when we look something up; we just got to `patternfly.css` and look at the generated theme file. What `package.json` generates is the base theme for Authentik and the metadata necessary to make that theme malleable for agents and automation tools. The DTCG and Theme CSS Custom Property files are more than sufficient for that purpose; if anything, as a separate source of truth for “what is a property set to?” the category files are a barrier to tooling rather than a help.
* core/outposts: Move `setOutpostHost()` from the client to the server
## What
Writes the `config.outpost.authentik_host` field from information derived on first set-up and available server-side, then removes the same transaction from the client.q
## Why
@beryju has proposed some changes to the Dashboard, and making them would be awkward if a critical infrastructure transaction like this were made “optional” to the system administrator. My first thought was to move just this transaction into a ReactiveController so we could hook it into the lifecycle of something else, like the Dashboard shell or even the entire Admin application shell in ak-interface-admin. He pointed out that the current `main` has `base_url` as a *required* field. So putting it into the server makes sense.
The port was straightforward. I’m not so confident about the tests, but I think they’re right. I’m not as comfortable with the reconciliation process as I should be. There’s some deep magic there. (And *why* is `ManagedAppConfig` in `blueprints`, of all places?)
* Sigh.
* Have I ever mentioned how much I hate side-effects?
* web/admin: create a “permissions datalist” object to use instead of the stock table
## What
Provide a “permissions datalist” object that provides a list of all the permissions per role, so that they’re visible to users and can be manipulated and searched. This view allows users to see the *whole* permission and permission name, rather than the truncated version that sometimes doesn’t stop the whole list from scrolling horizontally off the board.
* Revise, clean, and simplify. Rename and move permission list renderer. Formalize fields needed for display. Remove 'map()'; the native is fine. Add 'id' to all msgs. Fetch APIs in parallel. Simplify sorting; remove redundant sort requests. Unify sort & filter options to a single drop-down.
* Remove debugging code.
* Remove unused property.
* Add the type tag to the display.
* Updated the display: much better and stronger CSS, and now the permissions tag (global, object, or other) is correctly displayed.
* Language change: 'active' -> assigned. Made internal names consistent. Better CSS.
* Young man, in this house we have STANDARDS!
* Update web/src/admin/rbac/ak-rbac-model-permissions-list.ts
Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Ken Sternberg <[email protected]>
* Update web/src/admin/rbac/ak-rbac-model-permissions-list.ts
Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Ken Sternberg <[email protected]>
* Update web/src/admin/rbac/ak-rbac-role-object-permission-table.ts
Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Ken Sternberg <[email protected]>
---------
Signed-off-by: Ken Sternberg <[email protected]>
Co-authored-by: Teffen Ellis <[email protected]>
* core: prefetch token owners and memberships
* core: serialize token owners as partial users
Nothing reads an owner's groups, roles, or computed user fields from
the token API, and fetching them cost several queries per token. Use
PartialUserSerializer and join the owner, so serializing a page of
tokens takes one query.
user_obj on tokens, and on token_obj in SCIM sources and SSF
providers, now has the PartialUser shape instead of the full User.
* core: bound token list query growth instead of counting queries
website/docs: require all flow policies for GitHub organization check
The default source enrollment and authentication flows already bind a
policy that passes on every source login, and flows default to the ANY
policy engine mode. Binding the organization policy to those flows
therefore never denied anyone. Tell readers to switch the flows to ALL.
Co-authored-by: Dominic R <[email protected]>
* docs/single-logout: add information around proxy providers for single logout
* Update website/docs/add-secure-apps/providers/single-logout/index.mdx
Co-authored-by: Dewi Roberts <[email protected]>
Signed-off-by: Connor Peshek <[email protected]>
* Update website/docs/add-secure-apps/providers/single-logout/index.mdx
Co-authored-by: Dewi Roberts <[email protected]>
Signed-off-by: Connor Peshek <[email protected]>
* update feedback and add LDAP information
---------
Signed-off-by: Connor Peshek <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
* crypto: add ML-DSA certificate generation
* make rust and go files
* Potential fix for pull request finding 'CodeQL / Information exposure through an exception'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Connor Peshek <[email protected]>
* update exceptions to not leak information
* add line about radius eap-tls 1.3
* Update website/docs/sys-mgmt/certificates.mdx
Co-authored-by: Dewi Roberts <[email protected]>
Signed-off-by: Connor Peshek <[email protected]>
* clean up migration file
* slight code cleanup
Signed-off-by: Jens Langhammer <[email protected]>
* add todo to remove when fips updates
---------
Signed-off-by: Connor Peshek <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Dewi Roberts <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
Some authenticators send attestation certificates that are not strict
DER, for example ecdsa-with-SHA256 with explicit NULL parameters.
OpenSSL accepts them, but cryptography raises a ValueError that
py_webauthn does not wrap in a WebAuthnException. For packed, TPM, and
FIDO U2F attestation this escaped verification and showed the user a
system exception instead of the registration error.
android-key attestation verifies the certificate with OpenSSL, so
registration can succeed and the ValueError only comes from loading the
certificate for storage afterwards. The credential is valid there, so
register the device without the certificate rather than failing.
* enterprise/providers/microsoft_entra: skip members already in the group
Each group write re-adds every member, and Graph answers a member that
is already in the group with 400 instead of 409. That error became
StopSync, so from the second full sync on, the sync stopped at the
first group with members and skipped the rest of the page. Map that
response to ObjectExistsSyncException, which the member loop already
ignores.
Closes: #26817
* enterprise/providers/microsoft_entra: only add members missing from the group
Graph's 400 for an existing member carries only the generic
Request_BadRequest code, so recognising it means matching the message
text. List the group's members instead and only post the missing ones,
which also stops every full sync from re-posting every member.
* blueprints: re-apply when a file referenced by `!File` changes
The blueprint hash only covered the blueprint file itself, so a change to
a file referenced through a `!File` tag - such as a Kubernetes Secret
mounted into the container and then rotated - was never detected and the
blueprint was not re-applied.
Hash the referenced files' paths and contents alongside the blueprint's
own content, in both places the hash is computed, so discovery and apply
stay in agreement.
Closes#26289
* blueprints: skip `!File` tags whose path is itself a tag when hashing
`File.__init__` assigns `self.path` from `loader.construct_object()` when the
tag is built from a sequence node, so `!File [!Env P, default]` carries a tag
object rather than a string. `Path()` raises `TypeError` on it, which the
surrounding `except OSError` does not catch, and `blueprints_find` has no
per-file guard - so one such blueprint would abort discovery for all of them.
Skip those tags: their own content is already part of the blueprint content
hashed above, and resolving them needs an entry and a blueprint that the
hashing path does not have.
* blueprints: don't let an unreadable `!File` path abort blueprint discovery
The previous commit's guard reads `tag.path` to decide whether to skip the
tag, but `File.__init__` assigns `self.path` only for scalar and sequence
nodes; `path` is otherwise just a class annotation, which creates no
attribute. A `!File` built from a mapping node takes neither branch, so the
guard raises `AttributeError` before it can guard anything. Read the
attribute with `getattr()` so the check cannot be what fails.
`Path(...).read_bytes()` also raises `ValueError`, not `OSError`, for a path
no syscall can accept, such as one containing a null byte, so widen the
except to cover it.
Both inputs parse cleanly and hash without complaint before this series, and
neither `blueprints_find` nor `apply_blueprint` catches either exception, so
a single such blueprint would stop every other blueprint from being
discovered.
Drop the separate digest of the path while here: the path of a tag that is
hashed is a substring of the blueprint content already hashed above, so it
cannot contribute anything the content digest does not.
* blueprints: bound the `!File` tag walk on cyclic blueprints
YAML anchors and aliases let a node be its own descendant, and PyYAML builds
collections in two steps precisely so such documents load. `iter_file_tags`
recurses with no bound, so hashing a blueprint like
context:
secret: &anchor
- *anchor
raises `RecursionError`. `blueprints_find` has no per-file guard around
`blueprint_hash` and `apply_blueprint` does not catch `RecursionError`, so one
such blueprint stops every other blueprint from being discovered - and the
document hashes without complaint before this series, so this would be a
regression rather than a pre-existing limitation.
Skip a node already on the path from the root. A node shared by two disjoint
routes - an ordinary blueprint reusing one anchor - is not its own ancestor, so
it is still walked from each route and its digest is unchanged; suppressing
those instead would silently move the hash of every aliased blueprint in the
wild and re-apply each one once.
Spell the widened `except` as `black` at the version pinned in pyproject.toml
formats it.
* blueprints: pin the per-route hashing of an aliased `!File` tag
A node reached by two routes through one anchor is walked from each of them,
so the file it references is folded into the digest twice, exactly as it is
when the tag is written out twice. Bounding the walk by the ancestor chain
keeps that; suppressing every node seen anywhere would fold it in once and
move the hash of every blueprint that reuses an anchor.
Compute the expected digest from the blueprint's own content rather than
comparing two runs, so the test pins the count and not just stability.
* blueprints: describe the `!File` hash tests by what they assert
The stability cases read as annotations of a patch rather than as tests of the
hash, which is not how the rest of the file reads.
* blueprints: pin the `!File` hash on file removal, swapped contents and cycle fold count
* blueprints: fold the `!File` hash tests into the file's idiom
The tests covering the `!File` hashing added cases one per input, which made
the test diff several times the size of the change it covers. Group the ones
that differ only in the reference they hash into subtests, keeping every input,
and drop the docstrings from the test-local helpers.
* blueprints: pin discovery surviving a two-anchor cycle and an unencodable `!File` path
* blueprints: trim `!File` hashing comments to the runtime contract
* blueprints: test CRLF blueprint discovery and apply hashes agree
* blueprints: pin the CRLF blueprint's discovery hash to its text-mode digest
* blueprints: an unreadable `!File` keeps its place in the hash
blueprint_hash skipped an unreadable reference entirely, so [missing, X] and
[X, missing] both hashed as the content plus the digest of X: a file
disappearing while another appeared with the same contents left the hash
unchanged, and discovery would not re-apply the blueprint. An unreadable
reference now contributes a one-byte marker, where a readable one
contributes its 64-byte digest, so its position counts. Blueprints whose
references all resolve hash as before.
* blueprints: move `!File` hashing to blueprints/v1/hash.py
* core: keep the current login when adding a user after a stale session save
The add-user marker lives in the session's flow plan. A concurrent request that
saved an older copy of the session could drop it, so the login stage treated the
new login as a plain one and login() deleted the previous user's session.
When the brand has a user switch flow, logging in as another user now always
keeps the current login as a switch target.
* core: stop users/me from erasing session data saved by concurrent requests (#26790)
* stages/user_login: only keep the current login for explicit user switches
Treating every login on a brand with user switching as an add-user login
changed what signing in as someone else means and skipped the
internal-user check for added accounts. The plan losing its marker is
fixed at its cause instead.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* core: extend session expiry from users/me without rewriting session data
users/me marked the whole session modified to slide its expiry, so it
saved the session data it loaded at the start of the request. A request
that saved the session in the meantime, like starting "Add another
user", lost its changes, and the flow then logged in without the
add-user marker and signed out the first account.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* core: pin that a plain login replaces the session with user switching enabled
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* core: read expiry_extended directly in the session middleware (#26791)
authentik's SessionStore is the only session engine, so the getattr
fallback never applies. It only hid that save_expiry() right below is
called without one.
Co-authored-by: Claude Opus 5.5 <[email protected]>
* stages/user_login: save only the last IP when a bound session changes IP
The binding middleware set LAST_IP as a session key, which marked the
session as modified. The full save at the end of the request then wrote
back the session data loaded at its start, erasing anything a concurrent
request saved in the meantime, like the user switching flow plan.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Dominic Roy <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
* show remote error details for 4xx/5xx responses
* fall back to default message for empty error bodies
---------
Co-authored-by: Jens L. <[email protected]>
* core: separate applications API
this separates the concept of "RBAC accessible application" and "Policy-accessible application"
Signed-off-by: Jens Langhammer <[email protected]>
* fix tests
Signed-off-by: Jens Langhammer <[email protected]>
* make URL path not clash?
Signed-off-by: Jens Langhammer <[email protected]>
* core: filter accessible applications with action filter backends
The helper that re-ran every filter backend except ObjectFilter only
served the old policy-based list. Declare the backends on the
@accessible action instead, the same way the enterprise requestable
action does, and describe what the endpoint checks in its docstring
since that becomes the API description.
* core, website: test and document the applications API split
Callers that relied on /core/applications/ evaluating policies, or on
its superuser_full_list, for_user and only_with_launch_url parameters,
must move to /core/applications/@accessible/, so call that out as a
breaking change in the 2026.11 release notes.
* remove superuser_full_list from rac devices
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Dominic R <[email protected]>
SCIMPatchProcessor.apply_patches() built its result with dict.copy(), so
every nested mutation (name.givenName, filtered list items, ...) was
written through shared references into the stored attributes dict.
The SCIM source views then compare the patched data against
connection.attributes to decide whether anything changed; because the
original was mutated in place, the comparison saw no difference, the
update was skipped, and the endpoint returned HTTP 200 with the patched
values rendered from the in-memory dict -- so clients like Microsoft
Entra ID saw a successful provisioning while authentik kept the old
values. Patching an existing nested attribute was silently dropped
unless a top-level attribute changed in the same request.
Copy the input deeply so the processor does not modify its input: the
views' change detection can see nested changes again and persists them.
Fixes#26896
Signed-off-by: choksi2212 <[email protected]>
Co-authored-by: choksi2212 <[email protected]>
Co-authored-by: Hermes <[email protected]>
* lifecycle: rewrite the container entrypoint in Rust and add a debug image
* improvements
* rename debug-image stage to just debug
* rename final stage
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Emil Burzo <[email protected]>
* message when readline is unavailable
* remove find_shell / no_shell_error
* refactor commands/arguments based on feedback
* redo
* wip
* wip
* wip
* read AUTHENTIK_DEBUGGER directly in rust instead of shelling out
---------
Signed-off-by: Emil Burzo <[email protected]>
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
The dark-theme overrides pointed the table toolbar and bottom pagination at
--ak-dark-background-light (#1c1e21), while the surrounding card uses the
oklab-defined --pf-global--BackgroundColor--100 (#1b1d21). The one-unit
mismatch rendered as a faint band around the toolbar and pagination rows.
PatternFly's default for both already resolves to BackgroundColor--100, so
the overrides are dropped.
--ak-dark-background-light is a hardcoded #1c1e21 from before the dark
palette moved to oklab tokens. Every surface that still used it (select
toggles, toggle-group buttons, control buttons, the dual-select search
inputs, and readonly or disabled form controls) sat one unit lighter than
the card or modal around it, which shows as a faint seam. Point them at
--pf-global--BackgroundColor--100, which is what their containers use, and
drop the overrides where that is already PatternFly's default. The hover
and gradient uses of the variable are intentional distinct shades and are
left alone.
The multi-step invitation wizard was replaced by a single form in
2026.5, but the docs still described a caret menu, a wizard flow
selection step, and automatic flow selection that no longer exist.
Closes: #26872
* core: fix pagination for user application lists
* core: use query budget in application pagination tests
---------
Co-authored-by: Jens L. <[email protected]>
Since 2026.5 the worker exits when it cannot bind its HTTP or metrics
address, so a server and worker that share a network and use the same
ports take each other down. The error only read "Address already in use
(os error 98)", with nothing saying which component or address failed.
Add both to the error, and document that the server and worker need
different listen ports when they share a network.
Closes: #23531
* Set postgresql sslmode to require
* Don't set postgresql minor version, let aws choose the default for the region
* remove comment
Signed-off-by: Marcelo Elizeche Landó <[email protected]>
---------
Signed-off-by: Marcelo Elizeche Landó <[email protected]>
Since #18274, the default manager of expiring models excludes expired
objects instead of `filter_not_expired()` deleting them. The consent stage
therefore no longer finds an expired consent, and creates a new one, which
conflicts with the expired consent's unique (user, application, permissions)
key until `clean_expired_models` removes it.
Remove expired consents for the user and application before saving.
Closes#24466
Each guide's authentik configuration section opens by naming the
objects the reader will create, such as an application/provider pair,
property mappings, or an outpost, without saying what they are. Link
the first mention of each to its authentik documentation so readers new
to authentik can look it up before following the steps. The template
carries the link so new guides start with it.
Closes: #21963
The memory searcher discarded the errors from the users and groups
paginators and always replaced its snapshot with the result. When the
core API fails during a provider refresh, the paginator returns an
empty list, so one transient error replaced a known-good directory
with an empty one. Every search then returned no entries or was
denied until a later refresh succeeded or the outpost restarted.
fetch() now checks both errors. If either fetch failed and a previous
snapshot exists, it logs the error and keeps the previous snapshot.
Users and groups are kept together, so a snapshot never mixes data
from two fetches. On the first fetch there is no previous snapshot,
so the searcher stores what it got, as before, and the next
successful refresh replaces it.
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Jens L. <[email protected]>
* sources/oauth: follow Entra ID group pagination
* sources/oauth: simplify Entra pagination tests
* sources/oauth: use msgraph client for Entra group pagination
Closes: #26497
* sources/oauth: generate Entra ID test tokens
* sources/oauth: use the new Entra entity conversion helper
* sources/oauth: avoid sharing Entra Graph request headers
kiota's RequestConfiguration uses a shared HeadersCollection default, so
Authorization values accumulated across Graph requests and users.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* enterprise/agents: add user queryset filters
* core: restore explicit anonymous-user manager filter
* enterprise/agents: move user queryset filters into models
Delegate through local imports so core models can finish loading before the agent models import User and Actor.
* core: only allow internal users in user switching
The account switcher is only in the User interface, which external
users can't open, so adding one left the browser's other logins
unreachable.
Closes: #26676
* core: keep user switching add-user context through source logins
A source picked inside "Add user" planned its own flow without the
add-user context, so the login linked the source to the current user
or replaced the current session instead of adding one.
* core: track user switching add-user outside the flow plan
SAML POST bindings and Telegram replace the flow plan before the source
callback, and a plan left by an abandoned "Add user" lingers in the
session. Use a session key that the source callback consumes and that
opening an interface clears. Refuse source enrollment during "Add user",
since enrollment creates the user before the login stage can refuse it.
* core: import add-user session key directly
* core: ignore tracing errors for add-user enrollment denial
* flows: respect authentication requirements when adding users
* ci: pull the e2e server image from 127.0.0.1
On ubuntu-26.04, localhost resolves to ::1, which Docker does not treat as an
insecure registry, so the pull tried HTTPS on port 443 and failed. 127.0.0.1 is
insecure by default and falls back to HTTP on the registry's port 80.
* ci: pull the e2e server image from a registry on port 5000
Docker on ubuntu-26.04 won't fall back to HTTP for a registry without a port.
Pins action-setup-authentik to goauthentik/action-setup-authentik#42, which
splits the version input on its last colon.
* switch tagged
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
* web/elements: wait for form fields to settle before submitting
Some fields only know their value once they have loaded their options, e.g. a
search select that preselects a default flow. A form submitted before then
serialized them empty.
- Add a SettlingFormField contract (a `settled` promise) and
settleFormFields(), which waits on every settling field in a form.
- Form.submit() settles the form's fields before validating and serializing.
- FormWizardPage no longer pre-validates before submit(), which settles and
validates itself, and treats a `false` result as a failed step.
- The application wizard's provider step settles before checking validity.
* web/elements: rebuild ak-search-select as a form-associated element
Replace ak-search-select, its view, ak-list-select, and the EZ variant with a single
form-associated element built on the platform: a native combobox input, a popover
listbox positioned with CSS anchor positioning (with a JS fallback for Firefox), and
ElementInternals for its value and validity.
- `value` is the chosen key. Options come from a SearchSelectSource (fetchObjects,
keyOf, labelOf, describe, isDisabled, groupBy, preselect). `selectedObject` labels
the field before the options load, and the selection stays listed when it isn't on
the fetched page.
- `settled` resolves once the latest fetch lands, for Form.submit() to wait on.
- Keyboard navigation with aria-activedescendant, a pinned action item, a blank
option, creatable free text, and closing on outside clicks even when focus stays in
the input. A late preselection doesn't close an open menu.
- The input takes its accessible name from `label`, the field's <label>, or the
enclosing horizontal form element, since none can reach it across the shadow root.
- `emptyValue` sets what an empty field serializes as, for string fields.
Component tests cover the element.
* web: add search select components and shared sources
Replace the per-type wrapper elements with function components over the new element:
AKSearchSelect and AKSearchSelectField, AKFlowSearch and AKFlowField, and
AKCertificateSearch. Shared sources for policies, groups, users, device access groups,
roles, and notification mappings live in #admin/common/search-sources.
ak-file-search-input moves onto a file source with free-text values.
* web/admin: add presets for provider and source flow fields
The authorization, authentication, and invalidation flow fields repeat across the
provider forms, and the pre-authentication, authentication, and enrollment flow fields
across the source forms. So do the SAML NameID and AuthnContextClassRef mapping fields.
Each becomes a field preset with the shared wording, which forms can override.
* web/admin: move provider forms onto the new search select
Also fixes the brand's default flows never preselecting in the LDAP and RADIUS
provider forms: the brand stores slugs, not primary keys.
* web/admin: move source forms onto the new search select
* web/admin: move stage and flow forms onto the new search select
* web/admin: move application and policy forms onto the new search select
* web/admin: move the remaining forms onto the new search select
Brands, outposts, events, RBAC, blueprints, endpoints, lifecycle rules, requests,
tokens, users, object attributes, property mapping tests, and sync objects. Blueprint
paths serialize as an empty string when unset, since the field isn't nullable.
* web/test: cover the new search select end to end
The form fixture finds search selects by their label and chooses options by role.
New cases cover a default flow still loading at submit, keyboard and search, outside
clicks, edit forms showing saved values, and a group binding in the application
wizard.
* web/elements: drop the settle helpers duplicated from main
Rebasing onto main brought in settle-form-fields.ts from #26566, while this
branch still carried its own earlier copy of settleFormFields and
SettlingFormField in form-associated-element.ts. Form.ts imported both, which
failed type checking with a duplicate identifier.
Keeps main's version, which also times out and never rejects, and points
Form and ak-search-select at it.
* web/admin: save the LDAP source's parent group; scope create clicks in tests
The LDAP source form submitted its parent group as `additionalParentGroup`,
a name the API doesn't know, so the group never saved. Submit it as
`syncParentGroup`.
The admin tables render a second create button in their empty state while rows
load, so an unscoped "New …" click could match two buttons. Scope those clicks
in the e2e tests to the table toolbar, as the provider tests already do.
* web/elements: send numeric keys to the API as numbers; keep option IDs unique
- Sources can declare parseKey(); the user and provider sources send their
primary keys as numbers again, matching main.
- Object option IDs get their own prefix and an unambiguous encoding, so keys
like "blank" or "action" no longer collide with the built-in options.
- The active option scrolls into view by its rendered ID.
* web/elements: settle form fields before wizard and modal validation
Wizard steps and modal forms checked validity synchronously before waiting for
fields to settle, so a required search select still preselecting its default
rejected the click and never retried.
- WizardStep waits for settled() before validating Next/Finish and ignores
repeat clicks meanwhile; ApplicationWizardStep settles its form.
- ModalForm settles the form before its validity check.
- Cover the provider step with an e2e test that holds back the invalidation flows.
* web: recover stranded Transifex translations into canonical xliff files
Transifex writes web/xliff/<lang>.xlf with underscore codes (cs_CZ.xlf),
but lit-localize only reads the hyphenated files named in targetLocales.
Translator work landing in the underscore files never shipped.
Fold each underscore file into its canonical sibling, following the
#24563 recovery rule: a stranded target wins over the existing one. A
donor target is only taken when its <source> matches the canonical
source and its placeholder ids match; placeholders are rewritten from the
canonical source so equiv-text stays current.
- In-tree duplicates: cs_CZ, de_DE, fi_FI, fr_FR, it_IT, ja_JP, pt_BR,
bg_BG, pl_PL, plus ar_AA -> ar and no_NO -> nb-NO.
- Files deleted by #24024, recovered from 1dc509dca^: es_ES, ko_KR,
ru_RU, tr_TR (and the older cs/de/fi/fr/it/ja/pt_BR copies as a
lower-priority donor).
2,478 targets filled and 167 replaced across 15 locales. The underscore
duplicates are removed. Orphans for unshipped locales (bn_BD, cy_GB,
da_DK, hr_HR, sk_SK, sv_SE) are left for their enablement PRs.
* web: fix recovered French Kerberos help and typos
The recovered fr-FR Kerberos sync help described a password or keytab cache instead of the alternative credentials. Also fixes a French typo and a German formal/informal mix.
* core, web: register locales in locales.yaml and normalize Transifex paths
Transifex substitutes its own language code into both translation paths,
and its language_mapping is global, so it can't satisfy lit-localize
(pt-BR.xlf) and Django (locale/pt_BR/) at once. Files landed under names
neither build reads, and nothing reported it.
- locales.yaml is the source of truth: tag, Django directory, Transifex
code, and whether the locale ships.
- `make gen-locales` writes targetLocales, the LocaleLoaderRecord
region, and the Transifex language_mapping (code -> web tag).
- `make locales-normalize` moves locale/<tag>/ to locale/<to_locale(tag)>/
and folds stray xliff files into their canonical file.
- `make lint-locales` / ci-lint-locales fail on unregistered paths and
stale generated files. A Django test checks each shipped catalog loads.
- A workflow normalizes Transifex PRs and pushes the correction.
Migration: ar_AA -> ar and no_NO -> nb_NO backend catalogs merged;
locale/zh-Hans and zh-Hant renamed to zh_Hans/zh_Hant, which Django
can now find (it served 37 of 1043 zh-Hans strings before); unshipped
xliff orphans renamed to their tags.
Refs #24563
* core: address locale pipeline review
- Normalize xliff target-language on every recognized file, not only
renamed ones, and fail the check on a mismatch. Transifex's mapping
renames files but keeps aliases like ar-AA inside them, and
lit-localize keys catalogs by that attribute.
- Merge every file from a Transifex locale directory, not only
django.po. A conflicting non-catalog file stops the merge before
anything is deleted.
- Set each catalog's Language header to its directory, and check it.
- Type the merge callback for mypy --strict.
- Ignore msgstr == msgid in the catalog test, so an English fallback
can't count as a served translation.
* core, web: ship bn-BD and sk-SK through locales.yaml
Bengali and Slovak were enabled on main by hand. Register them as shipped so the generated lists stay in sync.
* web: re-extract locales
Normalizes Transifex entity escaping in recovered targets and drops the removed base-URL banner strings.
* ci: harden translation normalize workflow
currently there's a single load state before JS is loaded, then an empty card before the challenge is loaded. once the initial challenge is loaded, there's a shift since the flow title is now there.
This switches directly from no js-load to empty card load with flow title, causing one less layout shift
Signed-off-by: Jens Langhammer <[email protected]>
meta: fix `core-install:uv cache clean` on MacOS
## What
Replace the `ifdef` expression for checking if the `brew` program is installed on MacOS with one that actually works.
## Why
The check to clean the `uv` cache and install `libxml` and `xmlsec` never ran on MacOS. Now it will.
## Details
While I was debugging the Makefile, the “checkmake” linting program (can’t recommend it; it missed a lot of things) noted that the construct `ifdef ($(BREW_EXISTS))` contains a `$` and so was likely wrong. Sure enough,
> The `ifdef` form takes the *name* of a variable as its argument, not a reference to a variable. If the value of that variable has a non-empty value, the *text-if-true* is effective; otherwise, the *text-if-false*, if any, is effective. Variables that have never been defined have an empty value.
The `ifdef` expression [takes a bare variable name](https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html), not a reference. If you passed it a variable expression, `$(BREW_EXISTS)`, then the *contents* of `BREW_EXISTS` (either “” or “/opt/homebrew/bin/brew”) will be looked up in Make’s variable table and it returns true there is a variable with either name… which of course, there isn’t, as both are invalid variable names.
Of course `make` doesn’t tell you that. Make’s error checking, even GNU Make, kinda sucks.
The correct check is `ifneq ($(BREW_EXISTS),)`, the part after the comma expressing “empty string.”
## What
This commit turns the import of `ak-search-ql` into a lazy import, reducing the weight of those pages that don’t use it and don’t need it. It keeps ahold of the promise used to resolve the import, and the browser will always return `true` immediately after the first import since the component will be cached, even if working with an entirely new table and TableSearch object.
## Credit
@zwj-cheer (or their Agent) has been making some interesting changes to the authentik UI. [The lazy import idea from this commit](https://github.com/goauthentik/authentik/commit/3846fb687d0588b422abc8a8f86156d3473ea4c6), and I quite liked it, although using `until()` to display the correct Lit anchor until the import completes is not in zwj-cheer’s original.
* web: enable Bengali (bn-BD) locale
Adds bn-BD to the target locale list and its module loader entry so
the Transifex-translated Bengali strings compile and become
selectable in the UI language picker. Renames
web/xliff/bn_BD.xlf to bn-BD.xlf (content unchanged) to match the
project's hyphenated locale code convention used by every other
target locale.
Translation content itself is left untouched; Transifex sync will
continue to update it as usual.
Signed-off-by: Azharul Haque <[email protected]>
* Update extract.
* Second pass at filling in gaps.
---------
Signed-off-by: Azharul Haque <[email protected]>
Co-authored-by: Azharul Haque <[email protected]>
Co-authored-by: Teffen Ellis <[email protected]>
* Add caching static assets info
* Update website/docs/install-config/reverse-proxy.mdx
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Dewi Roberts <[email protected]>
---------
Signed-off-by: Dewi Roberts <[email protected]>
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
* web/elements: wait for form fields to settle before submitting
Some fields only know their value once they have loaded their options, e.g. a
search select that preselects a default flow. A form submitted before then
serialized them empty.
- Add a SettlingFormField contract (a `settled` promise) and
settleFormFields(), which waits on every settling field in a form.
- Form.submit() settles the form's fields before validating and serializing.
- FormWizardPage no longer pre-validates before submit(), which settles and
validates itself, and treats a `false` result as a failed step.
- The application wizard's provider step settles before checking validity.
* web/elements: time out settling fields and ignore repeat wizard clicks
Move the settle helpers into a DOM-free module so they can be unit
tested, give settleFormFields a timeout so a stalled field request
can't hang submission, and ignore repeated "next" clicks while the
provider step is still settling.
* web/elements: replace the custom event mixins with typed events and @listen
CustomEmitterElement and CustomListenerElement predate typed Event subclasses
and the @listen decorator. Remove both and eventEmitter.ts.
- ak-dual-select: DualSelectEvent and SearchbarEvent, registered in
GlobalEventHandlersEventMap with the same `detail` shapes as before. The
provider listens with @listen, which also stops it re-adding its listeners
on every reconnect.
- BaseTaskButton, ak-checkbox-group, and the application wizard's submit step
dispatch plain events (the latter an AKRefreshEvent).
- The search wrappers drop the listener mixin they never used.
Fix @listen along the way:
- Its docs said listeners attach to `window`; the default target is the
element itself.
- A subclass adding its own @listen wrapped the parent's lifecycle hooks a
second time, leaving the parent's listeners attached after disconnect.
- Reconnecting without a disconnect no longer stacks registrations.
- Plain methods are bound to the element, so `this` is right for any target.
* Fix matchers.
* web: move NamedEntity types to #common/api/entities
The entity naming types lived in the dialogs module, and ModelForm kept its own
copy of the predicate. Both now come from one place, which the document title
helpers can also use.
* web: move page details and document titles to #elements/router/meta
setPageDetails lived in ak-page-navbar, so importing it also registered the
navbar element. It now lives in a small module of its own, alongside a shared
formatDocumentTitle/setTitle. The branding mixin exposes setTitle, and the
navbar, flow executor and RAC interface use it instead of building titles by
hand. The admin interface now imports the navbar explicitly.
* web/user: set document titles for user pages
The user interface has no page navbar, so its pages never set a title and every
tab read as the brand alone. Each page now announces its header, and the
interface turns it into the title ("Applications - authentik").
* web/user: include the active tab in document titles
Path-routed tab groups now announce their active tab's label, and the user
interface puts it ahead of the page header, e.g. "My Requests - Discover -
authentik".
* web/admin: include the sidebar section in detail page titles
A detail page's title now names its list page, using the same activeWhen
patterns that highlight the sidebar entry: "<name> - Providers - Admin -
authentik". List pages already name themselves and are left as they were.
* Fix issue where clicking links to same link causes reload.
* Fix alignment.
* web/admin: track the route path as state instead of forcing an update
The navbar's section was computed from location in render, which Lit does not
track, so the route listener called requestUpdate. Store the pathname as state
instead, so only a real path change re-renders. It stays raw because the
element upgrades before the entrypoint calls initRouter; the interface prefix
is stripped at render time.
* web/admin: match sidebar entries by route name
Sidebar entries carried hand-written regexes that duplicated the route table,
and they drifted when tabs moved into the path: a detail page's tabs
(/outpost/outposts/<uuid>/tasks) left the sidebar with no active entry. Entries
now list the route names that keep them active, resolved through the router's
own matcher.
ChannelsLoggingMiddleware decoded the User-Agent and X-Forwarded-For
header values as strict UTF-8. Header values are raw bytes and HTTP
doesn't require them to be UTF-8, so a client sending any other byte
(for example the Meta AI in-app browser on iOS, whose User-Agent has a
Latin-1 non-breaking space, 0xA0) made log() raise UnicodeDecodeError.
log() runs before the middleware's try, so the handshake failed with a
500 and the client couldn't open a websocket at all.
Decode with errors="backslashreplace": valid UTF-8 is logged as before,
and other bytes are logged escaped (\xa0) instead of failing.
Co-authored-by: Jens L. <[email protected]>
* ## What
window.authentik.flow = {
"layout": "{{ flow.layout }}",
+ "background": "{{ flow.background }}",
+ "title": "{{ flow.title }}",
};
Amends the `flow.html` template and `GlobalAuthentik` parser to include new parameters, `background` and `title`, in the flow-specific part of the configuration written to the HTML `<head>` object, and to provide those parameters to client code.
## Why
The `layout` is start-up critical: it tells the Flow interface how the admin wants the Flow page to look, and allows the HTML and CSS to be pre-aligned to that condition. `layout` is determined on a per-Flow bases, not a per-Stage basis; Flows are derived from a tuple of `(Brand, Application?)`, where the opening policy *may* direct a user to a different flow if the user reached authentik via a redirect from a specific application, but will otherwise fall back to the default Flow for the Brand.
The `background` is a field that is required if the `Flow`’s layout is of type `frame_background`; in this case, the part of the viewport not dedicated to the FlowExecutor is reserved for an `<iframe>` that will be filled in with whatever the administrator specifies. Although this gives it the same priority as `layout` (whether it’s provided or undefined) for describing the [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome) around a challenge, it is currently not provided to the application in the start-up config; it is provided in the `challenge` and renders the IFrame as part of the initial challenge.
This patch fixes that; if `layout` is provided, `background` ought to be as well, even if it’s empty. The execution of a Challenge ought not have any influence over the look and feel of the Flow-defined appearance *around* that Challenge.
I have added `title` as well; with that, all of the current theme-and-appearance related configuration details are placed into `<head>` and can be removed from the FlowExecutor.
Server-side, `background` is currently specified: `background = FileField(blank=True, default="")` which is … interesting since we also appear to store URLs in it. I don’t see anything in the FlowSerializer that would change that from a client’s point of view.
This patch furthers the effort to separate flow execution from flow presentation.
- \[🐰\] The code has been formatted (`make web`)
* web/maintentance: update deprecated browser test imports
# What
Update imports of `@vitest/browser/context` to `vitest/browser`.
# Why
To eliminate these warnings:
- DEPRECATED /Users/ken/projects/dev/web/test/lit/setup.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" instead.
- DEPRECATED /Users/ken/projects/dev/web/test/lit/rendering.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" i
Sorry, been using the tests and Storybook a lot lately. Cleaning up as I go along.
* web/website/docs: Amend the Blueprints documentation to describe what a blueprint *is*
# What
This commit revises the “Blueprints: Blueprint Execution” section of the documentation to give a precise, concrete definition of what a Blueprint file actually is: a series of instructions to create, modify, or delete objects and their relationships within the authentik database. It gives examples of these relationships, and describes how instantiating these objects and their relationships within authentik is order-dependent.
I also re-arranged a few sentences in that section for readability, using [Vale](https://docs.vale.sh/) and the Microsoft style guide as an example. I ignored a *lot* of the advice, but a few things stood out as “Yeah, that could be clearer.”
# Why
Mostly because I never understood exactly what the heck a Blueprint was until I read that single, clear sentence elsewhere, that’s why. Surely I’m not the only person feeling perplexed about it.
* Stylistic choices following the Microsoft style guide with the no-ai-voice mod. The section of blueprint instantiation was edited to my best understanding of @beryju's explanation of the current rules for when the directory is scanned or monitored.
* Last minute change caused link breakage. Sorry about that.
* Making requested changes.
* Oxfmt has an opinion.
* core: split users list superuser annotation into two EXISTS subqueries
UserViewSet annotates every user with is_superuser using one EXISTS with
an OR across two join paths: direct membership of a superuser group, and
membership of a descendant group through authentik_core_groupancestry.
PostgreSQL can't convert a subquery whose OR mixes two correlated
conditions into a hashed subplan, so it runs once per user row, including
rows skipped by OFFSET and inside DISTINCT/COUNT wrappers. Its join plan
also depends on the ancestry materialized view's statistics: once a first
group hierarchy exists and the view's stats are stale, the planner can
pick a merge join that scans every group for every user.
Use two separate EXISTS subqueries combined with OR instead. Each one is
correlated only by user id equality, so PostgreSQL can run it once per
query as a hashed subplan. The result is unchanged: a user is a superuser
if they are a member of a superuser group or of any of its descendants,
the same as User.is_superuser.
Add tests for direct, child, grandchild, non-superuser parent and no
group membership in the list and detail endpoints, and check that the
list doesn't add group queries per user.
* core: drop ExpressionWrapper from superuser annotation
Exists | Exists already resolves to a Q with a boolean output field, so
the wrapper isn't needed. The generated SQL is unchanged.
* core/applications: Make Application List cache timeout a configurable option
## What
Adds a new entry to `default.yml`: `cache.timeout_application_policies`.
Modifies `core/api/applications.py` to apply use the timeout. Supplies a default if the value is missing from `default.yml`.
Updates the *Installation and Configuration* documentation to describe the new field.
## Why
Answering issue \#26279: @BeryJu suggested: “A better option would including making the default cache duration shorter.” So why not make it configurable?
* dont need a var
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
* core, web: update Russian translations
Consolidates the community Russian translations from #25518 and #26619,
applied onto the current locale files by message key so later Transifex
syncs are preserved.
- django.po: fills 412 missing backend strings (#25518) and revises 13
(#26619). Multi-line email/Kerberos strings from #25518 had literal
newlines that broke msgfmt; these are repaired.
- ru-RU.xlf: adds 36 web UI strings and fixes 3 (#26619).
- Review fixes: participle agreement in the SAML issuer help text, and
kept the existing, more accurate wording for the MFA email and
identification-data errors. Translated "relying parties", clarified
"OAuth (Silent)", and capitalized Outpost consistently.
Closes#25518Closes#26619
Co-authored-by: FerrumNST <[email protected]>
Co-authored-by: Mikhail Frolov <[email protected]>
* web: draft remaining Russian web UI translations
Fills the 1,774 untranslated units in ru-RU.xlf, bringing the Russian
web UI from 48% to complete (excluding one empty source string).
These are machine-drafted and should get a native-speaker pass. Terms
follow the existing human translations where a precedent exists
(Outpost = внешний компонент, Flow = поток, Blueprint = чертеж,
Slug = идентификатор, Notification Transport = поставщик уведомлений).
New terms: Entitlement = право доступа, Reviewer = проверяющий,
OAuth grant type = тип гранта, Offboarding = офбординг.
Strings that interpolate a runtime noun use colon constructions
("Создать: …") to avoid Russian case and gender agreement errors.
All placeholders were checked against the source and the locale
build compiles.
* Second pass with edits.
---------
Co-authored-by: FerrumNST <[email protected]>
Co-authored-by: Mikhail Frolov <[email protected]>
* web: preload the locale catalog to kill the flash of English
The locale catalog chunk previously downloaded only after the entry bundle
booted, so a non-English page briefly rendered in English. The server now
tells the browser which catalog to fetch up front.
- the web build emits dist/manifest.json mapping each locale tag to its
content-hashed catalog chunk (esbuild metafile), for both build and watch
- a {% locale_modulepreload %} template tag reads that manifest (cached
in-process, tolerant of a missing/malformed file) and emits a
<link rel=modulepreload> for the request's resolved locale; the source
locale and en-XA pseudo-locale emit nothing
- wire the tag into skeleton.html next to the entry scripts
Full production-build verification of the manifest is pending a working web
dependency install (this tree is missing the MDX build deps); the plugin's
metafile->manifest mapping is covered by the template-tag tests and an
isolated esbuild probe. Making first render await the catalog import is a
small follow-up that pairs with the C4 LocaleContextController rework.
Co-authored-by: Playpen Agent <[email protected]>
* no more mark safe
Signed-off-by: Jens Langhammer <[email protected]>
* actually no we need it
Signed-off-by: Jens Langhammer <[email protected]>
* ts ts ts claude
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Playpen Agent <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
* web/test: skip the vendor CAPTCHA tests on CI
The @vendor-network tests load CAPTCHA widgets from the vendors' servers,
which CI can't rely on reaching. They fail on nearly every run and use up
the five-failure budget before other tests get to run. Skip them when CI is
set; they still run locally.
* web/test: fix the ak-mdx docs link and application wizard flakes
The ak-mdx link test expected relative docs links to resolve to
next.goauthentik.io. That's only the pre-release docs host: a build with
GIT_BUILD_HASH set, like the CI image, resolves them to the versioned host
(version-<major>-<minor>.goauthentik.io). So the test failed whenever it ran
in CI, and only looked intermittent because CI stops after five failures and
the vendor CAPTCHA tests often used those up first. Accept either host.
The application wizard's provider step now settles its fields before moving
on, so the test's next "Next" click could land on that step's button again
and leave the wizard short of the review step. Wait for the bindings step to
show before continuing.
* web: persist locale in a cookie and reload to switch
Locale becomes fixed for the lifetime of a page: instead of switching live
in JavaScript, every locale-change path now persists the preference to the
Django language cookie (which LocaleMiddleware already reads) and reloads,
so the server re-renders every string — including server-rendered flow
challenges — in the new locale. This structurally rules out the mixed
client/server language state behind #18179 / #22954.
- add persistLocale/applyLocaleChange helpers backed by the authentik_language
cookie; switch the flow locale selector, the user-settings prompt stage, and
the session controller's post-render locale application to persist + reload
- drop the sessionStorage['authentik:locale'] path and remove it from
autoDetectLanguage; the server-resolved hint (window.authentik.locale) is now
authoritative, with navigator.languages only relevant on a first anonymous visit
- honor ?locale= server-side in LocaleOverrideMiddleware (validated via
check_for_language) so the shell and the web UI, which read the same parameter,
cannot disagree. It sits directly after ImpersonateMiddleware, which wraps the
rest of the chain in the user's saved locale, so an explicit override wins
- unit-test the cookie helper; test the server-side ?locale= override
Live-switching machinery (LocaleContextController observer, msg() thunks) is
removed separately in a follow-up.
Co-authored-by: Playpen Agent <[email protected]>
* Clean up cookie parsing, tests.
---------
Co-authored-by: Playpen Agent <[email protected]>
* meta: fix Makefile documentation
## Why
I actually use the Makefile, and `make help`, a lot. I started to realize that it was getting a bit scrambled, with some important targets not document and others no longer reflecting what they actually do.
## What
Fixed spelling of “authentik” (not “Authentik”) in several places.
lint-fix, lint, gen-build, docs, integrations, all: These commands all either misrepresented what they do, or were incomplete in their description.
migrate, dev-reset, install, node-install, web, web-test, test, run-watch: Mostly correct, but sometimes wrong in the details, missing one or more sub-targets, and otherwise just needing to be fixed.
core-install, lint-fix-rust, web-lint-fix, web-lint, web-check-compile, docs-lint-fix, docs-build, integrations-build, docs-api-build, aws-cfn, and test-docker: These didn’t have help strings, and they’re central enough that they should. docs-build, docs-api-build, and integration-build especially, since they all have docs-*-watch equivalents that *were* documented.
makemigrations: Only accessible from `uv ak run` prior to this change.
web-check, web-test, web-test-e2e, web-test-visual: Only accessible via `pnpm --dir web run` prior to this change.
docs-test, docs-check: Only accessible via `pnpm --dir website run` prior to this change.
## Name alignment
A lot of these names are… nonsense. We use `lint` where we mean `fix`, `format` where we mean `lint`. @BeryJu (65.5%), @risson (14.2%), @GirlBossRush (6.3%) and @PeshekDotDev (3.3%) are the most frequent contributors to changes in the Makefile; I would welcome contributions on how to enforce the following:
- lint: Report on issues but do not change them (spelling, formatting)
- spellcheck: Use for spell-checking only
- format: Apply formatting rules to the source code (oxfmt, rustfmt, black)
- fix: Apply non-formatting automatic fixes to machine-fixable issues
- prep: Apply format & fix, then lint and return non-zero if unfixable issues remain
- test: Build what is necessary, then run the test
- build: Use when the result is a local artifact, a concrete, runnable or useable result. Examples: `build-go-client`, `build-ts-client`.
- watch: Use when instantiating a notify-driven build-on-demand process
- verify: Use when validating the development environment, not the source (use lint) or the artifacts (use test)
- install: Use when pulling crates, packages, libraries, and dependencies
* Typo in `lint-fix` documentation
* web/admin: show agent connector local auth & compliance status
* update docs
Signed-off-by: Jens Langhammer <[email protected]>
* Update website/docs/endpoint-devices/authentik-agent/device-authentication/local-device-login/linux.mdx
Signed-off-by: Dewi Roberts <[email protected]>
* Apply suggestion from @dewi-tik
Signed-off-by: Dewi Roberts <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Dewi Roberts <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
* core/policies: Second cache-clear not needed
## What
Delete the second `cache.delete_many` in `PolicyViewSet.cache_clear`, because it expresses a subset of what is deleted in the first, so it effectively does nothing.
## Details
Both `core/api/applications.py` and `policies/api/policies.py` both import
from authentik.policies.types import CACHE_PREFIX
`policies/api/policies.py` performs the following cache-clearing:
keys = cache.keys(f"{CACHE_PREFIX}*")
cache.delete_many(keys)
keys = cache.keys(user_app_cache_key("*"))
cache.delete_many(keys)
However, the `user_app_cache_clear`, defined in `core/api/applications.py` includes the `CACHE_PREFIX` as its prefix; they’re not different:
"""Cache key where application list for user is saved"""
key = f"{CACHE_PREFIX}app_access/{user_pk}"
The second cache-clearing `.keys()` retrieval will always be empty. The effect does nothing.
* core/applications: Make client_ip apart of the UserApplicationCacheKey
Closes \#26279
## What
Adds the `client_ip` as a key to the generated `user_app_cache_key` when storing or retrieving a cached user_applications list.
## Why
This adds another layer to fixing the application list caching problem, in this case the second reported issue, “When a user connects or disconnects a VPN connection, their client IP changes. The application tile on the dashboard does not update to reflect the new IP.” If they get a new IP, it’s treated as a new cache and that cache will be populated automatically.
* readme: fix broken brand logo
Signed-off-by: Dominic Roy <[email protected]>
* i need a red text one which the website doesn't seem to have
Signed-off-by: Dominic Roy <[email protected]>
---------
Signed-off-by: Dominic Roy <[email protected]>
* core/policies: Second cache-clear not needed
## What
Delete the second `cache.delete_many` in `PolicyViewSet.cache_clear`, because it expresses a subset of what is deleted in the first, so it effectively does nothing.
## Details
Both `core/api/applications.py` and `policies/api/policies.py` both import
from authentik.policies.types import CACHE_PREFIX
`policies/api/policies.py` performs the following cache-clearing:
keys = cache.keys(f"{CACHE_PREFIX}*")
cache.delete_many(keys)
keys = cache.keys(user_app_cache_key("*"))
cache.delete_many(keys)
However, the `user_app_cache_clear`, defined in `core/api/applications.py` includes the `CACHE_PREFIX` as its prefix; they’re not different:
"""Cache key where application list for user is saved"""
key = f"{CACHE_PREFIX}app_access/{user_pk}"
The second cache-clearing `.keys()` retrieval will always be empty. The effect does nothing.
* Apply suggestion from @BeryJu
Signed-off-by: Jens L. <[email protected]>
---------
Signed-off-by: Jens L. <[email protected]>
Co-authored-by: Jens L. <[email protected]>
* web/user: make MFA device keys unique for bulk-delete
Closes \#25287
## What
Replaces blunt and embedded “PK or JSON blob” algorithm in `ak-table` with an overrideable `makeItemKey` that allows client code to dictate how to generate the key from a row object.
Uses `makeItemKey` to create unique item keys for MFA devices, since their primary key is just a simple auto-increment on a per-device-type basis, which easily leads to collisions.
This technique can be expanded to the wider collection of Table-using pages as needed.
* 'Table.makeItemKey()' deserved documentation.
* makeItemKey is a property; let clients know they can override *or* provide.
Spell the brand icon filenames the American way, consistent with the
rest of the codebase's spelling conventions, and redirect the old
URLs so existing links and embeds keep working.
pbf 5 exports PbfReader, which is the type @mapbox/vector-tile expects,
so extract-labels.ts no longer fails to type-check.
Co-authored-by: Playpen Agent <[email protected]>
* remove tenants
* remove unused ignore
* add missing migration
* merge migrations
* remove probably-unneeded redirect
* fix docs link
* fix e2e tests
* fixup! fix e2e tests
* change `base_url` to `TextField`
* abstract `schema_name`
* keep database fields required for rolling upgrade
These should be deleted in a subsequent cleanup patch.
* introduce system settings cache
This is a bit more complicated than other middleware context var caches,
because invalidation is sometimes needed.
* cleanup
* fixup! change `base_url` to `TextField`
* fix tests
Whoops
* ## What
window.authentik.flow = {
"layout": "{{ flow.layout }}",
+ "background": "{{ flow.background }}",
+ "title": "{{ flow.title }}",
};
Amends the `flow.html` template and `GlobalAuthentik` parser to include new parameters, `background` and `title`, in the flow-specific part of the configuration written to the HTML `<head>` object, and to provide those parameters to client code.
## Why
The `layout` is start-up critical: it tells the Flow interface how the admin wants the Flow page to look, and allows the HTML and CSS to be pre-aligned to that condition. `layout` is determined on a per-Flow bases, not a per-Stage basis; Flows are derived from a tuple of `(Brand, Application?)`, where the opening policy *may* direct a user to a different flow if the user reached authentik via a redirect from a specific application, but will otherwise fall back to the default Flow for the Brand.
The `background` is a field that is required if the `Flow`’s layout is of type `frame_background`; in this case, the part of the viewport not dedicated to the FlowExecutor is reserved for an `<iframe>` that will be filled in with whatever the administrator specifies. Although this gives it the same priority as `layout` (whether it’s provided or undefined) for describing the [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome) around a challenge, it is currently not provided to the application in the start-up config; it is provided in the `challenge` and renders the IFrame as part of the initial challenge.
This patch fixes that; if `layout` is provided, `background` ought to be as well, even if it’s empty. The execution of a Challenge ought not have any influence over the look and feel of the Flow-defined appearance *around* that Challenge.
I have added `title` as well; with that, all of the current theme-and-appearance related configuration details are placed into `<head>` and can be removed from the FlowExecutor.
Server-side, `background` is currently specified: `background = FileField(blank=True, default="")` which is … interesting since we also appear to store URLs in it. I don’t see anything in the FlowSerializer that would change that from a client’s point of view.
This patch furthers the effort to separate flow execution from flow presentation.
- \[🐰\] The code has been formatted (`make web`)
* web/maintentance: update deprecated browser test imports
# What
Update imports of `@vitest/browser/context` to `vitest/browser`.
# Why
To eliminate these warnings:
- DEPRECATED /Users/ken/projects/dev/web/test/lit/setup.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" instead.
- DEPRECATED /Users/ken/projects/dev/web/test/lit/rendering.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" i
Sorry, been using the tests and Storybook a lot lately. Cleaning up as I go along.
* web/bug: \#22744: Do not silently clear API-set cookie_domain on save
- Closes \#22744
- Supersedes \#4063
# What
This is the smallest and most straightforward fix; it continues to silently clear the `cookie_domain` field, but *if and only if* the proxy was in `ForwardDomain` mode and switched away from it. This prevents a stale cookie domain from being present if the user changes the proxy mode from the UI.
The original lines addressed issue \#4063, “switching from forward auth (domain level) to forward auth (single application) should reset domain value of the cookie authentik_proxy.” The Rust outpost uses a different algorithm (issue \#4666, “different cookie name based on hashed client_id”) than the one in 2022, creating uniquely signed cookies but allowing them to use `Domain:`, so the browser can have two cookies scoped to a single domain while keeping log-ins to separate subdomains valid. \#4063 will not rise from the dead.
It’s worth noting that the Application Wizard has three similar lines ([ak-application-wizard-submit-steps.ts:200](https://github.com/goauthentik/authentik/blob/main/web/src/admin/applications/wizard/steps/ak-application-wizard-submit-step.ts#L199)):
if (proxyProviderRequest.mode !== ProxyMode.ForwardDomain) {
proxyProviderRequest.cookieDomain = "";
}
I don’t think this needs to be changed; the Wizard is for new Applications only, so the cookieDomain should always be cleared (if it wasn’t already) if the user is creating anything other than a `ForwardDomain`.
# Unanswered questions:
1. Should we show `CookieDomain` as a visible, optional field for ForwardSingle mode?
2. Does this rule need to be in the server as a check in `ProxyProviderSerializer.validate()`?
3. This is a vanishingly small edge case, but I can see it happening: We never check if `external_host` and `cookie_domain` overlap. If `CookieDomain` isn’t visible for ForwardSingle mode, since we’re leaving the `cookie_domain` set, then if the user changes `external_host` via the frontend, since they can’t also edit `cookie_domain`, they’ll never match and users will be unable to access the ProxyProvider.
* Formatters with opinions. Faugh.
Keep browser-facing Host overrides effective by giving OAuth backchannel operations a dedicated HTTP/1.1-only client. Preserve standalone TLS settings and embedded Unix-socket transport.
Add wire-level tests against an HTTP/2-capable TLS peer for token issuers, grant and introspection requests, authority variations, JWKS, cleartext HTTP, and Unix sockets. Removing the restriction reproduces InvalidIssuer.
Addresses the demonstrated HTTP/2 defect in #26280.
AI assistance: implementation and tests developed with OpenCode (OpenAI).
* website/docs: document Entra ID source mappings
Refs: #10724
* website/docs: describe paginated Entra ID group sync
Requires the pagination fix in #26497.
* Update website/docs/users-sources/sources/social-logins/entra-id/oauth/index.mdx
Signed-off-by: Dewi Roberts <[email protected]>
---------
Signed-off-by: Dewi Roberts <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
* website/docs: clarify SAML transient user lifecycle
The Shibboleth guide recommends transient NameIDs without explaining that authentik creates temporary accounts.
Document account creation, deletion on logout, and expiration cleanup, including deletion while a session remains active. Explain the “Delete temporary users after” setting and recommend persistent NameIDs when accounts need to survive across logins.
* Update website/docs/users-sources/sources/protocols/saml/index.mdx
Co-authored-by: Dewi Roberts <[email protected]>
Signed-off-by: Dominic Roy <[email protected]>
---------
Signed-off-by: Dominic Roy <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
* website/docs: document OpenID Connect key binding
Add a guide to OpenID Connect key binding, linked from the `bound_key` scope description. Cover supported flows, provider configuration, JWK thumbprints, DPoP proofs, code exchanges, refreshes, and common failures.
Clarify that ID tokens are key-bound while access tokens remain bearer tokens.
* well the whole doc is .8, fixed
* website/docs: set key binding sidebar position
ConnectionToken.get_settings() splits the endpoint host on the first colon. When an IPv6 address is passed such as [2001:1234::1]:5900 it produces "[2001" and "1234::1]:5900" which causes an error when it's passed to guacd. This made it functional impossible to use IPv6 for RAC endpoints.
Replaced with the standard urllib parser that gracefully handles IPv4, IPv6, and FQDNs. Added unit tests to ensure it continues to work correctly.
Co-authored-by: Jens L. <[email protected]>
A successful authorization already redirects to a private-use scheme
(RFC 8252), such as a native app's `com.example.app:/callback`. The
error path used a plain HttpResponseRedirect, which only allows http,
https and ftp. The native app got a bare HTTP 400 in place of the
OAuth error, so it could not show the user why the login failed.
Allow the redirect URI's own scheme on the error path too. This is safe
because check_redirect_uri() matches the URI against the provider and
rejects forbidden schemes before any AuthorizeError is raised.
`UsersFilter.type` is a `MultipleChoiceFilter`, which defaults to
`distinct=True` because filters across to-many relationships can return
duplicate rows. `type` is a column on the user table, so it can't, but the
DISTINCT made the paginator count and every page evaluate the superuser
annotation for, and sort, all matching users (all columns), usually on disk.
* ## What
window.authentik.flow = {
"layout": "{{ flow.layout }}",
+ "background": "{{ flow.background }}",
+ "title": "{{ flow.title }}",
};
Amends the `flow.html` template and `GlobalAuthentik` parser to include new parameters, `background` and `title`, in the flow-specific part of the configuration written to the HTML `<head>` object, and to provide those parameters to client code.
## Why
The `layout` is start-up critical: it tells the Flow interface how the admin wants the Flow page to look, and allows the HTML and CSS to be pre-aligned to that condition. `layout` is determined on a per-Flow bases, not a per-Stage basis; Flows are derived from a tuple of `(Brand, Application?)`, where the opening policy *may* direct a user to a different flow if the user reached authentik via a redirect from a specific application, but will otherwise fall back to the default Flow for the Brand.
The `background` is a field that is required if the `Flow`’s layout is of type `frame_background`; in this case, the part of the viewport not dedicated to the FlowExecutor is reserved for an `<iframe>` that will be filled in with whatever the administrator specifies. Although this gives it the same priority as `layout` (whether it’s provided or undefined) for describing the [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome) around a challenge, it is currently not provided to the application in the start-up config; it is provided in the `challenge` and renders the IFrame as part of the initial challenge.
This patch fixes that; if `layout` is provided, `background` ought to be as well, even if it’s empty. The execution of a Challenge ought not have any influence over the look and feel of the Flow-defined appearance *around* that Challenge.
I have added `title` as well; with that, all of the current theme-and-appearance related configuration details are placed into `<head>` and can be removed from the FlowExecutor.
Server-side, `background` is currently specified: `background = FileField(blank=True, default="")` which is … interesting since we also appear to store URLs in it. I don’t see anything in the FlowSerializer that would change that from a client’s point of view.
This patch furthers the effort to separate flow execution from flow presentation.
- \[🐰\] The code has been formatted (`make web`)
* web/maintentance: update deprecated browser test imports
# What
Update imports of `@vitest/browser/context` to `vitest/browser`.
# Why
To eliminate these warnings:
- DEPRECATED /Users/ken/projects/dev/web/test/lit/setup.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" instead.
- DEPRECATED /Users/ken/projects/dev/web/test/lit/rendering.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" i
Sorry, been using the tests and Storybook a lot lately. Cleaning up as I go along.
* web/bug: scroll stuck when too many tables are visible on the page
# What
Hoo, boy. This one was *fun*.
Definitions: *instance* in the following refers to an instance of a Table or child class of Table. *class* refers to the Table class or a child class of Table.
## Bugs in `observe()`:
First, `observer.disconnect()` completely disconnects the observer for *every instance of that subclass of Table*. It says so [in the spec](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/disconnect):
> The disconnect() method of the IntersectionObserver interface stops the observer watching **all** of its target elements for visibility changes. \[Emphasis mine\]
A table that gets disconnected (because a row closed or the table scrolled out of view) would cause *all* the BindingTables to stop being observed. This is why some BindingTables seemed to randomly hang with their spinners going; if you opened a bunch and scrolled past quickly, they’d get unobserved and the shared observer would end up observing nothing and those BindingTable fetches would never actually run.
**Fix**: When an instance calls `disconnectedCallback()`, remove that instance from the observer, rather than cancel the whole observer.
Second, `useAncestorBox` *lied*. It gets updated and changed depending on when an instance’s `displayBox` field changed. But decorators (and state-tracking variable enclosed within them) are *class-level*; one instance which sets that definition sets it for *every instance* of that specific subclass of Table. In the case of BoundStagesList, that could be as many BindingTables as there were Stages, since each Stage has a collection of Bindings.
**Fix**: Just like `boxTargets`, `useAncestorBox` must be tracked on a per-instance basis, not a per-class basis. I’ve supplied a `WeakMap`.
(I found this one out simply by putting a `console.log()` into the decorator, and saw that no matter how many stages or policies or bindings I had, there were always three instances of the IntersectionObserver: One for the *Stage* table, one for each *Stage Binding* table … and this was really fun to figure out … one for the *Used By* table that warns you if anyone else is using a Policy when you delete its Binding from a Stage. **One instance per subclass of Table** on the page.)
## The bug in `Table`:
`@observe() visible = false;` is `@property()` with some extra behavior about IntersectionObserver. When `@observe` flipped that boolean value, a refresh was called and `sychronizeRefreshSchedule` got called in the `updated()` phase. A scheduler in that phase noted that the table was now not visible and forced the table back into the “loading” state. When you tried to scroll, the table would suddenly go, “Wait, I’m visible again,” do the fetch, which (on a fast enough network) would trigger an immediate page reflow. Scroll position vs layout was getting hosed because the reflow could push a higher table into view, out of view, into view, out of view, over and over, and if the bottom of the page was visible, the browser’s “scroll position reset” wouldn’t let you scroll up because it “knew better” where you wanted to be.
That’s the original bug as reported.
The fix:
1. Only do `renderLoading()` when there’s no data. Don’t do it if the table goes out-of-view or any of that. Only load data if (a) there’s no data, (b) a `submit` event happens (something changed and we need to renew the cache of data) or (c) an `AKRefreshEvent` happens.
2. Only ever set `deferredRefreshRequestAt` when one of 👆🏽 happens and the table isn’t in view yet. That’s the *only* reason you shouldn’t fetch immediately. Do not set it just because the table isn’t visible. Don’t refetch every time the visibility flag changes.
Added a couple cheap tests to bang on it and play with the viewport and see that it passes.
Closes \#25408
* Oxfmt has opinions.
* web/flows: render CAPTCHA widgets without an iframe wrapper
The CAPTCHA stage rendered every interactive widget inside an iframe it
generated itself, as a blob URL or a `document.write`-populated
`about:blank` document. The wrapper existed to stop two providers
colliding over their `window` globals, since a flow can present more than
one CAPTCHA stage and each vendor installs a global under a fixed name.
The collision was real, but the iframe addressed the symptom. The cause is
that `CaptchaController.discover()` chose a provider by sniffing `window`
in a fixed preference order rather than by looking at the script the
challenge actually asked for. Provider scripts are appended to
`document.head` and never removed, so by the second stage several globals
are present and the first one in the list wins regardless of which vendor
the challenge named.
Providers are now resolved with `matchesURL()` against the challenge's
`jsUrl`, which is unambiguous, and widgets render in place through each
vendor's own explicit render API. Falling back to global discovery is kept
for proxied script URLs that no host pattern can anticipate, and that path
now logs which mechanism it used.
Removing the wrapper removes everything built on top of it: the
`postMessage` bridge, the generated document template, the `document.write`
fallback, blob URLs, and the MutationObserver/ResizeObserver pair that
synchronised the wrapper's height. Widgets participate in normal layout
instead, and `CaptchaStage` loses more than half its length.
This also un-blocks a strict Content-Security-Policy: the generated
document required `script-src 'unsafe-inline'` for its callbacks and
`frame-src blob:` for its own URL, neither of which is needed now. The
directives a policy still has to allow are per-provider and derived from
the stage's configured URLs; `script-loader.ts` documents them.
Along the way:
- Reload the widget when `challenge` changes, not only on first render.
The executor reuses one `<ak-stage-captcha>` element across stages, so a
flow with two CAPTCHA stages previously kept showing the first stage's
solved widget and never advanced.
- Talk to `grecaptcha.enterprise` when the challenge names `enterprise.js`.
Enterprise site keys are rejected by the classic entry point.
- Give the "Provider Type", "Order" and "Stage" form controls accessible
names. The first two had labels that could not associate across a shadow
root, and the stage picker had no accessible name at all.
- Await the typed filter in `FormFixture.selectSearchValue`. The floating
promise meant the option lookup searched an unfiltered list, which finds
nothing once a collection outgrows the picker's first page.
Tests: `test/unit/captcha-provider-resolution.test.ts` covers provider
resolution for all four vendors, including Cap, with no network. The
browser suite drives a real flow per vendor against the vendors' published
test keys; it is tagged `@vendor-network` since it depends on third-party
availability.
web/flows: render CAPTCHA widgets in the document tree
Removing the wrapper iframe broke reCAPTCHA. The widget rendered, but the
checkbox spun forever and the flow never advanced: reCAPTCHA resolves its
own elements through `document`, so a container whose `getRootNode()` is a
`ShadowRoot` can never finish verifying. Rendering in place had put the
container inside the flow executor's shadow root.
So the wrapper was load-bearing for a second reason nobody wrote down. It
was not only keeping two providers from colliding over their `window`
globals — it was also handing reCAPTCHA a document to work in.
Confirmed with a controlled test: same page, same script, same site key,
same callback, ~20 lines of vanilla JS and no authentik code. Rendered into
`document.body` the token arrives; rendered into an `attachShadow()` root it
never does. hCaptcha and Turnstile both solve either way.
The container now attaches to the nearest ancestor that sits in the document
tree — the flow executor, which the Django template writes directly into the
page — and is projected back into the card through a chain of forwarded
slots. Slotting moves no nodes, so the container keeps `getRootNode() ===
document` while appearing exactly where it did before. The executor forwards
into whichever stage it renders, and the identification stage forwards again
into its embedded CAPTCHA; a forwarded slot with no matching name in the
child's shadow root renders nothing, so no stage needs special-casing.
The widget frames also needed clipping. Providers size them with the
`height` content attribute, and that hint does not survive on authentik's
pages — a plain `<iframe height="78">` computes to the 150px
replaced-element default in both the flow and admin apps, while identical
markup computes to 78px elsewhere — so the frame spilled below the widget as
a blank band. Inside the wrapper iframe no surrounding stylesheet reached
it. The cause is not yet identified; clipping to the box the provider
declares is safe because every provider renders its expanded challenge as an
overlay on `document.body`, never inside the container.
Also collects the vendor constants that had spread across the controllers —
host patterns, globals and URL matching now hang off a single `CaptchaVendor`
spine, so a controller declares its vendor and inherits the rest. The
provider presets in the admin form point at the same spine instead of
carrying a second copy of the Cap URL test. Test credentials live in `e2e/`
rather than `src/`: esbuild drops an unused object only when its initializer
is free of property accesses, so a record referencing the spine can never be
tree-shaken out of the bundle.
Tests: each vendor now has a solve-and-advance case, which is what the suite
was missing — every case asserted a widget rendered, none that it could be
completed, so reCAPTCHA stayed green while broken. Verified by reverting the
container to shadow placement and watching the reCAPTCHA case fail.
web/flows: keep CAPTCHA frames at their declared size and backdrop
Now that vendor widgets render in the document tree, the flow interface's
stylesheets reach them. Two regressions from that, both on reCAPTCHA:
PatternFly's base reset (`img, embed, iframe, ... { height: auto }`) beats
the presentational `width`/`height` attributes vendors size their anchor
frames with, so the frame computed to the 150px replaced-element default
and showed 72px of blank body below the widget. The stage now observes the
container and pins each arriving frame to its declared size inline. Turnstile
already sizes its frame inline and is left alone.
The frame element inherits `color-scheme: dark` from the theme while the
anchor document declares none, and browsers paint an opaque canvas behind an
embedded document whose scheme disagrees with its element's. That was the
white behind the widget's rounded corners and along its 2px inset. Vendors
can now adjust their own frames through `CaptchaController.decorateFrame`;
reCAPTCHA declares its frame `light` to match the document.
Also passes `theme` to the invisible reCAPTCHA render, gives test flows
names that can be told apart in the admin list, and asserts the rendered
frame size matches the declared one.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vf7S2QdjCToGGTwz7uxPaD
Clarify comment.
Re-render after theme change.
Clean up.
* packages/fonts: add a no-op build script
The npm publish workflow runs `pnpm run build` for every package, and
fonts had no build script, so its publish failed with
ERR_PNPM_NO_SCRIPT.
* packages: bump tsconfig to 2.1.0 and docusaurus-config to 3.2.0
Both changed without a version bump, so publishing them would fail
with a 403 for the already-published version. tsconfig's empty build
script also failed with ERR_PNPM_NO_SCRIPT.
* web: keep Storybook docs in sync with theme changes
createUIThemeEffect skipped a change when html[data-theme] already
matched, but another listener sharing the document may have set it
first, so later listeners (Storybook's docs container) never updated.
Each listener now tracks the last theme it handled. The Storybook
preview styles follow html[data-theme] instead of the OS color scheme.
* web/test/visual: keep a separate report per suite
Each suite now writes its HTML report to .visual/report/<suite>/ and
its artifacts to test-results/visual/<suite>/, so running one suite no
longer replaces the other's report.
* packages/tsconfig: split into base, web, and node configs
@goauthentik/tsconfig is now an environment-agnostic base with two
presets:
- `@goauthentik/tsconfig/web` for bundled code: bundler resolution,
`module: preserve`, the DOM libraries, JSX, and declaration-only emit.
- `@goauthentik/tsconfig/node` for scripts Node runs from source:
`noEmit`, erasable syntax only, `verbatimModuleSyntax`, and `.ts`
import extensions.
The base no longer includes Node types or JSX, so this is a major
version. web and website move to the web preset; the root, scripts,
web/packages/core, and geo's scripts and tests move to the node preset;
packages that stay on the base and need Node declare its types
themselves. web, web/packages/core, and website/api link the local
package instead of a published version.
* packages/theme: emit the spacing category file
The spacing category matched the `global--space--` prefix, but the
tokens are named `--ak-global--spacer--*`, so the build skipped it and
the exported ./dist/spacing.css was never written.
* web/admin: back-fill the created stage in the bind wizard
The stage wizard's binding step passed only the new stage's pk, so the
stage picker could only select it when it happened to be on the first
page of results. Beyond that the binding saved with a null stage. Pass
the stage object too, so the picker always offers and selects it.
The captcha e2e fixture relies on the back-fill instead of searching,
and scopes the Create or bind button to the toolbar, since an empty
flow shows a second one.
* web/flows: harden the CAPTCHA stage's load lifecycle
- Discard a mount that finishes after a newer load has started, instead
of making it the active controller and leaving its widget behind.
- Rebuild the widget for every new challenge object rather than a
jsUrl/siteKey/interactive signature, so two identical CAPTCHA stages
in a row no longer reuse the first stage's solved widget.
- Forget the loaded challenge and cancel in-flight loads on disconnect,
and reload on reconnect.
- Skip theme and locale rebuilds once a token has been issued, since a
rebuilt widget would be unsolved while its token was already handed on.
Also rewords the file's comments.
* web/testing/snapshots: enable visual comparisons
As an experiment, I have added three visual comparisons:
- dashboard
- event notification rules table
- new prompt form
… which provides a wide variety of controls that I can see and compare. As we move toward a more robust testing scheme *and* toward a more dispersed repository of artifacts (theme, elements, etc), I wanted a way to ensure that our upgrades to Patternfly and components didn’t break anything. I spent the day learning much more about Playwright and the snapshot tests.
I don’t think @BeryJu’s concern for snapshot size isn’t wholly warranted. I’ve manually restricted the viewport to 1280x800, so each snapshot pair (“light” and “dark”) is about 220Kb. The current project repo is 795Mb in size; it would take 40 tests to increase the size of the repository by 1%. If we have half that many snapshot pairs by next year, I’ll be delighted.
One challenge these tests present is that they should be run on a completely fresh database with no modifications; the dashboard and notifications page should reflect only the default status of an authentik instance when it comes up. The purpose of the snapshots isn’t to record the utility of the front-end; it’s to record and preserve the appearance of select elements in the page.
* Of course prettier had opinions.
* Optimised images with calibre/image-actions
* web/theme: the patternfly bridge
Generates the PatternFly 4 variables from the theme source instead of
maintaining them by hand: moves the token modules from src/tokens/ to
src/authentik/, and adds src/patternfly/ which emits the PF variables
from those tokens.
Known gaps: 17 colors remain unmapped and undefined; PatternFly dark
mode is not emitted yet; the linter cannot compare PatternFly and
authentik colors because the theme is authored in oklch.
* web: compare screenshots against the base branch locally
Replace the committed page snapshots with a local visual comparison
workflow. `pnpm run test:visual` screenshots every Storybook story in
light and dark, and compares it against the merge-base with
origin/main. Baselines are recorded on demand from a temporary
worktree and cached in the git-ignored `.visual/` store, keyed by
commit and platform, so no images are committed.
A `pages` suite covers admin screens without generated data (login,
a modal form, a wizard) on a running instance.
Also break an import cycle between the notifications mixin and the
drawer components, which broke the Page Navbar story.
* web: load @goauthentik/theme in the app styles
Build packages/theme before the web build, Storybook, and watch, and
import its generated CSS after the legacy variables in the theme layer
so the generated PatternFly variables take precedence.
* web/theme: fix inverted PatternFly light/dark text colors
PatternFly names text colors by the color of the text itself:
--pf-global--Color--dark-100 is dark text (#151515) for light surfaces,
and --pf-global--Color--light-100 is light text for dark surfaces. The
bridge mapped them the other way around, so components that set
--pf-global--Color--100 from dark-100 (Page, Alert, Table, and others)
rendered white text in light mode.
* web/theme: add a muted ink for light surfaces
Add ink.pin-light.muted (#6a6e73) and map --pf-global--Color--dark-200
to it. PatternFly uses dark-200 for helper and placeholder text on
light surfaces; it was mapped to full-strength ink.
* web: commit the generated theme stylesheet
Building web in the container only installs the web workspace, so it
can't build packages/theme, which belongs to the root workspace and has
its own dependencies. Commit the theme's generated CSS instead, the same
way the API client is committed, and drop the theme build from the web
build graph.
`pnpm run build:theme` regenerates it; `pnpm run lint:theme` fails when
the committed copy is out of date.
* web/theme: convert the build scripts to TypeScript
Node runs TypeScript directly now, so replace build.mjs, build-demo.mjs,
lint-bridge.mjs, reference.css.js, and stylelint.config.mjs with .ts
equivalents. JSDoc typedefs become interfaces.
lint-bridge's array and CSS branches returned a bare string instead of a
[kind, value] pair, and its ref branch passed an extra argument that
shifted every parameter; both are fixed. Its output is unchanged for the
current tokens.
The generated header also names the current source directory; it still
pointed at the old src/tokens/.
* Format.
* web: move ak-drawer onto the generated theme tokens
Replaces the drawer's --ak-v2-global--* references with the
--ak-global--* tokens from the generated theme, and gives the drawer its
own directional shadows and RTL inverse multiplier. The multiplier was
previously read from --ak-v2-global--inverse--multiplier, which nothing
defined.
Co-Authored-By: Ken Sternberg <[email protected]>
* Fix overflow.
* packages/fonts: declare RedHatText's full weight range
The variable face covers 300-700, but the @font-face rules declared
400 500, so light text rendered at 400 and bold was capped at 500.
* website: copy docusaurus-config into the image instead of mounting it
pnpm can place workspace links in a package's own node_modules (for
example `@goauthentik/fonts` under packages/docusaurus-config), and a
read-only bind mount of the package source over that directory hides
them from the docs build. Copy docusaurus-config and fonts into the
image before the root install instead, so those links survive.
* website: load the docs fonts from @goauthentik/fonts
Replaces docusaurus-config's hand-written @font-face rules and the
modified RedHat copies in website/static/fonts with the faces from
@goauthentik/fonts, so the docs and the web UI share one set of fonts.
* packages/theme: bump to 2.0.0
* Remove development comments
Drops file headers, restated JSDoc, commented-out reference values, and
exploratory notes added on this branch, keeping only comments that
explain something surprising.
---------
Co-authored-by: Ken Sternberg <[email protected]>
Co-authored-by: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com>
* web: Close command palette when opening About
Opening About returned a promise that resolved only after the dialog closed, leaving the command palette visible behind it.
Closes: #25726
* tweak
* eh its redundant
* ## What
window.authentik.flow = {
"layout": "{{ flow.layout }}",
+ "background": "{{ flow.background }}",
+ "title": "{{ flow.title }}",
};
Amends the `flow.html` template and `GlobalAuthentik` parser to include new parameters, `background` and `title`, in the flow-specific part of the configuration written to the HTML `<head>` object, and to provide those parameters to client code.
## Why
The `layout` is start-up critical: it tells the Flow interface how the admin wants the Flow page to look, and allows the HTML and CSS to be pre-aligned to that condition. `layout` is determined on a per-Flow bases, not a per-Stage basis; Flows are derived from a tuple of `(Brand, Application?)`, where the opening policy *may* direct a user to a different flow if the user reached authentik via a redirect from a specific application, but will otherwise fall back to the default Flow for the Brand.
The `background` is a field that is required if the `Flow`’s layout is of type `frame_background`; in this case, the part of the viewport not dedicated to the FlowExecutor is reserved for an `<iframe>` that will be filled in with whatever the administrator specifies. Although this gives it the same priority as `layout` (whether it’s provided or undefined) for describing the [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome) around a challenge, it is currently not provided to the application in the start-up config; it is provided in the `challenge` and renders the IFrame as part of the initial challenge.
This patch fixes that; if `layout` is provided, `background` ought to be as well, even if it’s empty. The execution of a Challenge ought not have any influence over the look and feel of the Flow-defined appearance *around* that Challenge.
I have added `title` as well; with that, all of the current theme-and-appearance related configuration details are placed into `<head>` and can be removed from the FlowExecutor.
Server-side, `background` is currently specified: `background = FileField(blank=True, default="")` which is … interesting since we also appear to store URLs in it. I don’t see anything in the FlowSerializer that would change that from a client’s point of view.
This patch furthers the effort to separate flow execution from flow presentation.
- \[🐰\] The code has been formatted (`make web`)
* web/maintentance: update deprecated browser test imports
# What
Update imports of `@vitest/browser/context` to `vitest/browser`.
# Why
To eliminate these warnings:
- DEPRECATED /Users/ken/projects/dev/web/test/lit/setup.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" instead.
- DEPRECATED /Users/ken/projects/dev/web/test/lit/rendering.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" i
Sorry, been using the tests and Storybook a lot lately. Cleaning up as I go along.
* web/website/docs: Amend the Blueprints documentation to describe what a blueprint *is*
# What
This commit revises the “Blueprints: Blueprint Execution” section of the documentation to give a precise, concrete definition of what a Blueprint file actually is: a series of instructions to create, modify, or delete objects and their relationships within the authentik database. It gives examples of these relationships, and describes how instantiating these objects and their relationships within authentik is order-dependent.
I also re-arranged a few sentences in that section for readability, using [Vale](https://docs.vale.sh/) and the Microsoft style guide as an example. I ignored a *lot* of the advice, but a few things stood out as “Yeah, that could be clearer.”
# Why
Mostly because I never understood exactly what the heck a Blueprint was until I read that single, clear sentence elsewhere, that’s why. Surely I’m not the only person feeling perplexed about it.
* Update website/docs/customize/blueprints/index.mdx
Co-authored-by: Dominic Roy <[email protected]>
Signed-off-by: Ken Sternberg <[email protected]>
---------
Signed-off-by: Ken Sternberg <[email protected]>
Co-authored-by: Dominic Roy <[email protected]>
* ## What
window.authentik.flow = {
"layout": "{{ flow.layout }}",
+ "background": "{{ flow.background }}",
+ "title": "{{ flow.title }}",
};
Amends the `flow.html` template and `GlobalAuthentik` parser to include new parameters, `background` and `title`, in the flow-specific part of the configuration written to the HTML `<head>` object, and to provide those parameters to client code.
## Why
The `layout` is start-up critical: it tells the Flow interface how the admin wants the Flow page to look, and allows the HTML and CSS to be pre-aligned to that condition. `layout` is determined on a per-Flow bases, not a per-Stage basis; Flows are derived from a tuple of `(Brand, Application?)`, where the opening policy *may* direct a user to a different flow if the user reached authentik via a redirect from a specific application, but will otherwise fall back to the default Flow for the Brand.
The `background` is a field that is required if the `Flow`’s layout is of type `frame_background`; in this case, the part of the viewport not dedicated to the FlowExecutor is reserved for an `<iframe>` that will be filled in with whatever the administrator specifies. Although this gives it the same priority as `layout` (whether it’s provided or undefined) for describing the [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome) around a challenge, it is currently not provided to the application in the start-up config; it is provided in the `challenge` and renders the IFrame as part of the initial challenge.
This patch fixes that; if `layout` is provided, `background` ought to be as well, even if it’s empty. The execution of a Challenge ought not have any influence over the look and feel of the Flow-defined appearance *around* that Challenge.
I have added `title` as well; with that, all of the current theme-and-appearance related configuration details are placed into `<head>` and can be removed from the FlowExecutor.
Server-side, `background` is currently specified: `background = FileField(blank=True, default="")` which is … interesting since we also appear to store URLs in it. I don’t see anything in the FlowSerializer that would change that from a client’s point of view.
This patch furthers the effort to separate flow execution from flow presentation.
- \[🐰\] The code has been formatted (`make web`)
* web/maintentance: update deprecated browser test imports
# What
Update imports of `@vitest/browser/context` to `vitest/browser`.
# Why
To eliminate these warnings:
- DEPRECATED /Users/ken/projects/dev/web/test/lit/setup.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" instead.
- DEPRECATED /Users/ken/projects/dev/web/test/lit/rendering.js tries to load a deprecated
"@vitest/browser/context" module. This import will stop working in the next major version. Please,
use "vitest/browser" i
Sorry, been using the tests and Storybook a lot lately. Cleaning up as I go along.
* TPP (Transformation Priority Premise) for the win. (Also, looking at IBM Carbon for ideas on how to fix this.) Wrote a checker that takes the Django Paginator output and correctly converts it to the format used by most paginators, including the Patternfly React paginator. So now we have a tool to communicate with the paginator, correctly converting, bounded, and compensating for stupid sh❋t. Well, that's two circles. Now to draw the rest of the owl.
* Storybook works. Styles still suck. Can't really test the events handler because it doesn't issue an event if there's no change.
* Fixed a problem with bounds and unnatural numbers; got the hover/active/focus right; got the input number field to show up, but not happy with the effect when you leave it.
* It's all working. Whee!
* Implemented Paginator on Tables.
* web/elements/paginator: Add “paginator” to list of standarized elements
# What
This commit adds a new element, `ak-paginator`, and replaces the two uses of pagination in our product: the progressive reveal in DualSelect, and the page selector in Table.
The Paginator is a revision of the React version component. It has been cut down to our use case, and the term “bottom” has been replaced with “compact”; a “compact” paginator has only the summary (hidden below 640px) and the next/prev indicators; a full size one has the summary, the “first/prev/next/last” indicators, and an input box so the user can navigate to any page. A pair of helper functions convert from the Django paginator format to the one used by Patternfly’s paginator. The paginator emits an event that clients are expected to respond to, and then update the paginator component when the page is valid and has been changed to.
The converters have 10 tests; there are 30 unit tests covering edge cases, keyboard interaction, and ARIA validation.
Both Table and DualSelect have had their ad-hoc implementations replaced with Paginator. The DualSelect storybook has been updated to work correctly with the PageChangeEvent.
# Why
Well, for one thing, it’s not a great idea to multiple incompatible versions of the same component lying around.
For another, I’m about to add a third component that uses a paginator, and I didn’t want to add yet another paginator implementation to the mix. May as well clean it all up now.
* Noticed some leftover patternfly stuff.
* Man, my aim is terrible.
* Okay, that's multiple linters I've got to roll into my pre-commit check.
* A bit of nitpicking.
* providers/scim: build OAuth authorization URLs only for interactive mode
Only the interactive OAuth mode uses the start and callback URLs. The
guard listed the modes that do not need them, so any mode added later
would get a URL it cannot use. Check for the one mode that does.
* providers/scim: add Basic authentication mode
Some SCIM service providers only accept HTTP Basic authentication and
have no way to consume a bearer token. Add a "basic" mode that stores a
username and password on the provider, alongside the existing token and
OAuth modes.
The header is built here rather than with requests' HTTPBasicAuth, which
encodes credentials as latin-1. RFC 7617 expects UTF-8.
The password is write-only over the API, like the existing token field.
Basic needs no license, same as the token mode.
Closes#15267
* core: regenerate API schema and clients
* web: add Basic authentication mode to the SCIM provider form
* providers/scim: test outgoing request authentication headers
Assert the Authorization header authentik sends for the token and basic
modes, including UTF-8 encoding of non-ASCII credentials.
* website/docs: document the SCIM Basic authentication mode
---------
Co-authored-by: Jens Langhammer <[email protected]>
* sources/kerberos, sources/ldap: Save source connections when linking an existing user or group
* add tests
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
* website/docs: clarify LDAP sync direction and document user creation
Clarify that LDAP user and group synchronization is inbound and that `SkipObject` does not affect password writeback or custom LDAP writes.
Add a notification policy example for creating users on an external LDAP server.
Closes: #20886
* website/docs: explain LDAP user creation example
Non-ASCII proxy header values can cause requests or WebSocket handshakes to fail in upstream applications.
Document how to use an existing scope mapping to percent-encode `X-authentik-name` and other headers.
Closes: #24156
{id="RUSTSEC-2026-0374",reason="basic-toml is a build-time only dependency of the askama template engine, not shipped in the app or daemon; remove when askama drops basic-toml"},
| Add or change a REST endpoint, model field, or serializer | `authentik/` (Python) | `make gen` to refresh `schema.yml` + clients, and commit the generated migration |
| Change UI behavior, a flow screen, or an admin page | `web/` | [`web/AGENTS.md`](web/AGENTS.md) — call the API only through `@goauthentik/api` |
| Write or edit docs, an integration guide, or a glossary term | `website/` | [`website/AGENTS.md`](website/AGENTS.md), then `make docs` / `make integrations` |
| Write or edit docs or an integration guide | `website/` | [`website/AGENTS.md`](website/AGENTS.md), then `make docs` / `make integrations` |
| Change an outpost (LDAP, proxy, RAC, RADIUS) or the front proxy | `cmd/` + `internal/` (Go) | `make go-test` |
| Change a native server/worker component or shared crate | `src/` + `packages/ak-*` (Rust)| `make rust-test` |
| Seed or reconcile a managed object (flow, stage, policy, brand) | `blueprints/` (YAML) | prefer a blueprint over an ad-hoc data migration |
@@ -108,6 +108,7 @@ make lint-fix # Auto-fix: black + ruff (Python) and rustfmt (Rust)
make lint # Check: bandit, mypy --strict, golangci-lint, cargo deny/machete
make lint-spellcheck # cspell across the repo (typo-only mode: reports known misspellings and forbidden British spellings, not unknown words)
make lint-catalogs # pnpm catalog pins in sync across the root/web/website workspaces
make lint-locales # translation files + generated locale lists match locales.yaml (`make gen-locales` regenerates)
```
CI mirrors these as `ci-lint-*` / `ci-test` targets. Run the matching `make lint` / `make test` (plus `make web` / `make docs` for those subtrees) before pushing — CI runs the same checks.
@@ -154,7 +155,7 @@ Authoritative contributor docs live under `website/docs/developer-docs/` and are
Loaded 100 of 2674 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.