- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经实现了 appengine docs 中提到的通用 blob 服务处理程序。 .只要您知道该 blob 的 key 字符串,该处理程序就会为您提供任何 blob。我使用它来轻松编写客户端可以用来下载文件的 URL。如果客户端 A 检查 URL 以下载他们的文件并找到他们的 blob key (即 1CX2kh468IDYKGcDUiq5c69u8BRXBtKBYcIaJkmSbSa4QY096gGVaYCZJjGZUpDz == str(BlobKey)
),他们能否以某种方式对该 key 进行逆向工程并轻松构建另一个可用于下载客户端 B 文件的 key ?或者 key 是否添加了随机组件?
供引用,有this note关于 str(db.Key)
,这引起了我的问题:
Note: The string representation of a key looks cryptic, but is not encrypted! It can be converted back to the raw key data, both kind and identifier. If you don't want to expose this data to your users (and allow them to easily guess other entities' keys), then encrypt these strings or use something else.
filename
参数,所以我认为问题归结为,
create()
如何“挑”一个
filename
什么时候没有指定?我想我可以生成一个随机文件名并将其传递到这里,以确保这是安全的。
file_name = files.blobstore.create(mime_type='application/octet-stream')
最佳答案
BlobKeys 是不可猜测的。如果用户有一个 key ,那绝不会让他们猜测另一个 key 。与包含完整路径信息的数据存储区 key 不同,BlobKeys 不编码任何此类数据。您可以安全地共享它们,而不会像您描述的那样冒用户进行攻击的风险。
(我找不到这些声明的文档 - 这是基于我的记忆。)
关于google-app-engine - str(BlobKey) 的安全性如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17079219/
我想知道保存 blobstore 引用的最佳方法是什么记录的方式是这样的: blobstore.BlobReferenceProperty() 或 ndb.BlobKeyProperty() 或 db
我已经实现了 appengine docs 中提到的通用 blob 服务处理程序。 .只要您知道该 blob 的 key 字符串,该处理程序就会为您提供任何 blob。我使用它来轻松编写客户端可以用来
我想为该用户上传到服务器的文件提供服务(编辑)。将其保存到 blobstore 后,我想将其加载到内存中进行编辑。存储文件后,我得到了 BlobKey 作为返回。据我了解,我应该使用以下方法将其加载到
您好,我正在尝试制作一个 servlet,允许管理员上传图像,并允许任何 google 用户查看这些图像,到目前为止,我正在使用 https://developers.google.com/appen
我从数据存储区获取 blobkey。 现在我想使用这个 blobkey 来获取 blobstore 中 blob 的内容类型。 怎么做? 最佳答案 您可以尝试此代码 BlobInfoFactory b
这是一个服务器端问题。我只有一个 BlobKey,没有其他东西。如何从所述 BlobKey 获取 blob 文件名?我知道如何获取servingUrl为 ServingUrlOptions optio
我编写了一个 Google App Engine 应用程序,它使用 Blobstore 来保存以编程方式生成的数据。为此,我使用了 Files API ,不幸的是,它已被弃用,取而代之的是 Googl
我正在从已弃用的文件 API 中转换代码。 我有以下代码在 SDK 服务器中运行良好但在生产环境中失败。我在做什么是正确的吗?如果是,可能出了什么问题,有什么解决方法吗? # Code earlier
我正在尝试在 GoogleAppEngine 上保存并提供一个 blob。 // Save the data as a blob final FileService fileService = Fil
我有一个从给定网址获取图像并将其保存到 Google Cloud Storage 并检索服务网址的过程。现在,我的理解(根据我读过的文档)是我还必须在引用 GCS 文件的过程中创建一个 blob。如果
我正在运行本地开发服务器并使用 image.ServingURL 从存储在 Google 存储中的 BlobKey 创建一个 url。这个 url 应该返回开发服务器上的图像吗? 我收到这样的错误:C
这里发生了奇怪的事情。运行任何调用的单元测试时: FileService fileService = FileServiceFactory.getFileService(); writeChannel
因此,由于新的高性能图片服务,我决定重写我的图片库。这意味着使用我以前从未使用过的 Blobstore。在我尝试将 BlobKey 存储在我的模型中之前,它看起来很简单。 到底如何在模型中存储对 bl
我有一个充满 BlobKey 的数据库,这些 BlobKey 是以前通过标准 Google App Engine 上传的 create_upload_url()过程,并且通过设置 gs_bucket_
在我的 Android 应用程序中,我想将图像上传到 Blobstore,然后检索上传 url 和图像的 Blobkey,这样我就可以将 Blobkey 存储在 DataStore 中。 我试过这段代
我是一名优秀的程序员,十分优秀!