CouchDB
  1. CouchDB
  2. COUCHDB-1431

DDoc name with underscore as first char produce invalid filters

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2, 1.3
    • Fix Version/s: None
    • Component/s: Database Core
    • Labels:
      None
    • Environment:

      Apache CouchDB 1.3.0a-5cece68-git
      Apache CouchDB 1.2.0a-0d8ddc8-git

    • Skill Level:
      New Contributors Level (Easy)

      Description

      CouchDB allows to create design document with id as `_design/_private`, but there is no way to use filters from it:

      $ curl -v http://localhost:5984/test/_changes?filter=_private/confidential

      • About to connect() to localhost port 5984 (#0)
      • Trying 127.0.0.1...
      • connected
      • Connected to localhost (127.0.0.1) port 5984 (#0)
        > GET /test/_changes?filter=_private/confidential HTTP/1.1
        > User-Agent: curl/7.24.0 (i686-pc-linux-gnu) libcurl/7.24.0 GnuTLS/2.10.5 zlib/1.2.5
        > Host: localhost:5984
        > Accept: /
        >
        < HTTP/1.1 400 Bad Request
        < Server: CouchDB/1.3.0a-5cece68-git (Erlang OTP/R14B04)
        < Date: Wed, 07 Mar 2012 04:51:06 GMT
        < Content-Type: text/plain; charset=utf-8
        < Content-Length: 63
        < Cache-Control: must-revalidate
        < {"error":"bad_request","reason":"unknown builtin filter name"}
      • Connection #0 to host localhost left intact
      • Closing connection #0

        Activity

        Hide
        Paul Joseph Davis added a comment -

        Wonky. Although as far as I see it, the bug here is that we allow the underscore after "_design/" not that we can't use filters from it. Anyone have other thoughts?

        Show
        Paul Joseph Davis added a comment - Wonky. Although as far as I see it, the bug here is that we allow the underscore after "_design/" not that we can't use filters from it. Anyone have other thoughts?
        Hide
        Jason Smith added a comment -

        I guess it makes sense that _design/_whatever is disallowed; but if CouchDB did that, it would entail whitelisting _design/_auth in the _users db, and _design/_replicator in /_replicator.

        Show
        Jason Smith added a comment - I guess it makes sense that _design/_whatever is disallowed; but if CouchDB did that, it would entail whitelisting _design/_auth in the _users db, and _design/_replicator in /_replicator.
        Hide
        Paul Joseph Davis added a comment -

        Interesting. If only someone had raised concerns about having such things as HTTP accessible databases that mandated API compatibility with non-system databases.

        Show
        Paul Joseph Davis added a comment - Interesting. If only someone had raised concerns about having such things as HTTP accessible databases that mandated API compatibility with non-system databases.

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexander Shorin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development