|
@@ -310,9 +310,6 @@ LDAP = ConfigSection(
|
|
|
BASE_DN=Config("base_dn",
|
|
BASE_DN=Config("base_dn",
|
|
|
default=None,
|
|
default=None,
|
|
|
help=_("The base LDAP distinguished name to use for LDAP search.")),
|
|
help=_("The base LDAP distinguished name to use for LDAP search.")),
|
|
|
- NT_DOMAIN=Config("nt_domain",
|
|
|
|
|
- default=None,
|
|
|
|
|
- help=_("The NT domain used for LDAP authentication.")),
|
|
|
|
|
LDAP_URL=Config("ldap_url",
|
|
LDAP_URL=Config("ldap_url",
|
|
|
default=None,
|
|
default=None,
|
|
|
help=_("The LDAP URL to connect to.")),
|
|
help=_("The LDAP URL to connect to.")),
|
|
@@ -323,9 +320,6 @@ LDAP = ConfigSection(
|
|
|
LDAP_CERT=Config("ldap_cert",
|
|
LDAP_CERT=Config("ldap_cert",
|
|
|
default=None,
|
|
default=None,
|
|
|
help=_("A PEM-format file containing certificates for the CA's that Hue will trust for authentication over TLS. The certificate for the CA that signed the LDAP server certificate must be included among these certificates. See more here http://www.openldap.org/doc/admin24/tls.html.")),
|
|
help=_("A PEM-format file containing certificates for the CA's that Hue will trust for authentication over TLS. The certificate for the CA that signed the LDAP server certificate must be included among these certificates. See more here http://www.openldap.org/doc/admin24/tls.html.")),
|
|
|
- LDAP_USERNAME_PATTERN=Config("ldap_username_pattern",
|
|
|
|
|
- default=None,
|
|
|
|
|
- help=_("A pattern to use for constructing LDAP usernames.")),
|
|
|
|
|
BIND_DN=Config("bind_dn",
|
|
BIND_DN=Config("bind_dn",
|
|
|
default=None,
|
|
default=None,
|
|
|
help=_("The distinguished name to bind as, when importing from LDAP.")),
|
|
help=_("The distinguished name to bind as, when importing from LDAP.")),
|
|
@@ -526,24 +520,13 @@ def config_validator(user):
|
|
|
res.extend(validate_path(KERBEROS.KINIT_PATH, is_dir=False))
|
|
res.extend(validate_path(KERBEROS.KINIT_PATH, is_dir=False))
|
|
|
res.extend(validate_path(KERBEROS.CCACHE_PATH, is_dir=False))
|
|
res.extend(validate_path(KERBEROS.CCACHE_PATH, is_dir=False))
|
|
|
|
|
|
|
|
- if LDAP.NT_DOMAIN.get() is not None or \
|
|
|
|
|
- LDAP.LDAP_USERNAME_PATTERN.get() is not None:
|
|
|
|
|
- if LDAP.LDAP_URL.get() is None:
|
|
|
|
|
- res.append((LDAP.LDAP_URL,
|
|
|
|
|
- unicode(_("LDAP is only partially configured. An LDAP URL must be provided."))))
|
|
|
|
|
-
|
|
|
|
|
- if LDAP.LDAP_URL.get() is not None:
|
|
|
|
|
- if LDAP.NT_DOMAIN.get() is None and \
|
|
|
|
|
- LDAP.LDAP_USERNAME_PATTERN.get() is None:
|
|
|
|
|
- res.append((LDAP.LDAP_URL,
|
|
|
|
|
- unicode(_("LDAP is only partially configured. An NT Domain or username "
|
|
|
|
|
- "search pattern must be provided."))))
|
|
|
|
|
-
|
|
|
|
|
- if LDAP.LDAP_USERNAME_PATTERN.get() is not None and \
|
|
|
|
|
- '<username>' not in LDAP.LDAP_USERNAME_PATTERN.get():
|
|
|
|
|
- res.append(LDAP.LDAP_USERNAME_PATTERN,
|
|
|
|
|
- unicode(_("The LDAP username pattern should contain the special"
|
|
|
|
|
- "<username> replacement string for authentication.")))
|
|
|
|
|
|
|
+ if LDAP.LDAP_URL.get() is None:
|
|
|
|
|
+ res.append((LDAP.LDAP_URL,
|
|
|
|
|
+ unicode(_("LDAP is only partially configured. An LDAP URL must be provided."))))
|
|
|
|
|
|
|
|
|
|
+ if LDAP.BIND_DN.get():
|
|
|
|
|
+ if LDAP.BIND_PASSWORD.get() is None:
|
|
|
|
|
+ res.append((LDAP.BIND_PASSWORD,
|
|
|
|
|
+ unicode(_("If you set bind_dn, then you must set bind_password."))))
|
|
|
|
|
|
|
|
return res
|
|
return res
|