Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Add admin API to create users #3019

Merged
merged 5 commits into from
Aug 1, 2024
Merged

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Jul 26, 2024

This also adds a utility to create access tokens quickly to help writing tests for the admin API

Copy link

cloudflare-workers-and-pages bot commented Jul 26, 2024

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

Latest commit: 089ba5a
Status: ✅  Deploy successful!
Preview URL: https://94a59102.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-admin-api-create-us.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose requested a review from reivilibre July 29, 2024 08:46
@sandhose sandhose mentioned this pull request Jul 29, 2024
@sandhose sandhose added the A-Admin-API Related to the admin API label Jul 29, 2024
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.

nothing awful ;-)

crates/handlers/src/admin/v1/users/add.rs Outdated Show resolved Hide resolved
crates/handlers/src/admin/v1/users/add.rs Show resolved Hide resolved
Comment on lines +108 to +110
/// Use this with caution! The main reason to use this, is when a user used
/// by an application service needs to exist in MAS to craft special
/// tokens (like with admin access) for them
Copy link
Contributor

Choose a reason for hiding this comment

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

I.... don't understand

Copy link
Member Author

@sandhose sandhose Aug 1, 2024

Choose a reason for hiding this comment

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

Use case for this is if you want to create a user on the MAS side for a user reserved by an application service, or a user which for some reason already exists in Synapse but not in MAS

For the application service, it's useful if you need a token for a AS user which also has Synapse admin access

Tweaked the wording to say 'available' instead of 'valid'

@sandhose sandhose requested a review from reivilibre August 1, 2024 13:37
@sandhose sandhose force-pushed the quenting/admin-api/create-user branch from 523b90d to 0bb5cf7 Compare August 1, 2024 14:02
@sandhose sandhose force-pushed the quenting/admin-api/create-user branch from 0bb5cf7 to 089ba5a Compare August 1, 2024 14:07
@sandhose sandhose enabled auto-merge (rebase) August 1, 2024 14:08
@sandhose sandhose merged commit 65f1c45 into main Aug 1, 2024
16 checks passed
@sandhose sandhose mentioned this pull request Aug 2, 2024
13 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API Related to the admin API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants