From 9722531817dbe6178748c9938d9491ff9b1fab0e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 26 Jan 2021 09:53:29 -0800 Subject: [PATCH] fix: purge LDAP deprecated keys --- cmd/config/identity/ldap/config.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/config/identity/ldap/config.go b/cmd/config/identity/ldap/config.go index 42a001c77..cd7dfeef9 100644 --- a/cmd/config/identity/ldap/config.go +++ b/cmd/config/identity/ldap/config.go @@ -103,6 +103,11 @@ const ( EnvLookupBindPassword = "MINIO_IDENTITY_LDAP_LOOKUP_BIND_PASSWORD" ) +var removedKeys = []string{ + "username_search_filter", + "username_search_base_dn", +} + // DefaultKVS - default config for LDAP config var ( DefaultKVS = config.KVS{ @@ -366,6 +371,12 @@ func Enabled(kvs config.KVS) bool { // Lookup - initializes LDAP config, overrides config, if any ENV values are set. func Lookup(kvs config.KVS, rootCAs *x509.CertPool) (l Config, err error) { l = Config{} + + // Purge all removed keys first + for _, k := range removedKeys { + kvs.Delete(k) + } + if err = config.CheckValidKeys(config.IdentityLDAPSubSys, kvs, DefaultKVS); err != nil { return l, err }