google-drive-api - 谷歌文档不需要资源键吗?
问题描述
您好,我正在尝试使用 google drive api 获取资源密钥我已经更新了你们推荐的安全性
但是我仍然无法从带有fileId的文件的get api中获取resourceKey所以我想检查谷歌文档,如谷歌文档、谷歌表格、谷歌幻灯片、谷歌表单不需要用于共享链接的资源密钥,如exportLinks、webContentLink、和 webViewLink 以及当我使用 google drive files 的 get 方法时,google doc 的文件类型是否具有 resourceKey?
我附上了我的谷歌电子表格文件元数据的回复,请检查以下内容并告诉我我错了什么或错过了什么
"kind": "drive#file",
"id": "1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4",
"name": "CSS_v1_lpNnyJfGaiAo_6",
"mimeType": "application/vnd.google-apps.spreadsheet",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"spaces": [
"drive"
],
"version": "8",
"webViewLink": "https://docs.google.com/spreadsheets/d/1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4/edit?usp=drivesdk",
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.spreadsheet",
"hasThumbnail": true,
"thumbnailLink": "https://docs.google.com/feeds/vt?gd=true&id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&v=2&s=AMedNnoAAAAAYSRx8dDKAoD1Q16M021MvQjUnGn3rCDS&sz=s220",
"thumbnailVersion": "2",
"viewedByMe": true,
"viewedByMeTime": "2021-04-08T08:51:13.861Z",
"createdTime": "2021-04-08T08:45:54.117Z",
"modifiedTime": "2021-04-08T08:46:04.434Z",
"modifiedByMe": false,
"sharedWithMeTime": "2021-04-08T08:51:13.861Z",
"owners": [
{
"kind": "drive#user",
"displayName": "realsearch@realsearch-1611815321770.iam.gserviceaccount.com",
"me": false,
"permissionId": "08922093982962563488",
"emailAddress": "realsearch@realsearch-1611815321770.iam.gserviceaccount.com"
}
],
"lastModifyingUser": {
"kind": "drive#user",
"displayName": "realsearch@realsearch-1611815321770.iam.gserviceaccount.com",
"me": false,
"permissionId": "08922093982962563488",
"emailAddress": "realsearch@realsearch-1611815321770.iam.gserviceaccount.com"
},
"shared": true,
"ownedByMe": false,
"capabilities": {
"canAddChildren": false,
"canAddMyDriveParent": false,
"canChangeCopyRequiresWriterPermission": false,
"canChangeSecurityUpdateEnabled": false,
"canChangeViewersCanCopyContent": false,
"canComment": true,
"canCopy": true,
"canDelete": false,
"canDownload": true,
"canEdit": true,
"canListChildren": false,
"canModifyContent": true,
"canMoveChildrenWithinDrive": false,
"canMoveItemIntoTeamDrive": false,
"canMoveItemOutOfDrive": false,
"canMoveItemWithinDrive": true,
"canReadRevisions": true,
"canRemoveChildren": false,
"canRemoveMyDriveParent": true,
"canRename": true,
"canShare": true,
"canTrash": false,
"canUntrash": false
},
"viewersCanCopyContent": true,
"copyRequiresWriterPermission": false,
"writersCanShare": true,
"permissions": [
{
"kind": "drive#permission",
"id": "anyoneWithLink",
"type": "anyone",
"role": "writer",
"allowFileDiscovery": false
},
{
"kind": "drive#permission",
"id": "08922093982962563488",
"type": "user",
"emailAddress": "realsearch@realsearch-1611815321770.iam.gserviceaccount.com",
"role": "owner",
"displayName": "realsearch@realsearch-1611815321770.iam.gserviceaccount.com",
"deleted": false
}
],
"permissionIds": [
"anyoneWithLink",
"08922093982962563488"
],
"quotaBytesUsed": "0",
"isAppAuthorized": false,
"exportLinks": {
"application/x-vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&exportFormat=ods",
"text/tab-separated-values": "https://docs.google.com/spreadsheets/export?id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&exportFormat=tsv",
"application/pdf": "https://docs.google.com/spreadsheets/export?id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&exportFormat=pdf",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "https://docs.google.com/spreadsheets/export?id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&exportFormat=xlsx",
"text/csv": "https://docs.google.com/spreadsheets/export?id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&exportFormat=csv",
"application/zip": "https://docs.google.com/spreadsheets/export?id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&exportFormat=zip",
"application/vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=1X8LSm3IuA90EDGg3DRQ39cs87OoQYDjxrJwoxq0bPx4&exportFormat=ods"
},
"linkShareMetadata": {
"securityUpdateEligible": false,
"securityUpdateEnabled": true
}
}
解决方案
从 2021 年 9 月 13 日星期一开始,Google 将开始对 Google Drive 执行安全更新。从 2021 年 7 月 26 日星期一开始,将向像您这样拥有或管理受影响文件的用户通知受影响的文件。
此安全更新添加了一个资源密钥,可以更安全地共享来自 Google 云端硬盘文件的链接。当文件链接更新时,用户可能会收到新的文件访问请求。那些在更新之前没有访问过文件的人将不得不使用包含资源键的 URL 来访问文件。
为避免链接失效,用户应在 9 月 13 日之前更新其网站和共享资源上的 Google Drive 链接。
更新影响开发者
受影响的项目是具有类型=域或type=anyone
where withLink=true
(v2)或allowFileDiscovery=false
(v3)的 Drive File API 权限的项目。
除了项目 ID,应用程序可能还需要资源密钥来访问文件。使用Google 的开发者资源详细了解此更新将如何影响您的项目。
谷歌文档不需要资源键吗?
只有您可以决定您的文件及其当前拥有的权限是否需要您使用资源密钥。
查找受影响的文件
推荐阅读
- php - 如何填充(html)输入标签类型文件的值?
- javascript - jQuery AJAX 调用将数据“d:null”附加到 Json 返回
- c - crypt 函数的不同输出
- php - 如何从具有不同 URL 的网页访问 cookie 信息
- css - SCSS 模块给出流量错误
- r - 条件面板未按预期显示,但出现警告消息
- mongodb - MongoError:包含 ObjectId 的唯一复合索引的 E11000 重复键错误集合
- mongodb - MongoDb - 查询 - 即使结果不为空也为空
- python - 难以弄清楚如何在单词之间实现空格。现在我有下划线
- sql - 如何计算 T-SQL 中事件之间的时间间隔