python-无法为Google云存储对象创建签名网址

时间:2018-05-30 02:50:10

标签: python-3.x google-cloud-storage

我使用下面的代码为Google云端存储上的文件生成已签名的网址,但是当我点击我获得的链接时SignatureDoesNotMatch

from google.cloud.storage._signing import generate_signed_url
from google.oauth2.service_account import Credentials

signed_url = generate_signed_url(credentials=Credentials.from_service_account_file(google_cloud_platform__key_path),
                                     resource=self.canonicalized_resource,
                                     expiration=self.expiration,
                                     content_type=self.content_type
                                     )

0 个答案:

没有答案