From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Shan Shaji" <s.shaji@proxmox.com>, <pdm-devel@lists.proxmox.com>
Subject: applied: [PATCH datacenter-manager] ui: remove URL encoding from token ID during creation
Date: Tue, 26 May 2026 15:52:17 +0200 [thread overview]
Message-ID: <DISNP5SPJAGI.2I1NGCPIF9JAX@proxmox.com> (raw)
In-Reply-To: <20260526125912.454182-1-s.shaji@proxmox.com>
On Tue May 26, 2026 at 2:59 PM CEST, Shan Shaji wrote:
> When creating a new token via the UI, token IDs containing hyphens
> ("-") were URL-encoded. This caused the API request to fail
> with a 400 Bad Request error, preventing the token from being
> generated.
>
> Fixed the issue by removing the unnecessary URL encoding from the
> token ID before sending the request.
>
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
> ui/src/remotes/auto_installer/token_panel.rs | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/ui/src/remotes/auto_installer/token_panel.rs b/ui/src/remotes/auto_installer/token_panel.rs
> index 06aed7bc..f8d26451 100644
> --- a/ui/src/remotes/auto_installer/token_panel.rs
> +++ b/ui/src/remotes/auto_installer/token_panel.rs
> @@ -384,12 +384,7 @@ async fn create_token(form_ctx: FormContext) -> Result<AnswerTokenCreateResult>
> proxmox_time::parse_rfc3339(&form_ctx.read().get_field_text("expire-at")).unwrap_or(0);
>
> Ok(pdm_client()
> - .add_autoinst_token(
> - &percent_encode_component(&id),
> - Some(comment),
> - Some(enable),
> - Some(expire),
> - )
> + .add_autoinst_token(&id, Some(comment), Some(enable), Some(expire))
> .await?)
> }
>
applied, thanks!
On a general note, sent another patch to enforce the token name
schema directly at the API level (it was already enforced when saving
the tokens to disk).
Before applying, I double-checked that the schema is actually URL-safe,
which it is. It is essentially gated by PROXMOX_SAFE_ID_REGEX, which
is (?:[A-Za-z0-9_][A-Za-z0-9._\-]*)
https://lore.proxmox.com/pdm-devel/20260526133056.334639-1-l.wagner@proxmox.com/T/#u
prev parent reply other threads:[~2026-05-26 13:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 12:59 [PATCH datacenter-manager] ui: remove URL encoding from token ID during creation Shan Shaji
2026-05-26 13:52 ` Lukas Wagner [this message]
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=DISNP5SPJAGI.2I1NGCPIF9JAX@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
--cc=s.shaji@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.