【问题标题】:Is the google doc doesn't need the resourcekey?谷歌文档不需要资源键吗?
【发布时间】:2021-08-24 02:28:53
【问题描述】:

您好,我正在尝试使用 google drive api 获取资源密钥 我已经更新了你们推荐的安全性

但我仍然无法使用 fileId 从文件的 get api 中获取 resourceKey 所以我想检查像谷歌文档、谷歌表格、谷歌幻灯片、谷歌表单这样的谷歌文档不需要用于共享链接的资源键,比如 exportLinks、webContentLink 和 webViewLink 还有当我使用谷歌驱动文件的get方法时,谷歌文档的文件类型是否有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
 }
}

【问题讨论】:

  • 不,你读过我的问题了吗?我问谷歌文档是否有resourceKey

标签: google-drive-api


【解决方案1】:

并非所有文件都受到此安全更新的影响。当我尝试对我的应用程序进行更改时,我也遇到了这个问题,即当谷歌驱动器文档清楚地表明它应该存在时,文件的元数据没有显示 resourceKey。我的问题是我假设所有文件都有resourceKey,我发现这实际上不是真的。我的谷歌驱动器中只有一些文件有资源密钥。

您可以通过搜索找到受此安全更新影响的文件

is:security_update_applied

在谷歌驱动器搜索字段中。

如果您尝试获取这些文件的元数据,您可以在文档底部找到资源键。

【讨论】:

    【解决方案2】:

    从 2021 年 9 月 13 日星期一开始,Google 将开始对 Google 云端硬盘执行安全更新。从 2021 年 7 月 26 日星期一开始,我们会通知像您这样拥有或管理受影响文件的用户。

    此安全更新添加了一个资源密钥,可以更安全地共享来自 Google 云端硬盘文件的链接。当文件链接更新时,用户可能会收到新的文件访问请求。那些在更新之前没有访问过文件的人将不得不使用包含资源键的 URL 来访问文件。

    为避免链接失效,用户应在 9 月 13 日之前更新其网站和共享资源上的 Google 云端硬盘链接。

    更新影响开发者

    受影响的项目是具有驱动器文件 API 权限且 type=domain 或 type=anyone 其中 withLink=true (v2)allowFileDiscovery=false (v3) 的项目。

    除了项目 ID 之外,应用程序可能还需要资源密钥才能访问文件。使用 Google’s Developer resource 详细了解此更新将如何影响您的项目。

    google doc不需要resourcekey吗?

    只有您可以决定您的文件及其当前拥有的权限是否需要您使用资源密钥。

    查找受影响的文件

    Security update for Google Drive

    【讨论】:

    • 这几乎是 Google 发送给我们的电子邮件中的复制粘贴,但您能建议更具体的具体操作吗?讨厌谷歌,已经工作的东西 - 现在坏了,甚至更多 - 没有任何尊重的建议如何修复它(只有谷歌风格的手册适用于每个人,因此,没有人完全适用)
    • @okliv 在撰写此答案时,我们的信息非常有限。我一直在努力更新答案。因为您的问题是一个很好的地方,可以让这些事情集中起来,而不是在同一个主题上提出多个问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-30
    • 2023-01-08
    • 2010-09-08
    • 2014-01-20
    • 2016-12-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多