]> git.proxmox.com Git - pve-access-control.git/commitdiff
api: user: add pattern for user keys option
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 8 Feb 2024 09:45:39 +0000 (10:45 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 8 Feb 2024 10:08:49 +0000 (11:08 +0100)
While nowadays, most entries should be just 'x', there can also still
be legacy entries with 'x!u2f', 'x!yubico' and base32 encoded secrets.
For example, some users might be syncing them from LDAP.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
src/PVE/API2/User.pm

index a2e5be09a846fb775f2ad3e221fd6ed99baa3ff0..2220d8f5c73b57c3ecc892d093114efbc465777b 100644 (file)
@@ -36,6 +36,7 @@ register_standard_option('user-comment', { type => 'string', optional => 1 });
 register_standard_option('user-keys', {
     description => "Keys for two factor auth (yubico).",
     type => 'string',
+    pattern => '[0-9a-zA-Z!=]{0,4096}',
     optional => 1,
 });
 register_standard_option('group-list', {