public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH datacenter-manager] api: autoinstaller: token: enforce token schema constraints
Date: Tue, 26 May 2026 15:30:56 +0200	[thread overview]
Message-ID: <20260526133056.334639-1-l.wagner@proxmox.com> (raw)

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





             reply	other threads:[~2026-05-26 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 13:30 Lukas Wagner [this message]
2026-05-26 13:50 ` applied: [PATCH datacenter-manager] api: autoinstaller: token: enforce token schema constraints Thomas Lamprecht

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=20260526133056.334639-1-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pdm-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