Skip to content

Default Signature V2 to HMAC-SHA256 - #160

Open
PanPanZou wants to merge 4 commits into
masterfrom
fix/signature-v2-default-sha256
Open

PanPanZou wants to merge 4 commits into
masterfrom
fix/signature-v2-default-sha256

Conversation

@PanPanZou

@PanPanZou PanPanZou commented Oct 30, 2026 •

Copy link
Copy Markdown

Use HMAC-SHA256 by default for RPC, ROA, CommonClient, and STS AssumeRole requests. Preserve the existing constructor API for explicitly supplied signers.

Rebuild product clients with the updated Core headers to pick up the new constructor default; previously compiled callers may retain the SHA1 signer from the old default argument.

@yndu13

yndu13 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

[P2] 请给 CommonClient 保留显式选择 SHA1 的入口。目前它的三个构造函数都固定创建 HmacSha256Signer,且 signer 为私有成员。RPC 和 ROA 专用客户端可以传入 HmacSha1Signer,但使用 Common API 的调用方无法按同样方式兼容只支持 SHA1 的端点。可以保留现有构造调用方式并提供可选 signer,默认使用 SHA256,同时补上 Common 请求默认 SHA256 和显式 SHA1 的签名测试。

@PanPanZou

Copy link
Copy Markdown
Author

针对这条评审意见:

RpcServiceClient、RoaServiceClient 原本支持传入 Signer,该能力继续保留;显式传入 HmacSha1Signer 时仍按 HMAC-SHA1 签名。

CommonClient 的三个构造函数原本均没有 signer 参数,内部固定创建签名器。本 PR 仅将其默认实现从 SHA1 升级为 SHA256。按照本次“升级默认算法、保留已有显式选择、不新增 SHA1 回退入口”的改动范围,不再为 CommonClient 新增可选 signer 参数。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants