在Vue中从Google Cloud Storage提供用户图像

这是我的项目的一些背景信息:

  • 具有Django Rest Framework的Django后端API,可与前端进行通信
  • 带有Vuetify的VueJS前端(SPA)
  • 用户使用用户名和密码进行身份验证,我使用JWT来验证api请求(python lib是djangorestframework-simplejwt
  • 我计划将前端和API托管在同一Google App Engine上
  • 该应用程序有一个图片库。用户只能看到自己的照片。

现在,我不确定如何提供照片...我想Google Cloud Storage是必经之路。

选项1最初,我认为使用后端检索照片会更简单,因为它可以简单地使用服务帐户向Cloud Storage进行身份验证。但是我想通过串行器将照片从后端传递到前端会非常慢。可能有几百张照片。

选项2仅将URL发送到前端(仅当前用户的URL)可能会更加有效。然后,前端获取图像(例如<v-img :src={{ photo.url }}>)。问题是客户端需要向Google进行身份验证才能具有对Cloud Storage的读取权限。在这一点上我迷路了。

  • 我应该使用签名的网址吗?
  • 我是否应该按照此处所述使用OAuth 2.0对存储进行身份验证但据我了解,这意味着用户必须拥有Google帐户并同意条款等。
  • 我可以拥有对象级别的权限还是必须是存储桶级别的?

感谢您提供的任何见解!

玛丽安·弗拉多伊

阅读您的用例,我建议您使用签名URL。

根据官方文件:

A signed URL is a URL that provides limited permission and time to make a request.
Signed URLs contain authentication information in their query string, allowing users without credentials to perform specific actions on a resource

签名网址

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何允许用户从Google Cloud Storage下载图像

来自分类Dev

如何提供Google Cloud Storage图片?

来自分类Dev

如何提供Google Cloud Storage映像?

来自分类Dev

在Google Cloud Storage中保存图像

来自分类Dev

将图像保存在Google Cloud Storage中

来自分类Dev

使用Google Cloud Dataflow合并Google Cloud Storage中的文件

来自分类Dev

使用Google Cloud Storage托管图像共享站点的图像

来自分类Dev

从Google Cloud Storage提供Google客户服务帐户的keyFilename

来自分类Dev

在Google Cloud Storage签名的URL中提供回调URL

来自分类Dev

从 Google Cloud Storage 提供单页 React 应用程序

来自分类Dev

如何从Node中的图像URL将图像上传到Google Cloud Storage?

来自分类Dev

Google Cloud Storage与Google Cloud CDN

来自分类Dev

如何使用存储在Google Cloud Storage中的图像调用Google Vision API?

来自分类Dev

来自Google Vision API的空响应,其中包含存储在Google Cloud Storage中的图像

来自分类Dev

Google Cloud Storage中的Concat Avro文件

来自分类Dev

Google Cloud Storage中的速率限制

来自分类Dev

如何从网络上传图像到Google Cloud Storage?

来自分类Dev

PHP Google Cloud Storage Tools getImageServingUrl返回旧图像

来自分类Dev

PHP Google Cloud Storage Tools getImageServingUrl返回旧图像

来自分类Dev

使用Google Cloud Storage处理用户权限的正确方法?

来自分类Dev

使用Python脚本中的Google Cloud Functions从Google Cloud Storage中读取CSV

来自分类Dev

Google Cloud Storage Force下载

来自分类Dev

上载Google Cloud Storage iOS

来自分类Dev

Android的Google Cloud Storage管理

来自分类Dev

Configure Django and Google Cloud Storage?

来自分类Dev

IP限制Google Cloud Storage

来自分类Dev

Google Cloud Storage - 权限不足

来自分类Dev

使用Google Cloud Console在Google Cloud Storage中的文件夹之间移动文件

来自分类Dev

从两个不同的Google Cloud项目访问Google Cloud Storage中的文件

Related 相关文章

  1. 1

    如何允许用户从Google Cloud Storage下载图像

  2. 2

    如何提供Google Cloud Storage图片?

  3. 3

    如何提供Google Cloud Storage映像?

  4. 4

    在Google Cloud Storage中保存图像

  5. 5

    将图像保存在Google Cloud Storage中

  6. 6

    使用Google Cloud Dataflow合并Google Cloud Storage中的文件

  7. 7

    使用Google Cloud Storage托管图像共享站点的图像

  8. 8

    从Google Cloud Storage提供Google客户服务帐户的keyFilename

  9. 9

    在Google Cloud Storage签名的URL中提供回调URL

  10. 10

    从 Google Cloud Storage 提供单页 React 应用程序

  11. 11

    如何从Node中的图像URL将图像上传到Google Cloud Storage?

  12. 12

    Google Cloud Storage与Google Cloud CDN

  13. 13

    如何使用存储在Google Cloud Storage中的图像调用Google Vision API?

  14. 14

    来自Google Vision API的空响应,其中包含存储在Google Cloud Storage中的图像

  15. 15

    Google Cloud Storage中的Concat Avro文件

  16. 16

    Google Cloud Storage中的速率限制

  17. 17

    如何从网络上传图像到Google Cloud Storage?

  18. 18

    PHP Google Cloud Storage Tools getImageServingUrl返回旧图像

  19. 19

    PHP Google Cloud Storage Tools getImageServingUrl返回旧图像

  20. 20

    使用Google Cloud Storage处理用户权限的正确方法?

  21. 21

    使用Python脚本中的Google Cloud Functions从Google Cloud Storage中读取CSV

  22. 22

    Google Cloud Storage Force下载

  23. 23

    上载Google Cloud Storage iOS

  24. 24

    Android的Google Cloud Storage管理

  25. 25

    Configure Django and Google Cloud Storage?

  26. 26

    IP限制Google Cloud Storage

  27. 27

    Google Cloud Storage - 权限不足

  28. 28

    使用Google Cloud Console在Google Cloud Storage中的文件夹之间移动文件

  29. 29

    从两个不同的Google Cloud项目访问Google Cloud Storage中的文件

热门标签

归档