gpt4 book ai didi

c# - 我们可以继续在服务器端按需创建 Azure 共享访问签名吗?

转载 作者:行者123 更新时间:2023-12-03 05:55:07 25 4
gpt4 key购买 nike

我们计划将文件上传到 Azure blob。默认情况下,上传到 Azure blob 的任何内容都是私有(private)的。例如,只有经过身份验证后才能访问该 blob 项目的 Uri。

我们计划列出人们上传到这个单一容器的所有文件。我们计划将其显示在网页上。

我们认为可以在网页上列出所有这些 Uri,并在 Uri 中包含 SaS 值

然后我们想:我们如何生成短暂的 SaS?

所以

  • 我们可以继续按需创建 SaaS 吗?
  • (每个容器)有限制吗?

(旁注:我正在考虑拥有一个未过期的静态 SaS token 并使用它,否则生成一个新 token 。过期时间大约为 15 分钟左右)。

最佳答案

是的,您可以继续创建它们,没有限制。 Azure 存储不会跟踪 SAS token ,它们由客户端生成并使用 Azure 存储终结点用来验证其有效性的签名进行签名。

来自文档(强调我自己的):

Note that the SAS token is a string generated on the client side (see the SAS examples section below for code examples). The SAS token generated by the storage client library is not tracked by Azure Storage in any way. You can create an unlimited number of SAS tokens on the client side.

When a client provides a SAS URI to Azure Storage as part of a request, the service checks the SAS parameters and signature to verify that it is valid for authenticating the request. If the service verifies that the signature is valid, then the request is authenticated. Otherwise, the request is declined with error code 403 (Forbidden).

--https://learn.microsoft.com/en-us/azure/storage/storage-dotnet-shared-access-signature-part-1

关于c# - 我们可以继续在服务器端按需创建 Azure 共享访问签名吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42499357/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com