]> git.proxmox.com Git - proxmox.git/commitdiff
src/tools/ticket.rs: define const TICKET_LIFETIME
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 5 Mar 2019 11:52:39 +0000 (12:52 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 5 Mar 2019 11:56:21 +0000 (12:56 +0100)
src/server/rest.rs

index b5ad9cd00236eb72fc2461a025a5bfe28ae58a55..87401f4e518bf83a8c5c2852f66bb6508a31920b 100644 (file)
@@ -461,7 +461,7 @@ fn extract_auth_data(headers: &http::HeaderMap) -> (Option<String>, Option<Strin
 
 fn check_auth(method: &hyper::Method, ticket: &Option<String>, token: &Option<String>) -> Result<String, Error> {
 
-    let ticket_lifetime = 3600*2; // 2 hours
+    let ticket_lifetime = tools::ticket::TICKET_LIFETIME;
 
     let username = match ticket {
         Some(ticket) => match tools::ticket::verify_rsa_ticket(public_auth_key(), "PBS", &ticket, None, -300, ticket_lifetime) {