transloadit / uppy

The next open source file uploader for web browsers :dog:
https://uppy.io
MIT License
29.26k stars 2.01k forks source link

Improve Google Picker #5532

Open mifi opened 1 day ago

mifi commented 1 day ago

Initial checklist

Problem

There are some potential improvements remaining from #5443:

Solution

Finish some/all of these

Alternatives

Just leave it as is

StrixOSG commented 1 day ago

An aside, and maybe this is a separate fix potentially but I noticed in the other PR #5443 the permission requested for Google Drive is: https://www.googleapis.com/auth/drive.readonly in https://github.com/transloadit/uppy/blob/988cc2d0b20d78fee9b8a607627f1188e0dd159a/packages/%40uppy/provider-views/src/GooglePicker/googlePicker.ts which is a restricted scope requiring CASA Tier 2 compliance.

This should likely be https://www.googleapis.com/auth/drive.file which is a non-restricted scope? As the other scope is restricted, which I believe is the reason we're switching to Google Picker?

EDIT: After testing with only https://www.googleapis.com/auth/drive.file I can confirm it works as expected however thumbnail previews of the images are not visible for Google Drive but it looks like that was solved here: https://community.transloadit.com/t/to-use-google-drive-you-must-pass-googles-tier-2-security-assessment/16701/8

Another update, it looks like since we're not actually getting the files and displaying them in a list with Uppy, there may not be much we can do here. After some research it might just be that you use https://www.googleapis.com/auth/drive.readonly and go through CASA Tier 2 compliance or use https://www.googleapis.com/auth/drive.file and also add .setMode(google.picker.DocsViewMode.LIST) so it looks marginally better then deal with thumbnails not displaying. Until Google fixes their issue since 2021: https://issuetracker.google.com/issues/208855070. Unless I'm missing something here? If not maybe the user could have the option here for which scope to use.