-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implements admin API to lock an user (MSC3939) #15870
Conversation
da798c0
to
4d4054e
Compare
4d4054e
to
9a695b0
Compare
This comment suggests that this MSC was also written to deal with the expiring accounts feature. I am hence inclined to:
I think it also mean that we want to deprecate I'll not do that in this PR and push a new one later on. |
@@ -205,6 +207,16 @@ async def get_user_by_req( | |||
# so that we don't provision the user if they don't have enough permission: | |||
requester = await self.get_user_by_access_token(access_token, allow_expired) | |||
|
|||
# Deny the request if the user account is locked. | |||
if not allow_locked and await self.store.get_user_locked_status( |
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.
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.
Even if we keep the synapse layer here, if a mechanism exists to signal a locked user in OIDC (does it ?), we should probably convert that to the proper synapse API error code (introduced by MSC3939).
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.
I recently implemented account locking in MAS. This should be implemented when Synapse introspects the token ; there is no standard on the introspection API to signal that, but we can do something somewhat custom. It's already on my radar
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.
Woo!
This PR implements a way to lock an user without deactivating them.
It is based on MSC3939.
The locked user is also hidden from the user directory. This behavior can be tweaked with an option.
Pull Request Checklist
(run the linters)