fluent/fluentd-ui — pull request #92 by kou (2014-10-11 07:07:00+00:00)
Title: Support authentication by LDAP

The current authentication system stores password into local file. It is OK for using one fluentd-ui.

But it is not good when user has two or more fluentd-ui. User needs to change the default password N times. If user wants to change the current password, user needs to change the current password N times.

The pull request adds LDAP authentication support to fluentd-ui. If fluentd-ui can use LDAP authentication, user doesn't need to change the default (or current) password N times. User just only change one time.

If fluentd-ui product doesn't expected to be used with N fluentd-ui instances, this pull request will be rejected.

To use LDAP authentication, user needs to change the following two configuration file:

* config/ldap.yml (NEW!)
* config/application.yml

See config/ldap.yml.example for config/ldap.yml details. Most of LDAP configurations are included in [LDAP URL](https://www.ietf.org/rfc/rfc2255.txt).

This pull requests adds `authentication_methods` parameter into config/application.yml. It is used to enable LDAP authentication. LDAP authentication is disabled by default even if config/ldap.yml exists.

Why do I introduce `authentication_methods` parameter? Because I want to disable LDAP support without removing config/ldap.yml.

Configuration files in Rails include three type configurations: test, development and production. config.ldap.yml should also have them because it is also an Rails application configuration file.

There two options where we should put enable/disable LDAP authentication flag. They are config/ldap.yml or config/application.yml.

I choose config/application.yml because whether is LDAP authentication used or not is decided in `User` model. It is not `LdapAuthenticator`. If it is a work of `LdapAuthenticator`, config/ldap.yml is a good place. If it is a work of `User` model, config/application.yml. So I choose config/application.yml.