This adds a regex check for valid fingerprints.

Signed-off-by: Maximiliano Sandoval <m.sando...@proxmox.com>
---

Diferences from v1:
 - Use get_standard_option

 PVE/API2/Nodes.pm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 1db148af..8dddf58b 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -2566,11 +2566,10 @@ __PACKAGE__->register_method ({
                    optional => 1,
                    renderer => 'duration',
                },
-               ssl_fingerprint => {
+               ssl_fingerprint => get_standard_option('fingerprint-sha256', {
                    description => "The SSL SHA-256 fingerprint for the node 
certificate.",
-                   type => 'string',
                    optional => 1,
-               },
+               }),
            },
        },
        links => [ { rel => 'child', href => "{node}" } ],
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to