add creation date and expiration date to access keys

This commit is contained in:
Alex Auvolat
2025-04-17 11:09:21 +02:00
parent 2f21181ccb
commit c56b7e20c3
10 changed files with 225 additions and 33 deletions
+2 -13
View File
@@ -272,19 +272,8 @@ fn verify_authorization(
.admin_token_table
.get_local(&EmptyKey, &prefix.to_string())?
.and_then(|k| k.state.into_option())
.filter(|p| {
p.expiration
.get()
.map(|exp| now_msec() < exp)
.unwrap_or(true)
})
.filter(|p| {
p.scope
.get()
.0
.iter()
.any(|x| x == "*" || x == endpoint_name)
})
.filter(|p| !p.is_expired(now_msec()))
.filter(|p| p.has_scope(endpoint_name))
.ok_or_else(|| Error::forbidden(invalid_msg))?
.token_hash
} else {