def METHOD_NAME() -> LDAPConnection:
    ldap_config_from_env_vars = dict(
        server_url=LDAP_SERVER,
        bind_dn=LDAP_BIND_DN,
        bind_password=LDAP_BIND_PASSWORD,
        base_dn=LDAP_BASE_DN,
        authentication_filter=LDAP_AUTHENTICATION_FILTER,
        authorization_filter=LDAP_AUTHORIZATION_FILTER,
        group_field=LDAP_GROUP_FIELD,
        roles_mapping=LDAP_ROLES_MAPPING,
    )
    try:
        ldap_config = get_repo_config().ldap_config
    except Exception:
        ldap_config = dict()
    merged = merge_dict(ldap_config_from_env_vars, ldap_config)
    return LDAPConnection(**merged)