[pve-devel] [PATCH v2 manager 2/2] ui: cert upload: fix private key field sending empty string

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Mar 7 11:53:44 CET 2023


On March 3, 2023 6:57 pm, Max Carrara wrote:
> The private key's field is now excluded from the upload form's
> JSON data if it's considered empty by Ext.js.
> 
> Prior to this change, the form still sent an empty string if no
> private key was provided by the user, even though the private key's
> field is marked as optional in `pve-manager/PVE/API2/Certificates.pm`,
> causing the JSONSchema validation to fail.
> 
> Signed-off-by: Max Carrara <m.carrara at proxmox.com>

Reviewed-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>

didn't apply for now, as without the additional check it actually makes the
pitfall a bit worse ;)

> ---
>  www/manager6/node/Certificates.js | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/www/manager6/node/Certificates.js b/www/manager6/node/Certificates.js
> index 34013b44..84fc12ff 100644
> --- a/www/manager6/node/Certificates.js
> +++ b/www/manager6/node/Certificates.js
> @@ -173,6 +173,9 @@ Ext.define('PVE.node.CertUpload', {
>  	    emptyText: gettext('No change'),
>  	    name: 'key',
>  	    xtype: 'textarea',
> +	    getSubmitValue: function() {
> +		return this.getValue() || null;
> +	    },
>  	},
>  	{
>  	    xtype: 'filebutton',
> -- 
> 2.30.2
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 





More information about the pve-devel mailing list