IdentityPython / idpy-oidc

Implementation of everything OIDC and OAuth2
Apache License 2.0
40 stars 22 forks source link

Grant manager 2 #38

Closed rohe closed 1 year ago

rohe commented 2 years ago

Refactored SessionManager to a more general class (GrantManager) and a session specific (SessionManager). Added some documentation which turned out to be a bigger overhaul of the documentation.

rohe commented 2 years ago

There are a few breaking changes: (1) in the information returned by get_session_info the key to the information has changed name from _sessionid to _branchid .

(2) Keys to node information has also changed. From _user_sessioninfo to user and _client_sessioninfo to client . get_session_info also now ignores all parameters except the session_id/branch_id and will always return a dictionary with all the information. You can no longer chose to have only part of the information returned. For session_management that means that the returned dictionary will have the keys:

 {
    "client_id",
    "grant_id",
    "user_id",
    "user",
    "client",
    "grant",
    "branch_id"
}

(3) The key to a node in the database is the branch_id which is based on the path to the node. For session_management the key to a grant would then be equal to branch_key(<user_id>,<client_id>,<grant_id>). Previously the key to a grant would just be the grant_id. The reason to include the whole chain was to prevent name clashes (previously there was nothing there to prevented a user_id to be the same as a client_id or a grant_id for instance).

(4) branch_id is what is stored in the list of subordinates.

rohe commented 2 years ago

So we have this PR and set of other PR in the queue all based on the current develop branch. I'd like to merge this one before the others. Anyone against that ??

c00kiemon5ter commented 2 years ago

I think we should move forward! This PR was tested by @ctriant and that resulted in the comments above. There's only one that is not addressed. Let's discuss that and then merge 😉

rohe commented 2 years ago

Fine! I'll deal with it during the weekend.

rohe commented 1 year ago

Guys, I don't know what's holding you reviewers up but I would really like to have your feedback pretty soon.

ctriant commented 1 year ago

Sorry, I had some pretty busy days. I'll try to test it and let you now by tomorrow morning