SUSE / velum

Dashboard for CaaS Platform clusters (v1, v2 and v3)
https://www.suse.com/
Apache License 2.0
54 stars 30 forks source link

Added LDAP Connector validation button and logic #616

Closed danielorf closed 6 years ago

danielorf commented 6 years ago

Added new controller "ldap_test_controller". Updated _form.html.slim to add test button and message. Updated application.js to add jquery logic to test button in place and modify message. Updated routes.rb for new controller. Added RSpec tests.

Other notes: RSpec tests require a working LDAP server. Additionally, the LDAP server must allow for anonymous binds, support TLS and be populated with at least one user having "objectClass=person". The certificate in the tests is pulled from the dockerized LDAP server used during development/testing and can be found here: https://github.com/osixia/docker-openldap

There are coverage guards/exceptions around two "rescue StandardError" code blocks in ldap_test_controller.rb. These blocks are fail-safes in case the error-handling blocks above them fail to catch an error. Fail-safes are deemed necessary in both cases because the "begin" blocks run "net/ldap" code which is light on documentation regarding errors. We are not currently aware of a state that will enter these "rescue StandardError" code blocks, thus they are skipped in testing.

vitoravelino commented 6 years ago

Besides my latest comments, LGTM.

Another thing, travis is failing because of coverage.

vitoravelino commented 6 years ago

Could you rebase it once again?

vitoravelino commented 6 years ago

It would be helpful for docs if you could add some screenshots.