Files
matrix-authentication-service/docs/api
Devon HudsonandClaude Opus 5.5 52437ff8e3 Let a registration token's username be a template
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
2026-11-10 00:59:31 +00:00
..
2025-02-11 19:16:59 +01:00