[Kimchi-devel] [PATCH V3 0/3] let session expire when request access periodically

Aline Manera alinefm at linux.vnet.ibm.com
Wed Mar 5 18:54:16 UTC 2014


Need to update the test cases

======================================================================
FAIL: test_kimchi_config (test_config.ConfigTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/home/alinefm/kimchi/tests/test_config.py", line 160, in 
test_kimchi_config
     self.assertEquals(kimchi_config, configObj)
AssertionError: {'/data/screenshots': {'tools.nocache.on': False, 
'tools.staticdir.dir': '/home/alinefm/kimchi/data/screenshots', 
'tools.staticdir.on': True}, '/data/debugreports': 
{'tools.kimchiauth.on': True, 'tools.nocache.on': False, 
'tools.staticdir.dir': '/home/alinefm/kimchi/data/debugreports', 
'tools.staticdir.content_types': {'xz': 'application/x-xz'}, 
'tools.staticdir.on': True}, '/libs': {'tools.expires.on': True, 
'tools.nocache.on': False, 'tools.staticdir.dir': 
'/home/alinefm/kimchi/ui/libs', 'tools.expires.secs': 31536000, 
'tools.staticdir.on': True}, '/help': {'tools.nocache.on': False, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/pages/help', 
'tools.staticdir.on': True}, '/favicon.ico': {'tools.staticfile.on': 
True, 'tools.staticfile.filename': 
'/home/alinefm/kimchi/ui/images/logo.ico'}, '/config/ui/tabs.xml': 
{'tools.nocache.on': True, 'tools.staticfile.on': True, 
'tools.staticfile.filename': '/home/alinefm/kimchi/config/ui/tabs.xml'}, 
'/images': {'tools.nocache.on': False, 'tools.staticdir.dir': 
'/home/alinefm/kimchi/ui/images', 'tools.staticdir.on': True}, '/css': 
{'tools.expires.on': True, 'tools.nocache.on': False, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/css', 
'tools.expires.secs': 31536000, 'tools.staticdir.on': True}, '/': 
{'tools.sessions.httponly': True, 'tools.sessions.on': True, 
'tools.nocache.on': True, 'tools.sessions.storage_type': 'ram', 
'tools.sessions.timeout': 10, 'request.methods_with_bodies': ('POST', 
'PUT'), 'tools.trailing_slash.on': False, 'tools.kimchiauth.on': False, 
'tools.sessions.name': 'kimchi', 'tools.sessions.locking': 'explicit'}, 
'/js': {'tools.expires.on': True, 'tools.nocache.on': False, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/js', 
'tools.expires.secs': 31536000, 'tools.staticdir.on': True}} != 
{'/data/screenshots': {'tools.nocache.on': False, 'tools.staticdir.dir': 
'/home/alinefm/kimchi/data/screenshots', 'tools.staticdir.on': True}, 
'/data/debugreports': {'tools.kimchiauth.on': True, 'tools.nocache.on': 
False, 'tools.staticdir.dir': '/home/alinefm/kimchi/data/debugreports', 
'tools.staticdir.content_types': {'xz': 'application/x-xz'}, 
'tools.staticdir.on': True}, '/libs': {'tools.expires.on': True, 
'tools.nocache.on': False, 'tools.expires.secs': 31536000, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/libs', 
'tools.staticdir.on': True}, '/config/ui/tabs.xml': {'tools.nocache.on': 
True, 'tools.staticfile.on': True, 'tools.staticfile.filename': 
'/home/alinefm/kimchi/config/ui/tabs.xml'}, '/favicon.ico': 
{'tools.staticfile.on': True, 'tools.staticfile.filename': 
'/home/alinefm/kimchi/ui/images/logo.ico'}, '/js': {'tools.expires.on': 
True, 'tools.nocache.on': False, 'tools.expires.secs': 31536000, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/js', 
'tools.staticdir.on': True}, '/images': {'tools.nocache.on': False, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/images', 
'tools.staticdir.on': True}, '/help': {'tools.nocache.on': False, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/pages/help', 
'tools.staticdir.on': True}, '/css': {'tools.expires.on': True, 
'tools.nocache.on': False, 'tools.expires.secs': 31536000, 
'tools.staticdir.dir': '/home/alinefm/kimchi/ui/css', 
'tools.staticdir.on': True}, '/': {'tools.sessions.httponly': True, 
'tools.sessions.on': True, 'tools.nocache.on': True, 
'tools.sessions.storage_type': 'ram', 'request.methods_with_bodies': 
('POST', 'PUT'), 'tools.trailing_slash.on': False, 
'tools.kimchiauth.on': False, 'tools.sessions.name': 'kimchi', 
'tools.sessions.locking': 'explicit'}}

----------------------------------------------------------------------
Ran 158 tests in 149.610s

FAILED (failures=1)
[05/Mar/2014:15:50:05] ENGINE Waiting for child threads to terminate...
make[3]: *** [check-local] Error 1
make[3]: Leaving directory `/home/alinefm/kimchi/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/alinefm/kimchi/tests'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/home/alinefm/kimchi/tests'
make: *** [check-recursive] Error 1


On 03/04/2014 09:52 PM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> V2 -> V3
> raise 401 http error when expire.
> Set the timeout of sessions 10 minutes explicitly.
>
> V1 -> V2
> Address ming's comment, raise 403 http error when expire.
> Send UI patch.
>
> UI still need to improve as Adam king said.
>
> Hong Liang will improve it.
>
> ShaoHe Feng (3):
>    add timeout for sessions
>    auth enhancement: expire the session when the request access
>      periodically
>    UI: set kimchi robot header for some request.
>
>   src/kimchi/auth.py      | 13 +++++++++++++
>   src/kimchi/config.py.in |  4 ++++
>   ui/js/src/kimchi.api.js |  2 ++
>   3 files changed, 19 insertions(+)
>




More information about the Kimchi-devel mailing list