public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Folke Gleumes <f.gleumes@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/2] webui: acme: add eab fields
Date: Tue, 16 Jan 2024 15:33:38 +0100	[thread overview]
Message-ID: <20240116143338.294260-3-f.gleumes@proxmox.com> (raw)
In-Reply-To: <20240116143338.294260-1-f.gleumes@proxmox.com>

Adds fields for eab credentials. By default eab is optional, but if the
directory should report that eab is required, the eab credential fields
are marked as mandatory and prevent the form from being submittable
until credentials are provided.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
---
 www/manager6/node/ACME.js | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/www/manager6/node/ACME.js b/www/manager6/node/ACME.js
index 5b71778a..ab2f0211 100644
--- a/www/manager6/node/ACME.js
+++ b/www/manager6/node/ACME.js
@@ -16,6 +16,12 @@ Ext.define('PVE.node.ACMEAccountCreate', {
     viewModel: {
 	data: {
 	    customDirectory: false,
+	    eabRequired: false,
+	},
+	formulas: {
+	    eabEmptyText: function(get) {
+		return get('eabRequired') ? gettext("required") : gettext("optional");
+	    },
 	},
     },
 
@@ -123,6 +129,7 @@ Ext.define('PVE.node.ACMEAccountCreate', {
 			    let me = this;
 
 			    let w = me.up('window');
+			    let vm = w.getViewModel();
 			    let disp = w.down('#tos_url_display');
 			    let field = w.down('#tos_url');
 			    let checkbox = w.down('#tos_checkbox');
@@ -150,6 +157,7 @@ Ext.define('PVE.node.ACMEAccountCreate', {
 					checkbox.setValue(false);
 					disp.setValue("No terms of service agreement required");
 				    }
+				    vm.set('eabRequired', !!response.result.data.externalAccountRequired);
 				},
 				failure: function(response, opt) {
 				    disp.setValue(undefined);
@@ -184,6 +192,26 @@ Ext.define('PVE.node.ACMEAccountCreate', {
 		return false;
 	    },
 	},
+	{
+	    xtype: 'proxmoxtextfield',
+	    name: 'eab-kid',
+	    fieldLabel: gettext('EAB Key ID'),
+	    bind: {
+		hidden: '{!customDirectory}',
+		allowBlank: '{!eabRequired}',
+		emptyText: '{eabEmptyText}',
+	    },
+	},
+	{
+	    xtype: 'proxmoxtextfield',
+	    name: 'eab-hmac-key',
+	    fieldLabel: gettext('EAB Key'),
+	    bind: {
+		hidden: '{!customDirectory}',
+		allowBlank: '{!eabRequired}',
+		emptyText: '{eabEmptyText}',
+	    },
+	},
     ],
 
     clearToSFields: function() {
-- 
2.39.2





  parent reply	other threads:[~2024-01-16 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 14:33 [pve-devel] [PATCH manager 0/2] fix #5093 add custom directory and eab to ui Folke Gleumes
2024-01-16 14:33 ` [pve-devel] [PATCH manager 1/2] fix #5093: webui: acme: custom directory option Folke Gleumes
2024-04-17 14:34   ` Mira Limbeck
2024-01-16 14:33 ` Folke Gleumes [this message]
2024-01-16 14:49 ` [pve-devel] [PATCH manager 0/2] fix #5093 add custom directory and eab to ui Folke Gleumes
2024-04-16  8:46 ` Folke Gleumes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116143338.294260-3-f.gleumes@proxmox.com \
    --to=f.gleumes@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal