placed the file in the discourse/lib/validators/ldap_setting_validator.rband it worked,
discourse/lib/validators/ldap_setting_validator.rb
forum_ldap_validation: default: 'system' validator: 'LdapSettingValidator'
how to make the code work from the plugin?