From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 000EE68B9B for ; Fri, 15 Jan 2021 10:20:51 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EBC272299D for ; Fri, 15 Jan 2021 10:20:51 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 15FFB2298C for ; Fri, 15 Jan 2021 10:20:51 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CC39945268 for ; Fri, 15 Jan 2021 10:20:50 +0100 (CET) From: Wolfgang Bumiller To: pbs-devel@lists.proxmox.com Date: Fri, 15 Jan 2021 10:20:49 +0100 Message-Id: <20210115092049.16706-4-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210115092049.16706-1-w.bumiller@proxmox.com> References: <20210115092049.16706-1-w.bumiller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.052 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH backup 4/4] gui: tfa configuration X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 09:20:52 -0000 Signed-off-by: Wolfgang Bumiller --- www/Makefile | 1 + www/SystemConfiguration.js | 26 +++++++++++ www/config/WebauthnView.js | 91 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 www/config/WebauthnView.js diff --git a/www/Makefile b/www/Makefile index 3d8d4fa1..c2d80c74 100644 --- a/www/Makefile +++ b/www/Makefile @@ -30,6 +30,7 @@ JSSRC= \ config/ACLView.js \ config/SyncView.js \ config/VerifyView.js \ + config/WebauthnView.js \ window/ACLEdit.js \ window/AddTfaRecovery.js \ window/AddTotp.js \ diff --git a/www/SystemConfiguration.js b/www/SystemConfiguration.js index d82396af..025e0273 100644 --- a/www/SystemConfiguration.js +++ b/www/SystemConfiguration.js @@ -44,6 +44,27 @@ Ext.define('PBS.SystemConfiguration', { }, ], }, + { + title: gettext('Authentication'), + itemId: 'authentication', + xtype: 'panel', + layout: { + type: 'vbox', + align: 'stretch', + multi: true, + }, + defaults: { + collapsible: true, + animCollapse: false, + margin: '10 10 0 10', + }, + items: [ + { + title: gettext('Webauthn'), + xtype: 'pbsWebauthnConfigView', + }, + ], + }, ], initComponent: function() { @@ -55,6 +76,11 @@ Ext.define('PBS.SystemConfiguration', { Ext.Array.forEach(networktime.query(), function(item) { item.relayEvents(networktime, ['activate', 'deactivate', 'destroy']); }); + + let authentication = me.getComponent('authentication'); + Ext.Array.forEach(authentication.query(), function(item) { + item.relayEvents(authentication, ['activate', 'deactivate', 'destroy']); + }); }, }); diff --git a/www/config/WebauthnView.js b/www/config/WebauthnView.js new file mode 100644 index 00000000..3e8df709 --- /dev/null +++ b/www/config/WebauthnView.js @@ -0,0 +1,91 @@ +Ext.define('PBS.WebauthnConfigView', { + extend: 'Proxmox.grid.ObjectGrid', + alias: ['widget.pbsWebauthnConfigView'], + + initComponent: function() { + let me = this; + + let run_editor = function() { + let win = Ext.create('PBS.WebauthnConfigEdit'); + win.show(); + }; + + Ext.apply(me, { + url: "/api2/json/config/access/tfa/webauthn", + cwidth1: 150, + interval: 1000, + run_editor: run_editor, + rows: { + rp: { + header: gettext('Relying Party'), + required: true, + }, + origin: { + header: gettext('Origin'), + required: true, + }, + id: { + header: gettext('Id'), + required: true, + }, + }, + tbar: [ + { + text: gettext("Edit"), + handler: run_editor, + }, + ], + listeners: { + itemdblclick: run_editor, + }, + }); + + me.callParent(); + + me.on('activate', me.rstore.startUpdate); + me.on('deactivate', me.rstore.stopUpdate); + me.on('destroy', me.rstore.stopUpdate); + }, +}); + +Ext.define('PBS.WebauthnConfigEdit', { + extend: 'Proxmox.window.Edit', + alias: ['widget.pbsWebauthnConfigEdit'], + + initComponent: function() { + let me = this; + + me.items = [ + { + xtype: 'textfield', + fieldLabel: gettext('Relying Party'), + name: 'rp', + allowBlank: false, + }, + { + xtype: 'textfield', + fieldLabel: gettext('Origin'), + name: 'origin', + allowBlank: false, + }, + { + xtype: 'textfield', + fieldLabel: gettext('id'), + name: 'id', + allowBlank: false, + }, + ]; + + Ext.applyIf(me, { + subject: gettext('DNS'), + url: "/api2/extjs/config/access/tfa/webauthn", + fieldDefaults: { + labelWidth: 120, + }, + }); + + me.callParent(); + + me.load(); + }, +}); -- 2.20.1