restrict consent-banner text length

Add a maxLength in of 64*1024 in the frontend and the api. We allow
a max body size of 512*1024 in the api (with patch [0]) so we should be
fine.

[0]: https://git.proxmox.com/?p=proxmox.git;a=commit;h=cf9e6c03a092acf8808ce83dad9249414fe4d588

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Link: https://lore.proxmox.com/20250410082052.53097-1-g.goller@proxmox.com
This commit is contained in:
Gabriel Goller 2025-04-10 10:20:52 +02:00 committed by Thomas Lamprecht
parent f9532a3a84
commit 427c687e35
2 changed files with 8 additions and 0 deletions

View File

@ -174,6 +174,11 @@ pub enum Translation {
"description" : {
optional: true,
schema: MULTI_LINE_COMMENT_SCHEMA,
},
"consent-text" : {
optional: true,
type: String,
max_length: 64 * 1024,
}
},
)]

View File

@ -59,6 +59,9 @@ Ext.define('PBS.NodeOptionView', {
name: 'consent-text',
text: gettext('Consent Text'),
deleteEmpty: true,
fieldOpts: {
maxLength: 64 * 1024,
},
onlineHelp: 'consent_banner',
},
],