@@ -352,6 +352,40 @@ validate_ldap_configuration_via_api(Config) ->
352352 % % Should NOT contain GET or HEAD
353353 ? assertEqual (0 , string :str (string :to_upper (AllowHeader ), " GET" )),
354354 ? assertEqual (0 , string :str (string :to_upper (AllowHeader ), " HEAD" )),
355+
356+ % % Missing required fields tests
357+ % % Empty servers array - connection failure (400)
358+ http_put (Config , " /ldap/validate/simple-bind" ,
359+ #{
360+ 'user_dn' => AliceUserDN ,
361+ 'password' => Password ,
362+ 'servers' => [],
363+ 'port' => LdapPort
364+ }, ? BAD_REQUEST ),
365+
366+ % % Missing servers field entirely - defaults to [], same as above (400)
367+ http_put (Config , " /ldap/validate/simple-bind" ,
368+ #{
369+ 'user_dn' => AliceUserDN ,
370+ 'password' => Password ,
371+ 'port' => LdapPort
372+ }, ? BAD_REQUEST ),
373+
374+ % % Missing user_dn field entirely - empty DN fails credential validation (422)
375+ http_put (Config , " /ldap/validate/simple-bind" ,
376+ #{
377+ 'password' => Password ,
378+ 'servers' => [" localhost" ],
379+ 'port' => LdapPort
380+ }, ? UNPROCESSABLE_ENTITY ),
381+
382+ % % Missing password field entirely - empty password fails credential validation (422)
383+ http_put (Config , " /ldap/validate/simple-bind" ,
384+ #{
385+ 'user_dn' => AliceUserDN ,
386+ 'servers' => [" localhost" ],
387+ 'port' => LdapPort
388+ }, ? UNPROCESSABLE_ENTITY ),
355389 http_put (Config , " /ldap/validate/simple-bind" ,
356390 #{
357391 'user_dn' => AliceUserDN ,
0 commit comments