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

CLOUD: Update Dropbox to use refresh_token #2715

Open
wants to merge 1 commit into
base: master
from

Conversation

@Tkachov
Copy link
Contributor

@Tkachov Tkachov commented Jan 4, 2021

Dropbox is switching to short-lived access_token OAuth mid 2021. This commit adapts Cloud::DropboxStorage to use refresh_token similarly to how other Storages do: by introducing a DropboxTokenRefresher.

@Mataniko already added a new endpoint on cloud.scummvm.org, which will be used for Dropbox from now on. Older versions of ScummVM, which do not have this change, will still work with "Legacy" endpoint until Dropbox deprecates it.

I've checked all the Dropbox*Request classes with Testbed for handling the "expired_access_token" error (handled via the DropboxTokenRefresher) and all of them work.

Dropbox is switching to short-lived access_token OAuth. This commit adapts Cloud::DropboxStorage to use refresh_token similarly to how other Storages do: by introducing a DropboxTokenRefresher.

It is used instead of plain CurlJsonRequest. It just checks if received JSON has access_token-related error and tries to refresh it, then repeats the original request transparently for the caller. If no such errors found, it just passes the info to the caller.
@Mataniko Mataniko self-requested a review Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.