Skip to content
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

Fix: Handle RFC3339 date format #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cirosec
Copy link

@cirosec cirosec commented Nov 29, 2024

This PR fixes #82.
The JWT Standard defines the Numerical Date as either a Unix Epoch in seconds or a non-integer value from RFC3339 (https://www.rfc-editor.org/rfc/rfc7519#section-2). Currently, passing a RFC3339 formatted date leads to a ValueError.
This Error gets caught and instead the date is parsed as ISO / RFC3339. If the date can also not be parsed as ISO, the script will still throw a value error.
Implementing further date parsing, for example for the date formats shown in #95 could be considered, but would not follow the standard.
Cheers, JM-Lemmi

catch timestamp error and attempt to convert from isoformat
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.

ValueError: invalid literal for int() with base 10:
2 participants