couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [5/5] git commit: updated refs/heads/master to ae6f1eb
Date Tue, 23 Apr 2013 13:43:10 GMT
Add tests for passwords beginning with :


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ae6f1ebd
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ae6f1ebd
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ae6f1ebd

Branch: refs/heads/master
Commit: ae6f1ebd8d0c63384050eb8c83b401a01095ad2c
Parents: 0838d8d
Author: Robert Newson <rnewson@apache.org>
Authored: Mon Nov 19 10:55:57 2012 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Apr 23 14:37:19 2013 +0100

----------------------------------------------------------------------
 share/www/script/test/users_db.js |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ae6f1ebd/share/www/script/test/users_db.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/users_db.js b/share/www/script/test/users_db.js
index 4d6e4de..56dae6b 100644
--- a/share/www/script/test/users_db.js
+++ b/share/www/script/test/users_db.js
@@ -142,6 +142,24 @@ couchTests.users_db = function(debug) {
     } catch(e) {
       TEquals("Character `:` is not allowed in usernames.", e.reason);
     }
+
+    // test that you can login as a user with a password starting with :
+    var doc = CouchDB.prepareUserDoc({
+      name: "foo@example.org"
+    }, ":bar");
+    T(usersDb.save(doc).ok);
+
+    T(CouchDB.session().userCtx.name == null);
+
+    // test that you can use basic auth aginst the users db
+    var s = CouchDB.session({
+      headers : {
+        //                 base64_encode("foo@example.org::bar")
+        "Authorization" : "Basic Zm9vQGV4YW1wbGUub3JnOjpiYXI="
+      }
+    });
+    T(s.userCtx.name == "foo@example.org");
+
   };
 
   usersDb.deleteDb();


Mime
View raw message