-
Notifications
You must be signed in to change notification settings - Fork 45
Silo admin endpoints for user logout + listing tokens and sessions #8479
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
base: main
Are you sure you want to change the base?
Conversation
044ccfc
to
109676e
Compare
109676e
to
276db6b
Compare
"modify" if "admin" on "parent_silo"; | ||
|
||
# A silo admin can list a user's tokens and sessions. | ||
"list_children" if "admin" on "parent_silo"; |
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.
This is a little funny because I'm using list_children
to determine whether you can list sessions and tokens (only self and silo admin can) but then I'm using modify
on the list itself to determine whether you can do the logout delete-all operation. It works fine, but it goes slightly against the grain of how I know it's supposed to work. We just don't have many delete all type things.
The idea here is that to disable a user's access to the system, admins first disable that user's ability to log in on the IdP side and then hit this endpoint to remove all of their existing credentials on our end. The centerpiece is the logout endpoint, but I added the endpoints for listing sessions and tokens because someone pointed out you really want to see those come back empty after logout. They're also kind of useful anyway. Then I added
user_view
just because it wouldn't make sense to have token and session list endpoints hanging off/v1/users/{user_id}
without having that defined./v1/users/{user_id}/logout
that deletes all of the user's tokens and sessionsSiloUserAuthnList
letting us authorize that action for silo admins specifically (can't use silo modify because fleet collaborator and admin get that on all silos)user_view
anduser_token_list
anduser_session_list
endpoints for symmetry and to give the admin a warm fuzzy feeling when they see that the tokens and sessions are in fact gone (also makes testing a little cleaner)