(exp: i64)
| 221 | |
| 222 | #[allow(clippy::result_large_err)] |
| 223 | fn validate_exp(exp: i64) -> Result<(), Status> { |
| 224 | if exp == 0 { |
| 225 | return Ok(()); |
| 226 | } |
| 227 | |
| 228 | if exp < now_secs().saturating_sub(SANDBOX_JWT_EXP_LEEWAY_SECS) { |
| 229 | debug!("sandbox JWT expired"); |
| 230 | return Err(Status::unauthenticated("invalid token: ExpiredSignature")); |
| 231 | } |
| 232 | |
| 233 | Ok(()) |
| 234 | } |
| 235 | |
| 236 | fn now_secs() -> i64 { |
| 237 | i64::try_from( |
no test coverage detected