api: user: limit maximum length for certain properties

The user.cfg file resides on the cluster filesystem where files have
a maximum allowed size (currently 1 MiB).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2024-02-08 10:45:41 +01:00 committed by Thomas Lamprecht
parent 793039db4d
commit 04712fc464

View File

@ -29,10 +29,19 @@ register_standard_option('user-expire', {
minimum => 0, minimum => 0,
optional => 1, optional => 1,
}); });
register_standard_option('user-firstname', { type => 'string', optional => 1 }); register_standard_option('user-firstname', { type => 'string', optional => 1, maxLength => 1024, });
register_standard_option('user-lastname', { type => 'string', optional => 1 }); register_standard_option('user-lastname', { type => 'string', optional => 1, maxLength => 1024, });
register_standard_option('user-email', { type => 'string', optional => 1, format => 'email-opt' }); register_standard_option('user-email', {
register_standard_option('user-comment', { type => 'string', optional => 1 }); type => 'string',
optional => 1,
format => 'email-opt',
maxLength => 4096,
});
register_standard_option('user-comment', {
type => 'string',
optional => 1,
maxLength => 8192,
});
register_standard_option('user-keys', { register_standard_option('user-keys', {
description => "Keys for two factor auth (yubico).", description => "Keys for two factor auth (yubico).",
type => 'string', type => 'string',