Skip to content

Commit

Permalink
Re-formatted start/2
Browse files Browse the repository at this point in the history
  • Loading branch information
ariel-anieli authored and michaelklishin committed Feb 1, 2024
1 parent 4923b10 commit 33c7a5c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions deps/amqp_client/src/amqp_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,14 @@ start(AmqpParams) ->
%% user specified connection name.
start(AmqpParams, ConnName) when ConnName == undefined; is_binary(ConnName) ->
ensure_started(),
ObfuscateFn = fun credentials_obfuscation:encrypt/1,
ToPropList = fun rabbit_data_coercion:to_proplist/1,
AmqpParams0 =
case AmqpParams of
#amqp_params_direct{password = Password, client_properties = Props} ->
AmqpParams#amqp_params_direct{
password = ObfuscateFn(Password),
client_properties = ToPropList(Props)
};
AmqpParams#amqp_params_direct{password = credentials_obfuscation:encrypt(Password),
client_properties = rabbit_data_coercion:to_proplist(Props)};
#amqp_params_network{password = Password, client_properties = Props} ->
AmqpParams#amqp_params_network{
password = ObfuscateFn(Password),
client_properties = ToPropList(Props)
}
AmqpParams#amqp_params_network{password = credentials_obfuscation:encrypt(Password),
client_properties = rabbit_data_coercion:to_proplist(Props)}
end,
AmqpParams1 =
case AmqpParams0 of
Expand Down

0 comments on commit 33c7a5c

Please sign in to comment.