Re-formatted start/2

This commit is contained in:
Ariel Otilibili 2024-01-02 18:58:58 +01:00
parent 7db274ee7d
commit 12648bd73b
1 changed files with 4 additions and 10 deletions

View File

@ -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