You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/07/21 15:16:29 UTC

[2/3] couch commit: updated refs/heads/master to 6c7cd6a

Use dynamic handler for `_oauth`


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/e41205f3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/e41205f3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/e41205f3

Branch: refs/heads/master
Commit: e41205f393e1440003927539c53ab1a83d53ac9f
Parents: c70c966
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Fri Jul 17 10:59:06 2015 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Fri Jul 17 10:59:06 2015 -0700

----------------------------------------------------------------------
 src/couch_httpd_handlers.erl | 22 ++++++++++++++++++++++
 src/couch_secondary_sup.erl  |  5 ++++-
 2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/e41205f3/src/couch_httpd_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_handlers.erl b/src/couch_httpd_handlers.erl
new file mode 100644
index 0000000..b8ee3ef
--- /dev/null
+++ b/src/couch_httpd_handlers.erl
@@ -0,0 +1,22 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License.  You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_httpd_handlers).
+
+-export([url_handler/1, db_handler/1, design_handler/1]).
+
+url_handler(<<"_oauth">>)          -> fun couch_httpd_oauth:handle_oauth_req/1;
+url_handler(_) -> no_match.
+
+db_handler(_) -> no_match.
+
+design_handler(_) -> no_match.

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/e41205f3/src/couch_secondary_sup.erl
----------------------------------------------------------------------
diff --git a/src/couch_secondary_sup.erl b/src/couch_secondary_sup.erl
index 09e77b7..4bda4ef 100644
--- a/src/couch_secondary_sup.erl
+++ b/src/couch_secondary_sup.erl
@@ -26,7 +26,10 @@ init([]) ->
             worker,
             dynamic}
     ],
-    Children = SecondarySupervisors ++ [
+    ServiceProviders = [
+        chttpd_handlers:provider(couch, couch_httpd_handlers)
+    ],
+    Children = SecondarySupervisors ++ ServiceProviders ++ [
         begin
             {ok, {Module, Fun, Args}} = couch_util:parse_term(SpecStr),