def METHOD_NAME(username):
    """Get LDAP config from environment."""
    ldap_search_filter_template = os.environ.get("LDAP_SEARCH_FILTER", "(|(uid=$username)(cn=$username))")
    return {
        "ldap_root_dn": os.environ.get("LDAP_ROOT_DN", "dc=example,dc=org"),
        "ldap_urls": os.environ.get("LDAP_URL", "ldap://localhost:389").split(","),
        "ldap_lookup_user_dn": os.environ.get("LDAP_LOOKUP_USER_DN", "cn=admin,dc=example,dc=org"),
        "ldap_lookup_user_pw": os.environ.get("LDAP_LOOKUP_USER_PASSWORD", "admin"),
        "ldap_search_filter": string.Template(ldap_search_filter_template).substitute(username=username),
    }