From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <l.wagner@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 31F8F88A5
 for <pve-devel@lists.proxmox.com>; Fri, 28 Jul 2023 10:29:28 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 1310D13239
 for <pve-devel@lists.proxmox.com>; Fri, 28 Jul 2023 10:29:28 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Fri, 28 Jul 2023 10:29:27 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6ACB741E3F
 for <pve-devel@lists.proxmox.com>; Fri, 28 Jul 2023 10:29:27 +0200 (CEST)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Fri, 28 Jul 2023 10:29:26 +0200
Message-Id: <CUDNX7KTBHZU.1SFG6W92JAAYM@pali>
From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
 <c.heiss@proxmox.com>
X-Mailer: aerc 0.14.0
References: <20230727133341.1009881-1-c.heiss@proxmox.com>
 <20230727133341.1009881-2-c.heiss@proxmox.com>
In-Reply-To: <20230727133341.1009881-2-c.heiss@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.054 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: Re: [pve-devel] [PATCH access-control 1/2] api: domains: add
 off-by-default `check-connection` parameter
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Fri, 28 Jul 2023 08:29:28 -0000

On Thu Jul 27, 2023 at 3:33 PM CEST, Christoph Heiss wrote:
> Removes the dreaded DN regex, instead introducing a connect/bind check
> on creation/update, aligning it with the way PBS does it. This is
> enabled by default for new realms, but opt-in for existing, to not break
> backwards-compatibility.
>
> Additionally, it has the benefit that instead of letting a sync fail on
> the first try due to e.g. bad bind credentials, it gives the user some
> direct feedback when trying to add/update a LDAP realm, if enabled.
>
> Should be rather a corner case, but it's the easiest way for us to
> accomodate and the most versatile for users needing this.
>

I think it would be enough to have the 'check-connection' parameter only fo=
r
the API call itself, I wouldn't store it in the domains.cfg configuration
file.

That would imply that the 'Check configuration' checkbox that you introduce=
 in
the next patch could *always* be ticked, even for old realms. So whenever y=
ou
create/update an LDAP/AD realm configuration you have to explicitly tell it
"hey, I do not want the check right now, my LDAP server is down currently".

My main point in making the check behavior opt-in rather was so that
scripts/API consumers continue to work as before. For the GUI however, it
should be fine to just always check by default, unless the behavior is=20
explicitly turned off.

> +	},
> +	'check-connection' =3D> {
> +	    description =3D> 'Check bind connection to LDAP server.',
> +	    type =3D> 'boolean',
> +	    optional =3D> 1,
> +	    # TODO: Make it enabled-by-default with PVE 9.0?
                ^ This wouldn't be necessary any more.
> +	    default =3D> 0,
> +	},
>      };
>  }