问题
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