-
Notifications
You must be signed in to change notification settings - Fork 167
Closed
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Environment details
- OS type and version:
- Python version: Python 3.8.6
- pip version:
pip 20.3.3 google-cloud-storageversion:Version: 1.37.1
Steps to reproduce
- Generate a signed url with an expiration of more than 7 days in the future
- Save it
- Wait for 7+ days
- Try to access the URL
Code example
expiration = timedelta(seconds=45*86400) #45 days
signed_url = blob.generate_signed_url(
expiration=expiration,
service_account_email=service_account_email,
access_token=credentials.token,
)Stack trace
After 7 days accessing the URL will result in this error:
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Message>
<StringToSign>GET 1629488504 /BUCKET_NAME/inspection-media/DSC00095.JPG</StringToSign>
</Error>
This used to work, but the documentation recently updated here, to include a warning instead of just saying
https://cloud.google.com/storage/docs/access-control/signed-urls-v2
This is a big issue for us. We generate exports of data including spreadsheets. Our customers want the access in these exports to work for more than 7 days.
- The documentation should be very clear that signed urls are invalid after 7 days with an error message that is not clear. I assume this is because the underlying key has been rotated out.
- The library should reject expiration dates to far in the future.
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.