(bundle: dict)
| 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: |
no test coverage detected