public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH datacenter-manager] ui: remove URL encoding from token ID during creation
@ 2026-05-26 12:59 Shan Shaji
  2026-05-26 13:52 ` applied: " Lukas Wagner
  0 siblings, 1 reply; 2+ messages in thread
From: Shan Shaji @ 2026-05-26 12:59 UTC (permalink / raw)
  To: pdm-devel

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?)
 }
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* applied: [PATCH datacenter-manager] ui: remove URL encoding from token ID during creation
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Lukas Wagner @ 2026-05-26 13:52 UTC (permalink / raw)
  To: Shan Shaji, pdm-devel

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-26 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 12:59 [PATCH datacenter-manager] ui: remove URL encoding from token ID during creation Shan Shaji
2026-05-26 13:52 ` applied: " Lukas Wagner

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