nao-pon/flysystem-google-drive

Google Drive API Update

mbaxter91288 opened this issue · 1 comments

Hi There,

We've had an email sent through about a Google Drive API update. Now, I don't think anything is required, but can you confirm? Below is the key information from the email:

Hello Google Drive Developer,

We have identified you as a Developer who has used the Drive API in the last 30 days. We are writing to let you know that on September 13, 2021, Drive will apply a security update that will change the links used to share some files, and may lead to some new file access requests. Access to files won’t change for people who have already viewed or modified these files.

Please update your code as detailed below before September 13, 2021, to avoid failing requests.

What do I need to know?
Items that have a Drive API permission with type=domain or type=anyone, where withLink=true (v2) or allowFileDiscovery=false (v3), will be affected by this security update.

In addition to the item ID, your application may now also need a resource key to access these items. Without a resource key, requests for these items may result in a 404 Not Found error (See below for details). Note that access to items that are directly shared with the user or group are not affected.

Will this change affect me?
If your application uses the Drive API to access files which have been shared with a user through link sharing, your application may be affected by this change.

I am presuming that as this reads files directly from Google Drive, this update that affects sharing will not affect us?

Thanks,
Mat

Maybe no support for this package, i think that only getDownloadUrl($file) will be affected

protected function getDownloadUrl($file)
{
if (strpos($file->mimeType, 'application/vnd.google-apps') !== 0) {
return 'https://www.googleapis.com/drive/v3/files/' . $file->getId() . '?alt=media';
} else {
$mimeMap = $this->options['appsExportMap'];
if (isset($mimeMap[$file->getMimeType()])) {
$mime = $mimeMap[$file->getMimeType()];
} else {
$mime = $mimeMap['default'];
}
$mime = rawurlencode($mime);
return 'https://www.googleapis.com/drive/v3/files/' . $file->getId() . '/export?mimeType=' . $mime;
}
return false;
}