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 2016/09/13 19:27:16 UTC

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

GitHub user iilyak opened a pull request:

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

    Make sure authentication_db for clustered is considered as users db

    Fixes the case when the following are configured to something other than _users
     - chttpd_auth.authentication_db
     - couch_httpd_auth.authentication_db
    
    For chttpd_auth only clustered db should be considered as users_db.
    For couch_http_db only node-local db should be considered.
    So we take wheither it is a clustered db into account in `is_usersdb/2`.
    
    COUCHDB-2731

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

    $ git pull https://github.com/cloudant/couchdb-couch 74046-authentication_db-should-be-sysdb

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

    https://github.com/apache/couchdb-couch/pull/198.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 #198
    
----
commit ef2ff60d3430ead8101102608c1684ceba287046
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2016-09-13T18:42:47Z

    Make sure authentication_db for clustered is considered as users db
    
    Fixes the case when the following are configured to something other than _users
     - chttpd_auth.authentication_db
     - couch_httpd_auth.authentication_db
    
    For chttpd_auth only clustered db should be considered as users_db.
    For couch_http_db only node-local db should be considered.
    So we take wheither it is a clustered db into account in `is_usersdb/2`.
    
    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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    Isn't that obviously broken then? How would you ever match something with '/' in it to filename:basename(Anything)?
    
    Is there an intent to make this different than _replicator databases where we just look at the last component of the path? couch_replicator_manager:is_replicator/1 actually even hard codes that check to be `<<"_replicator">> == couch_db:dbname_suffix(DbName).`



---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    `chttpd_auth.autentication_db = "<cluster>/users"`
    `couch_httpd_auth.authentication_db = "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 issue #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    It seems a bit odd to have the system database feature flagged on an HTTP layer config option. Have we considered just removing both the chttpd and couch_httpd options and moving it to the `[couchdb]` section?


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    The PR has been re-written to merge two distinct settings `chttpd_auth.authentication_db` and `couch_httpd_auth.authentication_db` with a single one `couchdb.users_db_suffix`.  


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    Yes to in the [couchdb] section, no to the distinction between clustered and local. Just make "users_db_suffix = _users" and apply it the same across both. Not only do most people probably never change that (and honestly why is this even configurable to begin with?), who would want to have two different names for local vs clustered? That doesn't make any sense to me given that clients would have to have knowledge about that sort of thing and I've never once seen a client that even does anything other than the default _users db.


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    > @davisp:  who would want to have two different names for local vs clustered? 
    
    Cloudant!


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    Also it occurs to me that the check for the replicator here is broken since we hardcode that in couch_replicator_manager. We could be adding sys_db hooks to something the manager isn't looking at and not adding hooks for things it thinks are _replicator databases.


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    Also, yes, we'd have to update the docs, but I was hoping that'd be trivial and just require moving a paragraph or two and tweaking for the name.


---
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 #198: Make sure authentication_db for clustered i...

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

    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 issue #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    @davisp: How about the following?
    
    ```
    [couchdb]
    sys_dbs = _users, _replicator, _dbs, _nodes
    ```
    I don't really like it since it gives the user ability to shout themselves in the foot. However it would simplify `maybe_add_sys_db_callbacks`.


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    Erm, what do we call it other than _users? And if we do, why do we do that?


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    No it is not going to work because we set different set of callbacks for _users and _replicator.


---
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 #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    @davisp: We didn't consider it. Although in this case we would need to update documentation as well.
    Do you mean something like follows?
    
    ```
    [couchdb]
    
    clustered_users_db_suffix = _users
    node_local_users_db_suffix = _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 issue #198: Make sure authentication_db for clustered is consi...

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

    https://github.com/apache/couchdb-couch/pull/198
  
    @davisp: I did fix `_replicator` part of a PR.
    > Isn't that obviously broken then? How would you ever match something with '/' in it to filename:basename(Anything)?
    
    basename is needed to extract last component of the path. The `couch_db:normalize_dbname` makes sure we strip `couch` extension, creation_time and whatnot.  
    ```
    couch_db:1616: dbname_suffix_test_ ("long/co$mplex-/path+/_something" -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ (<<"long/co$mplex-/path+/_something">> -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ ("shards/00000000-3fffffff/long/co$mplex-/path+/_something.1415960794" -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ (<<"shards/00000000-3fffffff/long/co$mplex-/path+/_something.1415960794">> -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ ("shards/00000000-3fffffff/long/co$mplex-/path+/_something.1415960794.couch" -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ (<<"shards/00000000-3fffffff/long/co$mplex-/path+/_something.1415960794.couch">> -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ ("_something" -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ (<<"_something">> -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ ("shards/00000000-3fffffff/_something.1415960794" -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ (<<"shards/00000000-3fffffff/_something.1415960794">> -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ ("shards/00000000-3fffffff/_something.1415960794.couch" -> <<"_something">>)...ok
    couch_db:1616: dbname_suffix_test_ (<<"shards/00000000-3fffffff/_something.1415960794.couch">> -> <<"_something">>)...ok
    ```


---
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.
---