Skip to content

Commit 0f48e4b

Browse files
committed
fixup
1 parent f9d1875 commit 0f48e4b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

deps/rabbitmq_auth_backend_ldap/src/rabbit_auth_backend_ldap_mgmt.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ unicode_format(Format, Args) ->
204204
format_password_for_logging(<<>>) ->
205205
"[empty]";
206206
format_password_for_logging(Password) ->
207-
io_lib:format("[~p bytes]", [byte_size(Password)]).
207+
io_lib:format("[~p characters]", [string:length(Password)]).
208208

209209
safe_parse_int(Value, FieldName) ->
210210
try

deps/rabbitmq_auth_backend_ldap/test/system_SUITE.erl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,25 @@ validate_ldap_configuration_via_api(Config) ->
424424
'servers' => "not_a_list",
425425
'port' => LdapPort
426426
}, ?BAD_REQUEST),
427+
428+
%% Network/Infrastructure scenarios
429+
%% Non-existent server
430+
http_put(Config, "/ldap/validate/simple-bind",
431+
#{
432+
'user_dn' => AliceUserDN,
433+
'password' => Password,
434+
'servers' => ["nonexistent.example.com"],
435+
'port' => LdapPort
436+
}, ?BAD_REQUEST),
437+
438+
%% Invalid hostname format
439+
http_put(Config, "/ldap/validate/simple-bind",
440+
#{
441+
'user_dn' => AliceUserDN,
442+
'password' => Password,
443+
'servers' => ["not..a..valid..hostname"],
444+
'port' => LdapPort
445+
}, ?BAD_REQUEST),
427446
http_put(Config, "/ldap/validate/simple-bind",
428447
#{
429448
'user_dn' => AliceUserDN,

0 commit comments

Comments
 (0)