summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2012-11-19 10:55:57 +0000
committerRobert Newson <rnewson@apache.org>2013-04-23 14:37:19 +0100
commitae6f1ebd8d0c63384050eb8c83b401a01095ad2c (patch)
tree8c1461ebab1cdaa544b432b04219c58768adc132
parent0838d8d618a361fe3751503f154b00c912f81a3f (diff)
downloadcouchdb-ae6f1ebd8d0c63384050eb8c83b401a01095ad2c.tar.gz
Add tests for passwords beginning with :
-rw-r--r--share/www/script/test/users_db.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/share/www/script/test/users_db.js b/share/www/script/test/users_db.js
index 4d6e4de58..56dae6bb8 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();