* 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]>
Bootstrap (wait_for_db, migrate) and the manage, dump_config and
test-all commands now run inside the authentik binary through the
embedded interpreter instead of spawning `python`. The interpreter
activates the virtualenv itself, since it isn't started from it.
Claude-Session: https://claude.ai/code/session_019wqL8VsUDCMXtG8EgpkBh8
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
* stages/authenticator_static: show tokens in hyphenated groups, accept separators
Static tokens are usually the last-resort backup and are often copied
onto paper and typed back by hand. A 12+ character unbroken string is
hard to read back and easy to mistype, so display them in groups of
four (abcd-efgh-ijkl).
Stored tokens are unchanged (no migration). On verification, hyphens
and whitespace are stripped before matching; generated tokens are
alphanumeric, so this cannot change which token matches. The raw input
is still matched too, so any existing token containing a separator
keeps working. The static code input's pattern now allows hyphens and
spaces.
refs #15917
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* tests/e2e: read the static token as displayed, then strip the hyphens
test_static_setup took the first token's on-screen text and looked it up
in the database verbatim. Tokens are now displayed in hyphenated groups
but stored without hyphens, so assert the displayed format and strip the
hyphens before the lookup.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
* web: replace JSDoc types with TypeScript sources for build tooling
Node runs TypeScript directly now, so the build scripts, bundler plugins,
and `@goauthentik/core` no longer need to be JavaScript annotated with
JSDoc. Every module reachable from `scripts/build-web.ts` is now real
TypeScript, run under Node's type stripping.
The package.json `imports`/`exports` maps point at the `.ts` sources
instead of pairing a `.js` runtime entry with a generated `.d.ts` under
`out/`, so types resolve on a clean checkout without a declaration build
first. Type stripping does not rewrite `.js` specifiers back to `.ts`,
so relative imports name the real file on disk and `web/tsconfig.json`
enables `allowImportingTsExtensions`.
Two suppressions in the locale scripts turned out to be a real
soundness gap rather than the `@lit/localize-tools` bug the tsconfig
comment claimed. `Config["output"]` is a union, and `outputDir` is only
required on its runtime variant, so the unnarrowed access was
legitimately `string | undefined`. `build-locales` only works in
runtime mode, so it now validates `output.mode` up front the way it
already validated `interchange.format`; the narrowing that follows
removes both the cast and the `@ts-expect-error`, and a misconfigured
`lit-localize.json` fails with a clear message instead of a TypeError
inside the library. Regenerating all 18 locale modules produces
byte-identical output.
Co-Authored-By: Playpen Agent <[email protected]>
* web/elements: show forms slotted into a wizard step
A Form renders nothing while `visible` is false, and that flag is driven by an
IntersectionObserver on the form itself. The two states feed each other: an
invisible form renders nothing, a form that renders nothing has no box, and an
element with no box never reports as intersecting. A step that lands in that
state stays blank permanently -- no error, no console message, just an empty
wizard page whose Create button then posts an empty payload.
ModalForm and ak-modal already set the flag when they slot a form in. Nothing
did so for a wizard step, which left it to chance whether the observer happened
to catch the element while it still had layout.
Confirmed against a running instance: the provider wizard's OAuth2 step mounted
ak-provider-oauth2-form with an empty shadow root, `visible === false` and a 0x0
box, and setting `visible = true` by hand rendered all nine inputs immediately.
This was surfacing as an intermittent e2e failure in every suite that drives the
provider wizard -- the dialog never closes, because the wizard cannot advance
past a step whose form was never there.
* web/elements: keep the current selection in a search select's options
fetchObjects returns a single page, so an object selected out of band -- one just
created through the dropdown's own action, say -- is frequently absent from it.
The view resolves a value's label from the options alone and prints the raw value
when it finds none, so the control would sit there showing a bare primary key
while holding a perfectly good selected object.
Confirmed on the invitation form, whose flow select creates an enrollment flow
from its own action: the new flow sorts by slug into a page the select had not
fetched, so it displayed a UUID. Include the selection in the options when the
fetched page omits it.
* Fix drift.
---------
Co-authored-by: Playpen Agent <[email protected]>
* Updated release notes to reflect changes for v2026.8.3
* Prettier.
* Oxfmt?
* Oxfmt? WTF?
* Oh, come on.
* Hand-fixed a formatting bug emitted by gen-diff
* Fix issues surrounding sidebar expansion.
* web/e2e: fix search-select option matching in the form fixture
selectSearchValue did not await its own fill, so the option list was queried
before the typed filter landed -- a race every caller shared, and one that hides
itself: the control still reports a value, and the form saves without the field.
Also accept a pattern for the field label. Matching by accessible name is
substring-based, and a picker whose name comes from its placeholder cannot
otherwise be told apart from a neighbouring control with a longer name.
* web/tests: repair the user offboarding suite
Three failures, two causes.
The pending-offboardings filter is an ak-switch-input, which renders the
PatternFly switch: .pf-c-switch__toggle covers the input, so clicking the
checkbox by role is always intercepted. Drive it through form.setInputCheck,
which exists for this.
The raw-event assertions matched page.locator("pre"), which is ambiguous
whenever the dev-mode "consecutive requests" notification is on screen, since it
renders a pre of its own. Scope them to ak-event-view.
Mark the suite serial. Every test drives "Execute due user offboardings", a
single instance-wide schedule that drains every due offboarding, including ones
another test has scheduled and not yet asserted on.
* web/tests: build the account lockdown prerequisite through the UI
The suite's lockdown flow came from web/test/blueprints, but nothing applies that
directory -- not CI, which points AUTHENTIK_BLUEPRINTS_DIR at ./blueprints, and
not a local run. The flow never existed, so every test failed at the brand's
"Account lockdown flow" picker. CI did not catch it because the suite skips
without an enterprise license.
Create the flow, stage, and binding through the admin UI in beforeAll instead,
and drop the blueprint. Idempotent on the binding rather than the flow: a run
interrupted between the two leaves a flow that exists but does nothing, which a
flow-only check would skip over.
The stage name carries a random suffix so a partially-completed earlier run
cannot collide, and the completion flow is selected by string so the picker
filters -- passing a pattern leaves the field empty, and the stage then saves
silently, failing much later with "Self-service account lockdown requires a
completion flow".
* web/tests: re-submit the offboarding search until the row count settles
searchRows submitted once and returned, so the caller's count assertion polled a
DOM that had stopped changing. When a row landed after that fetch the table kept
its previous result set and the assertion could only time out, however long it
waited.
Driving the browser by hand against the same instance shows the table does
refetch on every submit, including when the query is unchanged, so re-submitting
is what picks the row up. Take the expected count and re-submit until it holds.
* web/tests: find the offboarding schedule by actor name
runDueOffboardings searched the schedules table for the schedule's display
description. The API searches id, identifier, _uid, actor_name and the rel_obj
fields (authentik/tasks/schedules/api.py), not the description, so that query
matches nothing and filters the table to empty.
The step nevertheless passed most of the time, because a fill+Enter that fails
to submit leaves the table unfiltered and the row therefore present. Two defects
cancelling out: the run failed exactly when the search did work. Forcing the
search to land on every attempt, while hardening this same step earlier, made it
fail every time -- which is what put the mechanism beyond doubt.
Search by actor name, which the API matches and the row text contains.
* web: e2e tests for account lockdown
Adds web/test/browser/320-account-lockdown.test.ts, covering the enterprise
account lockdown feature from both entry points:
- An administrator locking another account from the user details page.
- A user locking their own account from the Security tab of user settings,
which deletes their session and hands them to the stage's completion flow.
- The action being hidden for the administrator's own account.
Each case proves the lockdown took effect rather than inferring it: the
target signs in successfully beforehand, and afterwards the account reads
inactive and its credentials are rejected.
Nothing seeds a lockdown flow, and the feature is inert until a brand points
at one, so test/blueprints/test-account-lockdown-flow.yaml supplies the flow,
the stage, and the binding. The suite drives only the brand field an operator
actually configures, and that hook is read-only once set so repeat runs do
not race on the brand row.
Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Dominic R <[email protected]>
* web: skip account lockdown e2e tests without an enterprise license
---------
Signed-off-by: Dominic R <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
* web: e2e tests for user offboarding
Adds web/test/browser/310-user-offboarding.test.ts, covering scheduling,
listing, cancelling, rescheduling, bulk cancellation, and execution of
user offboardings, plus the audit events they emit.
Carried over from dominic/user-offboarding-e2e and reconciled with the UI
that actually merged. Fixes needed to make the suite pass:
- Scope field interactions to the modal wrapper, not the `dialog` element.
`ak-forms-modal`/`ak-forms-confirm`/`ak-forms-delete-bulk` slot their
content into `ak-modal`, whose `<dialog>` lives in a shadow root, so the
dialog is not a DOM ancestor of any field and role queries scoped to it
matched nothing at all.
- Match the pending-offboarding trigger by text. Its label sits inside a
`pf-tooltip`, which keeps it out of the button's accessible name.
- Address the Active row from its `dt` across to the paired `dd`; the
`term` role does not take its name from content.
- Address the System Tasks page by element, since it renders an unnamed
`<main>` unlike the table pages.
- Raise the timeout on the two execution tests, which wait for a schedule
to fall due, and pin their scheduled time immediately before scheduling
so setup cannot push it into the past.
- Reload between attempts when waiting for the completed status; the list
does not refetch when an unchanged search query is re-submitted.
Signed-off-by: Dominic R <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
* web: skip offboarding e2e tests without an enterprise license
---------
Signed-off-by: Dominic R <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
* Flesh out Oxlint, Oxfmt
* Flesh out.
* web: finish oxlint/oxfmt activation
- Fix `oxlint.config.ts` to invoke `createOxlintConfig` (it was exporting the
factory uninvoked, so nothing was linted); enable `lit` + `react`.
- Repair the lint scripts: `lint:fix` referenced a deleted `format` script;
add `fix:oxfmt`; switch the strict `lint-check` from ESLint to oxlint.
- Drop the now-redundant ESLint/Prettier deps and the `@goauthentik/prettier-config`
override; lit/wc linting now comes from oxlint via `@goauthentik/oxlint-config`.
- Move the `prettier --write` wireit steps to `oxfmt --write`.
- Remove the orphaned `eslint.config.mjs` and `prettier.config.mjs`.
- Regenerate `package-lock.json`.
* web: apply `oxlint --fix` autofixes
Mechanical autofixes across web/ from `oxlint --fix`: padding-lines blank lines,
object-shorthand, and unicorn's no-useless-spread / prefer-string-starts-ends-with.
Clears 1170 of the 1184 baseline findings; the remaining ~14 need manual attention.
* web: resolve remaining oxlint findings
The ~14 findings `oxlint --fix` could not auto-fix:
- Prefix unused positional params with `_` (9 callbacks/methods).
- Name the empty Playwright fixtures param `_` instead of `{}` (no-empty-pattern).
- Make a stray trailing comment a leading comment so padding-lines is satisfied.
- Disable unicorn/no-thenable on `Route.then()` — an intentional fluent builder.
- Delete two dead, fully-commented, unimported files (no-empty-file).
- Fix a malformed `apple.d.ts` ambient declaration (invalid destructuring-as-type
and an `async` modifier) that oxlint's parser rejected.
`oxlint --max-warnings=0` now exits clean.
* web: complete prettier removal and sync pnpm lockfiles
Swaps the `@goauthentik/prettier-config-dev` optional dependency for the
oxlint/oxfmt equivalents that web/oxlint.config.ts and web/oxfmt.config.ts
import, and drops the top-level `prettier` key pointing at the deleted
prettier.config.mjs.
Replaces the upstream package-lock.json regeneration, which no longer
applies now that the repo is pnpm-only.
* root, web: drop the last eslint and prettier references
Points the `locales:repair` and `precommit` wireit steps at oxfmt, and
removes the root `prettier` config key and `eslint` dependency now that
nothing consumes them.
* build: bump oxfmt to 0.68.0 and stop greedy JSDoc re-wrapping
oxfmt's JSDoc formatter re-wraps every description by default, and in doing
so deletes the space between an inline code span and the adjacent word:
`\`::part(cell-{idx})\` remains` becomes `\`::part(cell-{idx})\`remains`.
Present in both 0.67.0 and 0.68.0.
`lineWrappingStyle: "balance"" keeps the original line breaks when they
already fit inside the print width, which avoids the re-wrap entirely for
all but a couple of comments.
* web: reformat with oxfmt
Mechanical reformat of web/ under the oxfmt config.
ak-select-table's doc block listed @element and @class ahead of its prose,
so the formatter read the whole body as the tag's description and indented
it under them. Moved the tags below the description, which is the
conventional JSDoc order and keeps the sections intact.
* web/oxlint-config: port the padding rules and a fixture harness
Expands `padding-lines` and adds the two rules that sit beside it, under the
existing `goauthentik/` plugin namespace:
- `padding-lines` — blank line before the statements that end a path or a step
(`return`, `continue`, `break`, a bare `x++`), before block-like statements,
and before TS interface/type/enum/module declarations. The old copy covered
`return` and blocks only, and looked through an `export` wrapper, so
`export interface Foo {}` was never padded.
- `console-padding` — blank line each side of a `console.*` call, with a run of
consecutive calls treated as one group.
- `multiline-statement-padding` — blank line each side of a statement spanning
lines.
All three share `padding-utils.ts`, which anchors every fix to the END of the
earlier statement. That keeps them composable: two rules wanting the same blank
line emit the identical edit, so one applies and the other is a no-op, instead
of each inserting a newline and leaving a gap of two.
Opt-in via `createOxlintConfig({ padding: true })`, and no workspace turns them
on, so this reformats nothing. On `web/` they would be 1217, 1816 and 58 fixes
respectively.
`scripts/verify-fixtures.mjs` asserts each rule fires in its violating fixture
and is silent in the clean one, that each autofix lands the violating fixture
exactly on its clean counterpart with a second pass changing nothing, and that
the rules stay off by default. Runs in CI as the `oxlint-fixtures` job.
`fixtures/` is excluded from this package's own oxlint and oxfmt runs, since
formatting them would insert the blank lines they exist to be missing.
* web: apply the padding rule autofixes
Fallout from enabling `console-padding` and `multiline-statement-padding`
on web via the new `padding` option.
* packages/oxlint-config: fix the misapplied oxfmt ignore
The cherry-picked patch targeted packages/oxlint-config/oxfmt.config.ts,
which does not exist on this branch, so git applied it to client-ts's
identical file — leaving it importing DefaultIgnorePatterns from
@goauthentik/oxfmt-config, which does not export it.
Restores client-ts's config and adds the intended one to oxlint-config,
sourcing DefaultIgnorePatterns from @goauthentik/oxlint-config.
* website: swap eslint and prettier for oxlint and oxfmt
Drops the five eslint configs and .prettierignore, adds the oxlint/oxfmt
configs, and reformats. DefaultIgnorePatterns is imported from
@goauthentik/oxlint-config, which is where it lives.
* packages: swap eslint and prettier for oxlint and oxfmt
Migrates docusaurus-config, esbuild-plugin-live-reload, geo, logger-js and
theme to the shared oxlint/oxfmt configs; fonts is asset-only so it gets
formatting alone. theme's CSS check moves from @eslint/css to stylelint,
matching web.
Deletes packages/eslint-config and packages/prettier-config — nothing
depends on them any more — and drops them from the npm publish matrix and
the three workspace manifests.
* root, web/sfe: drop the last prettier ignores and scripts
Removes the orphaned .prettierignore files and points sfe's formatting
scripts at oxfmt.
oxfmt honours .prettierignore, so web's and website's exclusions move into
their oxfmt configs — without them the minified vendored assets, the
generated locale-codes.ts and the pnpm manifests get reformatted.
* packages/oxfmt-config: export a createOxfmtConfig builder
Mirrors createOxlintConfig: takes ignorePatterns and an overrides escape
hatch, appending per-file overrides to the shared ones rather than
replacing them. Every consumer was hand-spreading authentikOxfmtConfig and
cross-importing DefaultIgnorePatterns from oxlint-config; that constant is
now exported here too.
Also sets capitalizeDescriptions: false. oxfmt capitalises the first letter
of every JSDoc description, which rewrote `authentik` to `Authentik` in
eight files — the product name is always lowercase.
* root, web, website, packages: make `lint` cover formatting everywhere
website ran oxlint only; it now checks formatting too, matching web and the
packages. The two config packages shipped an oxlint.config.ts with no script
to run it, and fonts had no aggregate script at all.
Declares npm-run-all in the eight manifests that call run-s, and restores
eslint-plugin-lit/wc in web — oxlint resolves jsPlugins relative to the
config, not to @goauthentik/oxlint-config, so web has to see them itself.
* Flesh out playwright reports.
* Fix alignment on smaller viewports.
* Reorder.
* Fix issues surrounding alignment, ARIA labels, mouse behavior, etc.
* Clean up nav tab alignment.
* Fix timing issue where license mixin does not consistently trigger updates.
* Remove unused.
* Fix warning.
* Fix config.
* Fix types.
* Clean up scripts.
* Format generated.
* Retire eslint and prettier from dependency tooling.
The dependabot `eslint` groups matched packages no longer in the tree.
Replace them with an `oxc` group for oxlint/oxfmt and a `lint` group for
what survived the swap: eslint-plugin-lit and eslint-plugin-wc, whose
rules oxlint loads through `jsPlugins`, plus stylelint, which picked up
CSS linting and had no group at all.
Cover packages/{fonts,geo,theme} in the NPM Packages block. All three are
workspace members with oxlint/oxfmt devDependencies, but no npm block
listed them, so dependabot was never updating them.
Drop the dead eslint/typescript-eslint catalog entries and the overrides
keyed on them, along with the prettier entries website/ still carried. No
manifest referenced any of them, and pnpm had recorded none of them in a
lockfile's `catalogs:` section. eslint itself stays in the tree as a
type-only peer of the two plugins.
* web: realign the user-switcher e2e locators, fix an invalid ARIA attribute
The navigation header rework renamed the switcher toggle's accessible name
from "Switch user" to "Toggle user navigation menu" and gave each account
entry an `aria-label` of `Switch to user "<display name>"`. Three locators
still targeted the old markup, across two fixtures and one test, which broke
the remember-me, passkey and user-switching specs.
The entry locator matches rendered text rather than the accessible name: the
new aria-label omits the email, which is what identifies an account under any
UserDisplay setting.
The menu also carried `aria-labelled`, which is not an ARIA attribute and so
named nothing. It is passed a string rather than an ID, so it wants
`aria-label`.
* web/flow: fix leaked keydown listener in RedirectStage
The Enter-to-redirect handler was added to `document` on every challenge
update and never removed, leaking a listener per update and firing
redirect() once per accumulated listener. Register it a single time and
tear it down on disconnect via an AbortController.
* Clean up.
* Fix method accessors.
* Fix static challenge type check.
* web/test: scope the New Provider click to the toolbar
`Table` renders the create control twice: once in the toolbar, and once
inside the empty state it shows while rows are still loading
(`Table.renderEmpty`, and again in `TablePage`). An unscoped
`getByRole("button", { name: "New Provider" })` matches both, so the
click fails strict mode — but only when the table is empty at that
moment, which is why it took three tests down in one run while a fourth
passed on retry.
Measured against a live instance: the locator matches one button once
rows are present and two while the table is empty.
Scoping to `[part="toolbar-secondary"]` picks the toolbar copy and is
unaffected by whether the table has loaded.
* web/test: follow remember-me past the identification stage
Remember-me does not only pre-fill the identification stage, it submits
it. Captured from the executor during a failing run:
GET executor/default-authentication-flow -> ak-stage-identification
POST executor/default-authentication-flow -> 302
GET executor/default-authentication-flow -> ak-stage-password
So after signing out the flow is frequently already on the password
stage. `signOut()` waited for `ak-stage-identification`, which by then no
longer exists, and blocked until the test's own budget expired — about
one run in three, and only in this test, since it is the only one that
stores a remember-me identifier.
`signOut()` now waits for whichever stage the flow settles on. The test
follows suit: both remember-me routes converge on the password stage, so
it submits identification only when the flow is still sitting there. The
variant that embeds the password field in the identification stage never
leaves it and keeps its own assertion.
Verified against the reproduction: 8 serial repeats and 6 parallel, all
green, where the same repeat count previously failed roughly one in three.
Two new workspace packages, ahead of anything using them.
`@goauthentik/oxlint-config` exports a `createOxlintConfig` factory rather than
a static config, because the lit/wc rules and the React plugin vary per consumer
and four near-copies of one rule set is how they drift. It also carries the
platform-layering `no-restricted-imports` rules and a bundled JS plugin for
authentik's own rules.
`@goauthentik/oxfmt-config` is the formatting half. `src/imports.ts` is the part
worth a look: it reproduces the import grouping `format-imports` gave us under
Prettier, using oxfmt's perfectionist-style selectors.
Both compile to a gitignored `out/`, which every consuming config imports at
load time, so both carry a `prepare` script — pnpm runs it on a fresh install,
which is what CI always does. `make node-install` builds them explicitly as
well, since `prepare` does not re-run on a warm tree when the lockfile is
already satisfied.
Nothing consumes either package yet.
`ak-codemirror` imports its editor lazily, so between first render and that
import resolving there is no editor state to read and the value getter returns
an empty string. A form submitted in that window serializes the field as "",
and the server rejects it — creating a group or a user through a dialog fails
with "Attributes: Value must be a dictionary, and not have any duplicate
keys" and the dialog stays open.
The value setter has already stringified the incoming value by then, so fall
back to it when no editor state exists yet.
Co-authored-by: Playpen Agent <[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/bug/25815: fix display of capabilities tabs on the User Applications page
# What
Fixes a visible race condition on the User Applications page
The test for license status would allow the “Agents” tab to be shown briefly when the `licenseSummary.status` was undefined. This looks like a race condition; sometimes the licensing information hadn’t arrived when the display rendered. This commit extracts the predicate into a function and makes it positive (“You *can* do this”) rather than negative.
Also: separates copy/pasta machinery from the intent. 🗣🔥🔥🔥
Closes \#25815
* A much cleaner separation. I didn't like that weird '[valid] : []' construct.
* invalidate Policy cache when a Policy or PolicyBinding is updated
* policies: normalize binding UUID during cache invalidation
* fix UUID capture bug in blueprints
---------
Co-authored-by: Dewi Roberts <[email protected]>
* model changes and a few other things for sasl
* source changes plus a small UI change to view connection settings
* e2e testing via openldap docker container
* code review comments re: docker images
---------
Co-authored-by: Jens L. <[email protected]>
* flows: clear login_hint on cancel to fix 'Not You?' loop
When a login_hint is passed to the OAuth2 authorize endpoint, it is prefilled
into the identification stage and also carried in the flow's `next` param. On
clicking 'Not You?', CancelView redirected back to `next`, which re-entered the
authorize flow and re-applied login_hint from the URL, trapping the user in a
loop.
Strip login_hint from the cancel `next` redirect so re-entering the flow no
longer re-prefills the identifier, while legitimate first-arrival prefill (read
directly from the authorize URL) is unaffected.
Fixes#25476
* cleanup
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
Clarify the difference between API tokens and app passwords. Document app-password creation, the LDAP password backend requirement, proxy HTTP Basic authentication, and OAuth2 token exchange.
Closes#12916
* server: preserve websocket close code when proxying to outposts
The websocket proxy that bridges outpost connections to the gunicorn/uvicorn
backend replaced every relayed close frame with a code-less close
(`Message::Close(None)`), discarding the status code and reason from the peer.
When a web worker is recycled (routinely, via web.max_requests) or restarted on
upgrade, uvicorn closes the outpost websocket gracefully with 1012 (service
restart). Because the proxy relayed `Close(None)`, the outpost instead received a
close frame with no status code, which surfaces as `websocket: close 1005 (no
status)` and is logged at warning level - indistinguishable from a genuine fault,
so a healthy deployment warns on every recycle and trips outpost-disconnect
alerting. The reverse direction stripped the outpost's own close code too.
Relay the received close frame verbatim in both directions so the peer sees the
real close code and reason. The tail-of-stream case (peer closes without sending
a Close frame) still sends `Close(None)`, which is correct.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* no claude comments
Signed-off-by: Jens Langhammer <[email protected]>
---------
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
OR_LIST_FORMATTERS was constructed once at module load with the locale
string "default", which resolves to the browser's own locale rather than
authentik's active locale. Individual field labels (e.g. "Username") are
translated correctly via msg(), but the "or" connecting them never was.
Move construction to render time via a createOrListFormatter(locale)
factory, using the stage's already-available this.activeLanguageTag
(BaseStage extends WithLocale(AKElement)) so it follows the active
locale, including changes at runtime.
Fixes#20632
| 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
@@ -2,7 +2,7 @@ authentik takes security very seriously. We follow the rules of[responsible di
## Independent audits and pentests
We are committed to engaging in regular pentesting and security audits of authentik. Defining and adhering to a cadence of external testing ensures a stronger probability that our code base, our features, and our architecture is as secure and non-exploitable as possible. For more details about specific audits and pentests, refer to "Audits and Certificates" in our [Security documentation](https://docs.goauthentik.io/docs/security).
We are committed to engaging in regular pentesting and security audits of authentik. Defining and adhering to a cadence of external testing ensures a stronger probability that our code base, our features, and our architecture is as secure and non-exploitable as possible. For more details about specific audits and pentests, refer to [Audits and Certificates](https://docs.goauthentik.io/security/audits-and-certs/).
## What authentik classifies as a CVE
@@ -14,6 +14,14 @@ If it is determined that the issue does qualify as a CVE, a CVE number will be i
Even if the issue is not a CVE, we still greatly appreciate your help in hardening authentik.
## Our CNA
GitHub is the CNA (CVE Numbering Authority) for authentik. We request every authentik CVE ID from GitHub through the [repository security advisory](https://docs.github.com/en/code-security/security-advisories/working-with-repository-security-advisories/about-repository-security-advisories) that the report was filed under. This places authentik vulnerabilities in the scope of [GitHub, Inc. (CNA-2019-0009)](https://www.cve.org/PartnerInformation/ListofPartners/partner/GitHub_M).
Please do not reserve or assign a CVE ID for authentik from any other CNA, including your own. A second ID creates a duplicate record for the same vulnerability. If you have already reserved an ID, please withdraw it and use the ID that GitHub assigns.
GitHub reviews each request, so assignment can take several weeks. We publish the advisory without waiting for the ID, and the ID is added to the advisory once GitHub assigns it.
## Supported Versions
(.x being the latest patch release for each version)
@@ -96,10 +104,12 @@ The destinations of outgoing network requests (HTTP, TCP, etc.) made by authenti
1. Vulnerability is reported via a GitHub Security Advisory, as listed above.
2. The authentik Security team will try to reproduce the issue and ask for more information if required.
3. A severity level is assigned.
4.A fix is created, and if possible tested by the issue reporter.
5.The fix is backported to other supported versions, and if possible a workaround for other versions is created.
6.An announcement is sent out with a fixed release date and severity level of the issue. The announcement will be sent at least 24 hours before the release of the security fix.
7.The fixed version is released for the supported versions.
4.If the issue qualifies as a CVE, a CVE ID is requested from GitHub, our CNA. See [Our CNA](#our-cna).
5.A fix is created, and if possible tested by the issue reporter.
6.The fix is backported to other supported versions, and if possible a workaround for other versions is created.
7.An announcement is sent out with a fixed release date and severity level of the issue. The announcement will be sent at least 24 hours before the release of the security fix.
8. The fixed version is released for the supported versions.
9. The security advisory is published. If GitHub has not assigned the CVE ID by then, the ID is added to the advisory once it arrives.
Loaded 100 of 3288 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.