Repository navigation
Conversation
|
This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #3729. If a maintainer assigns you to #3729, this PR reopens on its own and there's nothing more you need to do here. Assignment is a maintainer call based on capacity; comments that only ask to be assigned don't factor in. What does help is engaging on the issue itself by confirming the repro, explaining why it matters for your use case, or describing the approach you'd take. You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned, and realistically most auto-closed PRs stay closed. There's no need to open a new PR either way. CONTRIBUTING.md has the full reasoning, but in short:
Maintainers: reopen, remove |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fixes #3729
Summary
In
OAuthContext.is_token_valid()andIdentityAssertionOAuthProvider._auth_flow, token validity against expiry was evaluated using<=:Under RFC 7519 §4.1.4, expiration time (
exp) defines the moment on or after which the token must not be accepted for processing. At exact equality (current_time == token_expiry_time), the token has expired.Using
<=caused:expires_in=0to evaluate as valid when inspected within the same clock tick (time.time() == token_expiry_time), skipping token refresh.time.time()resolution is coarse (such as Windows with Python 3.12).Changes
src/mcp/client/auth/oauth2.py:191, changetime.time() <= self.token_expiry_timetotime.time() < self.token_expiry_time.src/mcp/client/auth/extensions/identity_assertion.py:170, changetime.time() <= self._expirytotime.time() < self._expiry.tests/client/test_auth.py, add test assertions covering exact expiry boundary equality and immediate invalidity forexpires_in=0tokens.Testing
pytest tests/client/test_auth.py(160 passed, 1 xfailed).ruff checkandruff format --check.pyright.Disclaimer: This pull request was created with AI assistance and validated through local test execution.