-
Notifications
You must be signed in to change notification settings - Fork 54
Add admin APIs to finish individual sessions #5091
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
Conversation
Deploying matrix-authentication-service-docs with
|
Latest commit: |
7e3df55
|
Status: | ✅ Deploy successful! |
Preview URL: | https://09cdcbe5.matrix-authentication-service-docs.pages.dev |
Branch Preview URL: | https://quenting-admin-api-sessions.matrix-authentication-service-docs.pages.dev |
1f72136
to
b856c88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine overall
repo.save().await?; | ||
|
||
Ok(Json(SingleResponse::new( | ||
CompatSession::from((session, sso_login)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slight eyebrow raise at CompatSession::from((CompatSession, Option<CompatSsoLogin>))
but I guess it's OK and matches what we do in other places
// If the session has a user associated with it, schedule a job to sync devices | ||
if let Some(user_id) = session.user_id { | ||
tracing::info!(user.id = %user_id, "Scheduling device sync job for user"); | ||
let job = SyncDevicesJob::new_for_id(user_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weirdly inconsistent with how it's done for CompatSessions; why use the db-loaded User
in one place and the ID in the other?
I think just using the user_id
should win, though; should be no need to verify the user exists in the DB given the FK constraint should do that for us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good q, dunno why I did that on the compat sessions. Fixed that in 7e3df55
This adds 3 endpoints to finish sessions, one for each kind of session.