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
[web]: Improves the API for session management and adds expire support. #212
Conversation
Codecov Report
@@ Coverage Diff @@
## master #212 +/- ##
=========================================
+ Coverage 77.13% 77.2% +0.06%
=========================================
Files 80 80
Lines 6683 6716 +33
=========================================
+ Hits 5155 5185 +30
- Misses 1528 1531 +3
Continue to review full report at Codecov.
|
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.
Fails for python3! use class Store(circuits.six.with_metaclass(ABCMeta))
Review? |
@prologic Will do soon! |
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 do not see anything wrong with the change. For fun you could add a Session implementation which does put the data into a signed cookie so you do not need server-side storage.
circuits/web/sessions.py
Outdated
@@ -10,6 +10,8 @@ | |||
|
|||
from circuits import Component, handler | |||
|
|||
from six import with_metaclass |
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.
from circuits.six.
Unfortunately this breaks the existing (very lacking) API for managing sessions
and introduces the concept of a "Store" -- An abstract class with one
implementation
MemoryStore
. The idea here is that all session storesimplement this interface.
Closes #133