You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Chris Anderson <jc...@apache.org> on 2009/12/24 17:27:25 UTC
authentication cleanup
Devs,
I'm attempting to make more sense of CouchDB's authentication system.
The current system is a proverbial ball of spaghetti. I'm still in the
investigation stage of my work, and I'm writing this to clarify my
thoughts and solicit feedback.
To start with, the current default_authentication_handler is unaware
of the users db. I plan to fix that, and to change default.ini so that
cookie_auth is enabled for all Couches. I also plan to make it so that
CouchDB never triggers the basic-auth popup box, because we all know
that that's a UI dealbreaker. (We'll still accept basic auth, we just
won't prompt for it.)
One question is how to manage system roles such as _admin. My thinking
is that the users db validation function will forbid roles starting
with underscore from being stored on user's documents. Instead, when
Couch loads a user from the db, it will cross-reference the user with
the list of node and db admins, and apply the _admin role when
appropriate. This way we can avoid having more than one distinct type
of user in the system. This should also allow us to have more system
roles (prefixed with underscore) in the future.
Another question is bootstrapping the cookie auth system. Currently a
node secret needs to be configured before cookie_auth is enabled. I
don't plan to change that, but I do plan to add a UI workflow to Futon
which encourages you to setup an initial admin user and configure the
secret. Once that is done, cookie auth will be enabled.
At the level of code, I plan to move some things around so most of the
auth stuff is together in the codebase. I'll also be removing the
/_user handler in favor of CouchDB's standard database API + a
validation function. If the /_user handler is widely used, I can
replace it with an _update function which will handle setting up the
hashed password and salt, as well as accepting
application/x-www-form-urlencoded POSTs. If there is concern about
backwards compatibility with existing software, I can also setup an
internal rewrite so that the /_user URL continues to function as it
does now.
I'm also thinking that the /_session handler should speak JSON
primarily (but I'll probably leave in the ability to handle
form-encoded request bodies as well).
As far as security on the users DB, I don't plan to change anything
from how it is now. The basic idea is that anyone can create a new
user document (eg anyone can signup), but only _admins can set roles
on user documents. Additionally, only _admins or the user whos
document it is can update a user document.
In the future, when we implement reader access-control-lists for
databases, they will be useful to further secure the users DB. For
now, the users db will be world-readable, which is fine as long as
no-one breaks the crypto. We're already using strong hashes and long
salts, so I think we're already relatively secure.
None of what I'm doing should change the oauth handlers.
Thanks for your attention. Please fire aware with questions and comments.
Happy holidays,
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Mon, Jan 4, 2010 at 10:26 PM, Adam Kocoloski <ko...@apache.org> wrote:
> Hi, just catching up on this very nice thread. I'm +1 on using the login for the docid instead of triggering a view lookup, for the reasons Chris outlined. Regarding resistance to brute force attacks, bcrypt storage is definitely better than salted sha-anything, and Colin Percival's scrypt[1] is definitely better than bcrypt. I'm not aware of javascript implementations of either of them, though.
>
> I'm curious to see where we end up on the whole 401 Unauthorized browser popup thing. At Cloudant we still respond with a 401 if a basic auth request failed, but we send a 403 if a /_session request failed or a cookie expired, and for exactly this reason.
>
> Anyway, nice work Chris! Best, Adam
>
> [1]: http://www.tarsnap.com/scrypt.html
There are some blowfish implementation in javascript :
http://dren.ch/js_blowfish/#js_blowfish_20081901
I guess it could be used to do bcrypt but not sure about the exact algorithm.
- benoît
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
Here is an implementation of blowfish in javascript :
http://farfarfar.com/scripts/encrypt/
- benoit
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Wed, Jan 6, 2010 at 3:25 AM, Chris Anderson <jc...@apache.org> wrote:
> On Tue, Jan 5, 2010 at 10:50 AM, Chris Anderson <jc...@apache.org> wrote:
>>
>> I'd be happy to see the users db design document ported to erlang, so
>> we can use erlang's bcrypt (assuming license is ok).
>
> One problem here is I think that we currently ship with the native
> query server disabled. We'd need to add this to default.ini to make
> this stuff ship with CouchDB:
>
> [native_query_servers]
> erlang={couch_native_process, start_link, []}
>
> I'm wary about making this change because native query servers aren't
> as sandboxed as the couchjs query server.
>
> So... I'm lead to think of an http api:
>
> POST /_bcrypt
> "json clearstring"
>
> response:
> {
> "crypted" : "sdafkjhskasdf/sdd",
> "salt" : "foo"
> }
>
> This smells. Crypto should run in the browser. I haven't found a
> JavaScript bcrypt yet.
>
> The sane alternative seems to be to special-case the user's-db _design
> document somehow, so it can be in Erlang even if native query servers
> are not enabled. After all, it is trusted Erlang code that ships with
> the package.
>
> I don't think I'll let our still using salted sha1 keep me from
> merging to trunk. After all, it's what we're using now so this
> definitely isn't a step backwards.
>
> Chris
>
> --
There is a blowfish encryption implementation available in javascript.
doesn't bcrypt stand for "blowfish crypt" ?
http://www.openbsd.org/cgi-bin/man.cgi?query=bcrypt&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html
fro where it has been created.
- benoît
Re: authentication cleanup
Posted by Jan Lehnardt <ja...@apache.org>.
On 6 Jan 2010, at 03:25, Chris Anderson wrote:
> On Tue, Jan 5, 2010 at 10:50 AM, Chris Anderson <jc...@apache.org> wrote:
>>
>> I'd be happy to see the users db design document ported to erlang, so
>> we can use erlang's bcrypt (assuming license is ok).
>
> One problem here is I think that we currently ship with the native
> query server disabled. We'd need to add this to default.ini to make
> this stuff ship with CouchDB:
>
> [native_query_servers]
> erlang={couch_native_process, start_link, []}
>
> I'm wary about making this change because native query servers aren't
> as sandboxed as the couchjs query server.
We shouldn't enable the erlang view server by default.
Cheers
Jan
--
>
> So... I'm lead to think of an http api:
>
> POST /_bcrypt
> "json clearstring"
>
> response:
> {
> "crypted" : "sdafkjhskasdf/sdd",
> "salt" : "foo"
> }
>
> This smells. Crypto should run in the browser. I haven't found a
> JavaScript bcrypt yet.
>
> The sane alternative seems to be to special-case the user's-db _design
> document somehow, so it can be in Erlang even if native query servers
> are not enabled. After all, it is trusted Erlang code that ships with
> the package.
>
> I don't think I'll let our still using salted sha1 keep me from
> merging to trunk. After all, it's what we're using now so this
> definitely isn't a step backwards.
>
> Chris
>
> --
> Chris Anderson
> http://jchrisa.net
> http://couch.io
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Tue, Jan 5, 2010 at 10:50 AM, Chris Anderson <jc...@apache.org> wrote:
>
> I'd be happy to see the users db design document ported to erlang, so
> we can use erlang's bcrypt (assuming license is ok).
One problem here is I think that we currently ship with the native
query server disabled. We'd need to add this to default.ini to make
this stuff ship with CouchDB:
[native_query_servers]
erlang={couch_native_process, start_link, []}
I'm wary about making this change because native query servers aren't
as sandboxed as the couchjs query server.
So... I'm lead to think of an http api:
POST /_bcrypt
"json clearstring"
response:
{
"crypted" : "sdafkjhskasdf/sdd",
"salt" : "foo"
}
This smells. Crypto should run in the browser. I haven't found a
JavaScript bcrypt yet.
The sane alternative seems to be to special-case the user's-db _design
document somehow, so it can be in Erlang even if native query servers
are not enabled. After all, it is trusted Erlang code that ships with
the package.
I don't think I'll let our still using salted sha1 keep me from
merging to trunk. After all, it's what we're using now so this
definitely isn't a step backwards.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Tue, Jan 5, 2010 at 10:45 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Tue, Jan 5, 2010 at 7:38 PM, Chris Anderson <jc...@apache.org> wrote:
>> FYI - I have pushed the account branch to Apache SVN.
>>
>> I plan to merge it to trunk in the next couple of days. Please test,
>> especially if you are making heavy use of authentication / oauth /
>> cookie auth.
>>
>> There may be some small backwards incompatibilities, hopefully these
>> are slight enough that we can fix them in CouchDB or your application
>> code. My intention is to make this patch as smooth as possible for
>> people to work with. If you see something that's not fun to handle on
>> your end, please let us know.
>>
>> Chris
>
> I will try while working on nymphormation v0.2 (out on thursday). What
> is the plan about password encryption? It may be better to make a
> choice before 0.11 so people won't have to reset user db or such
> thing. (this is what I had to do for nymphormation 0.1 yesterday :( ).
>
I'd be happy to see the users db design document ported to erlang, so
we can use erlang's bcrypt (assuming license is ok).
I think you are right we should handle this before 0.11
> - benoît
>
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Jan 5, 2010 at 7:38 PM, Chris Anderson <jc...@apache.org> wrote:
> FYI - I have pushed the account branch to Apache SVN.
>
> I plan to merge it to trunk in the next couple of days. Please test,
> especially if you are making heavy use of authentication / oauth /
> cookie auth.
>
> There may be some small backwards incompatibilities, hopefully these
> are slight enough that we can fix them in CouchDB or your application
> code. My intention is to make this patch as smooth as possible for
> people to work with. If you see something that's not fun to handle on
> your end, please let us know.
>
> Chris
I will try while working on nymphormation v0.2 (out on thursday). What
is the plan about password encryption? It may be better to make a
choice before 0.11 so people won't have to reset user db or such
thing. (this is what I had to do for nymphormation 0.1 yesterday :( ).
- benoît
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
FYI - I have pushed the account branch to Apache SVN.
I plan to merge it to trunk in the next couple of days. Please test,
especially if you are making heavy use of authentication / oauth /
cookie auth.
There may be some small backwards incompatibilities, hopefully these
are slight enough that we can fix them in CouchDB or your application
code. My intention is to make this patch as smooth as possible for
people to work with. If you see something that's not fun to handle on
your end, please let us know.
Chris
On Mon, Jan 4, 2010 at 5:20 PM, Adam Kocoloski <ko...@apache.org> wrote:
> On Jan 4, 2010, at 4:54 PM, Chris Anderson wrote:
>
>> On Mon, Jan 4, 2010 at 1:26 PM, Adam Kocoloski <ko...@apache.org> wrote:
>>> Hi, just catching up on this very nice thread. I'm +1 on using the login for the docid instead of triggering a view lookup, for the reasons Chris outlined. Regarding resistance to brute force attacks, bcrypt storage is definitely better than salted sha-anything, and Colin Percival's scrypt[1] is definitely better than bcrypt. I'm not aware of javascript implementations of either of them, though.
>>
>> The current implementation runs the crypto in the browser to create
>> the user document. This could be run in an Erlang _update function and
>> then we could use erlang's bcrypt.
>
> Yep, that would work.
>
>>> I'm curious to see where we end up on the whole 401 Unauthorized browser popup thing. At Cloudant we still respond with a 401 if a basic auth request failed, but we send a 403 if a /_session request failed or a cookie expired, and for exactly this reason.
>>>
>>
>> The solution I'm going with right now is to send a 401, but without
>> the WWW-Authenticate header. This avoids triggering the popup, without
>> breaking anything else.
>
> That sounds like a better approach. Cheers, Adam
>
>
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Adam Kocoloski <ko...@apache.org>.
On Jan 4, 2010, at 4:54 PM, Chris Anderson wrote:
> On Mon, Jan 4, 2010 at 1:26 PM, Adam Kocoloski <ko...@apache.org> wrote:
>> Hi, just catching up on this very nice thread. I'm +1 on using the login for the docid instead of triggering a view lookup, for the reasons Chris outlined. Regarding resistance to brute force attacks, bcrypt storage is definitely better than salted sha-anything, and Colin Percival's scrypt[1] is definitely better than bcrypt. I'm not aware of javascript implementations of either of them, though.
>
> The current implementation runs the crypto in the browser to create
> the user document. This could be run in an Erlang _update function and
> then we could use erlang's bcrypt.
Yep, that would work.
>> I'm curious to see where we end up on the whole 401 Unauthorized browser popup thing. At Cloudant we still respond with a 401 if a basic auth request failed, but we send a 403 if a /_session request failed or a cookie expired, and for exactly this reason.
>>
>
> The solution I'm going with right now is to send a 401, but without
> the WWW-Authenticate header. This avoids triggering the popup, without
> breaking anything else.
That sounds like a better approach. Cheers, Adam
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Mon, Jan 4, 2010 at 1:26 PM, Adam Kocoloski <ko...@apache.org> wrote:
> Hi, just catching up on this very nice thread. I'm +1 on using the login for the docid instead of triggering a view lookup, for the reasons Chris outlined. Regarding resistance to brute force attacks, bcrypt storage is definitely better than salted sha-anything, and Colin Percival's scrypt[1] is definitely better than bcrypt. I'm not aware of javascript implementations of either of them, though.
>
The current implementation runs the crypto in the browser to create
the user document. This could be run in an Erlang _update function and
then we could use erlang's bcrypt.
> I'm curious to see where we end up on the whole 401 Unauthorized browser popup thing. At Cloudant we still respond with a 401 if a basic auth request failed, but we send a 403 if a /_session request failed or a cookie expired, and for exactly this reason.
>
The solution I'm going with right now is to send a 401, but without
the WWW-Authenticate header. This avoids triggering the popup, without
breaking anything else.
> Anyway, nice work Chris! Best, Adam
>
Thanks!
> [1]: http://www.tarsnap.com/scrypt.html
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Adam Kocoloski <ko...@apache.org>.
Hi, just catching up on this very nice thread. I'm +1 on using the login for the docid instead of triggering a view lookup, for the reasons Chris outlined. Regarding resistance to brute force attacks, bcrypt storage is definitely better than salted sha-anything, and Colin Percival's scrypt[1] is definitely better than bcrypt. I'm not aware of javascript implementations of either of them, though.
I'm curious to see where we end up on the whole 401 Unauthorized browser popup thing. At Cloudant we still respond with a 401 if a basic auth request failed, but we send a 403 if a /_session request failed or a cookie expired, and for exactly this reason.
Anyway, nice work Chris! Best, Adam
[1]: http://www.tarsnap.com/scrypt.html
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Mon, Jan 4, 2010 at 11:31 AM, Joscha Feth <jo...@feth.com> wrote:
> Chris Anderson wrote:
>
>> My first thought is that there's got to be some common identifier in
>> your LDAP space (like a UUID or something) that is the real identifier
>> here. But I'm just guessing, maybe there's not...
>
> There is a UID I could use - but my idea was to leave this a little
> more open, so users do not necessarily need to be part of that single
> LDAP directory - there might be additional directories added by time,
> so I needed to find something unique - and thats the email address (at
> least for my scenario).
>
>> > Another question I didn't find anything about in the docs: is it
>> > intended to store additional properties within userCtx beside .name
>> > and .roles?
>>
>> I'm still on the fence about that. Reasons like your LDAP
>> extensibility mean maybe we should allow more fields. On the other
>> hand, I can imagine people abusing that and getting themselves stuck
>> in a land with weird security bugs.
>>
>> Damien has mentioned to me the idea of a site security object, which
>> would be stored in the database, and passed to validation functions.
>> This would allow the validation function to know things like: "this
>> application's authorization is implemented in terms of roles like
>> author and editor. this site's authentication gives users roles like
>> employee and manager. for this site, lets map employees to authors and
>> mangers to editors."
>>
>> I don't know if this quite does the trick for you. I think I need to
>> understand the first question (is there a real ID for your
>> multi-named users?) before I get much further.
>
> so I guess the answer would be no - at least no natural one which would
> help me do the trick here.
>
Perhaps the best option here would be to allow authorization plugins
to add extra fields to the userCtx. so you'd have
userCtx.email_addresses be the list of addresses for a user. To
normalize this we could send the entire user document from the users
db to the validation function.
The downside I can see is this might encourage app developers to use
the extensibility even when they don't strictly need it, which could
have a negative effect on interoperability.
I'm still curious about the multiple email addresses issue... maybe
it's more like the user has the ability to authenticate as any of
those addresses, but for a given operation, they should pick one?
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Joscha Feth <jo...@feth.com>.
Chris Anderson wrote:
> My first thought is that there's got to be some common identifier in
> your LDAP space (like a UUID or something) that is the real identifier
> here. But I'm just guessing, maybe there's not...
There is a UID I could use - but my idea was to leave this a little
more open, so users do not necessarily need to be part of that single
LDAP directory - there might be additional directories added by time,
so I needed to find something unique - and thats the email address (at
least for my scenario).
> > Another question I didn't find anything about in the docs: is it
> > intended to store additional properties within userCtx beside .name
> > and .roles?
>
> I'm still on the fence about that. Reasons like your LDAP
> extensibility mean maybe we should allow more fields. On the other
> hand, I can imagine people abusing that and getting themselves stuck
> in a land with weird security bugs.
>
> Damien has mentioned to me the idea of a site security object, which
> would be stored in the database, and passed to validation functions.
> This would allow the validation function to know things like: "this
> application's authorization is implemented in terms of roles like
> author and editor. this site's authentication gives users roles like
> employee and manager. for this site, lets map employees to authors and
> mangers to editors."
>
> I don't know if this quite does the trick for you. I think I need to
> understand the first question (is there a real ID for your
> multi-named users?) before I get much further.
so I guess the answer would be no - at least no natural one which would
help me do the trick here.
regards,
Joscha
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Mon, Dec 28, 2009 at 3:39 AM, Joscha Feth <jo...@feth.com> wrote:
> Chris Anderson wrote:
>
>> I'm attempting to make more sense of CouchDB's authentication system.
>> The current system is a proverbial ball of spaghetti. I'm still in the
>> investigation stage of my work, and I'm writing this to clarify my
>> thoughts and solicit feedback.
>
> Hi Chris,
>
> It's maybe not the ideal place to discuss this, but when using LDAP as
> authentication mechanism within a reverse proxy, I noticed, that the
> username (we have a large userbase, and users may have different eMail
> addresses) to be used to login might differ from time to time, so the
> user might "a@b.com" as well as "x@y.com" to login, but its still the
> same user.
My first thought is that there's got to be some common identifier in
your LDAP space (like a UUID or something) that is the real identifier
here. But I'm just guessing, maybe there's not...
> Another question I didn't find anything about in the docs: is it
> intended to store additional properties within userCtx beside .name and
> .roles?
I'm still on the fence about that. Reasons like your LDAP
extensibility mean maybe we should allow more fields. On the other
hand, I can imagine people abusing that and getting themselves stuck
in a land with weird security bugs.
Damien has mentioned to me the idea of a site security object, which
would be stored in the database, and passed to validation functions.
This would allow the validation function to know things like: "this
application's authorization is implemented in terms of roles like
author and editor. this site's authentication gives users roles like
employee and manager. for this site, lets map employees to authors and
mangers to editors."
I don't know if this quite does the trick for you. I think I need to
understand the first question (is there a real ID for your
multi-named users?) before I get much further.
Once top concern I have with the multi-name stuff is immutability. As
you mentioned, you'd be checking for set membership instead of
equality, which helps that some.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Joscha Feth <jo...@feth.com>.
Chris Anderson wrote:
> I'm attempting to make more sense of CouchDB's authentication system.
> The current system is a proverbial ball of spaghetti. I'm still in the
> investigation stage of my work, and I'm writing this to clarify my
> thoughts and solicit feedback.
Hi Chris,
It's maybe not the ideal place to discuss this, but when using LDAP as
authentication mechanism within a reverse proxy, I noticed, that the
username (we have a large userbase, and users may have different eMail
addresses) to be used to login might differ from time to time, so the
user might "a@b.com" as well as "x@y.com" to login, but its still the
same user.
For LDAP this is no problem, but I am setting a special header which
gets sent to CouchDB afterwards, if the user has successfully
authenticated. This header will contain both email addresses separated
(this "list" is coming from LDAP) - which is "a@b.com ; y@y.com" - now
I wanted to write a special authentication module, which can read this
header and distribute it to the userCtx - but the thing is, I have got
two possible user names, so ideally userCtx.name would be an object
{"a@b.com":true,"y@y.com": true} instead of a simple string - I would
then check for
"some@email.com" in userCtx.name or userCtx.name["some@email.com"]
to find out whether the current user has access to a specific doc.
Sure, I could assign userCtx.name the combined string and search with
.indexOf, but I am just a little worried that there might be some
built-in logic within CouchDB which makes a some assumptions about
userCtx.name (for example comparing it by ==), which would then break
my scenario in a later version of CouchDB.
Did you think of maybe provide a hook-point for users to do a
comparison for documents against userCtx? Something which could just
use == for .name in the default implementation, but which can be
changed using a design doc or a hook within local.ini? Then maybe
userCtx.name can be loosened to not only be a string.
Another question I didn't find anything about in the docs: is it
intended to store additional properties within userCtx beside .name and
.roles?
regards,
Joscha
--
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
More updates in the interest of keeping my work transparent. I don't
think it's clean enough yet to solicit help, but it is clean enough to
be worth backing up to Github.
The relevant tests are cookie_auth and users_db (they have a lot of
overlap, I'll be cleaning that up.)
The branch will live here until it's ready to merge to trunk:
http://github.com/jchris/couchdb/tree/account
My next step is to get the _admin role to apply cleanly to users
loaded from the users db. This isn't hard but it's gonna have to
happen after lunch at least.
Chris
On Fri, Dec 25, 2009 at 2:50 PM, Chris Anderson <jc...@apache.org> wrote:
> On Thu, Dec 24, 2009 at 10:16 AM, Benoit Chesneau <bc...@gmail.com> wrote:
>>>
>>> I'm also thinking that the /_session handler should speak JSON
>>> primarily (but I'll probably leave in the ability to handle
>>> form-encoded request bodies as well).
>>>
>> We could just detect http headers and provide the needed response for
>> that. Keeping the form encoded would be good. It's already used in
>> some applications.
>>
>
> I'm planning to remove the form-encoded handlers for creating and
> updating users documents as the special API is being removed in favor
> of having the users db be a plain-old-CouchDB-database. If we want to
> have a built-in API for creating and updating user's documents using
> form-encoded POSTs, we should generalize it to work against all
> databases, not just the users database.
>
> I do think we should keep the ability to login and logout via
> form-encoded POSTs, as that is not a document API and thus can't be
> wrapped in an _update handler for people who want applications to be
> compatible with non-JSON capable clients.
>
> Chris
>
> --
> Chris Anderson
> http://jchrisa.net
> http://couch.io
>
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Thu, Dec 24, 2009 at 10:16 AM, Benoit Chesneau <bc...@gmail.com> wrote:
>>
>> I'm also thinking that the /_session handler should speak JSON
>> primarily (but I'll probably leave in the ability to handle
>> form-encoded request bodies as well).
>>
> We could just detect http headers and provide the needed response for
> that. Keeping the form encoded would be good. It's already used in
> some applications.
>
I'm planning to remove the form-encoded handlers for creating and
updating users documents as the special API is being removed in favor
of having the users db be a plain-old-CouchDB-database. If we want to
have a built-in API for creating and updating user's documents using
form-encoded POSTs, we should generalize it to work against all
databases, not just the users database.
I do think we should keep the ability to login and logout via
form-encoded POSTs, as that is not a document API and thus can't be
wrapped in an _update handler for people who want applications to be
compatible with non-JSON capable clients.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Sun, Dec 27, 2009 at 10:47 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> The _session by form is already in place and used in some apps. I'm
> full for a json api, but also I think that both form and json ap
> should be supported as well and since orm api is already in place and
> used by apps, it should stay in place and json api just added as
> another alternative. One reason for this is that sometimes you don't
> want your app speak json but just have an easy way to login. Still
> there aren't only couchapps that use couchdb.
>
s/since orm api/since form api
Re: authentication cleanup
Posted by Jan Lehnardt <ja...@apache.org>.
On 27 Dec 2009, at 20:46, Benoit Chesneau wrote:
> On Sun, Dec 27, 2009 at 8:05 PM, Chris Anderson <jc...@apache.org> wrote:
>
>>
>> I haven't yet investigated what it takes to prevent the basic-auth
>> popup. It will be very hard to convince me that is acceptable to
>> trigger it. I understand the principles of RESTful service discovery,
>> I just think they are less important than having software people
>> actually use. Maybe we'll get lucky and we can have the 401 and avoid
>> the basic popup. We'll see.
>
> Well software people aren't only people that use CouchApps. About the
> popup, as I said the only way we (and mainly jason) found was to pass
> another header to couchdb like it is with cookie auth.
>
>>
>> Worst case scenario is application authors avoiding CouchDB's
>> authentication for aesthetic reasons. Eg: I'd rather have
>> authentication that is less than perfectly RESTful, that people
>> actually use, than a perfectly RESTful solution that is unusable in
>> practice.
>>
>>
>
> I'm not sure what do you mean by aesthetic here, that's not really my
> point although I sure don't really care about aestheticism :) I think
> we just have to make sure that it doesn't break expected behavior by
> other http clients.
If the default behaviour of CouchDB is to pop up the ugly basic auth
window nobody is going to use it. Chris advocates a solution where
CouchDB doesn't force login window at the expense of *potentially*
having library authors jump through an extra hoop. If it is going to turn
out that way, I'd +1 that, but let's first figure out if these solutions are
mutually exclusive.
Cheers
Jan
--
>
>>>>>> In the future, when we implement reader access-control-lists for
>>>>>> databases, they will be useful to further secure the users DB. For
>>>>>> now, the users db will be world-readable, which is fine as long as
>>>>>> no-one breaks the crypto. We're already using strong hashes and long
>>>>>> salts, so I think we're already relatively secure.
>>>
>>> relatively secure is not enough imo. We should try to make it really
>>> hard to guess a password and more generally to authenticate. Without
>>> that couchdb will never be acceped in some projects.
>>
>> I agree that there we'd like to make an option to restrict read-access
>> to the users db. I just don't think its part of the work I'm doing on
>> this patch. The work I'm doing now makes CouchDB more secure (by using
>> validation functions so that users can't make themselves into admins).
>>
>> The users db is currently world-readable, so I'm not opening a new
>> security hole here. Let's fix this. It's just not part of the current
>> patch.
>>
>> It would be worth it to start another thread about per-database reader
>> ACLs, which are the solution to this problem.
>>
>
> my point was just to say that until that you can't store sensitive
> data such as oauth credentials in userdb :) Sry was not totally clear.
> +1 for another thread.
>
>>>>>>
>>>>> Not really since salt is available and hash is only sha1. I think we
>>>>> could make it harder but I agree with a strong encryption we don't
>>>>> need to hide them.
>>
>> I'd be happy if someone can work out a stronger cryptographic
>> solution. I don't think that there's much we can do to make brute
>> force password guessing harder (aside from hiding the user's db, which
>> we should do), but I'd be happy to be shown otherwise.
>
> Maybe we could start by using sha256. or more. I will have a look on
> what could be done about it.
>
>
>> Erlang node names don't work because I'd like my username to be the
>> same across many nodes. Eg, I'd like to be able to replicate my users
>> db between my laptop and my server, and log into both with the same
>> credentials.
>
> The node was just the start to create an id on one node and also to
> make sure userid is unique outside a trusted environnement. I didn't
> see it like something that need to be changed across replication.
> Since you made the prefix configurable, the pb is mostly solved
> anyway. For non trusted environment prefix could be anything.
>
>
> - benoit
>
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Sun, Dec 27, 2009 at 1:33 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Sun, Dec 27, 2009 at 10:29 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>
>>
>> also there is already some erlang code :
>> http://github.com/skarab/erlang-bcrypt
>>
>> - benoit
>>
> Ah that what adam mentionned too.
>
Cool -- I'll have to look into bcrypt. A quick search doesn't reveal a
JavaScript implementation, but hopefully there's one somewhere.
For now I'll keep using sha as it doesn't really matter which one we
use for prototyping purposes.
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Sun, Dec 27, 2009 at 10:29 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>
> also there is already some erlang code :
> http://github.com/skarab/erlang-bcrypt
>
> - benoit
>
Ah that what adam mentionned too.
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Sun, Dec 27, 2009 at 10:09 PM, Glenn Rempe <gl...@rempe.us> wrote:
> On Sun, Dec 27, 2009 at 11:46 AM, Benoit Chesneau <bc...@gmail.com>wrote:
>
>> On Sun, Dec 27, 2009 at 8:05 PM, Chris Anderson <jc...@apache.org> wrote:
>>
>
>
>> >>>>>
>> >>>> Not really since salt is available and hash is only sha1. I think we
>> >>>> could make it harder but I agree with a strong encryption we don't
>> >>>> need to hide them.
>> >
>> > I'd be happy if someone can work out a stronger cryptographic
>> > solution. I don't think that there's much we can do to make brute
>> > force password guessing harder (aside from hiding the user's db, which
>> > we should do), but I'd be happy to be shown otherwise.
>>
>> Maybe we could start by using sha256. or more. I will have a look on
>> what could be done about it.
>>
>>
> I am just jumping in late here, so forgive me if this has been discussed.
> What about using bcrypt? Which is *designed* to be a slow hashing
> algorithm so that you dramatically reduce the ability to conduct brute force
> attacks. sha1, sha256, etc are designed to be fast, which if you gain
> access to the raw hashes is a bad thing. The idea is to make brute force
> attacks as computationally expensive as possible, while not impeding normal
> usage.
>
> for general context see :
>
> http://bit.ly/7nR09X
> http://bit.ly/91a05S
>
> And it seems like Adam K. has brought this up before as an option:
>
> http://bit.ly/7nxlA1
>
also there is already some erlang code :
http://github.com/skarab/erlang-bcrypt
- benoit
Re: authentication cleanup
Posted by Glenn Rempe <gl...@rempe.us>.
On Sun, Dec 27, 2009 at 11:46 AM, Benoit Chesneau <bc...@gmail.com>wrote:
> On Sun, Dec 27, 2009 at 8:05 PM, Chris Anderson <jc...@apache.org> wrote:
>
> >>>>>
> >>>> Not really since salt is available and hash is only sha1. I think we
> >>>> could make it harder but I agree with a strong encryption we don't
> >>>> need to hide them.
> >
> > I'd be happy if someone can work out a stronger cryptographic
> > solution. I don't think that there's much we can do to make brute
> > force password guessing harder (aside from hiding the user's db, which
> > we should do), but I'd be happy to be shown otherwise.
>
> Maybe we could start by using sha256. or more. I will have a look on
> what could be done about it.
>
>
I am just jumping in late here, so forgive me if this has been discussed.
What about using bcrypt? Which is *designed* to be a slow hashing
algorithm so that you dramatically reduce the ability to conduct brute force
attacks. sha1, sha256, etc are designed to be fast, which if you gain
access to the raw hashes is a bad thing. The idea is to make brute force
attacks as computationally expensive as possible, while not impeding normal
usage.
for general context see :
http://bit.ly/7nR09X
http://bit.ly/91a05S
And it seems like Adam K. has brought this up before as an option:
http://bit.ly/7nxlA1
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Sun, Dec 27, 2009 at 8:05 PM, Chris Anderson <jc...@apache.org> wrote:
>
> I haven't yet investigated what it takes to prevent the basic-auth
> popup. It will be very hard to convince me that is acceptable to
> trigger it. I understand the principles of RESTful service discovery,
> I just think they are less important than having software people
> actually use. Maybe we'll get lucky and we can have the 401 and avoid
> the basic popup. We'll see.
Well software people aren't only people that use CouchApps. About the
popup, as I said the only way we (and mainly jason) found was to pass
another header to couchdb like it is with cookie auth.
>
> Worst case scenario is application authors avoiding CouchDB's
> authentication for aesthetic reasons. Eg: I'd rather have
> authentication that is less than perfectly RESTful, that people
> actually use, than a perfectly RESTful solution that is unusable in
> practice.
>
>
I'm not sure what do you mean by aesthetic here, that's not really my
point although I sure don't really care about aestheticism :) I think
we just have to make sure that it doesn't break expected behavior by
other http clients.
>>>>> In the future, when we implement reader access-control-lists for
>>>>> databases, they will be useful to further secure the users DB. For
>>>>> now, the users db will be world-readable, which is fine as long as
>>>>> no-one breaks the crypto. We're already using strong hashes and long
>>>>> salts, so I think we're already relatively secure.
>>
>> relatively secure is not enough imo. We should try to make it really
>> hard to guess a password and more generally to authenticate. Without
>> that couchdb will never be acceped in some projects.
>
> I agree that there we'd like to make an option to restrict read-access
> to the users db. I just don't think its part of the work I'm doing on
> this patch. The work I'm doing now makes CouchDB more secure (by using
> validation functions so that users can't make themselves into admins).
>
> The users db is currently world-readable, so I'm not opening a new
> security hole here. Let's fix this. It's just not part of the current
> patch.
>
> It would be worth it to start another thread about per-database reader
> ACLs, which are the solution to this problem.
>
my point was just to say that until that you can't store sensitive
data such as oauth credentials in userdb :) Sry was not totally clear.
+1 for another thread.
>>>>>
>>>> Not really since salt is available and hash is only sha1. I think we
>>>> could make it harder but I agree with a strong encryption we don't
>>>> need to hide them.
>
> I'd be happy if someone can work out a stronger cryptographic
> solution. I don't think that there's much we can do to make brute
> force password guessing harder (aside from hiding the user's db, which
> we should do), but I'd be happy to be shown otherwise.
Maybe we could start by using sha256. or more. I will have a look on
what could be done about it.
> Erlang node names don't work because I'd like my username to be the
> same across many nodes. Eg, I'd like to be able to replicate my users
> db between my laptop and my server, and log into both with the same
> credentials.
The node was just the start to create an id on one node and also to
make sure userid is unique outside a trusted environnement. I didn't
see it like something that need to be changed across replication.
Since you made the prefix configurable, the pb is mostly solved
anyway. For non trusted environment prefix could be anything.
- benoit
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Sun, Dec 27, 2009 at 1:47 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> Sorry was off, hosting family for christmas.
>
> - benoit
>
> On Fri, Dec 25, 2009 at 12:58 AM, Chris Anderson <jc...@apache.org> wrote:
>> On Thu, Dec 24, 2009 at 10:16 AM, Benoit Chesneau <bc...@gmail.com> wrote:
>>> On Thu, Dec 24, 2009 at 5:27 PM, Chris Anderson <jc...@apache.org> wrote:
>
>>
>> I think it is possible to accept basic-auth when users provide it,
>> without sending the sort of response that triggers the popup in the
>> browser. If you have to have that popup to be RESTful, then I don't
>> want to be RESTful. On a serious note, I can't imagine anyone ever
>> writing a serious CouchApp if the browser-auth-popup is lurking there,
>> ready to ruin the user experience at every turn.
>>
> Basic auth isn't use only by couchapps. Libs need to access to. The
> 401 response which create the popup is needed by libs too.
>
I haven't yet investigated what it takes to prevent the basic-auth
popup. It will be very hard to convince me that is acceptable to
trigger it. I understand the principles of RESTful service discovery,
I just think they are less important than having software people
actually use. Maybe we'll get lucky and we can have the 401 and avoid
the basic popup. We'll see.
Worst case scenario is application authors avoiding CouchDB's
authentication for aesthetic reasons. Eg: I'd rather have
authentication that is less than perfectly RESTful, that people
actually use, than a perfectly RESTful solution that is unusable in
practice.
> The _session by form is already in place and used in some apps.
Agreed. I'm keeping the form-encoded login, and I haven't got around
to adding a JSON login yet.
>
>>>> In the future, when we implement reader access-control-lists for
>>>> databases, they will be useful to further secure the users DB. For
>>>> now, the users db will be world-readable, which is fine as long as
>>>> no-one breaks the crypto. We're already using strong hashes and long
>>>> salts, so I think we're already relatively secure.
>
> relatively secure is not enough imo. We should try to make it really
> hard to guess a password and more generally to authenticate. Without
> that couchdb will never be acceped in some projects.
I agree that there we'd like to make an option to restrict read-access
to the users db. I just don't think its part of the work I'm doing on
this patch. The work I'm doing now makes CouchDB more secure (by using
validation functions so that users can't make themselves into admins).
The users db is currently world-readable, so I'm not opening a new
security hole here. Let's fix this. It's just not part of the current
patch.
It would be worth it to start another thread about per-database reader
ACLs, which are the solution to this problem.
>>>>
>>> Not really since salt is available and hash is only sha1. I think we
>>> could make it harder but I agree with a strong encryption we don't
>>> need to hide them.
I'd be happy if someone can work out a stronger cryptographic
solution. I don't think that there's much we can do to make brute
force password guessing harder (aside from hiding the user's db, which
we should do), but I'd be happy to be shown otherwise.
>>
>> So I think I'm gonna switch to docids like "user:jchris@apache.org"
>> and "user:Monty4eva". If this is a stupid idea please convince me not
>> to do it.
>>
> why not choosing the erlang way ? We could associate a node name to
> each couchdb node (-sname or -name) which is a dns name. Then all user
> ids could be username@nodename ? Which could be an email but not
> necessarly. I like the approach used by XMPP and jid for that.
>
Erlang node names don't work because I'd like my username to be the
same across many nodes. Eg, I'd like to be able to replicate my users
db between my laptop and my server, and log into both with the same
credentials.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
Sorry was off, hosting family for christmas.
- benoit
On Fri, Dec 25, 2009 at 12:58 AM, Chris Anderson <jc...@apache.org> wrote:
> On Thu, Dec 24, 2009 at 10:16 AM, Benoit Chesneau <bc...@gmail.com> wrote:
>> On Thu, Dec 24, 2009 at 5:27 PM, Chris Anderson <jc...@apache.org> wrote:
>
> I think it is possible to accept basic-auth when users provide it,
> without sending the sort of response that triggers the popup in the
> browser. If you have to have that popup to be RESTful, then I don't
> want to be RESTful. On a serious note, I can't imagine anyone ever
> writing a serious CouchApp if the browser-auth-popup is lurking there,
> ready to ruin the user experience at every turn.
>
Basic auth isn't use only by couchapps. Libs need to access to. The
401 response which create the popup is needed by libs too.
>>
>>>
>>> One question is how to manage system roles such as _admin. My thinking
>>> is that the users db validation function will forbid roles starting
>>> with underscore from being stored on user's documents. Instead, when
>>> Couch loads a user from the db, it will cross-reference the user with
>>> the list of node and db admins, and apply the _admin role when
>>> appropriate. This way we can avoid having more than one distinct type
>>> of user in the system. This should also allow us to have more system
>>> roles (prefixed with underscore) in the future.
>>
>> Not sure to follow here.Do you plan to remove admins from ini ? I
>> would be to keep them. They are like super users. We could create
>> another class of users for that. Maybe _staff to follow unix
>> terminology?
>>
>
> I don't plan to remove admins from the config. The _admin role will be
> applied to users in the users db, based on the config setting. (Also,
> if you don't use the user's db, you will not notice any change at
> all.)
>
> Another _role that we could add in the future is a _replicate role,
> which normal users could have the option to run replication under.
> This would allow validations to enforce things like author names,
> without requiring users to run replication as _admin and expose design
> docs to potential unwanted changes.
>
>>
>>>
>>> I'm also thinking that the /_session handler should speak JSON
>>> primarily (but I'll probably leave in the ability to handle
>>> form-encoded request bodies as well).
>>>
>> We could just detect http headers and provide the needed response for
>> that. Keeping the form encoded would be good. It's already used in
>> some applications.
>
> I think we'll end up supporting both, but I want to get the JSON API
> in place and well tested.
>
The _session by form is already in place and used in some apps. I'm
full for a json api, but also I think that both form and json ap
should be supported as well and since orm api is already in place and
used by apps, it should stay in place and json api just added as
another alternative. One reason for this is that sometimes you don't
want your app speak json but just have an easy way to login. Still
there aren't only couchapps that use couchdb.
>>> In the future, when we implement reader access-control-lists for
>>> databases, they will be useful to further secure the users DB. For
>>> now, the users db will be world-readable, which is fine as long as
>>> no-one breaks the crypto. We're already using strong hashes and long
>>> salts, so I think we're already relatively secure.
relatively secure is not enough imo. We should try to make it really
hard to guess a password and more generally to authenticate. Without
that couchdb will never be acceped in some projects.
>>>
>> Not really since salt is available and hash is only sha1. I think we
>> could make it harder but I agree with a strong encryption we don't
>> need to hide them.
>>
>>
>>> None of what I'm doing should change the oauth handlers.
>>
>> oauth is a problem here if it's in a public db.
>>
>
> I agree hiding the users db would be more secure, but the current
> codebase uses a public users db. I've got to draw the line for this
> patch somewhere. Should we eventually get per-db reader ACLs, they'll
> be perfect for making this a little more secure.
>
In any case oauth credentials shouldn't be public. What about if
someone steal the key and use it to log ?
>
> One problem I've run into is how to enforce that logins are unique
> within the users db. The simple answer is to make the username into
> the docid. This has the upside that if 2 sites are replicated
> together, any duplicated user docs will go into a conflict state
> immediately. I think this is better than having the ambiguity come up
> at login time, when it's not clear which user document to test the
> password against.
>
> If we do login-as-docid, then we can encourage people to use email
> addresses as login tokens, which should help avoid spurious conflicts
> when sites are merged.
>
> The other option is to keep doing what we do now, and run a view query
> to see if the user name has been taken before saving the document.
> This has the advantage of mostly working while avoiding replication
> conflicts. However, as I said above, I think we want those replication
> conflicts. Also, having a uniqueness constraint on a field other than
> _id is one of those things that seems like it works, until it doesn't
> work. Then when it doesn't work (b/c of distributed apps or race
> conditions) the whole house of cards comes falling down.
>
> So I think I'm gonna switch to docids like "user:jchris@apache.org"
> and "user:Monty4eva". If this is a stupid idea please convince me not
> to do it.
>
why not choosing the erlang way ? We could associate a node name to
each couchdb node (-sname or -name) which is a dns name. Then all user
ids could be username@nodename ? Which could be an email but not
necessarly. I like the approach used by XMPP and jid for that.
- benoit
Re: authentication cleanup
Posted by Jan Lehnardt <ja...@apache.org>.
On 25 Dec 2009, at 14:11, Dirkjan Ochtman wrote:
> On Fri, Dec 25, 2009 at 00:58, Chris Anderson <jc...@apache.org> wrote:
>> So I think I'm gonna switch to docids like "user:jchris@apache.org"
>> and "user:Monty4eva". If this is a stupid idea please convince me not
>> to do it.
>
> Making the user IDs the document IDs seems to make sense, but I'm not
> sure what the user: prefix (which seems a little ugly) buys you.
>
> Are there documents in the users database that are not users?
I have a patch pending* that adds OAuth tokens to the users db.
*discussed here earlier.
Cheers
Jan
--
Re: authentication cleanup
Posted by Dirkjan Ochtman <di...@ochtman.nl>.
On Fri, Dec 25, 2009 at 16:40, Chris Anderson <jc...@apache.org> wrote:
> Not yet, but who knows what the next hundred years will bring. :)
YAGNI. ;)
Christmas cheers,
Dirkjan
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Fri, Dec 25, 2009 at 5:11 AM, Dirkjan Ochtman <dj...@gmail.com> wrote:
> On Fri, Dec 25, 2009 at 00:58, Chris Anderson <jc...@apache.org> wrote:
>> So I think I'm gonna switch to docids like "user:jchris@apache.org"
>> and "user:Monty4eva". If this is a stupid idea please convince me not
>> to do it.
>
> Making the user IDs the document IDs seems to make sense, but I'm not
> sure what the user: prefix (which seems a little ugly) buys you.
>
The reasoning is that applications may also want to have user profile
documents correlated with CouchDB auth documents. If we namespace our
user docs, we're less likely to cause spurious conflicts when people
do things like replicate the users db into their application db.
My current code is using "org.apache.couchdb.user:dirkjan@ochtman.nl"
because the fully qualified name makes it even less likely that people
will think it's a good idea to have applications which use the same
docid namespace.
> Are there documents in the users database that are not users?
>
Not yet, but who knows what the next hundred years will bring. :)
> Cheers,
>
> Dirkjan
>
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Dirkjan Ochtman <dj...@gmail.com>.
On Fri, Dec 25, 2009 at 00:58, Chris Anderson <jc...@apache.org> wrote:
> So I think I'm gonna switch to docids like "user:jchris@apache.org"
> and "user:Monty4eva". If this is a stupid idea please convince me not
> to do it.
Making the user IDs the document IDs seems to make sense, but I'm not
sure what the user: prefix (which seems a little ugly) buys you.
Are there documents in the users database that are not users?
Cheers,
Dirkjan
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Thu, Dec 24, 2009 at 10:16 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Thu, Dec 24, 2009 at 5:27 PM, Chris Anderson <jc...@apache.org> wrote:
>> Devs,
>>
>> I'm attempting to make more sense of CouchDB's authentication system.
>> The current system is a proverbial ball of spaghetti. I'm still in the
>> investigation stage of my work, and I'm writing this to clarify my
>> thoughts and solicit feedback.
>>
>> To start with, the current default_authentication_handler is unaware
>> of the users db. I plan to fix that, and to change default.ini so that
>> cookie_auth is enabled for all Couches. I also plan to make it so that
>> CouchDB never triggers the basic-auth popup box, because we all know
>> that that's a UI dealbreaker. (We'll still accept basic auth, we just
>> won't prompt for it.)
>
> Auth popup is created by the browser. Does it imply an ui would be
> needed to connect to CouchDB via the browser ? Also how can we detect
> the basic auth if you don't send the 401 status with WWW-Authenticate
> ? I think we should keep the default behaviour (popup) but on the
> other hand reusing the system used with cookie aut allowing us to not
> popup by just providing another header.
I think it is possible to accept basic-auth when users provide it,
without sending the sort of response that triggers the popup in the
browser. If you have to have that popup to be RESTful, then I don't
want to be RESTful. On a serious note, I can't imagine anyone ever
writing a serious CouchApp if the browser-auth-popup is lurking there,
ready to ruin the user experience at every turn.
>
>>
>> One question is how to manage system roles such as _admin. My thinking
>> is that the users db validation function will forbid roles starting
>> with underscore from being stored on user's documents. Instead, when
>> Couch loads a user from the db, it will cross-reference the user with
>> the list of node and db admins, and apply the _admin role when
>> appropriate. This way we can avoid having more than one distinct type
>> of user in the system. This should also allow us to have more system
>> roles (prefixed with underscore) in the future.
>
> Not sure to follow here.Do you plan to remove admins from ini ? I
> would be to keep them. They are like super users. We could create
> another class of users for that. Maybe _staff to follow unix
> terminology?
>
I don't plan to remove admins from the config. The _admin role will be
applied to users in the users db, based on the config setting. (Also,
if you don't use the user's db, you will not notice any change at
all.)
Another _role that we could add in the future is a _replicate role,
which normal users could have the option to run replication under.
This would allow validations to enforce things like author names,
without requiring users to run replication as _admin and expose design
docs to potential unwanted changes.
>
>>
>> I'm also thinking that the /_session handler should speak JSON
>> primarily (but I'll probably leave in the ability to handle
>> form-encoded request bodies as well).
>>
> We could just detect http headers and provide the needed response for
> that. Keeping the form encoded would be good. It's already used in
> some applications.
I think we'll end up supporting both, but I want to get the JSON API
in place and well tested.
>
>> As far as security on the users DB, I don't plan to change anything
>> from how it is now. The basic idea is that anyone can create a new
>> user document (eg anyone can signup), but only _admins can set roles
>> on user documents. Additionally, only _admins or the user whos
>> document it is can update a user document.
>>
>> In the future, when we implement reader access-control-lists for
>> databases, they will be useful to further secure the users DB. For
>> now, the users db will be world-readable, which is fine as long as
>> no-one breaks the crypto. We're already using strong hashes and long
>> salts, so I think we're already relatively secure.
>>
> Not really since salt is available and hash is only sha1. I think we
> could make it harder but I agree with a strong encryption we don't
> need to hide them.
>
>
>> None of what I'm doing should change the oauth handlers.
>
> oauth is a problem here if it's in a public db.
>
I agree hiding the users db would be more secure, but the current
codebase uses a public users db. I've got to draw the line for this
patch somewhere. Should we eventually get per-db reader ACLs, they'll
be perfect for making this a little more secure.
>
>>
>> Thanks for your attention. Please fire aware with questions and comments.
>>
>> Happy holidays,
>> Chris
>>
> Thanks you too. I would be happy to help on this part I have a project
> that just wait for a some auth. So tell me if I can help.
>
> - benoît
>
The code I've written so far is a huge mess, so there's not much room
to help at the moment. I'll hopefully have it in a publishable state
in the next few days. (yay to holidays, the one time I can actually
get work done!)
One problem I've run into is how to enforce that logins are unique
within the users db. The simple answer is to make the username into
the docid. This has the upside that if 2 sites are replicated
together, any duplicated user docs will go into a conflict state
immediately. I think this is better than having the ambiguity come up
at login time, when it's not clear which user document to test the
password against.
If we do login-as-docid, then we can encourage people to use email
addresses as login tokens, which should help avoid spurious conflicts
when sites are merged.
The other option is to keep doing what we do now, and run a view query
to see if the user name has been taken before saving the document.
This has the advantage of mostly working while avoiding replication
conflicts. However, as I said above, I think we want those replication
conflicts. Also, having a uniqueness constraint on a field other than
_id is one of those things that seems like it works, until it doesn't
work. Then when it doesn't work (b/c of distributed apps or race
conditions) the whole house of cards comes falling down.
So I think I'm gonna switch to docids like "user:jchris@apache.org"
and "user:Monty4eva". If this is a stupid idea please convince me not
to do it.
Cheers,
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Thu, Dec 24, 2009 at 5:27 PM, Chris Anderson <jc...@apache.org> wrote:
> Devs,
>
> I'm attempting to make more sense of CouchDB's authentication system.
> The current system is a proverbial ball of spaghetti. I'm still in the
> investigation stage of my work, and I'm writing this to clarify my
> thoughts and solicit feedback.
>
> To start with, the current default_authentication_handler is unaware
> of the users db. I plan to fix that, and to change default.ini so that
> cookie_auth is enabled for all Couches. I also plan to make it so that
> CouchDB never triggers the basic-auth popup box, because we all know
> that that's a UI dealbreaker. (We'll still accept basic auth, we just
> won't prompt for it.)
Auth popup is created by the browser. Does it imply an ui would be
needed to connect to CouchDB via the browser ? Also how can we detect
the basic auth if you don't send the 401 status with WWW-Authenticate
? I think we should keep the default behaviour (popup) but on the
other hand reusing the system used with cookie aut allowing us to not
popup by just providing another header.
>
> One question is how to manage system roles such as _admin. My thinking
> is that the users db validation function will forbid roles starting
> with underscore from being stored on user's documents. Instead, when
> Couch loads a user from the db, it will cross-reference the user with
> the list of node and db admins, and apply the _admin role when
> appropriate. This way we can avoid having more than one distinct type
> of user in the system. This should also allow us to have more system
> roles (prefixed with underscore) in the future.
Not sure to follow here.Do you plan to remove admins from ini ? I
would be to keep them. They are like super users. We could create
another class of users for that. Maybe _staff to follow unix
terminology?
>
> Another question is bootstrapping the cookie auth system. Currently a
> node secret needs to be configured before cookie_auth is enabled. I
> don't plan to change that, but I do plan to add a UI workflow to Futon
> which encourages you to setup an initial admin user and configure the
> secret. Once that is done, cookie auth will be enabled.
+1
>
> At the level of code, I plan to move some things around so most of the
> auth stuff is together in the codebase. I'll also be removing the
> /_user handler in favor of CouchDB's standard database API + a
> validation function. If the /_user handler is widely used, I can
> replace it with an _update function which will handle setting up the
> hashed password and salt, as well as accepting
> application/x-www-form-urlencoded POSTs. If there is concern about
> backwards compatibility with existing software, I can also setup an
> internal rewrite so that the /_user URL continues to function as it
> does now.
I guess the _user rewrite could go with the rewriter i will show this
we. (pure erlang)
>
> I'm also thinking that the /_session handler should speak JSON
> primarily (but I'll probably leave in the ability to handle
> form-encoded request bodies as well).
>
We could just detect http headers and provide the needed response for
that. Keeping the form encoded would be good. It's already used in
some applications.
> As far as security on the users DB, I don't plan to change anything
> from how it is now. The basic idea is that anyone can create a new
> user document (eg anyone can signup), but only _admins can set roles
> on user documents. Additionally, only _admins or the user whos
> document it is can update a user document.
>
> In the future, when we implement reader access-control-lists for
> databases, they will be useful to further secure the users DB. For
> now, the users db will be world-readable, which is fine as long as
> no-one breaks the crypto. We're already using strong hashes and long
> salts, so I think we're already relatively secure.
>
Not really since salt is available and hash is only sha1. I think we
could make it harder but I agree with a strong encryption we don't
need to hide them.
> None of what I'm doing should change the oauth handlers.
oauth is a problem here if it's in a public db.
>
> Thanks for your attention. Please fire aware with questions and comments.
>
> Happy holidays,
> Chris
>
Thanks you too. I would be happy to help on this part I have a project
that just wait for a some auth. So tell me if I can help.
- benoît
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Thu, Dec 31, 2009 at 8:50 PM, Steve Olson <st...@gmail.com> wrote:
> Chris, and other interested devs:
>
> I have become a CouchDB Evangelist for our development group (100+
> developers) and I'll be giving a presentation in January to many decision
> makers.
>
> One of my weaknesses in web development is working with authentication and
> that has been one of the main lynch pins in my discussions.
>
> I would like to write some documentation to help out with the couch effort
> of evangelizing how to authenticate and secure a CouchDB installation, maybe
> a best practices piece.
Steveo, good docs would help a lot of people.
I'd like to encourage you to follow through with this.
I plan to document it from a developers standpoint soon. Hopefully
that will help you get your bearings and write the kinds of docs
end-users would like to see.
>
> In order to write something like that I have to learn it, and from
> experience as a noob I find that learning while writing can work out pretty
> well because I don't assume as much knowledge on the part of the reader.
>
> Is there already some documentation describing how to set up authentication
> for couch? Maybe with this group we could come up with a list of
> scenarios...
You should read
http://www.jasondavies.com/blog/2009/05/27/secure-cookie-authentication-couchdb/
for some background. The account branch is basically an extension of
his work.
Have you tried the account branch? If you don't use git, I'll be
creating an Apache branch for it. If you've got git, you can start
using it easily at the url from this thread.
The main thing is a workflow for signup and login, it has some online
help, which should be a start.
>
> 1) Behind an Apache Proxy
> 2) Other proxies?
> 3) Basic Auth (I've seen some info in your book)
> 4) LDAP
>
> Steveo
>
> On Thu, Dec 31, 2009 at 7:16 PM, Chris Anderson <jc...@apache.org> wrote:
>
>> On Thu, Dec 24, 2009 at 8:27 AM, Chris Anderson <jc...@apache.org> wrote:
>> > Devs,
>> >
>> > I'm attempting to make more sense of CouchDB's authentication system.
>> > The current system is a proverbial ball of spaghetti. I'm still in the
>> > investigation stage of my work, and I'm writing this to clarify my
>> > thoughts and solicit feedback.
>> >
>>
>> http://github.com/jchris/couchdb/tree/account
>>
>> Just a note to say that this branch is nearly done. I'd love some review.
>>
>> To use it, visit Futon and look in the lower-right corner.
>>
>> Before merging I still need to remove extra log statements, etc.
>>
>> Feedback welcome!
>>
>> Chris
>>
>> --
>> Chris Anderson
>> http://jchrisa.net
>> http://couch.io
>>
>
>
>
> --
> Steveo
> Steven Douglas Olson
> steveolyo@gmail.com
>
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Steve Olson <st...@gmail.com>.
Chris, and other interested devs:
I have become a CouchDB Evangelist for our development group (100+
developers) and I'll be giving a presentation in January to many decision
makers.
One of my weaknesses in web development is working with authentication and
that has been one of the main lynch pins in my discussions.
I would like to write some documentation to help out with the couch effort
of evangelizing how to authenticate and secure a CouchDB installation, maybe
a best practices piece.
In order to write something like that I have to learn it, and from
experience as a noob I find that learning while writing can work out pretty
well because I don't assume as much knowledge on the part of the reader.
Is there already some documentation describing how to set up authentication
for couch? Maybe with this group we could come up with a list of
scenarios...
1) Behind an Apache Proxy
2) Other proxies?
3) Basic Auth (I've seen some info in your book)
4) LDAP
Steveo
On Thu, Dec 31, 2009 at 7:16 PM, Chris Anderson <jc...@apache.org> wrote:
> On Thu, Dec 24, 2009 at 8:27 AM, Chris Anderson <jc...@apache.org> wrote:
> > Devs,
> >
> > I'm attempting to make more sense of CouchDB's authentication system.
> > The current system is a proverbial ball of spaghetti. I'm still in the
> > investigation stage of my work, and I'm writing this to clarify my
> > thoughts and solicit feedback.
> >
>
> http://github.com/jchris/couchdb/tree/account
>
> Just a note to say that this branch is nearly done. I'd love some review.
>
> To use it, visit Futon and look in the lower-right corner.
>
> Before merging I still need to remove extra log statements, etc.
>
> Feedback welcome!
>
> Chris
>
> --
> Chris Anderson
> http://jchrisa.net
> http://couch.io
>
--
Steveo
Steven Douglas Olson
steveolyo@gmail.com
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Sun, Jan 3, 2010 at 4:02 PM, Chris Anderson <jc...@apache.org> wrote:
> On Sun, Jan 3, 2010 at 3:17 PM, Sam Bisbee <sb...@computervip.com> wrote:
>>> >>
>>> >> I was thinking we could even add some code which loads the admin
>>> >> config into a cookie, and then clears admins. When the tests are done
>>> >> it can re-configure the admins.
>>> >
>>> > This scares me: if the browser/client crashes while the tests are running, then
>>> > you've likely lost your admin config. Also, you're leaving yourself unprotected
>>> > for the length of the tests if it's a live system (doesn't even have to be
>>> > production, just on the 'net).
>>> >
>> [snip]
>>> Current trunk has failing tests when Couch isn't in admin party mode.
>>> So putting the warning and the option to temporarily remove admins
>>> before running tests is a step in the right direction. I think cookie storage
>>> for admin config is robust enough for the cases where someone would think of
>>> using it... it's essentially a convenience.
>>
>> Agreed that it's a good band aid. However, is there some way we could store it
>> server side? I'm concerned about the security implications. Sniffing the config
>> from the wire (assuming no HTTPS), browser, or OS file system aside, there is
>> the possibility of injection of bad accounts. Better put, it's the pillar of
>> security to never trust what the client sends you.
>
> I think there are very few security concerns with the idea. The config
> section we'd be storing in the browser state for the duration of the
> test run is available to all _admins via HTTP GET against
> /_config/admins/
>
> The contents are hashed so they look like this:
>
> {"jchris":"-hashed-58e36b11185d33e61206032e6e99635b854aaaf4,08c90dc21bb2d7dc672cb4305114252a"}
>
> So we'd just clear that setting, and restore it at the end. I don't
> think makes things less secure than they are.
>
> I was originally just thinking of a button on the test suite page to
> remove all admins from the config, but that's not as convenient as
> removing them and then putting them back at the end.
>
>>
>> Maybe write it to the OS's temp file space? That way it's safe and if something
>> crashes you can still easily recover the config. You could even automate the
>> recovery if you wanted to, which you couldn't reliably do if it came from the
>> client.
>>
>
> If losing the admin config would be a big deal, you shouldn't be
> running the tests on that node, for a whole host of reasons. That
> said, the current state of the art, which is to manually edit the
> local.ini file to comment out the admin lines, and then restart the
> server, will continue to work regardless of what sugar we add.
>
I've updated the branch to add this feature. Only, when it came time
to restore the admin config, I realized it can't be automated (b/c
Futon doesn't know your cleartext password, so it can't add back all
the admins.)
This isn't insurmountable (put the current user's admin info back
before asking them to log in, then put the other admins back) but it
would be a lot of code for a non-crucial feature anyway.
So I'm leaving it at: remove all admins for you before starting the
tests, with a stern warning that you shouldn't run tests on public
servers. The changes have been pushed to github:
http://github.com/jchris/couchdb/tree/account
I'll be pushing this to an Apache branch soon as I think I've got most
of the features ready for trunk.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Sun, Jan 3, 2010 at 3:17 PM, Sam Bisbee <sb...@computervip.com> wrote:
>> >>
>> >> I was thinking we could even add some code which loads the admin
>> >> config into a cookie, and then clears admins. When the tests are done
>> >> it can re-configure the admins.
>> >
>> > This scares me: if the browser/client crashes while the tests are running, then
>> > you've likely lost your admin config. Also, you're leaving yourself unprotected
>> > for the length of the tests if it's a live system (doesn't even have to be
>> > production, just on the 'net).
>> >
> [snip]
>> Current trunk has failing tests when Couch isn't in admin party mode.
>> So putting the warning and the option to temporarily remove admins
>> before running tests is a step in the right direction. I think cookie storage
>> for admin config is robust enough for the cases where someone would think of
>> using it... it's essentially a convenience.
>
> Agreed that it's a good band aid. However, is there some way we could store it
> server side? I'm concerned about the security implications. Sniffing the config
> from the wire (assuming no HTTPS), browser, or OS file system aside, there is
> the possibility of injection of bad accounts. Better put, it's the pillar of
> security to never trust what the client sends you.
I think there are very few security concerns with the idea. The config
section we'd be storing in the browser state for the duration of the
test run is available to all _admins via HTTP GET against
/_config/admins/
The contents are hashed so they look like this:
{"jchris":"-hashed-58e36b11185d33e61206032e6e99635b854aaaf4,08c90dc21bb2d7dc672cb4305114252a"}
So we'd just clear that setting, and restore it at the end. I don't
think makes things less secure than they are.
I was originally just thinking of a button on the test suite page to
remove all admins from the config, but that's not as convenient as
removing them and then putting them back at the end.
>
> Maybe write it to the OS's temp file space? That way it's safe and if something
> crashes you can still easily recover the config. You could even automate the
> recovery if you wanted to, which you couldn't reliably do if it came from the
> client.
>
If losing the admin config would be a big deal, you shouldn't be
running the tests on that node, for a whole host of reasons. That
said, the current state of the art, which is to manually edit the
local.ini file to comment out the admin lines, and then restart the
server, will continue to work regardless of what sugar we add.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Sam Bisbee <sb...@computervip.com>.
On Sun, Jan 03, 2010 at 12:55:29PM -0800, Chris Anderson wrote:
> On Sun, Jan 3, 2010 at 11:50 AM, Sam Bisbee <sb...@computervip.com> wrote:
> > On Sun, Jan 03, 2010 at 08:31:19AM -0800, Chris Anderson wrote:
> >> On Sun, Jan 3, 2010 at 5:28 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> >> > Just tested it, admin creation seem to work during the test I've done
> >> > at least admin user is created, for the rest I don't know, am not sure
> >> > yet what could be done with the changes, I need to have a closer look
> >> > in the code for it. There is a bug you mentioned in another mail with
> >> > tests, if we are loggged out, test fails and logically tests requiring
> >> > auth failed, to follow one of your proposal, I think we should add a
> >> > warning on top of tests saying that an admin user exists and tests
> >> > will fail; something like it.
> >>
> >> I was thinking we could even add some code which loads the admin
> >> config into a cookie, and then clears admins. When the tests are done
> >> it can re-configure the admins.
> >
> > This scares me: if the browser/client crashes while the tests are running, then
> > you've likely lost your admin config. Also, you're leaving yourself unprotected
> > for the length of the tests if it's a live system (doesn't even have to be
> > production, just on the 'net).
> >
[snip]
> Current trunk has failing tests when Couch isn't in admin party mode.
> So putting the warning and the option to temporarily remove admins
> before running tests is a step in the right direction. I think cookie storage
> for admin config is robust enough for the cases where someone would think of
> using it... it's essentially a convenience.
Agreed that it's a good band aid. However, is there some way we could store it
server side? I'm concerned about the security implications. Sniffing the config
from the wire (assuming no HTTPS), browser, or OS file system aside, there is
the possibility of injection of bad accounts. Better put, it's the pillar of
security to never trust what the client sends you.
Maybe write it to the OS's temp file space? That way it's safe and if something
crashes you can still easily recover the config. You could even automate the
recovery if you wanted to, which you couldn't reliably do if it came from the
client.
Cheers,
--
Sam Bisbee
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Sun, Jan 3, 2010 at 11:50 AM, Sam Bisbee <sb...@computervip.com> wrote:
> On Sun, Jan 03, 2010 at 08:31:19AM -0800, Chris Anderson wrote:
>> On Sun, Jan 3, 2010 at 5:28 AM, Benoit Chesneau <bc...@gmail.com> wrote:
>> > Just tested it, admin creation seem to work during the test I've done
>> > at least admin user is created, for the rest I don't know, am not sure
>> > yet what could be done with the changes, I need to have a closer look
>> > in the code for it. There is a bug you mentioned in another mail with
>> > tests, if we are loggged out, test fails and logically tests requiring
>> > auth failed, to follow one of your proposal, I think we should add a
>> > warning on top of tests saying that an admin user exists and tests
>> > will fail; something like it.
>>
>> I was thinking we could even add some code which loads the admin
>> config into a cookie, and then clears admins. When the tests are done
>> it can re-configure the admins.
>
> This scares me: if the browser/client crashes while the tests are running, then
> you've likely lost your admin config. Also, you're leaving yourself unprotected
> for the length of the tests if it's a live system (doesn't even have to be
> production, just on the 'net).
>
Generally, you shouldn't run the tests on a production system anyway.
The tests are constantly changing the admin config as they run anyway
(sometimes leaving the Couch wide open), so this is pretty much the
only option.
Current trunk has failing tests when Couch isn't in admin party mode.
So putting the warning and the option to temporarily remove admins
before running tests is a step in the right direction. I think cookie
storage for admin config is robust enough for the cases where someone
would think of using it... it's essentially a convenience.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Sam Bisbee <sb...@computervip.com>.
On Sun, Jan 03, 2010 at 08:31:19AM -0800, Chris Anderson wrote:
> On Sun, Jan 3, 2010 at 5:28 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> > Just tested it, admin creation seem to work during the test I've done
> > at least admin user is created, for the rest I don't know, am not sure
> > yet what could be done with the changes, I need to have a closer look
> > in the code for it. There is a bug you mentioned in another mail with
> > tests, if we are loggged out, test fails and logically tests requiring
> > auth failed, to follow one of your proposal, I think we should add a
> > warning on top of tests saying that an admin user exists and tests
> > will fail; something like it.
>
> I was thinking we could even add some code which loads the admin
> config into a cookie, and then clears admins. When the tests are done
> it can re-configure the admins.
This scares me: if the browser/client crashes while the tests are running, then
you've likely lost your admin config. Also, you're leaving yourself unprotected
for the length of the tests if it's a live system (doesn't even have to be
production, just on the 'net).
--
Sam Bisbee
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Sun, Jan 3, 2010 at 5:28 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Fri, Jan 1, 2010 at 3:16 AM, Chris Anderson <jc...@apache.org> wrote:
>> On Thu, Dec 24, 2009 at 8:27 AM, Chris Anderson <jc...@apache.org> wrote:
>>> Devs,
>>>
>>> I'm attempting to make more sense of CouchDB's authentication system.
>>> The current system is a proverbial ball of spaghetti. I'm still in the
>>> investigation stage of my work, and I'm writing this to clarify my
>>> thoughts and solicit feedback.
>>>
>>
>> http://github.com/jchris/couchdb/tree/account
>>
>> Just a note to say that this branch is nearly done. I'd love some review.
>>
>> To use it, visit Futon and look in the lower-right corner.
>>
>> Before merging I still need to remove extra log statements, etc.
>>
>> Feedback welcome!
>>
>> Chris
>>
>
> Just tested it, admin creation seem to work during the test I've done
> at least admin user is created, for the rest I don't know, am not sure
> yet what could be done with the changes, I need to have a closer look
> in the code for it. There is a bug you mentioned in another mail with
> tests, if we are loggged out, test fails and logically tests requiring
> auth failed, to follow one of your proposal, I think we should add a
> warning on top of tests saying that an admin user exists and tests
> will fail; something like it.
I was thinking we could even add some code which loads the admin
config into a cookie, and then clears admins. When the tests are done
it can re-configure the admins.
>
> About the ui the font size may be a little too small and login line
> should be imo on the top. More generally i'm a little frustrated, I
> can create an admin, add more admins, but what about removing one ?
> Also Having an interface allowing me to create more user and list them
> would be really cool.
Not much time right now, but I'll outline the UI flow.
When there's an admin party, you can create an admin to fix it.
If you are logged in as an admin, you can create more admins.
If you are not logged in (but it's not admin-party) then you can click
"Signup" to create a new user account with an empty roles list. If you
click your username when you are logged in, it will show your user
document.
Admins can add roles to existing user documents.
There isn't a UI for listing or editing users as I expect we'll just
use Futon's database UI for that.
Admins can delete admins via the Config UI (if you are trying to
delete all admins to run tests make sure to delete yourself last).
>
> Anyway I really like having the possibility to create user from futon
> thanks for that :) I will have a closer look on code in the next days.
>
Thanks for checking it out. There's not a whole lot of new code here,
just a cleanup of what we've been building since about 0.9. I'll push
it to an Apache branch with a detailed todo list as soon as I've had a
chance to clean up the patch.
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io
Re: authentication cleanup
Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Jan 1, 2010 at 3:16 AM, Chris Anderson <jc...@apache.org> wrote:
> On Thu, Dec 24, 2009 at 8:27 AM, Chris Anderson <jc...@apache.org> wrote:
>> Devs,
>>
>> I'm attempting to make more sense of CouchDB's authentication system.
>> The current system is a proverbial ball of spaghetti. I'm still in the
>> investigation stage of my work, and I'm writing this to clarify my
>> thoughts and solicit feedback.
>>
>
> http://github.com/jchris/couchdb/tree/account
>
> Just a note to say that this branch is nearly done. I'd love some review.
>
> To use it, visit Futon and look in the lower-right corner.
>
> Before merging I still need to remove extra log statements, etc.
>
> Feedback welcome!
>
> Chris
>
Just tested it, admin creation seem to work during the test I've done
at least admin user is created, for the rest I don't know, am not sure
yet what could be done with the changes, I need to have a closer look
in the code for it. There is a bug you mentioned in another mail with
tests, if we are loggged out, test fails and logically tests requiring
auth failed, to follow one of your proposal, I think we should add a
warning on top of tests saying that an admin user exists and tests
will fail; something like it.
About the ui the font size may be a little too small and login line
should be imo on the top. More generally i'm a little frustrated, I
can create an admin, add more admins, but what about removing one ?
Also Having an interface allowing me to create more user and list them
would be really cool.
Anyway I really like having the possibility to create user from futon
thanks for that :) I will have a closer look on code in the next days.
- benoît
Re: authentication cleanup
Posted by Chris Anderson <jc...@apache.org>.
On Thu, Dec 24, 2009 at 8:27 AM, Chris Anderson <jc...@apache.org> wrote:
> Devs,
>
> I'm attempting to make more sense of CouchDB's authentication system.
> The current system is a proverbial ball of spaghetti. I'm still in the
> investigation stage of my work, and I'm writing this to clarify my
> thoughts and solicit feedback.
>
http://github.com/jchris/couchdb/tree/account
Just a note to say that this branch is nearly done. I'd love some review.
To use it, visit Futon and look in the lower-right corner.
Before merging I still need to remove extra log statements, etc.
Feedback welcome!
Chris
--
Chris Anderson
http://jchrisa.net
http://couch.io