couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject chttpd commit: updated refs/heads/no-cassim to 5a693d3
Date Fri, 13 May 2016 11:15:51 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/no-cassim [created] 5a693d328


disable cassim until fixed


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

Branch: refs/heads/no-cassim
Commit: 5a693d328e6d5bd1713fd78cd8f4609c69dec7d6
Parents: 7cffe7e
Author: Jan Lehnardt <jan@apache.org>
Authored: Fri May 13 12:55:38 2016 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Fri May 13 13:14:26 2016 +0200

----------------------------------------------------------------------
 src/chttpd.app.src          |  3 +-
 src/chttpd_auth_request.erl |  3 +-
 src/chttpd_db.erl           | 61 +++++-----------------------------------
 src/chttpd_external.erl     |  2 +-
 4 files changed, 10 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/5a693d32/src/chttpd.app.src
----------------------------------------------------------------------
diff --git a/src/chttpd.app.src b/src/chttpd.app.src
index 2230849..5561994 100644
--- a/src/chttpd.app.src
+++ b/src/chttpd.app.src
@@ -40,8 +40,7 @@
         config,
         couch,
         ets_lru,
-        fabric,
-        cassim
+        fabric
     ]},
     {mod, {chttpd_app,[]}}
 ]}.

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/5a693d32/src/chttpd_auth_request.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_auth_request.erl b/src/chttpd_auth_request.erl
index 5d85cb0..20a1aeb 100644
--- a/src/chttpd_auth_request.erl
+++ b/src/chttpd_auth_request.erl
@@ -75,8 +75,7 @@ server_authorization_check(#httpd{method=Method, path_parts=[<<"_utils">>|_]}=Re
 server_authorization_check(#httpd{path_parts=[<<"_", _/binary>>|_]}=Req) ->
     require_admin(Req).
 
-db_authorization_check(#httpd{path_parts=[DbName|_],user_ctx=Ctx}=Req) ->
-    {_} = cassim:get_security(DbName, [{user_ctx, Ctx}]),
+db_authorization_check(Req) ->
     Req.
 
 require_admin(Req) ->

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/5a693d32/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 9347c1a..391ce3b 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -291,7 +291,6 @@ delete_db_req(#httpd{}=Req, DbName) ->
     end.
 
 do_db_req(#httpd{path_parts=[DbName|_], user_ctx=Ctx}=Req, Fun) ->
-    cassim:get_security(DbName, [{user_ctx,Ctx}]), % calls check_is_reader
     Fun(Req, #db{name=DbName, user_ctx=Ctx}).
 
 db_req(#httpd{method='GET',path_parts=[DbName]}=Req, _Db) ->
@@ -550,20 +549,11 @@ db_req(#httpd{method='PUT',path_parts=[_,<<"_security">>]}=Req,
Db) ->
     put_security(Req, Db, true);
 
 db_req(#httpd{method='GET',path_parts=[_,<<"_security">>],user_ctx=Ctx}=Req,
Db) ->
-    send_json(Req, cassim:get_security(Db, [{user_ctx,Ctx}]));
+    send_json(Req, couch_db:get_security(Db));
 
 db_req(#httpd{path_parts=[_,<<"_security">>]}=Req, _Db) ->
     send_method_not_allowed(Req, "PUT,GET");
 
-db_req(#httpd{method='PUT',path_parts=[_,<<"_security_mvcc">>]}=Req, Db) ->
-    put_security(Req, Db, false);
-
-db_req(#httpd{method='GET',path_parts=[_,<<"_security_mvcc">>],user_ctx=Ctx}=Req,
Db) ->
-    send_json(Req, cassim:get_security(Db, [{user_ctx,Ctx}]));
-
-db_req(#httpd{path_parts=[_,<<"_security_mvcc">>]}=Req, _Db) ->
-    send_method_not_allowed(Req, "PUT,GET");
-
 db_req(#httpd{method='PUT',path_parts=[_,<<"_revs_limit">>],user_ctx=Ctx}=Req,
         Db) ->
     Limit = chttpd:json_body(Req),
@@ -1491,49 +1481,12 @@ demonitor_refs(Refs) when is_list(Refs) ->
 %% record makes it difficult to separate. This function should be refactored and
 %% moved into cassim once couch_doc_from_req and update_doc are reworked.
 put_security(#httpd{user_ctx=Ctx}=Req, Db, FetchRev) ->
-    case {cassim:is_enabled(), cassim:metadata_db_exists()} of
-        {true, true} ->
-            DbName = Db#db.name,
-            DocId = cassim_metadata_cache:security_meta_id(DbName),
-            {SecObj0} = chttpd:json_body(Req),
-            {OldSecDoc} = cassim:get_security(DbName),
-            OldRev = couch_util:get_value(<<"_rev">>, OldSecDoc, undefined),
-            %% Maybe update the security doc with the rev when hiding mvcc logic
-            SecObj = case {FetchRev, OldRev} of
-                %% User supplied rev, just use the req body
-                {false, _} ->
-                    SecObj0;
-                %% User did not supply rev, but new security doc
-                {true, undefined} ->
-                    SecObj0;
-                %% User did not supply rev, use the old rev
-                {true, OldRev} ->
-                    [{<<"_rev">>, OldRev}|proplists:delete(<<"_rev">>,
SecObj0)]
-            end,
-            SecDoc = couch_doc_from_req(Req, DocId, {SecObj}),
-            Options = [
-                delay_commit,
-                interactive_edit,
-                {user_ctx, Ctx},
-                {w, integer_to_list(mem3:quorum(Db))}
-            ],
-            {Status, {etag, Etag}, Body} =
-                cassim:set_security(Db, SecDoc, Options),
-            HttpCode = http_code_from_status(Status),
-            ResponseHeaders = [{"Etag", Etag}],
-            send_json(Req, HttpCode, ResponseHeaders, Body);
-        {false, true} ->
-            throw({error, security_migration_updates_disabled});
-        %% handle completely disabled case and also cassim setting enabled but
-        %% metadata db does not exist.
-        _ ->
-            SecObj = chttpd:json_body(Req),
-            case fabric:set_security(Db, SecObj, [{user_ctx, Ctx}]) of
-                ok ->
-                    send_json(Req, {[{<<"ok">>, true}]});
-                Else ->
-                    throw(Else)
-            end
+    SecObj = chttpd:json_body(Req),
+    case fabric:set_security(Db, SecObj, [{user_ctx, Ctx}]) of
+        ok ->
+            send_json(Req, {[{<<"ok">>, true}]});
+        Else ->
+            throw(Else)
     end.
 
 set_namespace(<<"_all_docs">>, Args) ->

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/5a693d32/src/chttpd_external.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_external.erl b/src/chttpd_external.erl
index f9bebed..a0850b1 100644
--- a/src/chttpd_external.erl
+++ b/src/chttpd_external.erl
@@ -123,7 +123,7 @@ get_db_info(#db{} = Db) ->
 
 
 get_db_security(#db{main_pid = nil}=Db, #user_ctx{}=UserCtx) ->
-    cassim:get_security(Db, [{user_ctx, UserCtx}]);
+    couch_db:get_security(Db);
 get_db_security(#db{}=Db, #user_ctx{}) ->
     couch_db:get_security(Db).
 


Mime
View raw message