Support non ActiveDirectory LDAP
This PR has an optional local portal setup against this docker container - https://github.com/rroemhild/docker-test-openldap
The base modifications for LDAP was to change the actual authentication flow. Before, we only attempted to bind (setting up a DirContext and relying on an exception). We would test all of the search bases until we exhausted the list.
The new approach works differently:
1. First, login using the main service account
2. Second, do a lookup of the user
3. Finally, attempt to bind to that user's context directly using the password provided.
This works fine with both AD LDAP as well as the example docker container which uses OpenLDAP
Besides these changes, need to make configurable the userNameField, which is the ldap attribute that is used to search for the username sent in the login screen. In AD, this is `sAMAccountName`, but in the example it is `uid`, the logon field is up to the way LDAP is setup
- `docker-up-vinyldns.sh` - fixed a quote issue with the startup script to properly send in the version of vinyldns
- `docker-compose-build.yml` - added the `ldap` container so the portal can connect as `vinyldns-ldap`
- `docker/portal/application.conf` - new config file so that we can connect to the new ldap container
- `docker-compose.yml` - added the `ldap` container here as well so we can play with it using `reStart` in sbt instead of `docker-up-vinyldns.sh` - simplifies local testing
- `LdapAuthenticator.scala` - this is where the main changes happen
* Add task and task handler.
* Update tests.
* Updates.
* Updates based on feedback (rebstar6).
* Update tests.
* Updates based on feedback (rebstar6).
* Add log for sync error.
* Change handleError to handleErrorWith.
* WIP
* WIP
* Use new TaskScheduler
* Fixing unit test
* Cleanup errant change
* Update LDAP to handle more explicit cases so that UserDoesNotExistException is only returned when it truly does not exist and there are no other external factors.
* Update tests.
* Update return condition for findUserDetails, only allowing UserDoesNotException to indicate success.
Replace the repos in the portal with dynamodb and core
* Remove all data stores from the portal
* Use the user and user change repository from core and dynamodb
* Remove the UserAccount type, use core User instead
* Remove the UserChangeLog types, use core UserChange instead
* Clean up duplication in VinylDNS
* Moved `Module` to `modules.VinylDNSModule`. The reason is that
you cannot disable the "default" module for unit tests.
* Use mock configuration for VinylDNSSpec and FrontendControllerSpec.
The mock app configuration is what allows us to run without dynamodb
* Added a TestApplicationData trait to cut down on duplication