Skip to content

Commit

Permalink
Return pkey pass settings in GET /certificate/node/<node>
Browse files Browse the repository at this point in the history
... so it can be shown in CLI and UI

Change-Id: I2442f835b2211e374c1d8242000b817106d4eee5
Reviewed-on: http://review.couchbase.org/c/ns_server/+/162960
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
Tested-by: Timofey Barmin <timofey.barmin@couchbase.com>
  • Loading branch information
timofey-barmin committed Oct 7, 2021
1 parent 3494afb commit 8bd71e2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/menelaus_web_cert.erl
Expand Up @@ -146,6 +146,19 @@ jsonify_cert_props(Props) ->
K =:= id;
K =:= type ->
true;
({pkey_passphrase_settings, PKeySettings}) ->
PKeySettingsJSON =
{lists:map(
fun ({password, _}) ->
{password, <<"********">>};
({args, Args}) ->
{args, [iolist_to_binary(A) || A <- Args]};
({httpsOpts, Opts}) ->
{httpsOpts, {Opts}};
(KV) ->
KV
end, PKeySettings)},
{true, {privateKeyPassphrase, PKeySettingsJSON}};
({_, _}) ->
false
end, Props)}.
Expand Down Expand Up @@ -394,6 +407,7 @@ handle_get_node_certificate(NodeId, Req) ->
({not_after, V}) -> {true, {expires, V}};
({pem, _}) -> true;
({type, _}) -> true;
({pkey_passphrase_settings, _}) -> true;
(_) -> false
end, Props),
CertJson = jsonify_cert_props(Filtered),
Expand Down

0 comments on commit 8bd71e2

Please sign in to comment.