Google cloud storage - signed urls - one time access

拥有回忆 提交于 2021-02-18 08:19:41

问题


we are planning to use Google cloud storage with signed urls that we can give to users.

So we upload a document Generate the signed url (using the details mentioned here: https://developers.google.com/storage/docs/accesscontrol#Signed-URLs)

The issue is that google (or) aws etc.. they provide expiration time for the URLs (say : few min/ few hours/ few days etc..) But we want the urls to expire after certain number of requests

Let us say, I generate the URL and send to my user (with some 4 hrs expiration) and we want that url to expire after user access the URL for 2nd time (when the user access the URL for 3rd time, it (google) should not return the data.

Is this possible?


回答1:


This is not currently possible.




回答2:


You can achieve this by allowing the service account to read and create objects only. This way the link - once used - can't be used to upload again to the same file since it needs to delete it first which the service account doesn't have permission to.



来源:https://stackoverflow.com/questions/24042783/google-cloud-storage-signed-urls-one-time-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!