Skip to content

Registration tokens #4619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 5, 2025
Merged

Registration tokens #4619

merged 11 commits into from
Jun 5, 2025

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Jun 3, 2025

Fixes #3956
Fixes #4584

This can be reviewed commit by commit.

It includes an admin API to list/get/create/revoke tokens, as well as a CLI tool to issue a token.

  • Data model and repository for user registration tokens
  • Add config flag to require registration tokens for password registrations
  • Registration token step view
  • Enforce registration token on registration
  • List and count methods on the UserRegistrationTokenRepository
  • Admin API to list user registration tokens
  • Admin API to get individual user registration tokens
  • Admin API to create a new user registration token
  • Admin API to revoke user registration tokens
  • CLI tool to issue user registration tokens

@sandhose sandhose requested a review from reivilibre June 3, 2025 10:13
@sandhose sandhose added A-Registration-Flow Related to the user registration flow A-Admin-API Related to the admin API T-Enhancement New feature of request and removed A-Admin-API Related to the admin API labels Jun 3, 2025
@sandhose sandhose force-pushed the quenting/registration-tokens branch from 2f6ff5f to 9726f35 Compare June 3, 2025 10:16
Copy link

cloudflare-workers-and-pages bot commented Jun 3, 2025

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 12e9d02
Status: ✅  Deploy successful!
Preview URL: https://da0f1f99.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-registration-tokens.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose marked this pull request as ready for review June 3, 2025 10:16
@reivilibre reivilibre added the Z-Build-Workflow Add this label to trigger a build workflow for this pull request label Jun 3, 2025
token: Option<String>,

/// Maximum number of times this token can be used.
/// If not provided, the token can be used an unlimited number of times.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. kind of feels like the sensible default would be 1, to be honest

(the word 'token' feels like something you 'spend', not something that would be infinite by default)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I've changed the behaviour of the CLI tool in e53e266

@github-actions github-actions bot removed the Z-Build-Workflow Add this label to trigger a build workflow for this pull request label Jun 3, 2025
Copy link
Contributor

github-actions bot commented Jun 3, 2025

A build for this PR at commit 0f00bf0 has been created through the Z-Build-Workflow label by reivilibre.

Docker image is available at:

  • ghcr.io/element-hq/matrix-authentication-service:pr-4619
  • ghcr.io/element-hq/matrix-authentication-service:sha-0f00bf0

Pre-built binaries are available through the workflow run artifacts.

@sandhose sandhose requested a review from reivilibre June 3, 2025 12:30
@sandhose sandhose added the Z-Build-Workflow Add this label to trigger a build workflow for this pull request label Jun 3, 2025
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool stuff

@github-actions github-actions bot removed the Z-Build-Workflow Add this label to trigger a build workflow for this pull request label Jun 3, 2025
Copy link
Contributor

github-actions bot commented Jun 3, 2025

A build for this PR at commit cab8ba2 has been created through the Z-Build-Workflow label by sandhose.

Docker image is available at:

  • ghcr.io/element-hq/matrix-authentication-service:pr-4619
  • ghcr.io/element-hq/matrix-authentication-service:sha-cab8ba2

Pre-built binaries are available through the workflow run artifacts.

@olmari
Copy link

olmari commented Jun 3, 2025

Very +1 to this concept. After MAS we have basically lost the "not SSO" registation method of https://github.com/zeratax/matrix-registration/ we used to use, as we have 12+ different hackerspaces to cater and not everyone have an SSO available for an reason or another, so a method of registation tokens would be awesome to support while MAS is at use.

To say it most broadly, that Zeratax thing would still be just perfect as concept, but obviously it would need complete backend overhaul to use MAS instead. It has total server admin control of token use times and expiration dates etc.

@sandhose sandhose force-pushed the quenting/registration-tokens branch from a401332 to 12e9d02 Compare June 3, 2025 15:43
@sandhose sandhose merged commit c595a0d into main Jun 5, 2025
20 checks passed
@sandhose sandhose deleted the quenting/registration-tokens branch June 5, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Registration-Flow Related to the user registration flow T-Enhancement New feature of request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registration tokens Moderated registration
3 participants