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

Method _expiry

python/openshell/sandbox.py:1118–1128  ·  view source on GitHub ↗

Access-token expiry as a comparable number. A bundle without an `expires_at` is treated as non-expiring (`+inf`) — consistent with `_is_fresh`, which treats a missing expiry as always fresh. Used to decide which of two stale bundles (in-memory vs. on-disk) was refres

(bundle: dict)

Source from the content-addressed store, hash-verified

1116
1117 @staticmethod
1118 def _expiry(bundle: dict) -> float:
1119 """Access-token expiry as a comparable number.
1120
1121 A bundle without an `expires_at` is treated as non-expiring
1122 (`+inf`) — consistent with `_is_fresh`, which treats a missing
1123 expiry as always fresh. Used to decide which of two stale
1124 bundles (in-memory vs. on-disk) was refreshed more recently and
1125 therefore holds the newest refresh_token.
1126 """
1127 exp = bundle.get("expires_at")
1128 return float(exp) if isinstance(exp, int) else float("inf")
1129
1130 def _discover_token_endpoint(self, bundle: dict) -> str:
1131 if self._token_endpoint is not None:

Callers 1

current_access_tokenMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected