couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [7/19] git commit: A debugger server
Date Mon, 11 Feb 2013 13:51:16 GMT
A debugger server


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

Branch: refs/heads/nodejs_couchdb
Commit: 41b895d1f5051fc7e7d22c4f1cc29f5bcc26c2ed
Parents: ea88ce7
Author: Jason Smith (work) <jhs@iriscouch.com>
Authored: Thu Feb 7 07:50:47 2013 +0000
Committer: Jason Smith (work) <jhs@iriscouch.com>
Committed: Thu Feb 7 07:50:47 2013 +0000

----------------------------------------------------------------------
 src/couchdb/Makefile.am           |    2 +
 src/couchdb/couch_httpd_debug.erl |   75 ++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/41b895d1/src/couchdb/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index 9fe19bc..fd86d59 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -50,6 +50,7 @@ source_files = \
     couch_httpd_db.erl \
     couch_httpd_auth.erl \
     couch_httpd_cors.erl \
+    couch_httpd_debug.erl \
     couch_httpd_oauth.erl \
     couch_httpd_external.erl \
     couch_httpd_misc_handlers.erl \
@@ -108,6 +109,7 @@ compiled_files = \
     couch_httpd_auth.beam \
     couch_httpd_oauth.beam \
     couch_httpd_cors.beam \
+    couch_httpd_debug.beam \
     couch_httpd_proxy.beam \
     couch_httpd_external.beam \
     couch_httpd_misc_handlers.beam \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/41b895d1/src/couchdb/couch_httpd_debug.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_debug.erl b/src/couchdb/couch_httpd_debug.erl
new file mode 100644
index 0000000..22a9a11
--- /dev/null
+++ b/src/couchdb/couch_httpd_debug.erl
@@ -0,0 +1,75 @@
+% 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_debug).
+-include("couch_db.hrl").
+
+-export([handle_debug_req/1]).
+
+-import(couch_httpd, [header_value/2, send_method_not_allowed/2]).
+
+
+handle_debug_req(#httpd{method='GET'}=Req) -> ok
+    , ok = couch_httpd:verify_is_server_admin(Req)
+    , couch_httpd:send_json(Req, 200, {[ {ok, true} ]})
+    .
+
+%% Login handler with Browser ID.
+%handle_id_req(#httpd{method='POST'}=Req) -> ok
+%    , case couch_config:get("browserid", "enabled")
+%        of "true" -> ok
+%            , case couch_config:get("browserid", "audience", undefined)
+%                of undefined -> ok
+%                    , throw({error, no_browserid_audience})
+%                ; Audience -> ok
+%                    , handle_id_req(enabled, Audience, Req)
+%                end
+%        ; _ -> ok
+%            % Browserid is disabled in the config.
+%            , throw({error, browserid_not_enabled})
+%        end
+%    ;
+%
+%handle_id_req(_Req) ->
+%    % Send 405
+%    not_implemented.
+%
+%handle_id_req(enabled, Audience, #httpd{method='POST', mochi_req=MochiReq}=Req) ->
+%    ReqBody = MochiReq:recv_body(),
+%    Form = case MochiReq:get_primary_header_value("content-type") of
+%        % content type should be json
+%        "application/x-www-form-urlencoded" ++ _ ->
+%            mochiweb_util:parse_qs(ReqBody);
+%        "application/json" ++ _ ->
+%            {Pairs} = ?JSON_DECODE(ReqBody),
+%            lists:map(fun({Key, Value}) ->
+%              {?b2l(Key), ?b2l(Value)}
+%            end, Pairs);
+%        _ ->
+%            []%couch_httpd:send_json(Req, 406, {error, method_not_allowed})
+%    end,
+%    Assertion = couch_util:get_value("assertion", Form, ""),
+%    case verify_id(Assertion, Audience) of
+%    {error, _Reason} ->
+%        % Send client an error response, couch_util:send_err ...
+%        not_implemented;
+%    {ok, Verified_obj} -> ok
+%        , send_good_id(Req, Verified_obj)
+%    end.
+
+
+%
+% Utilities
+%
+
+
+% vim: sts=4 sw=4 et


Mime
View raw message