tencentyun / cos-java-sdk-v5

java sdk for qcloud cos v5 (xml api)
MIT License
157 stars 142 forks source link

[问题] - 请问腾讯云COS还兼容S3吗? #215

Closed xingya1822 closed 3 months ago

xingya1822 commented 3 months ago

一些使用aws-sdk-go的工具还能把COS当成S3来使用吗?

有没有腾讯的开发者能提供一点内幕。。。

根据这个签名的文档,怎么感觉是不再支持标准的s3协议了。

我们公司有私有的腾讯云,而我有一个自建K8S集群,向通过Velero备份到私有的腾讯云COS。

Velero使用aws-sdk-go,它发送的请求如下:

GET /cos/gitlab-backup-1255000007?delimiter=%2F&list-type=2&prefix=backups%2F HTTP/1.1
Host: x.x.x.x
User-Agent: aws-sdk-go/1.30.13 (go1.13.11; linux; amd64)
Authorization: AWS4-HMAC-SHA256 Credential=AKIDub18tIN8Yd15pGM8aka5G8ixsSieGYV9/20240812/gzyhdev/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=a35fe956a8aee3911c63af54455a5b3341bdcca6b11432782c8fae69e535c85b
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20240812T073228Z
Accept-Encoding: gzip

HTTP/1.1 403 Forbidden
Server: nginx/1.20.1
Date: Mon, 12 Aug 2024 07:32:28 GMT
Content-Type: application/xml
Content-Length: 200
Connection: keep-alive
x-amz-request-id: tx000000000000002920c4c-0066b9ba8c-1e65353-default
Accept-Ranges: bytes

<?xml version="1.0" encoding="UTF-8"?><Error><Code>SignatureDoesNotMatch</Code><RequestId>tx000000000000002920c4c-0066b9ba8c-1e65353-default</RequestId><HostId>1e65353-default-default</HostId></Error>

这跟腾讯的文档描述的签名差别巨大。。。

agin719 commented 3 months ago

使用s3的SDK访问COS可以参考这个文档https://cloud.tencent.com/document/product/436/37421#go