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

Method _is_fresh

python/openshell/sandbox.py:1106–1115  ·  view source on GitHub ↗
(bundle: dict)

Source from the content-addressed store, hash-verified

1104
1105 @staticmethod
1106 def _is_fresh(bundle: dict) -> bool:
1107 access_token = bundle.get("access_token")
1108 if not isinstance(access_token, str) or not access_token:
1109 return False
1110 exp = bundle.get("expires_at")
1111 if not isinstance(exp, int):
1112 # No expiry info — treat as fresh (matches the
1113 # `is_token_expired` semantics in the Rust CLI).
1114 return True
1115 return int(time.time()) + _OIDC_TOKEN_EXPIRY_GRACE_SECONDS < exp
1116
1117 @staticmethod
1118 def _expiry(bundle: dict) -> float:

Callers 2

current_access_tokenMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected