Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds functionality for automatically refreshing tokens when the one used is returned via a 401. Stops the workflow and asks for a username and password, which will kill automatic workflows but going to a access+refresh token situation didn't seem like a better option – I have added a flag for turning off auto-refresh onto the client constructor so this can be deactivated if necessary! The refreshment automatically updates the config file with the new token, I'm not 100% how this would work with mulitple clients open at teh same time though - we might want the auto-refresh to first check the config file to see if the token has been updated and then do a refreshment call? Will have a think abou this...
I've also added a method on the client (
update_token()
) so that users can manually refresh their token without intervention.These changes necessitated a bit of a refactor, so 'authentication.py' and 'config.py' now handle the token and the config file respectively. Have a look and let me know if you think it all makes sense, very happy to go through it in person of course!