-
Notifications
You must be signed in to change notification settings - Fork 20
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
In v2 of the SDK, the auto_refresh parameter of HTTPClient is not respected. #151
Comments
Concerning the "Perform token refresh prior to request if |
With respect to
Note: an extra
As best as I can tell, everything appears to be working as expected. Please let me know if I'm missing something. Thanks! |
Hello @sserrata, In the test proposed above, you're recreating the object (and in that case, it indeed refreshes the token). But if you keep holding the object - it doesn't:
|
Hi @mishas - yes, I understand that after an hour the |
You can simulate this by calling: (i'm not 100% sure about the above, didn't try it, but I think it should work) |
Hi @mishas - please see PR #152 for a fix. I discovered a regression bug introduced in #140. In weighing different options, I realized that it made little sense to apply |
The documentation for the auto_refresh parameter of HTTPClient says:
But there seems not to be any code to catch 401 and refresh the token.
Furthermore, in the
request
method, on line 223, there'scredentials = kwargs.pop("credentials", None)
, where it should probably becredentials = kwargs.pop("credentials", self._credentials)
.Expected behavior
When there's a 401, a new token should be generated, and a retry should happen.
Current behavior
I'm starting to get
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.us.cdl.paloaltonetworks.com:443/query/v2/jobs
after ~1 hour of use.Your Environment
The text was updated successfully, but these errors were encountered: