Commit Graph
3013 Commits
Author SHA1 Message Date
Quentin Gliech 2085f1097f Rename the WithCaptcha template context field to captcha_config
The field name is now more descriptive of what it actually is – the
configuration of the CAPTCHA provider – and aligns with the key used
when passing it to the client-side React form.
2026-08-10 15:01:55 +02:00
Quentin Gliech ed45464b9f Load frontend translations with JS dynamic imports rather than fetching as JSON (#5915) 2026-08-10 15:01:36 +02:00
Quentin Gliech 8892cc7eb8 Remove the GraphQL playground (#5914) 2026-08-10 14:57:59 +02:00
Quentin Gliech cacc757cef Emit a modulepreload for dynamically imported chunks in include_asset
Now that the translations are lazily imported JS chunks rather than plain JSON
assets, `include_asset('locales/<lang>.json')` resolves to a manifest entry
flagged `isDynamicEntry`. Those must not be evaluated eagerly with a `<script>`
tag, so emit the same `modulepreload` hint we already use for imported chunks,
integrity included, and drop the now-unreachable top-level JSON preload.
2026-08-07 17:59:27 +02:00
Quentin Gliech c3b5fa3b0c Remove the GraphQL playground
The interactive playground page and its route/config option are gone; the GraphQL API itself (POST /graphql) is unaffected. External GraphQL usage is deprecated anyway in favour of the REST admin API.
2026-08-07 12:26:42 +02:00
Quentin Gliech 146b7fe379 Update the Sentry transport to use the new options API 2026-08-07 10:07:38 +02:00
Quentin Gliech 7abe147ba0 Expose a logged_out variable to upstream authorization parameter templates (#5859) 2026-07-29 17:57:55 +02:00
Quentin Gliech 07857f591f Test that the session is not considered as 'just logged out' after some time
And fix the 'just logged out' logic
2026-07-29 14:52:01 +02:00
Quentin Gliech 2f733e90b3 Keep the auth action context when changing accounts (#5843) 2026-07-29 14:02:32 +02:00
Quentin Gliech f86cf820e3 Accept [ and ~ in OAuth 2.0 scope tokens (#5881) 2026-07-28 18:35:00 +02:00
Quentin Gliech b458faede7 Clean up the tests for allowed characters in scope 2026-07-28 18:08:14 +02:00
Quentin Gliech 7a2ea45678 Accept [ and ~ in OAuth 2.0 scope tokens
The `nqchar` predicate used exclusive ranges where RFC 6749's NQCHAR
ranges (%x23-5B / %x5D-7E) are inclusive on both ends, so scopes
containing `[` or `~` were rejected with "Invalid scope format". In
particular this broke `urn:matrix:client:device:` scopes for device IDs
containing `~`, which the Matrix spec explicitly allows.

Fixes #5878
2026-07-28 17:32:44 +02:00
Quentin Gliech 9d521acd02 Replace Unix socket on startup & allow setting permissions (#5858) 2026-07-28 13:48:39 +02:00
Quentin GliechandErik Johnston fc94b550db Use Utf8Path::with_added_extension for constructing the temporary socket path
Co-Authored-By: Erik Johnston <erikj@element.io>
2026-07-28 13:21:34 +02:00
Quentin Gliech 406d678a6f Add a filter[human-account-name] param to the upstream OAuth links admin API
Fuzzy (case-insensitive substring) search on the link's human account
name.
2026-07-27 16:09:01 +02:00
Quentin Gliech 85c902e000 Add a trigram index on upstream_oauth_links.human_account_name
Backs the ILIKE '%search%' fuzzy filter on the human account name.
2026-07-27 16:09:01 +02:00
Quentin Gliech f70abb914e Add a human_account_name filter to the upstream OAuth link repository
Fuzzy (case-insensitive substring) matching on the link's
human_account_name, following the OAuth 2.0 client name filter
precedent.
2026-07-27 16:09:00 +02:00
networkException bdfeee2ceb Add password_file config variant for email and database 2026-07-26 17:57:40 +02:00
Kai A. Hiller afe299dc90 Fix method calls 2026-07-24 13:27:36 +02:00
Kai A. Hiller 2e47d7a119 Add client_uri config for static clients 2026-07-24 13:09:38 +02:00
defaultdino 7eadb518e9 remove AuthorizationGrantStage branch. remove browser_session_id from Exchanged state 2026-07-22 11:30:42 +02:00
defaultdino 3dfa4a63e6 handle inactive browser session in separate branch. new migration for index, edit old. cover all match cases for authorization grant lookup 2026-07-20 16:03:45 +02:00
adis veletanlic 3665a3c650 Merge branch 'main' into oauth2-session-creation-at-token-exchange-time 2026-07-19 20:29:32 +02:00
defaultdino 684521a2a3 filter active browser sessions, remove update queries from migration, add index on user_session_id, add additional AuthorizationGrantStage case match22 2026-07-19 20:27:38 +02:00
Quentin Gliech cd78f82f9c Replace Unix socket on startup & allow setting permissions
Fixes #5572
Fixes #2424

This makes it so that MAS binds on a temporary path on startup, sets
permissions and then moves it to the configured path. This means that we don't
error out anymore if there is a stale socket file, and that it is safe to
rollout a new process without killing the old one first, without breaking
connections.
2026-07-13 13:46:47 +02:00
Quentin Gliech e7c57e013a Expose a logged_out variable to upstream authorization parameter templates
When a browser signs out (or discovers its session was ended), the
session cookie now remembers when that happened; the flag is cleared by
the next successful login. The `additional_authorization_parameters`
templates can read it as `logged_out`, so operators can force a fresh
prompt at the upstream provider after sign-out, e.g.:

    additional_authorization_parameters:
      prompt: "{% if logged_out %}login{% endif %}"

This addresses the "sign out signs me back in" loop with upstream SSO
providers that still hold a live session.

Fixes #1569
2026-07-10 15:55:14 +02:00
Quentin Gliech 0013606e9b handlers: test that the post-auth action survives the account-inactive sign-out flow 2026-07-06 14:29:26 +02:00
Quentin Gliech e9dd5636f1 handlers: preserve the post-auth action on the password login and upstream link inactive-account paths 2026-07-06 14:29:26 +02:00
Quentin Gliech 2d33e0f149 handlers: thread the post-auth action through the account-inactive fallback pages 2026-07-06 14:29:26 +02:00
Quentin Gliech eb97fa19e2 templates: allow the account locked/deactivated/logged-out pages to carry a post-logout action 2026-07-06 14:29:25 +02:00
Quentin Gliech cb46044f0d Adapt to minijinja 2.21, bump minijinja-contrib in lockstep
The 2.21 AST grew a dedicated Compare node for chained comparisons,
which the i18n scanner needs to walk. Also raise the workspace
requirements from 2.15.1/2.12.0 to 2.21.0.
2026-07-03 17:09:37 +02:00
Quentin Gliech 773ccdbfc2 Adapt to the v_htmlescape 0.17 API
The `escape()` entry point was replaced by `escape_string()` /
`escape_fmt()`. minijinja still depends on 0.15, so allow the duplicate
in cargo-deny.
2026-07-03 14:28:16 +02:00
Quentin Gliech 13d10dfe7e Adapt to the sd-notify 0.5 API changes
`notify()` lost its `unset_env` argument, and `watchdog_enabled()` now
returns an `Option<Duration>` directly.
2026-07-02 22:22:51 +02:00
Quentin Gliech 92318fc368 Upgrade aide, schemars and axum (#5752) 2026-07-02 17:43:41 +02:00
defaultdino 31632bff1f format crates/storage-pg/src/oauth2/authorization_grant.rs 2026-07-02 15:46:37 +02:00
defaultdino 5b9c6ffd6f wrap OAuth2 in tickmarks 2026-07-02 15:45:15 +02:00
defaultdino 2576ba3a13 defer oauth2 session creation to happen at token exchange time 2026-07-02 15:45:14 +02:00
Quentin Gliech a62a9ebdeb Fix the HTTP client not setting the ALPN extension (#5758) 2026-07-02 12:11:09 +02:00
Quentin Gliech 7d249dccb9 Upgrade ICU crates to 2.x (#5761) 2026-07-02 12:09:49 +02:00
Quentin Gliech 4912a36888 admin: keep generic response schema names stable under schemars 1.0
schemars 1.0 dropped the type parameter from a generic's default schema name
(SingleResponse_for_User -> SingleResponse with numeric dedup like
SingleResponse2/3...). Those names become the OpenAPI $defs keys and, downstream,
the generated TypeScript type names in element-admin's SDK — so the change both
renamed every wrapper type and made the names positional/unstable.

Restore the 0.9 '_for_T' naming via schemars 1.0's rename format string on the
three generic wrappers (SingleResponse/PaginatedResponse/SingleResource), keeping
the published admin API schema stable for consumers.
2026-07-01 17:09:26 +02:00
Quentin Gliech 98d1ac399e Port the remaining icu4x call sites to 2.0 2026-07-01 17:07:49 +02:00
Quentin Gliech 7dd04bb691 i18n: port the translator to the icu4x 2.0 API
Use the icu_locale fallbacker with a default LocaleFallbackConfig, build
PluralRules and the RelativeTimeFormatter from compiled data, format times with
the fieldset-based NoCalendarFormatter, and adopt the new data-error model
(IdentifierNotFound / MarkerNotFound).
2026-07-01 17:07:49 +02:00
Quentin Gliech b8aaa1a980 deps: upgrade icu4x 1.5 -> 2.2
Bumps all the ICU related dependencies to 2.2 or equivalent
2026-07-01 17:07:49 +02:00
Quentin Gliech b74ac42018 Install the rustls crypto provider in the handlers test setup
Building the HTTP client now relies on a process-level rustls crypto
provider being installed (we no longer pass a pre-configured TLS config
that bundled one). Tests going through TestState that didn't call
setup() — e.g. the login_sso_redirect tests — panicked when building the
client. Call setup() from from_pool_with_site_config so every TestState
installs the provider.
2026-06-30 12:18:47 +02:00
Quentin Gliech 938c6aee67 Do not customize the TLS configuration of the HTTP client
This fixes a bug where we were not sending the ALPN extension, which caused the
HTTP client to always use HTTP/1.1 instead of HTTP/2.

Fixes #5757
2026-06-30 12:18:47 +02:00
Quentin Gliech f7e2fd2803 Record the HTTP version in the HTTP client trace
As per the OTEL semantic conventions:
https://opentelemetry.io/docs/specs/semconv/http/http-spans/
2026-06-30 12:18:46 +02:00
Quentin Gliech f948dec457 config: remove the unused branding.logo_uri option
branding.logo_uri was accepted and validated by the config layer but never
plumbed through to SiteConfig or any template, so it had no effect. Remove the
field and regenerate the committed config schema to remove the confusion.
2026-06-25 19:04:19 +02:00
Quentin Gliech 1d1bcbaf26 cli: clean up the doctor homeserver checks
MSC2965 changed the discovery mechanism to stop relying on .well-known
documents a while back. We removed references to this in the configuration
manual some time ago (see e3d1b8abfa) but
`mas-cli doctor` was still checking for it.

See element-hq/backend-internal#5 as well
2026-06-25 19:04:18 +02:00
Quentin Gliech 5d489f71e9 Infer an initial name for the device for the device auth grant (#5750) 2026-06-25 18:34:46 +02:00
Quentin Gliech a51e222d49 Track and log database statistics for every request and job (#5745) 2026-06-25 18:26:09 +02:00