A token that is passwordless, has a username template and has no email
address pinned or allowed registers with only a display name. That
condition was called an invite link, though every token has an invite
link (`invite_url`), and a link listing the addresses allowed to use it
didn't count as one. It is now `registers_without_email()`, and
`without_email` on the registration page.
The page's other names drop the guest and link wording for what MAS
checks: `passwordless` for any valid passwordless token, with the
heading strings and the login link's prop named the same way. What the
page says is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJcZUXYbZ74Y9v5jZ7y
With a token listing the addresses it allows, `POST /register` refuses
any other with an error on the email field, before a code is sent, and
the island explains it without naming the listed addresses.
One check on the token covers a pinned address and a list, in
`POST /register`, the token step and the last checks when finishing.
The last two read the token as it stands then, so a list replaced while
a registration is under way applies to it. `invite-emails` sends a
listed token only to an address on its list.
A passwordless token with a list skips the registration rate limit, as
one with a pinned email does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJYpWHZUTqexCFxqUAq
Design alignment for the Guest-XP Figma, not for merge.
An invite link (passwordless token, username template, no pinned email)
registers a guest with a display name and no email: the first step asks
for the display name, finish skips the email code and the display-name
step. It names no address, so it stays under the per-IP registration
rate limit. Email invites only get the new heading, subtitle and icon.
A token listing the addresses allowed to use it isn't an invite link, so
the people it invites type and verify one of those addresses, and none
of them registers without one.
Co-Authored-By: Devon Hudson <devon.dmytro@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJYpWHZUTqexCFxqUAq
The endpoint emails the invite links of registration tokens minted
through the token API: to the token's own address, or to one given for
a token without an address. The links are only ever mailed, so the
response carries a count rather than the links.
Everything is checked before anything is scheduled, so a rejected
request sends no email at all: each token must exist and be valid, and
an address given for a token with one must be the token's, ignoring
case. A token and address given more than once, ignoring case, are
emailed once. The sends are spread 100 ms apart, so a large batch
doesn't burst against the SMTP server.
The caller sends the room name and the inviter on the inviter's behalf,
so the endpoint doesn't trust them. The room name and the inviter's
display name are stripped of control characters, including the
bidirectional controls `char::is_control` misses, and truncated before
they are stored in the job payload. The inviter's Matrix ID is never
truncated, so it can't show a server it isn't from: it is kept whole if
it is valid under the historical grammar, and left out otherwise.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJbETzs7DLgqpMfkYtG
`PUT /api/admin/v1/user-registration-tokens/{id}` takes `allowed_emails`,
which replaces the whole list, with the checks it gets when minting, and
null removes it. A token pinning an email, or one that isn't
passwordless, can't get a list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
`allowed_emails` lists the addresses that may register with the token.
Each must be an address the registration policy accepts, as a pinned
email must, and repeats in another case are dropped. A token pins an
email or lists addresses, not both, and only a passwordless token
lists them. The admin API shows the list on every token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
A token's `username` containing `{` is a minijinja template, rendered
when registering with `random` set to 32 lowercase letters and digits.
Localparts can't contain `{`, so no username a token could otherwise
pin is read as one.
Adding a token checks a template by rendering it with a sample `random`,
in strict mode so an unknown variable is an error rather than an empty
string, and runs the registration policy on the result. A template that
doesn't render is a 400 carrying the render error. The name a template
renders to is only known when registering, so the username-taken check
applies to literal usernames only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
A registration token can now carry a URL, for its link to send the user
to once they have registered or signed in. The admin API takes
`continue_url` when adding a token and reports it on every token. It
refuses anything but an http or https URL, and keeps the URL as given.
MAS doesn't read the URL. Whoever mints the token decides where it
leads, such as a room in a web client, or a page that lets the user
pick a client.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJbETzs7DLgqpMfkYtG
Every registration token the admin API returns now carries `invite_url`,
the `/register?token=…` link which opens the registration page with that
token, so that an admin client can hand it to the invitee as is. The
token endpoints take the `UrlBuilder` to build it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
A registration token can now be marked `passwordless`, which will let the
user register without picking a password: their identity is established
by verifying their email address instead. The admin API takes the flag
when creating a token and reports it on every token it returns, and
`manage issue-user-registration-token` takes `--passwordless`.
This only stores the flag; the registration flow doesn't use it yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
A registration token can now carry the username and the email address
the account registered with it has to use. The admin API takes both when
creating a token and reports them on every token it returns, and
`manage issue-user-registration-token` takes `--username` and `--email`.
The admin API checks the pins when a token is created, so that it
doesn't mint a token nobody can register with: a pinned email must
parse, both must pass the registration policy, and a pinned username
must not be taken already.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqDpJaaUkGGq5GiEbU9G3f
Mechanical output changes from the dependency bump:
- aide 0.16 strips redundant null branches from optional query-param schemas
(optionality stays expressed via required:false on the parameter).
- schemars 1.0 changes doc-comment dedenting, emits the ClientsConfig newtype as
a named definition, and simplifies generic schema names
(e.g. JsonWebKeySet_for_JsonWebKeyPublicParameters -> JsonWebKeySet).
Make `filter[client]` on `GET /api/admin/v1/oauth2-sessions` repeatable
so admin tooling can fetch sessions belonging to a set of clients in
one request. The field on `FilterParams` changes from `Option<Ulid>`
to `Vec<Ulid>`; the struct was already extracted with
`axum_extra::extract::Query` so the repeated values are not silently
dropped.
Each client ULID is validated to exist (mirroring the previous
single-client `404` behaviour) before being passed to the new
`OAuth2SessionFilter::for_clients` storage filter. The `Display`
impl used to reconstruct cursor links now emits one
`filter[client]=…` segment per client so pagination preserves the
filter. The OpenAPI schema is regenerated via `misc/update.sh` and
now describes the parameter as an array.
Adds `filter[has-active-compat-session]=true|false` to
`GET /api/admin/v1/users`. When `true` (resp. `false`), only users with
(resp. without) at least one active (non-finished) compatibility session
are returned.
Adds `filter[active-oauth2-client]` to `GET /api/admin/v1/users`. The
filter is a repeatable ULID query parameter; the semantics are OR across
the supplied clients (a user matches if they have an active OAuth2
session belonging to any of them).
Each supplied client ID is validated up front: a missing client returns
404 (mirroring the pattern in `oauth2-sessions/list`).