MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / validate_exp

Function validate_exp

crates/openshell-server/src/auth/sandbox_jwt.rs:223–234  ·  view source on GitHub ↗
(exp: i64)

Source from the content-addressed store, hash-verified

221
222#[allow(clippy::result_large_err)]
223fn 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
236fn now_secs() -> i64 {
237 i64::try_from(

Callers 1

validate_bearerMethod · 0.85

Calls 1

now_secsFunction · 0.85

Tested by

no test coverage detected