public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH v2 backup 4/4] gui: tfa configuration
Date: Fri, 15 Jan 2021 11:06:18 +0100	[thread overview]
Message-ID: <20210115100618.1208-4-w.bumiller@proxmox.com> (raw)
In-Reply-To: <20210115100618.1208-1-w.bumiller@proxmox.com>

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
Changes to v1:
* removed initComponent functions in favor of inlined data
* fixed a wrong label copy-pasta

 www/Makefile               |  1 +
 www/SystemConfiguration.js | 26 ++++++++++++
 www/config/WebauthnView.js | 83 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 110 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..914abcdc
--- /dev/null
+++ b/www/config/WebauthnView.js
@@ -0,0 +1,83 @@
+Ext.define('PBS.WebauthnConfigView', {
+    extend: 'Proxmox.grid.ObjectGrid',
+    alias: ['widget.pbsWebauthnConfigView'],
+
+    url: "/api2/json/config/access/tfa/webauthn",
+    cwidth1: 150,
+    interval: 1000,
+
+    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: 'runEditor',
+	},
+    ],
+    controller: {
+	xclass: 'Ext.app.ViewController',
+
+	runEditor: function() {
+	    let win = Ext.create('PBS.WebauthnConfigEdit');
+	    win.show();
+	},
+
+	startStore: function() { this.getView().getStore().rstore.startUpdate(); },
+	stopStore: function() { this.getView().getStore().rstore.stopUpdate(); },
+    },
+
+
+    listeners: {
+	itemdblclick: 'runEditor',
+	activate: 'startStore',
+	deactivate: 'stopStore',
+	destroy: 'stopStore',
+    },
+});
+
+Ext.define('PBS.WebauthnConfigEdit', {
+    extend: 'Proxmox.window.Edit',
+    alias: ['widget.pbsWebauthnConfigEdit'],
+
+    subject: gettext('Webauthn'),
+    url: "/api2/extjs/config/access/tfa/webauthn",
+    autoLoad: true,
+
+    fieldDefaults: {
+	labelWidth: 120,
+    },
+
+    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,
+	},
+    ],
+});
-- 
2.20.1





  parent reply	other threads:[~2021-01-15 10:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 10:06 [pbs-devel] [PATCH v2 backup 1/4] add tools::json for canonical json generation Wolfgang Bumiller
2021-01-15 10:06 ` [pbs-devel] [PATCH v2 backup 2/4] bakckup::manifest: use tools::json for canonical representation Wolfgang Bumiller
2021-01-15 10:06 ` [pbs-devel] [PATCH v2 backup 3/4] tfa: add webauthn configuration API entry points Wolfgang Bumiller
2021-01-15 10:06 ` Wolfgang Bumiller [this message]
2021-01-15 15:26 ` [pbs-devel] applied-series: [PATCH v2 backup 1/4] add tools::json for canonical json generation Thomas Lamprecht

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=20210115100618.1208-4-w.bumiller@proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=pbs-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