[pdm-devel] [PATCH proxmox v3 14/21] login: add helper to check whether a ticket is just informational

Shannon Sterz s.sterz at proxmox.com
Thu Feb 27 15:07:05 CET 2025


tickets that end in `::ticketinfo` are not properly signed and just
include information such as the timestamp when the ticket was created.

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 proxmox-login/src/ticket.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/proxmox-login/src/ticket.rs b/proxmox-login/src/ticket.rs
index 24606da5..dc70f913 100644
--- a/proxmox-login/src/ticket.rs
+++ b/proxmox-login/src/ticket.rs
@@ -94,6 +94,12 @@ impl Ticket {
         }
     }
 
+    /// Returns true when this is not a signed ticket, but just the information contained in a
+    /// ticket without a valid signature
+    pub fn is_info_only(&self) -> bool {
+        self.data.ends_with("::ticketinfo")
+    }
+
     /// Get the cookie in the form `<PRODUCT>AuthCookie=Ticket`.
     pub fn cookie(&self) -> String {
         format!("{}AuthCookie={}", self.product(), self.data)
-- 
2.39.5





More information about the pdm-devel mailing list