[pve-devel] [PATCH v3 widget-toolkit] utils: add api token RegExp
Tim Marx
t.marx at proxmox.com
Mon Jul 6 14:45:44 CEST 2020
Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
src/Utils.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/Utils.js b/src/Utils.js
index 9a156dd..14da82e 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -867,5 +867,8 @@ utilities: {
me.IP6_dotnotation_match = new RegExp("^" + IPV6_REGEXP + "(\\.\\d+)?$");
me.Vlan_match = /^vlan(\\d+)/;
me.VlanInterface_match = /(\\w+)\\.(\\d+)/;
+
+ let APIToken_REGEXP = "(([^\\s:/]+)\\@([A-Za-z][A-Za-z0-9\\.\\-_]+))!([A-Za-z][A-Za-z0-9\\.\\-_]+)";
+ me.APIToken_match = new RegExp("^" + APIToken_REGEXP);
},
});
--
2.20.1
More information about the pve-devel
mailing list