782 Commits
Author SHA1 Message Date
Hugh MessengerandJens L. 6919bf73ab outposts/ldap: apply provider changes to the cached binder on refresh (#27402)
In cached bind mode the refresh rebuilt the provider instance but kept
the previous session binder's direct binder, and that binder reads the
bind flow, the unbind flow, MFA support and the base DN from the
instance it was built with. A change to any of them on the provider
never reached a running outpost: it carried on executing the old bind
flow until the process was restarted, while the refresh log said the
new flow had been loaded. The cached results survived the refresh too,
so a bind refused under the old settings stayed refused, and one
accepted stayed accepted, for the life of its entry.

The direct binder is now always built from the new instance. The
session cache is carried over only when the settings that decide a
bind's outcome are unchanged; when one of them changes, the old cache
is stopped and a fresh one started, so every pair of credentials runs
the new flow once more and is cached again under it. The five-minute
refresh keeps the cache in the ordinary case; the cost lands only when
an administrator changed something, which is what the change was for.

Also fixes the comment on the caching line, which said the opposite of
what the code does: a result is cached whenever the bind itself
completed, refusals included; only a transport error is left uncached.

Tests: a refresh with unchanged settings keeps the cached sessions; a
changed bind flow, unbind flow, MFA setting or base DN discards them,
refusals included; and the direct binder answers for the new instance's
base DN after a refresh. The last two fail on the previous code.

Co-authored-by: Jens L. <[email protected]>
2026-11-02 15:15:37 +00:00
Dominic Roy 9a68e73d58 outposts, internal/outpost: keep the web path when outposts connect to authentik (#27290)
With authentik under AUTHENTIK_WEB__PATH, outposts could not reach it:

- The RAC outpost built its session websocket URL from the API client's
  scheme and host only, so it dialed /ws/outpost_rac/... and got a 404,
  while the control websocket already kept the path. Both now go
  through one dialer, which also gives the session websocket the unix
  socket support and query parameters of the control websocket.
- The API base was the path of AUTHENTIK_HOST with "api/v3" appended, so
  a path without a trailing slash, such as /authentik, became
  /authentikapi/v3. The websockets already joined the path correctly.
- The default outpost config, which the admin interface pre-fills for
  new outposts, set authentik_host to the server root.

Closes: #26803
2026-10-29 11:24:36 -04:00
Jens L. a25ffa9785 brands: in memory cache (#26926)
* brands: in memory cache

Signed-off-by: Jens Langhammer <[email protected]>

* fix tests

Signed-off-by: Jens Langhammer <[email protected]>

* same cache for system settings

Signed-off-by: Jens Langhammer <[email protected]>

* fix typing

Signed-off-by: Jens Langhammer <[email protected]>

* invalidate all via channels

Signed-off-by: Jens Langhammer <[email protected]>

* Revert "invalidate all via channels"

This reverts commit 6186875d77.

* fixup

Signed-off-by: Jens Langhammer <[email protected]>

* down to 1 min, add to API

Signed-off-by: Jens Langhammer <[email protected]>

* add ui

Signed-off-by: Jens Langhammer <[email protected]>

* fix gen

Signed-off-by: Jens Langhammer <[email protected]>

* Apply suggestion from @BeryJu

Signed-off-by: Jens L. <[email protected]>

* fixes for web-e2e

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens L. <[email protected]>
2026-10-24 19:50:52 +01:00
a42c652448 providers/ldap: keep cached directory when a refresh fetch fails (#26420)
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]>
2026-10-08 17:27:42 +01:00
Jens L.andDewi Roberts 20e2a3b60a providers/rac: integrate with ak-agent (#26361)
* providers/rac: merge into endpoints

Signed-off-by: Jens Langhammer <[email protected]>

* refactor some more

Signed-off-by: Jens Langhammer <[email protected]>

* cleanup

Signed-off-by: Jens Langhammer <[email protected]>

* create devices through endpoints

Signed-off-by: Jens Langhammer <[email protected]>

* cleanup api?

Signed-off-by: Jens Langhammer <[email protected]>

* cleanup un-needed changes

Signed-off-by: Jens Langhammer <[email protected]>

* cleanup more

Signed-off-by: Jens Langhammer <[email protected]>

* format

Signed-off-by: Jens Langhammer <[email protected]>

* fixup

Signed-off-by: Jens Langhammer <[email protected]>

* update e2e test

Signed-off-by: Jens Langhammer <[email protected]>

* Update release notes wording

Signed-off-by: Dewi Roberts <[email protected]>

* Remove linebreak

Signed-off-by: Dewi Roberts <[email protected]>

* ssh init

Signed-off-by: Jens Langhammer <[email protected]>

# Conflicts:
#	authentik/providers/rac/models.py

# Conflicts:
#	website/docs/releases/2026/v2026.11.mdx

* use platform ssh image for tests

Signed-off-by: Jens Langhammer <[email protected]>

* fix wrapping

Signed-off-by: Jens Langhammer <[email protected]>

* prevent duplicate events

Signed-off-by: Jens Langhammer <[email protected]>

* fallback to all protocols when override is set for host only

Signed-off-by: Jens Langhammer <[email protected]>

* keep key

Signed-off-by: Jens Langhammer <[email protected]>

* show local IP

Signed-off-by: Jens Langhammer <[email protected]>

* fix some RAC styling

Signed-off-by: Jens Langhammer <[email protected]>

* type

Signed-off-by: Jens Langhammer <[email protected]>

* switch to image with nss

Signed-off-by: Jens Langhammer <[email protected]>

* compatible user

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Dewi Roberts <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
2026-09-29 17:53:51 +01:00
Connor Peshek 73201b2af7 internal/utils: Add X25519MLKEM768 (#26368) 2026-09-23 15:50:03 +01:00
Hugh MessengerandDewi Roberts def9ac7f19 providers/ldap: fix memory leak in the cached searcher (#26028)
internal/outpost/ldap: stop retaining pointers into the cached user slice

The memory searcher stored `&ms.users[i]` on a non-searching bind DN's
flags the first time that user searched, and never cleared it. Every
refresh replaces `ms.users`, so each stored pointer kept an entire
superseded copy of the directory alive for the life of the process. On
a directory of ~6k users with ~70k memberships, each distinct password
login after a restart pinned ~100-160 MB until the outpost was killed
for memory. The same pointer also froze the user's own entry (memberOf)
at its first-search state.

Replace the two bare slices with an immutable snapshot (users, groups
and a pk index) behind an atomic pointer. fetch() builds a new snapshot
and swaps it; Search() loads the snapshot once per request, resolves
the bound user by pk against the current one and copies the value for
the duration of the request. Nothing is written to the per-DN flags.

This also removes the unsynchronised slice replacement during a refresh
and the per-request linear scan over all users.

The regression test drives the searcher against a fake core: a
non-searching user's self-read must reflect a group change after the
searcher is re-initialised the way Refresh() does, and the DN's flags
must not carry a user pointer afterwards. It fails on the previous
code on both counts.

Co-authored-by: Dewi Roberts <[email protected]>
2026-09-11 13:03:34 +01:00
Jens L. 95e758670a ci: bump golangci lint (#25513)
Signed-off-by: Jens Langhammer <[email protected]>
2026-08-26 20:06:45 +01:00
Marc 'risson' SchmittandJens L. 98bfc45c9d internal: remove unused go code (#25244)
Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
2026-08-21 16:28:32 +02:00
Nuno AlvesandMarc 'risson' Schmitt 42fb02e439 server/core: handle unsupported HTTP method (#22498)
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
2026-08-20 14:59:57 +02:00
Jens L. 992dc6b0a1 providers/radius: allow empty message authenticator (#25097)
Signed-off-by: Jens Langhammer <[email protected]>
2026-08-18 18:21:25 +01:00
Dominic Roy 5ca02ca26e outposts/proxy: include query string in post-authentication redirect (#25043)
providers/proxy: include query string in post-authentication redirect

Closes: #24966
2026-08-13 11:40:50 +01:00
authentik-automation[bot] 5cb6ee93ea root: bump version to 2026.11.0-rc1 (#24523)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com>
2026-07-31 17:22:34 +00:00
Georg dce01047cf internal: remove custom Vary header (#24078)
Signed-off-by: Georg Pfuetzenreuter <[email protected]>
2026-07-29 15:32:33 +02:00
Alexey AbelandAlexey Abel 84f89e0c94 internal/config: make storage file paths overwritable via env vars (#24177)
Co-authored-by: Alexey Abel <dev@abelonline>
2026-07-20 14:50:01 +02:00
Rabindra Kumar Meher 7b60a54a72 internal/outpost/ak: handle empty outpost list during refresh (#23827) 2026-07-08 17:30:37 +02:00
Jens L.andMarc 'risson' Schmitt 92982ccf5d providers/ldap: remove incorrect validation for code authenticator extraction (#23006)
* providers/ldap: remove incorrect validation for code authenticator extraction

Signed-off-by: Jens Langhammer <[email protected]>

* fix tests

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
2026-07-06 14:01:07 +01:00
Marc 'risson' Schmitt 927ec374e8 root: move server and worker healthcheck to rust (#23556)
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
2026-06-30 16:49:32 +00:00
Jose D. Gomez R. 9bacaf984d internal/outpost/ldap: remove Printf in MemberForGroup loop (#22952) 2026-06-15 16:50:05 +02:00
Jens L. c3c6508b67 providers/radius: fix panic in log due to type (#22965)
Signed-off-by: Jens Langhammer <[email protected]>
2026-06-10 00:12:33 +02:00
5727ae4271 core, internal, packages: fix British spellings flagged by cspell (#22819)
* core, internal, packages: fix British spellings flagged by cspell

Apply American spellings in Python docstrings/comments, Go log messages, a Rust doc comment, and a template comment (behaviour->behavior, initialise->initialize, finalise->finalize, etc.). Part of enabling cspell's British-spelling rule; the rule itself lands in a separate PR once all areas are clean.

Co-Authored-By: Playpen Agent <[email protected]>

* gen

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]>
2026-06-08 14:55:31 +02:00
Jens L. 0e4af73baf providers/radius: fix eap debug logging (#22551)
Signed-off-by: Jens Langhammer <[email protected]>
2026-05-22 14:16:36 +02:00
authentik-automation[bot] 78f5d85a8b internal: Automated internal backport: GHSA-5wcc-hf24-rf5h.sec.patch to authentik-main (#22304)
Automated internal backport of patch GHSA-5wcc-hf24-rf5h.sec.patch to authentik-main

Co-authored-by: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com>
2026-05-12 19:37:42 +02:00
authentik-automation[bot] ea61e1cf3b root: bump version to 2026.8.0-rc1 (#22167)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com>
2026-05-08 17:15:32 +00:00
Jens L. 311954f920 providers/radius: fix message authenticator validation (#21824)
* providers/radius: fix message authenticator validation

Signed-off-by: Jens Langhammer <[email protected]>

* fix panic

Signed-off-by: Jens Langhammer <[email protected]>

* send message auth

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
2026-04-25 20:53:29 +02:00
gp-somni-labsandcuriosity 79473341d6 internal/outpost: serialize websocket writes to prevent panic (#21728)
The outpost API controller shares a single *websocket.Conn across
multiple goroutines: the event-handler loop, the 10s health ticker
(SendEventHello), the shutdown path (WriteMessage close), initEvent
writing the hello frame on (re)connect, and RAC session handlers that
also invoke SendEventHello. gorilla/websocket explicitly documents that
concurrent WriteMessage/WriteJSON calls are unsafe and will panic with
"concurrent write to websocket connection", which takes the outpost
(and embedded-outpost authentik-server) pod down.

Fix by adding a sync.Mutex on APIController guarding every write path
on eventConn (initEvent hello, Shutdown close message, SendEventHello).
Reads (ReadJSON in startEventHandler) are left unsynchronized as
gorilla permits a single concurrent reader alongside a writer.

Minimal, localized change: no API changes, no behavior changes, writes
are already infrequent so lock contention is negligible.

Refs #11090

Co-authored-by: curiosity <[email protected]>
2026-04-23 02:33:10 +02:00
Bapuji Koraganti ae27fe4ce8 internal: fix certificate fallback without SNI (#21417)
21412: fix falls back to RSA instead of configured other TLS Certificates for a brand/domain

Honor the other certificates other than RSA
2026-04-07 01:28:44 +02:00
Jens L. a6775bc61e tests: refactor test harness to split apart a single file (#21391)
* re-instate previously flaky test

Signed-off-by: Jens Langhammer <[email protected]>

* break up big file

Signed-off-by: Jens Langhammer <[email protected]>

* move geoip data to subdir

Signed-off-by: Jens Langhammer <[email protected]>

* i am but a weak man

Signed-off-by: Jens Langhammer <[email protected]>

* fix ldap disconnect in testing

Signed-off-by: Jens Langhammer <[email protected]>

* account for mismatched uid due to test server process

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
2026-04-05 22:12:52 +02:00
Jens L. d5ee53feb2 providers/ldap: inherit adjustable page size for LDAP searchers (#21377)
Signed-off-by: Jens Langhammer <[email protected]>
2026-04-04 22:42:35 +02:00
Marc 'risson' SchmittandJens Langhammer 1ceb46ca15 providers/proxy: fix oidc client not using socket in embedded outpost (#21280)
* providers/proxy: fix oidc client not using socket in embedded outpost

Signed-off-by: Marc 'risson' Schmitt <[email protected]>

* cleanup and switch

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
2026-04-02 16:50:12 +02:00
dependabot[bot]andJens Langhammer ba82c97409 core: bump beryju.io/ldap from 0.1.0 to 0.2.1 (#21235)
* core: bump beryju.io/ldap from 0.1.0 to 0.2.1

Bumps [beryju.io/ldap](https://github.com/beryju/ldap) from 0.1.0 to 0.2.1.
- [Commits](https://github.com/beryju/ldap/compare/v0.1.0...v0.2.1)

---
updated-dependencies:
- dependency-name: beryju.io/ldap
  dependency-version: 0.2.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* update code

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jens Langhammer <[email protected]>
2026-04-02 14:37:00 +02:00
Jens L. 189251dc26 proviers/ldap: avoid concurrent header writes in API Client (#21223)
Signed-off-by: Jens Langhammer <[email protected]>
2026-03-29 20:52:49 +02:00
Marc 'risson' SchmittandJens Langhammer 2f70351c90 packages/client-go: init (#21139)
* packages/client-go: init

Signed-off-by: Marc 'risson' Schmitt <[email protected]>

* format

Signed-off-by: Jens Langhammer <[email protected]>

* remove mod/sum

Signed-off-by: Jens Langhammer <[email protected]>

* fix translate

Signed-off-by: Jens Langhammer <[email protected]>

* no go replace

Signed-off-by: Jens Langhammer <[email protected]>

* update rust makefile with pwd

Signed-off-by: Marc 'risson' Schmitt <[email protected]>

* fix build

Signed-off-by: Jens Langhammer <[email protected]>

* fix docs

Signed-off-by: Jens Langhammer <[email protected]>

* don't need a version ig?

Signed-off-by: Jens Langhammer <[email protected]>

* exclude go client from cspell

Signed-off-by: Jens Langhammer <[email protected]>

* fix main docker build

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
2026-03-25 15:26:50 +01:00
Marc 'risson' Schmitt 197cde8fae internal/web: remove authentication for metrics (#21077) 2026-03-23 14:52:04 +01:00
Marc 'risson' Schmitt bc0cbdf4b6 internal: remove unix sockets on shutdown (#21081) 2026-03-23 13:42:33 +00:00
Marc 'risson' Schmitt e3ddc0422a internal/outpost/ak: fix ws URL on outpost restart (#21041) 2026-03-20 14:11:38 +00:00
Marc 'risson' Schmitt 4dfdf9afa3 root: allow listening on multiple IPs (#20930) 2026-03-19 15:46:47 +00:00
Jens L.andDominic R ec7efa53cb providers/proxy: move search path to query instead of runtime parameter (#20662)
Co-authored-by: Dominic R <[email protected]>
2026-03-03 17:49:28 +00:00
Xabier Napal 35e025b25a outpost/proxyv2: prevent panic in handleSignOut (#20097)
outpost/proxyv2: use safe claims extraction in handleSignOut to prevent panic

Signed-off-by: Xabier Napal <[email protected]>
2026-03-03 18:21:25 +01:00
Jens L.andDewi Roberts 849c37806d internal: make http timeouts configurable (#20472)
* internal: make http timeouts configurable

Signed-off-by: Jens Langhammer <[email protected]>

* Changed formatting to match the rest of the doc

---------

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
2026-02-25 14:21:13 +01:00
Brolywood 17ab3a4b73 providers/proxy: preserve URL-encoded path characters in redirect (#20476)
Use r.URL.EscapedPath() instead of r.URL.Path when building the
redirect URL in redirectToStart(). The decoded Path field converts
%2F to /, which url.JoinPath then collapses via path.Clean, stripping
encoded slashes from the URL. EscapedPath() preserves the original
encoding, fixing 301 redirects that break apps like RabbitMQ which
use %2F in their API paths.
2026-02-23 17:30:47 +01:00
dependabot[bot]andJens Langhammer 122cee049a core: bump library/golang from 1.25.5-trixie to 1.26.0-trixie in /lifecycle/container (#20381)
* core: bump library/golang in /lifecycle/container

Bumps library/golang from 1.25.5-trixie to 1.26.0-trixie.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-version: 1.26.0-trixie
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* bump & fix

Signed-off-by: Jens Langhammer <[email protected]>

* bump docs too

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jens Langhammer <[email protected]>
2026-02-19 12:35:00 +00:00
authentik-automation[bot] 7cb789e777 root: bump version to 2026.5.0-rc1 (#20174)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com>
2026-02-11 01:43:16 +01:00
Chetan Sarva 3f1a0f83ca outpost/proxyv2: revalidate auth if session fails to load (#18063) 2026-02-05 17:19:28 +00:00
Dominic R 33594c9cb4 admin/files: add centralized theme variable support for file URLs (#19657)
* Revert "admin/files: support %(theme)s variable in media file paths (#19108)"

This reverts commit 1a963d27c8.

* admin/files: add centralized theme variable support for file URLs

Overview:

Adds support for `%(theme)s` placeholder in file paths, which allows theme-specific assets (like logos, backgrounds, icons) to be served based on the user's current theme (light/dark).

This replaces the previous implementation (reverted in this PR) which only handled theme substitution in the Go file backend and instead uses the new approach which centralizes theme logic and works across both backends.

Testing:

Try out the following for the file and s3 backend:

* Ensure themed images load
* Ensure non-themed images load

Motivation:

Internal

* brands: fix tests

* admin/files: s3 backend: fix tests

.xyz is a known MIME type for chemical/molecular structure files

* admin/files: api: fix tests

* core: fix tests

* admin/files: manager: fix tests

* admin/files: Support themed urls for passthrough backend

* admin/files: Create and use ThemedUrlsSerializer

* root: Regenerate

* core: Add read_only=True since it's a computed field from the model

* root: Regenerate

* web: Use the ThemedUrlsSerializer

* web, core: Fix frontend build

* core: Lint

* admin/files: Fix tests following CodeQL

* flows, providers: fix tests
2026-01-27 08:09:42 -05:00
Marc 'risson' Schmitt 85434710f3 root: update client-go generation (#19762) 2026-01-26 19:51:38 +01:00
Jens L. 9cb7c74e1c internal: fix certificate not refetched if fingerprint changes (#19761)
Signed-off-by: Jens Langhammer <[email protected]>
2026-01-26 17:07:35 +01:00
Jens L. 03e16b3a14 root: make logged HTTP headers configurable (#19716)
Signed-off-by: Jens Langhammer <[email protected]>
2026-01-26 14:31:54 +01:00
Jens L. 30ad2b78cb internal: fix incorrect metric calculation (#19701)
Signed-off-by: Jens Langhammer <[email protected]>
2026-01-23 16:52:53 +01:00
Vít SkalickýandDewi Roberts bc3a1f128b providers/proxy: Fix incorrect comparison of redirect URL and CookieDomain (#15686)
* Fix incorect comparison of redirect URL and CookieDomain. Fixes #15685

According to docs, URL.Host contains the host and port, while Hostname
returns only the host without the port. CookieDomain obviously does not
contain the port. string.HasSuffix function is used, so if a port is set
in the redirect URL, this check always fails.

* Fixed missing parentheses

---------

Co-authored-by: Dewi Roberts <[email protected]>
2026-01-22 17:44:22 +00:00