-
Notifications
You must be signed in to change notification settings - Fork 259
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
Shared sessiondb #660
Shared sessiondb #660
Conversation
@schlenk Could you please have a quick look? If it looks reasonable to you, I will add tests and will fox the |
src/oic/utils/sdb.py
Outdated
"""Return session ids (keys) based on `uid` (internal user identifier).""" | ||
|
||
@abstractmethod | ||
def get_by_sub(self, uid: str) -> List[str]: |
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.
Parameter should be sub not uid.
Looks mostly reasonable as an API. One small point that might be problematic is the fact, that the API assumes the authn event is always stored serialized as json, when iterating to find the sids for an uid. Maybe it would be better to have a two layer api, a facade that takes AuthnEvent objects and handles serialization/deserialization and the string based set/get interface for implementers to override. |
The AuthnEvent stuff is already handled in SessionDB directly: This is already two levels deep API (which I don't like...) and adding another layer doesn't look like a good idea to me. |
I see your point. Agreed, we do not want even more layers there. The responsibilities are not really well factored between the TokenFactories, SessionDB and the persistence layer. Your other change to cleanup the RefreshDB/Token stuff goes in the same direction of cleaning this up. This new API works as a better persistence option. I think a few more of the |
Yes, that is a good point. We should probably move that over as well. The question is if we want to force users to implement that methods, or if we implement a dumb lookup and let them optimize it if they find the need to? I am leaning towards the second option. |
I think the second option (provide some dumb/clear to read default implementations) is best. Then users with a smart backend can optimize and people with a dumb backend just use it as is. |
Codecov Report
@@ Coverage Diff @@
## master #660 +/- ##
==========================================
+ Coverage 62.02% 62.06% +0.03%
==========================================
Files 62 62
Lines 11331 11364 +33
Branches 2010 2014 +4
==========================================
+ Hits 7028 7053 +25
- Misses 3722 3730 +8
Partials 581 581
Continue to review full report at Codecov.
|
OK, I have moved more stuff, I think that should be all. I will work on tests of the new code. |
74c3c1b
to
9d9ff89
Compare
Now we get the sid by reverse lookup
3a3d611
to
26444f9
Compare
26444f9
to
f027a0a
Compare
OK, tests are finished. For some reason, Codecov is not picking up the new coverage but it should be mostly covered now, so please review. |
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.
LGTM.
CHANGELOG.md
.