8000 Handle expires_at with best effort basis by JonathanHuot · Pull Request #900 · oauthlib/oauthlib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle expires_at with best effort basis #900

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

Open
wants to merge 3 commits into
base: 2025-05-release
Choose a base branch
from

Conversation

JonathanHuot
Copy link
Member

Proposal for #899

@JonathanHuot JonathanHuot added this to the 3.3.0 milestone May 14, 2025
@auvipy auvipy requested a review from Copilot May 15, 2025 05:29
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a best‑effort handling of the token attribute "expires_at" by updating the conversion logic across token parsing and client methods, and adds a multi‑case test for various "expires_at" types.

  • Updated tests to cover multiple input types for "expires_at" and removed an invalid case test.
  • Changed the computation of expires_at in parameters and adjusted the client’s parsing logic accordingly.
  • Added a dependency on pytest‑subtests to support sub‑test execution.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/oauth2/rfc6749/clients/test_base.py Updated tests for various "expires_at" types and removed an invalid test case.
requirements-test.txt Added pytest‑subtests as a dependency.
oauthlib/oauth2/rfc6749/parameters.py Changed expires_at computation to use round(time.time()).
oauthlib/oauth2/rfc6749/clients/base.py Updated token attribute parsing with layered conversion for expires_at.
Comments suppressed due to low confidence (1)

tests/oauth2/rfc6749/clients/test_base.py:303

  • Consider retaining or reintroducing tests for invalid 'expires_at' values to ensure robust error handling for malformed inputs.
def test_parse_token_response_invalid_expires_at(self):

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0