mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-30 12:15:49 +00:00
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:
parent
867e890141
commit
f199b02a7a
@ -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`.
|
/// Get the cookie in the form `<PRODUCT>AuthCookie=Ticket`.
|
||||||
pub fn cookie(&self) -> String {
|
pub fn cookie(&self) -> String {
|
||||||
format!("{}AuthCookie={}", self.product(), self.data)
|
format!("{}AuthCookie={}", self.product(), self.data)
|
||||||
|
Loading…
Reference in New Issue
Block a user