mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
Extract parse_utc_datetime into litellm_core_utils/datetime_utils.py as the single ISO-8601 parse entrypoint for the proxy: it accepts str or datetime, handles the Z suffix on Python 3.10, and assumes naive values are UTC so results always compare safely against datetime.now(timezone.utc). Convert all 27 raw fromisoformat sites under litellm/proxy/ to the helper, collapsing the hand-rolled tzinfo guards they each carried. This also fixes a real bug in get_mcp_oauth_user_credential_status: a tz-naive expires_at raised TypeError against the aware now(), the bare except swallowed it, and the credential never read as expired. Two semgrep rules enforce the pattern in CI: raw fromisoformat is banned under litellm/proxy/, and a repo-wide taint rule flags comparing or subtracting an unnormalized fromisoformat result. |
||
|---|---|---|
| .. | ||
| reliability | ||
| unbounded-memory.yml | ||