From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id B3E341FF0AA for ; Tue, 17 Nov 2026 14:30:29 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E9363216BE; Tue, 17 Nov 2026 14:30:14 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 17 Nov 2026 14:30:00 +0100 Message-Id: To: "Thomas Lamprecht" , Subject: Re: [PATCH v2 cluster 3/19] datacenter config: token policy: allow extension on regeneration X-Mailer: aerc 0.20.0 References: <20261115194043.3947825-1-t.lamprecht@proxmox.com> <20261115194043.3947825-4-t.lamprecht@proxmox.com> In-Reply-To: <20261115194043.3947825-4-t.lamprecht@proxmox.com> From: "Shannon Sterz" X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794922200408 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.583 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 64CJY4EGYMFFC4UHBIP5QAOS33UF7WC4 X-Message-ID-Hash: 64CJY4EGYMFFC4UHBIP5QAOS33UF7WC4 X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Sun Nov 15, 2026 at 8:40 PM CET, Thomas Lamprecht wrote: > With 'disallow-expiry-extension' set, keeping an integration running > past the maximum lifetime needs a new token with all its permissions > set up again. As creating that token is always possible, the > restriction mostly adds work and discourages narrowly scoped tokens. > > Extending a token together with regenerating its secret has the same > effect as recreating it, as the old credential stops working. Add a > setting that allows exactly that, so tools can rotate their tokens in > place, within the maximum lifetime. > > Suggested-by: Shannon Sterz > Signed-off-by: Thomas Lamprecht > --- > > new in v2 > > src/PVE/DataCenterConfig.pm | 8 ++++++++ > src/test/test_token_policy.pl | 3 +++ > 2 files changed, 11 insertions(+) > > diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm > index 330126b..49d1bb6 100644 > --- a/src/PVE/DataCenterConfig.pm > +++ b/src/PVE/DataCenterConfig.pm > @@ -303,6 +303,14 @@ my $token_policy_format =3D { > . " lifetime instead of rejecting them, for example for tool= s unaware of the policy." > . " Has no effect without 'max-lifetime'.", > }, > + 'allow-extension-on-regenerate' =3D> { > + type =3D> 'boolean', > + optional =3D> 1, > + default =3D> 0, nit: `0` being the more cumbersome setting with little upside since recreating tokens is still possible makes it sound like a bad default. maybe add a sentence why it should be the default or change the default to one `1`. for example: Nonetheless, 0 is chosen as the default as allowing the expiry to be extended even by regeneration may not match an admins expectations. -->8 snip 8<--