<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 06/05/2014 01:10 PM,
      <a class="moz-txt-link-abbreviated" href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a> wrote:<br>
    </div>
    <blockquote
      cite="mid:1401984638-13103-1-git-send-email-shaohef@linux.vnet.ibm.com"
      type="cite">
      <pre wrap="">From: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>

V2 -&gt; V3:
improve when to show timeout message

V1 -&gt; V2:
when username or password is wrong, back to login page with an error message.        
when session time out, back to login page with an error message.        


ShaoHe Feng (5):
  create a new login page
  redirect the URL to login page when session timeout or first login
  when login successfully, redirect to the last page.
  login page prompts error when username or password is wrong
  login page prompts error when session timeout

 src/kimchi/auth.py        |  51 +++++++++--
 src/kimchi/config.py.in   |   7 ++
 src/kimchi/root.py        |  38 ++++++--
 src/kimchi/server.py      |   2 +
 ui/images/progressing.gif | Bin 0 -&gt; 1152 bytes
 ui/js/src/kimchi.main.js  |   6 +-
 ui/pages/login.html.tmpl  | 228 ++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 310 insertions(+), 22 deletions(-)
 create mode 100644 ui/images/progressing.gif
 create mode 100644 ui/pages/login.html.tmpl

</pre>
    </blockquote>
    <br>
    <font face="DejaVu Sans Mono">The tests are failing with this patch
      set.<br>
      <br>
======================================================================<br>
      FAIL: test_accepts (test_rest.HttpsRestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 134, in
      test_accepts<br>
      &nbsp;&nbsp;&nbsp; self.assertTrue('&lt;!doctype html&gt;' in
      resp.read().lower())<br>
      AssertionError: False is not true<br>
      <br>
======================================================================<br>
      FAIL: test_auth_bad_creds (test_rest.HttpsRestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1459, in
      test_auth_bad_creds<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(401, resp.status)<br>
      AssertionError: 401 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_auth_browser_no_httpba (test_rest.HttpsRestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1474, in
      test_auth_browser_no_httpba<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(401, resp.status)<br>
      AssertionError: 401 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_auth_protected (test_rest.HttpsRestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1453, in
      test_auth_protected<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(401, resp.status)<br>
      AssertionError: 401 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_auth_unprotected (test_rest.HttpsRestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1439, in
      test_auth_unprotected<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(200, resp.status)<br>
      AssertionError: 200 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_accepts (test_rest.RestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 134, in
      test_accepts<br>
      &nbsp;&nbsp;&nbsp; self.assertTrue('&lt;!doctype html&gt;' in
      resp.read().lower())<br>
      AssertionError: False is not true<br>
      <br>
======================================================================<br>
      FAIL: test_auth_bad_creds (test_rest.RestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1459, in
      test_auth_bad_creds<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(401, resp.status)<br>
      AssertionError: 401 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_auth_browser_no_httpba (test_rest.RestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1474, in
      test_auth_browser_no_httpba<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(401, resp.status)<br>
      AssertionError: 401 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_auth_protected (test_rest.RestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1453, in
      test_auth_protected<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(401, resp.status)<br>
      AssertionError: 401 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_auth_unprotected (test_rest.RestTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_rest.py", line 1439, in
      test_auth_unprotected<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(200, resp.status)<br>
      AssertionError: 200 != 303<br>
      <br>
======================================================================<br>
      FAIL: test_kimchi_config (test_config.ConfigTests)<br>
----------------------------------------------------------------------<br>
      Traceback (most recent call last):<br>
      &nbsp; File "/home/alinefm/kimchi/tests/test_config.py", line 173, in
      test_kimchi_config<br>
      &nbsp;&nbsp;&nbsp; self.assertEquals(kimchi_config, configObj)<br>
      AssertionError: {'/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}, '/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.staticdir.dir': '/home/alinefm/kimchi/ui/js',
      'tools.expires.secs': 31536000, 'tools.staticdir.on': True},
      '/images': {'tools.nocache.on': False, 'tools.staticdir.dir':
      '/home/alinefm/kimchi/ui/images', 'tools.staticdir.on': True},
      '/spice.html': {'tools.kimchiauth.on': True}, '/login.html':
      {'tools.kimchisession.on': False}, '/':
      {'request.methods_with_bodies': ('POST', 'PUT'),
      'tools.sessions.name': 'kimchi', 'tools.proxy.on': True,
      'tools.sessions.locking': 'explicit', 'tools.sessions.httponly':
      True, 'tools.sessions.storage_type': 'ram',
      'tools.sessions.timeout': 10, 'tools.sessions.on': True,
      'tools.sessions.secure': True, 'tools.nocache.on': True,
      'tools.kimchisession.on': True, 'tools.trailing_slash.on': False,
      'tools.kimchiauth.on': False}, '/data/screenshots':
      {'tools.nocache.on': False, 'tools.staticdir.dir':
      '/home/alinefm/kimchi/data/screenshots', 'tools.staticdir.on':
      True}, '/help': {'tools.nocache.on': False,
      'tools.staticdir.index': 'en_US/index.html',
      'tools.staticdir.dir': '/home/alinefm/kimchi/ui/pages/help',
      'tools.staticdir.on': True}, '/vnc_auto.html':
      {'tools.kimchiauth.on': True}, '/kimchi-ui.html':
      {'tools.kimchiauth.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}, '/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}, '/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},
      '/spice.html': {'tools.kimchiauth.on': True}, '/help':
      {'tools.nocache.on': False, 'tools.staticdir.index':
      'en_US/index.html', 'tools.staticdir.dir':
      '/home/alinefm/kimchi/ui/pages/help', 'tools.staticdir.on': True},
      '/vnc_auto.html': {'tools.kimchiauth.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},
      '/config/ui/tabs.xml': {'tools.nocache.on': True,
      'tools.staticfile.on': True, 'tools.staticfile.filename':
      '/home/alinefm/kimchi/config/ui/tabs.xml'}, '/':
      {'request.methods_with_bodies': ('POST', 'PUT'),
      'tools.sessions.name': 'kimchi', 'tools.proxy.on': True,
      'tools.sessions.locking': 'explicit', 'tools.sessions.httponly':
      True, 'tools.sessions.storage_type': 'ram',
      'tools.sessions.timeout': 10, 'tools.sessions.on': True,
      'tools.sessions.secure': True, 'tools.nocache.on': True,
      'tools.trailing_slash.on': False, 'tools.kimchiauth.on': False},
      '/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}}<br>
      <br>
----------------------------------------------------------------------<br>
      Ran 159 tests in 179.293s<br>
      <br>
      FAILED (failures=11)<br>
      [09/Jun/2014:15:25:53] ENGINE Waiting for child threads to
      terminate...<br>
      make[3]: *** [check-local] Error 1<br>
      make[3]: Leaving directory `/home/alinefm/kimchi/tests'<br>
      make[2]: *** [check-am] Error 2<br>
      make[2]: Leaving directory `/home/alinefm/kimchi/tests'<br>
      make[1]: *** [check] Error 2<br>
      make[1]: Leaving directory `/home/alinefm/kimchi/tests'<br>
      make: *** [check-recursive] Error 1<br>
      <br>
    </font>
  </body>
</html>