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

[1/2] chttpd commit: updated refs/heads/master to f86de50

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 5022a94d3 -> f86de505a


Don't allow security updates during cassim migration


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

Branch: refs/heads/master
Commit: df0da709d09fef7676d9ab436b58a6543ce6b7c4
Parents: 5022a94
Author: Russell Branca <ch...@apache.org>
Authored: Fri Jun 26 22:30:23 2015 +0000
Committer: Russell Branca <ch...@apache.org>
Committed: Tue Jul 21 20:50:17 2015 +0000

----------------------------------------------------------------------
 src/chttpd.erl    |  3 +++
 src/chttpd_db.erl | 10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/df0da709/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 1b12db0..539eae1 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -767,6 +767,9 @@ error_info({missing_stub, Reason}) ->
     {412, <<"missing_stub">>, Reason};
 error_info(request_entity_too_large) ->
     {413, <<"too_large">>, <<"the request entity is too large">>};
+error_info({error, security_migration_updates_disabled}) ->
+    {503, <<"security_migration">>, <<"Updates to security docs are disabled during "
+        "security migration.">>};
 error_info(not_implemented) ->
     {501, <<"not_implemented">>, <<"this feature is not yet implemented">>};
 error_info(timeout) ->

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/df0da709/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 207bc3f..97a70e5 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -1433,8 +1433,8 @@ 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() of
-        true ->
+    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),
@@ -1464,7 +1464,11 @@ put_security(#httpd{user_ctx=Ctx}=Req, Db, FetchRev) ->
             HttpCode = http_code_from_status(Status),
             ResponseHeaders = [{"Etag", Etag}],
             send_json(Req, HttpCode, ResponseHeaders, Body);
-        false ->
+        {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 ->


[2/2] chttpd commit: updated refs/heads/master to f86de50

Posted by ch...@apache.org.
Merge branch 'add-manual-migration-logic'


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

Branch: refs/heads/master
Commit: f86de505acdaab8e796c0694b388589b9c067792
Parents: 5022a94 df0da70
Author: Russell Branca <ch...@apache.org>
Authored: Tue Jul 21 20:51:01 2015 +0000
Committer: Russell Branca <ch...@apache.org>
Committed: Tue Jul 21 20:51:01 2015 +0000

----------------------------------------------------------------------
 src/chttpd.erl    |  3 +++
 src/chttpd_db.erl | 10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------