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
populate_token_attributes() ValueError for float expires_at values #745
Comments
Just above that self._expires_at = time.time() + int(self.expires_in) |
The usage of Any PR to fix its usage and add unit test to cover this edge-case is welcome. |
hey, can i have this issue? I'm just starting with open source, so this will be a good start ig. |
@default-303 go for it! |
@ggiill thanks, I did the following changes - self._expires_at = int(response.get('expires_at'))
+ self._expires_at = round(float(response.get('expires_at'))) and passes all the tests is when i run But what kinda tests you want me to add ? like a simple
or a full on |
@ggiill hey, can i get a review ? |
@default-303 I'm not a maintainer - pinging @JonathanHuot. You probably want to put in a PR for review as well. |
@default-303 : would you mind submitting a PR that we can easily review & discuss ? Thanks in advance! |
As discussed in oauthlib#745
oauthlib/oauthlib/oauth2/rfc6749/clients/base.py
Line 516 in d54965b
Some tokens have an
expires_at
value as a float (example:1612807300.1613762
) which causes this line to throw aValueError: invalid literal for int() with base 10
. This could be solved usingint(float(response.get('expires_at')))
(or rounding to not truncate).The text was updated successfully, but these errors were encountered: