Skip to content

Conversation

@reivilibre
Copy link
Contributor

@reivilibre reivilibre commented Oct 14, 2025

Follows: #5106
Part of: #4492

This PR introduces some admin API endpoints for Personal Sessions.

  • add: Creates a personal session along with its first personal access token, returning both. This is currently the only way to get a personal access token.
  • get: Shows the information about a personal session
  • list: Shows many personal sessions
  • revoke: Revokes a personal session, so it can't be used anymore
  • regenerate: Revoke the active personal access token for a session and issue a new one to replace it.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 14, 2025

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

Latest commit: dda3a49
Status: ✅  Deploy successful!
Preview URL: https://b755e684.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://rei-pat-admin.matrix-authentication-service-docs.pages.dev

View logs

@reivilibre reivilibre marked this pull request as ready for review October 14, 2025 11:51
@reivilibre reivilibre requested a review from sandhose October 14, 2025 11:51
@reivilibre reivilibre changed the title Personal Sessions: add create, list, get, revoke Admin APIs Personal Sessions: add create, list, get, revoke, regenerate Admin APIs Oct 20, 2025
@reivilibre reivilibre force-pushed the rei/pat_admin branch 2 times, most recently from 11f9074 to 9ba5df4 Compare October 20, 2025 13:44
.await?;
}

// Delete any personal access tokens & sessions owned
Copy link
Member

Choose a reason for hiding this comment

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

Neat.

revoked_at: Option<DateTime<Utc>>,

/// The ID of the user who owns this session (if user-owned)
#[schemars(with = "super::schema::Ulid")]
Copy link
Member

Choose a reason for hiding this comment

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

should be #[schemars(with = "Option<super::schema::Ulid>")] I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm hm, I think I got this from CompatSession, which also doesn't have the Option in the with type. Any idea if this is on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

6102a4b

Copy link
Member

Choose a reason for hiding this comment

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

Any idea if this is on purpose?

definitely not on purpose

@reivilibre reivilibre requested a review from sandhose October 21, 2025 10:35
Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

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

Alright, take your tick and run!

@sandhose sandhose added A-Admin-API Related to the admin API T-Enhancement New feature of request labels Oct 22, 2025
@reivilibre reivilibre merged commit eeba7e1 into main Oct 22, 2025
32 of 36 checks passed
@reivilibre reivilibre deleted the rei/pat_admin branch October 22, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Admin-API Related to the admin API T-Enhancement New feature of request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants