Closed b1scuit-thi3f closed 3 years ago
Added a new function to standardise the generation of user sessions:
def buildApplicationSessionData(application,sessionID,user):
return {application : { "_id" : user._id, "user" : user.username, "primaryGroup" : user.primaryGroup, "admin" : isAdmin(user), "accessIDs" : enumerateGroups(user), "authenticated" : True, "sessionID" : sessionID, "api" : False, "theme" : user.theme, "application" : application }}
These is then used to build sessions and to renew. I also added an additional check to ensure the user is still enabled when the session is regenerated.
Sessions are renewed regularly, however when renewing it is not checked if the user is still valid (i.e. active and not deleted) and whether their ACLs might have changed (i.e. part of a new group). https://github.com/z1pti3/jimi/blob/48cae178d2ebecca721c7f0a864727bc526c8ca2/core/auth.py#L454-L459
This should be fixed by reevaluating the user details within auth whenever a session is being asked to generate.