summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILYA Khlopotov <iilyak@apache.org>2020-07-29 07:11:06 -0700
committerILYA Khlopotov <iilyak@apache.org>2020-07-30 05:10:08 -0700
commit8360026459ac969325357aabc3ecb9850365d589 (patch)
tree49328d3ee86907f86781d19e91e913ff0d4856ed
parent52d532727a3cc7b94516e9ba4b0e1c7ba447fd3c (diff)
downloadcouchdb-8360026459ac969325357aabc3ecb9850365d589.tar.gz
Do not log admin credentials
-rw-r--r--rebar.config.script2
-rw-r--r--src/chttpd/src/chttpd_node.erl4
-rw-r--r--src/setup/src/setup.erl2
3 files changed, 5 insertions, 3 deletions
diff --git a/rebar.config.script b/rebar.config.script
index f8a24163f..007724088 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -151,7 +151,7 @@ SubDirs = [
DepDescs = [
%% Independent Apps
-{config, "config", {tag, "2.1.7"}},
+{config, "config", {tag, "2.1.8"}},
{b64url, "b64url", {tag, "1.0.2"}},
{erlfdb, "erlfdb", {tag, "v1.2.2"}},
{ets_lru, "ets-lru", {tag, "1.1.0"}},
diff --git a/src/chttpd/src/chttpd_node.erl b/src/chttpd/src/chttpd_node.erl
index 033abd68d..1ca4bbd5e 100644
--- a/src/chttpd/src/chttpd_node.erl
+++ b/src/chttpd/src/chttpd_node.erl
@@ -70,7 +70,9 @@ handle_node_req(#httpd{method='PUT', path_parts=[_, Node, <<"_config">>, Section
Value = couch_util:trim(chttpd:json_body(Req)),
Persist = chttpd:header_value(Req, "X-Couch-Persist") /= "false",
OldValue = call_node(Node, config, get, [Section, Key, ""]),
- case call_node(Node, config, set, [Section, Key, ?b2l(Value), Persist]) of
+ IsSensitive = Section == <<"admins">>,
+ Opts = #{persisit => Persist, sensitive => IsSensitive},
+ case call_node(Node, config, set, [Section, Key, ?b2l(Value), Opts]) of
ok ->
send_json(Req, 200, list_to_binary(OldValue));
{error, Reason} ->
diff --git a/src/setup/src/setup.erl b/src/setup/src/setup.erl
index 3d23229b8..c748cbcdc 100644
--- a/src/setup/src/setup.erl
+++ b/src/setup/src/setup.erl
@@ -165,7 +165,7 @@ enable_cluster_int(Options, false) ->
couch_log:debug("Enable Cluster: ~p~n", [Options]).
set_admin(Username, Password) ->
- config:set("admins", binary_to_list(Username), binary_to_list(Password)).
+ config:set("admins", binary_to_list(Username), binary_to_list(Password), #{sensitive => true}).
setup_node(NewCredentials, NewBindAddress, NodeCount, Port) ->
case NewCredentials of