Repository navigation
Treat an access token as expired at its expiry time #3761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3667,3 +3667,13 @@ async def echo_callback() -> AuthorizationCodeResult: | |
| await auth_flow.asend(httpx2.Response(200, request=final_req)) | ||
| except StopAsyncIteration: | ||
| pass | ||
|
|
||
|
|
||
| def test_a_token_is_invalid_at_its_expiry_instant(oauth_provider: OAuthClientProvider): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 nit (optional): The new top-level test Why this was flaggedNo runtime trigger applies; this is a convention check on the test code added since the last review. The signature at tests/client/test_auth.py:3672 reads Verification: AGENTS.md line 50 reads "- Type hints required for all code". The diff adds tests/client/test_auth.py:3672 Finding ID: |
||
| """SDK-defined: the deadline from `expires_in` is exclusive, like a JWT `exp` (RFC 7519 §4.1.4).""" | ||
| context = oauth_provider.context | ||
| with mock.patch("time.time", return_value=1_800_000_000.0): | ||
| token = OAuthToken(access_token="t", token_type="Bearer", expires_in=0) | ||
| context.current_tokens = token | ||
| context.update_token_expiry(token) | ||
| assert not context.is_token_valid() | ||
Uh oh!
There was an error while loading. Please reload this page.