* lifecycle/container: build the server image distroless
* redo
* wip
* shorter comment
* update base images from fips#178
Co-authored-by: Emil Burzo <[email protected]>
Signed-off-by: Emil Burzo <[email protected]>
* non-PR fips image
---------
Signed-off-by: Emil Burzo <[email protected]>
* 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
* 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]>
* 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]>
* web: Add router-core search-parameter accessors.
* web: Persist ak-tabs selection as a search parameter.
* web: Persist table search and pagination as search parameters.
* web: Persist notification drawer state as search parameters.
* web: Configure the router core at admin-interface boot.
* web: Convert the admin route table to URLPattern routes.
* web: Mount the path-routing outlet in the admin interface.
* web: Add toCurrentInterface href builder for shared nav.
* web: Convert shared navigation links to path URLs.
* web: Convert admin table filters to search parameters.
* web: Convert the application create-wizard link to a path URL.
* web: Convert in-admin route links to path URLs.
* web: Point cross-interface links at path-based admin URLs.
* web: Remove the legacy hash router.
* web: Add e2e coverage for admin-interface path routing.
* web: Add a web.path smoke test for admin-interface routing.
* web: Resolve the auth-flow redirect against the deployment base path.
* web: Route the lifecycle-review object link through path translation.
The row link was still a fragment href (`#${objectAdminUrl}`). With the legacy
hash router gone, clicking it changed only the fragment: applyHashRedirect runs
once at boot, there is no hashchange listener, and the click interceptor
deliberately declines fragment-only navigations — so the link did nothing until
a manual reload.
The backend still emits the legacy `;<json>` tab encoding here, so translate it
through the shim rather than hand-rolling a second parser.
* web: stop embedded table search from closing the dialog around it
Searching inside a selection dialog closed it. Two independent leaks, both from a
table's search escaping the component that renders it:
- `Table` wrote its search and page into the document URL unconditionally. That
navigates, the route re-renders, and a dialog the page mounted imperatively is torn
down mid-search. `searchParam` is now nullable and opt-in: set it and the table owns
those parameters, leave it and the state stays local. `TablePage` — the table that
*is* the page — sets `q`. Reading the page out of the URL moves from the constructor
to `connectedCallback`, since a subclass's `searchParam` initializer hasn't run yet
while the base constructor is still going.
- `ak-search-ql` dispatched its synthetic submit with `composed: true`, so it crossed
the shadow boundary and reached `window`, where every connected `Table` treats a
submit as "refresh". Searching in a dialog refetched the table behind it. Native
`submit` doesn't cross shadow boundaries either.
Repro before this change: open a group, Users, Add Existing User, pick the user
selector, type a name, press Enter — both dialogs vanish and the group's own user
search is left holding the term. The URL gained `?q=<term>` from a table two dialogs
deep.
Also braces the single-statement `if`s this stack introduced (the search-param
registry helpers); pre-existing ones are left as they were.
Fixes `400-groups` "Simple group" and "Edit group from related group list". Serial
suite: 30 passed / 6 failed to 32 passed / 4 failed.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* web/router: skip re-resolving the outlet on search-only navigations
Tab and table-filter navigations change only the query string, but
`matchRoute` returns a fresh `RouteMatch` every call. Reassigning
`current` handed `until()` a new promise and flashed the page-wide
loading spinner over an already-mounted view.
Compare the incoming match against the current one structurally (same
route, same path parameters) and bail before reassigning when only the
search string moved. Path-parameter routes (e.g. a provider :id) still
re-resolve because their parameters differ.
* web/router: path-segment tabs via a routed base context
Move tabs from ?page= search params to real path segments:
/settings/sessions, /identity/users/6/credentials/tokens/all-roles. The
page stays mounted across tab changes, and nesting composes with no
per-page wiring.
How the base is delivered:
- The outlet publishes the current page's mount path (the matched path
minus any tab tail) on a routedTabBaseContext.
- Each <ak-tabs routed> consumes that context as its base, and in turn
provides its active panel's path to its own subtree. So a nested tab
group derives its base automatically, and a dispatcher page
(provider/source/connector view) is transparent to it -- the value
flows through to the type-specific view's tabs.
Router core:
- sameRouteMatch ignores the wildcard tail (unnamed URLPattern groups),
so a subtree route (/settings{/*}?) stays mounted while its tabs move
through the tail; a named-param change (:id) still remounts.
- strip/join are segment-aware, so a base without a trailing slash never
captures a sibling that shares its text (.../users/22 vs .../users/220).
ak-tabs:
- With "routed" (or an explicit "base"), the active tab is the path
segment past the base; tabs render as real in-interface links and
switching navigates the router. Without it, the legacy ?page= behavior
is retained so not-yet-converted pages keep working during the rollout.
Slotted panels, lazy-tabs, the command palette, and focus delegation
are unchanged.
- Pure slot<->segment/href/active-slot logic lives in tabs/tab-path.ts,
unit-tested independently of the DOM.
Converted so far: user settings (flat); admin user view and its nested
credentials and roles tab groups, plus the RBAC object-permission tabs.
Remaining tabbed pages still use ?page= until converted.
* web/router: route the remaining tabbed pages by path
Roll the routed-tab pattern out across every remaining view page: the
route pattern gains a `{/*}?` tail and its <ak-tabs> gains `routed`. No
base wiring -- the base flows through the routedTabBaseContext, including
through the provider/source/connector dispatcher pages to the
type-specific view's tabs.
Covers: all provider views (oauth2, ldap, proxy, saml, radius, scim, rac,
google_workspace, microsoft_entra, ssf, wsfed), all source views (oauth,
ldap, saml, scim, plex, telegram, kerberos), the endpoint connector views
(agent, gdtc, fleet), and the application, device, group (+ its nested
roles), role, flow, outpost, system-tasks, and user access-requests pages.
Left on ?page= deliberately: the proxy setup-instructions tabs and the
device add-how-to, which are guidance panels, not navigation.
* web/test: cover path-segment settings tabs; refresh legacy-shim note
Add a routing test asserting the settings tabs track the path: a deep
load selects the named tab, switching writes the segment, and the default
tab drops back to the bare settings path. Update the legacy-hash-shim
test's note now that tabs are path-routed -- the shim deliberately does
not translate a legacy ?page= into a path segment.
* web/router: use a strict undefined check for the wildcard tail
The wildcard group is string | undefined, never null; satisfies eqeqeq.
* web,core: point the sources-tab redirects at the path segment
Now that settings tabs are path segments, the "show the connected
sources" redirects need to target /if/user/settings/sources instead of
the old hash (`#/settings;page-sources`) or `?page=page-sources`, which
path-routed tabs ignore.
- core: the source flow manager's post-link redirect, and its unit-test
assertion, use `settings/sources`.
- web: the OAuth/SAML source "Connect" links and the password/MFA/
access-request cross-links build the path form via toUserInterface
(details is the default tab, so it drops to the bare `settings`).
- e2e: the OAuth source test expects the path redirect and navigates to
the tab by path.
Keeps the existing Python e2e (test_source_oauth_oauth2) valid under
path-segment tabs.
* ci/web: run Playwright e2e suite on every PR
Adds an `e2e (playwright)` job to ci-web.yml that builds the web UI and the
Rust binary, brings up authentik with `ak allinone`, and runs
`web/test/browser/` against it. Traces, videos, the HTML report, and the
server log are uploaded on every non-cancelled run, and the pass/fail
summary is posted back to the PR as a single updated comment.
The S3 report hosting is wired up but gated behind
`vars.PLAYWRIGHT_S3_ENABLED` until the bucket exists; until then the comment
points reviewers at the `playwright-report` artifact.
Rebased onto core/source-redirect-path, which drops most of the original
change:
- The numbered test-file layout, the playwright.config.js reporters, and the
SessionFixture password-locator fix all landed upstream already.
- The Go server build, the gunicorn probe, and the worker port shuffle are
gone: `ak allinone` is a single process on :9000.
- corepack npm became pnpm, so setup goes through .github/actions/setup.
- The test-admin blueprint is unnecessary — setting AUTHENTIK_BOOTSTRAP_EMAIL
and AUTHENTIK_BOOTSTRAP_PASSWORD makes blueprints/system/bootstrap.yaml
create exactly the account SessionFixture logs in with.
Readiness now gates on the flow executor resolving
`default-authentication-flow` rather than on the SPA shell rendering: the
shell is served whether or not the worker has applied blueprints/default/
yet, so it was never a real signal that the flows the tests drive exist.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* web/e2e: fix the login redirect race and the unscoped table search
`session.login()` defaulted `to` to the flow pathname and then waited on it after
submitting, so `waitForURL` matched the page it was already on and returned before the
post-login redirect landed. Callers that passed `to` explicitly happened to dodge this;
the four provider tests call `login()` bare and ran their first step against the login
screen. `to` is now only the destination — pre-login navigation falls back to the flow
page, and with no destination the wait is for the flow pathname to be *left*, raced
against the auth-failure alert so the deliberate bad-credential tests still return.
`form.search()` matched anything named `/search/i` on the whole page. On pages that
mount a wizard that also picks up the dual-list-select boxes for scopes, sources, and
providers — seven elements on the providers page, so strict mode failed. Scoped to
`ak-table-search`, which keeps the match role-based: tables render either a plain
searchbox or a query-language combobox.
Provider tests also needed an explicit destination; they were relying on the bare
`login()` landing somewhere useful, and akadmin defaults to `/if/user/`.
Serial full-suite run goes from 26 passed / 10 failed to 30 passed / 6 failed. The
remaining six fail on this base independently of these fixes.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* web/test: let the library launch the RAC app it filters to
The test filtered the library to its application and then clicked the card, but the
click was intercepted for the full 30s by a Launch Endpoint dialog that was already
open. The filter opens it: `fill()` dispatches `change`, and `#changeListener` in
`ak-library-impl` focuses and clicks the row as soon as exactly one application matches.
So the explicit click landed on the modal the filter had just raised, with the card
underneath no longer taking pointer events.
Assert the launcher opens from the filter instead. The card is still asserted visible
first, so a missing application still fails here rather than further down.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* web/test: run the browser suite serially in CI
Under `workers: "50%"` the suite failed six tests on a five-worker run, and a different
six on the next. Every failure was a timeout on an operation that passes on its own, and
one was real interference rather than slowness: the groups and users suites both edit
`akadmin`'s group membership, so concurrent workers fight over the same records. The
tests share one authentik instance and one database; they were never independent.
Serial in CI only — local runs keep `"50%"`. The full suite takes about three and a half
minutes that way, against the job's 60 minute budget.
Also gives "Remember me persists username" a 60s budget. It signs in with remember-me,
signs out, and returns to a pre-filled form, so it pays the flow executor's startup cost
twice and did not fit in 30s; the wait for the identification stage is now explicit,
because the flow shell is served before the executor has resolved the first stage.
Full suite under the CI config: 36 passed, none flaky.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* web/test: make the browser suite independent instead of serial
Reverts the serial-in-CI change and fixes what parallelism was actually exposing.
The tests were not independent. Three of them reached for identities the whole suite
shares, so concurrent workers wrote to the same records — and so did every previous run,
which is why a group could fall off the first page of `akadmin`'s related group list:
- "Simple group" assigned `akadmin` to its group, and "Edit group from related group
list" added its group to `akadmin`. Both now create a user of their own through a
shared `createInternalUser` helper. The related-group assertion drops its `.first()`,
because the user it reads has exactly one group.
- "Creating a user within the admin group" wrote members into `"authentik Admins"`. The
mechanic under test is creating a user from inside a group's Users tab, which does not
care which group that is, so it makes its own — and stops quietly granting those users
superuser. Renamed to "Creating a user within a group".
- `101-session-lifecycle` enabled "Remember me on this device" from a `beforeAll`, saving
the default identification stage while other workers were authenticating through it.
That is a suite-wide precondition, so it moves to the `prerequisites` project and runs
once before any worker starts.
Timeouts are raised at the config rather than per assertion. Every action here is a round
trip to a real instance that the other workers are also hitting; Playwright's 5s
assertion default is written for in-process UI. With a 15s floor, the twelve
`{ timeout: 10_000 }` and `{ timeout: 5_000 }` overrides scattered through the suite had
become *stricter* than the default they were written to relax, so they are gone.
Verified at two workers, which is what `"50%"` gives CI's four-core runner: 36 passed in
2.6 minutes.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* web/user: launch the single library match on a first search
Committing a search from an empty box never opened the matching
application. `selectedApp` is null while the query is empty, so no row
carries `targetRef`; `input` and `change` arrive in the same task, and
the query setter narrows `visibleApplications` synchronously while Lit's
re-render — which binds the ref — is still pending. `#changeListener`
read `targetRef.value`, found nothing, and returned.
It only appeared to work when a render happened to land between the two
events, which is why the RAC e2e failed intermittently at the "Launch
Endpoint dialog opens" step: no launch, so no dialog.
Both the change and submit paths now await `updateComplete` before
reading the ref, so they act on the render that owns it rather than the
one before. Covered by a browser test that drives the two events in a
single task, the way a committed search does.
* core, web: inject the interface context as data, not as script
`base/header_js.html` built a `window.authentik = {...}` assignment out
of `JSON.parse('{{ config_json|escapejs }}')`, and the flow template
appended a second script that mutated it. Both are executable inline
script, which is the kind of thing that has to go before the interface
pages can be served under a strict CSP.
The server now renders the same values as data: `config` and `brand` as
`json_script` blocks (which serialize and escape on their own, so
`interface.py` hands them the objects instead of pre-dumped strings), and
the scalars — locale, version, build, base URL, flow layout/title/
background — as `<meta>` tags. The messages block was already
`type="application/json"`.
`globalAK()` reads them back from the DOM. Its return shape is unchanged,
so its 23 call sites are untouched; it memoizes on first read rather than
evaluating at import, keeping `#common/global` importable without a
document. A malformed `json_script` block is treated as absent, so the
interface still boots on the same fallbacks it uses when nothing is
injected at all.
* web/sfe: read the injected context as data
`base/header_js.html` stopped assigning `window.authentik` and now renders
the same values as data — a `json_script` block for the brand, `<meta>`
tags for the scalars. `web/src/common/global.ts` moved with it, but the
simplified flow executor has its own reader and was missed: it is a
separate Rollup bundle under `web/packages/sfe`, outside the `web/src`
tree that sweep covered.
`ak()` returned undefined, so the first property access threw before the
executor rendered anything, and every SFE test failed looking for
`#ident-form` — `test_flows_login_sfe` (both cases) and
`test_webauthn_authenticate_sfe`, all with that same selector.
Adds a standalone reader for the two values SFE needs, the brand and the
API base. It cannot import the shared one: that pulls in the generated
API client, which would dwarf this bundle. The brand block is the
serializer's own output, so its keys stay snake_case here rather than
being converted the way the main bundle converts them.
---------
Co-authored-by: Teffen Ellis <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
* web: Configure the router core at user-interface boot.
* web: Add an erased RouteLike surface for mixed route tables.
Route's parameter type sits in a contravariant position, so a route that
declares typed path parameters is not assignable to Route<RouteParameterRecord>
and a mixed table cannot be typed as Route[]. RouteLike erases the parameter
type through method bivariance, so each route keeps its own typed render
callback while the outlet drives them uniformly.
* web: Convert the user route table to URLPattern routes.
* web: Mount the path-routing outlet in the user interface.
* web: Persist library search as a real search parameter.
* web: Build the admin wizard link with the cross-interface helper.
* web: Point settings and requests deep links at path-based URLs.
* web: Update e2e coverage for user-interface path routing.
* web: Add a web.path smoke test for user-interface routing.
* web: Route the user nav-tabs through path-based navigation.
* tests/e2e: Build user-interface URLs as paths, not hashes.
* Format.
* web: Keep the bare legacy tab token through hash translation.
The legacy router read `#/settings;page-sources` as a tab selector, but the
shim fed the bare token to URLSearchParams, producing a valueless key that
serialized away — so the tab was silently dropped. Decode it to the `page`
parameter instead, which is what ak-tabs reads.
This keeps the source-linking redirect in flow_manager.py landing on the
Sources tab while it still emits the legacy hash form.
---------
Co-authored-by: Teffen Ellis <[email protected]>