TencentCloud / tencentcloud-sdk-nodejs

Tencent Cloud API 3.0 SDK for NodeJS
Apache License 2.0
368 stars 99 forks source link

HMAC-SHA256 签名方式有问题 ? #23

Closed eczn closed 5 years ago

eczn commented 5 years ago

SCF 传函数的时候需要传 zip 文件,根据文档里的描述这里可以采用传 Base64 的方式进行传输。

然而,base64 很长,最后得到的响应是签名无效。。。。

image

而代码里默认走的是 hmac256:

image

看起来是 Hmac 256 的实现有问题,能定位看看问题不?

eczn commented 5 years ago

https://cloud.tencent.com/document/api/583/18586

这是创建SCF函数的接口。

zqfan commented 5 years ago

签名v3尚未合入主干:https://github.com/TencentCloud/tencentcloud-sdk-nodejs/tree/signature3

eczn commented 5 years ago

签名v3尚未合入主干:https://github.com/TencentCloud/tencentcloud-sdk-nodejs/tree/signature3

好吧,我这里目前走 cos 上传代码了。

shynome commented 5 years ago

@zqfan 现在 signature3 的分支能用 v3 签名吗

shynome commented 5 years ago

signature3 分支 v3 签名 GeneralBasicOCRRequest 失败: The provided credentials could not be validated. Please check your signature is correct.