You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by iilyak <gi...@git.apache.org> on 2015/06/26 16:03:08 UTC

[GitHub] couchdb-couch pull request: Make sure authentication_db for cluste...

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb-couch/pull/62

    Make sure authentication_db for clustered is considered as users db

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/iilyak/couchdb-couch 2731-authentication-db-for-clustered

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch/pull/62.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #62
    
----
commit 7ec86489ba3c26cb36e99d5488b1a599de930d7c
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2015-06-26T13:59:26Z

    Strip shards timestamp in normalize_dbname
    
    COUCHDB-2731

commit 744ae3e558550588511705356d018802baf35f63
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2015-06-26T13:54:14Z

    Refactor IsUsersDb in maybe_add_sys_db_callback
    
    In addition to previous checks we consider db returned from
    config:get("chttpd_auth", "authentication_db", "_users") as a users db.
    
    COUCHDB-2731

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch issue #62: Make sure authentication_db for clustered is consid...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the issue:

    https://github.com/apache/couchdb-couch/pull/62
  
    Closed in favor of https://github.com/apache/couchdb-couch/pull/198


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Make sure authentication_db for cluste...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/62#issuecomment-115856279
  
    The explanation is in a bug description https://issues.apache.org/jira/browse/COUCHDB-2731


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Make sure authentication_db for cluste...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/62#issuecomment-129461562
  
    re-reading this, I think it's a mistake for couch to know about chttpd config settings.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Make sure authentication_db for cluste...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/62#issuecomment-117143313
  
    ok, I understand now. The fix here isn't quite right, I think as it will affect different databases as a side effect. If, say, the chttpd_auth db is called foo and the couch_http_db is called bar, then a node-local database called foo is also treated as a users db, as is a clustered database called bar.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request #62: Make sure authentication_db for clustered is...

Posted by davisp <gi...@git.apache.org>.
Github user davisp commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch/pull/62#discussion_r78438428
  
    --- Diff: src/couch_server.erl ---
    @@ -116,12 +116,16 @@ delete(DbName, Options) ->
     maybe_add_sys_db_callbacks(DbName, Options) when is_binary(DbName) ->
         maybe_add_sys_db_callbacks(?b2l(DbName), Options);
     maybe_add_sys_db_callbacks(DbName, Options) ->
    +    Normalized = couch_db:normalize_dbname(DbName),
    +    IsShard = couch_db:is_shard(DbName),
    +
         DbsDbName = config:get("mem3", "shards_db", "_dbs"),
         NodesDbName = config:get("mem3", "nodes_db", "_nodes"),
    -    IsReplicatorDb = DbName == config:get("replicator", "db", "_replicator") orelse
    -	path_ends_with(DbName, <<"_replicator">>),
    -    IsUsersDb = DbName ==config:get("couch_httpd_auth", "authentication_db", "_users") orelse
    -	path_ends_with(DbName, <<"_users">>),
    +    IsReplicatorDb = Normalized == config:get("replicator", "db", "_replicator") orelse
    --- End diff --
    
    As I read this, Normalized is guaranteed to be a binary, where config:get/3 is guaranteed to be a list, so the first part of the orelse is guaranteed to be false.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Make sure authentication_db for cluste...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/62#issuecomment-120441534
  
    @rnewson: PR is updated to address the problem you've identified.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request #62: Make sure authentication_db for clustered is...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak closed the pull request at:

    https://github.com/apache/couchdb-couch/pull/62


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Make sure authentication_db for cluste...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/62#issuecomment-115743223
  
    Can you explain this patch?
    
    Remembering that the clustered _users database and the node local _users databases are separate (a request to :5984 must not use the node-local _users, a request to :5986 must not use the clustered _users).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Make sure authentication_db for cluste...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/62#issuecomment-115861833
  
    Let's say we have following in default.ini
    ```
    [chttpd_auth] 
    authentication_db = myusers
    ```
    This would mean that it will not match on [any condition](https://github.com/apache/couchdb-couch/blob/master/src/couch_server.erl#L123:L124) we check to detect users db.
    This would mean that `couch_users_db:before_doc_update` wouldn't be called. I.e. plain password upgrade will not happen. Since some other parts of couch expect valid profile which includes for example  `<<"password_scheme">>` it causes failures.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---