login: add helper to check whether a ticket is just informational

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@proxmox.com>
This commit is contained in:
Shannon Sterz 2025-03-04 15:42:40 +01:00 committed by Wolfgang Bumiller
parent 867e890141
commit f199b02a7a

View File

@ -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)