public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Christoph Heiss <c.heiss@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH widget-toolkit 2/2] window: AuthEditOpenId: add validation for required fields
Date: Thu, 26 Jun 2025 12:47:16 +0200	[thread overview]
Message-ID: <20250626124716.3a3a9d7b@rosa.proxmox.com> (raw)
In-Reply-To: <20250318135919.888083-3-c.heiss@proxmox.com>

On Tue, 18 Mar 2025 14:59:18 +0100
Christoph Heiss <c.heiss@proxmox.com> wrote:

> For the `client-id` and `client-secret` OIDC-specific fields, allow the
> format specified in RFC 6749, Appendix A [0].
> 
> As per that, the OIDC-specific `client-id` and `client-key` can contain
> any printable ascii character, i.e. anything in the (inclusive) range
> 0x20-0x7E.
> 
> For the issuer URL, use our existing URL validation regex, while the
> realm name itself must follow authentication realm naming scheme.
> 
> [0] https://www.rfc-editor.org/rfc/rfc6749#appendix-A
> 
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>

not a maintainer for widget-toolkit - but from looking through the RFC
consider this:
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>

> ---
>  src/Utils.js                 | 4 ++++
>  src/window/AuthEditOpenId.js | 8 ++++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/src/Utils.js b/src/Utils.js
> index c873c85..e17bee8 100644
> --- a/src/Utils.js
> +++ b/src/Utils.js
> @@ -1545,6 +1545,10 @@ utilities: {
>  
>  	// Same as SAFE_ID_REGEX in proxmox-schema
>  	me.safeIdRegex = /^(?:[A-Za-z0-9_][A-Za-z0-9._\\-]*)$/;
> +
> +	me.printableAsciiRegex = /^[\x20-\x7E]+$/;
> +
> +	me.authRealmNameRegex = /^[A-Za-z][A-Za-z0-9.\-_]+$/;
>      },
>  });
>  
> diff --git a/src/window/AuthEditOpenId.js b/src/window/AuthEditOpenId.js
> index ed0a6dc..5939516 100644
> --- a/src/window/AuthEditOpenId.js
> +++ b/src/window/AuthEditOpenId.js
> @@ -23,6 +23,8 @@ Ext.define('Proxmox.panel.OpenIDInputPanel', {
>  	    name: 'issuer-url',
>  	    fieldLabel: gettext('Issuer URL'),
>  	    allowBlank: false,
> +	    regex: Proxmox.Utils.httpUrlRegex,
> +	    regexText: gettext('Must be a valid URL'),
>  	},
>      ],
>  
> @@ -36,6 +38,8 @@ Ext.define('Proxmox.panel.OpenIDInputPanel', {
>  	    },
>  	    fieldLabel: gettext('Realm'),
>  	    allowBlank: false,
> +	    regex: Proxmox.Utils.authRealmNameRegex,
> +	    regexText: gettext('Must be a valid realm name'),
>  	},
>  	{
>  	    xtype: 'proxmoxcheckbox',
> @@ -57,6 +61,8 @@ Ext.define('Proxmox.panel.OpenIDInputPanel', {
>  	    fieldLabel: gettext('Client ID'),
>  	    name: 'client-id',
>  	    allowBlank: false,
> +	    regex: Proxmox.Utils.printableAsciiRegex, // RFC 6749, Appendix A
> +	    regexText: gettext('Must be a valid OIDC Client ID'),
>  	},
>  	{
>  	    xtype: 'proxmoxtextfield',
> @@ -65,6 +71,8 @@ Ext.define('Proxmox.panel.OpenIDInputPanel', {
>  		deleteEmpty: '{!isCreate}',
>  	    },
>  	    name: 'client-key',
> +	    regex: Proxmox.Utils.printableAsciiRegex, // RFC 6749, Appendix A
> +	    regexText: gettext('Must be a valid OIDC Client Secret'),
>  	},
>      ],
>  



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


  reply	other threads:[~2025-06-26 10:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 13:59 [pmg-devel] [PATCH pmg-api/pwt 0/2] fix #6214: improve OIDC field validation Christoph Heiss
2025-03-18 13:59 ` [pmg-devel] [PATCH pmg-api 1/2] auth: oidc: fix pattern for `client-id` and `client-key` Christoph Heiss
2025-06-26 10:46   ` [pmg-devel] applied: " Stoiko Ivanov
2025-03-18 13:59 ` [pmg-devel] [PATCH widget-toolkit 2/2] window: AuthEditOpenId: add validation for required fields Christoph Heiss
2025-06-26 10:47   ` Stoiko Ivanov [this message]
2025-05-16 10:13 ` [pmg-devel] [PATCH pmg-api/pwt 0/2] fix #6214: improve OIDC field validation Christoph Heiss

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=20250626124716.3a3a9d7b@rosa.proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=c.heiss@proxmox.com \
    --cc=pmg-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