public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH datacenter-manager] api: autoinstaller: token: enforce token schema constraints
@ 2026-05-26 13:30 Lukas Wagner
  2026-05-26 13:50 ` applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wagner @ 2026-05-26 13:30 UTC (permalink / raw)
  To: pdm-devel

The PROXMOX_TOKEN_NAME schema is already used internally in the id
property of the AnswerToken type, so it makes sense to propagate the
schema to the API handler as well.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 server/src/api/auto_installer/mod.rs | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/server/src/api/auto_installer/mod.rs b/server/src/api/auto_installer/mod.rs
index 11054963..8c40c82e 100644
--- a/server/src/api/auto_installer/mod.rs
+++ b/server/src/api/auto_installer/mod.rs
@@ -4,6 +4,7 @@ use anyhow::{anyhow, Context, Result};
 use http::StatusCode;
 use std::collections::{BTreeMap, HashMap};
 
+use pdm_api_types::PROXMOX_TOKEN_NAME_SCHEMA;
 use pdm_api_types::{
     auto_installer::{
         AnswerToken, AnswerTokenCreateResult, AnswerTokenUpdateResult, AnswerTokenUpdater,
@@ -870,8 +871,7 @@ async fn list_tokens(rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<AnswerToken>
     input: {
         properties: {
             id: {
-                type: String,
-                description: "Token ID.",
+                schema: PROXMOX_TOKEN_NAME_SCHEMA,
             },
             comment: {
                 schema: COMMENT_SCHEMA,
@@ -939,8 +939,7 @@ fn create_token(
     input: {
         properties: {
             id: {
-                type: String,
-                description: "Token ID.",
+                schema: PROXMOX_TOKEN_NAME_SCHEMA,
             },
             update: {
                 type: AnswerTokenUpdater,
@@ -1047,8 +1046,7 @@ async fn update_token(
     input: {
         properties: {
             id: {
-                type: String,
-                description: "Token ID.",
+                schema: PROXMOX_TOKEN_NAME_SCHEMA,
             },
         },
     },
-- 
2.47.3





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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 13:30 [PATCH datacenter-manager] api: autoinstaller: token: enforce token schema constraints Lukas Wagner
2026-05-26 13:50 ` applied: " Thomas Lamprecht

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