storage: V4 getSignedUrl sorts canonical headers with localeCompare, so they disagree with X-Goog-SignedHeaders
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
handwritten/storage/src/signer.ts の URLSigner.getCanonicalHeaders から始め、ヘッダーの並び順を signedHeaders に使われている単純な .sort() と比較してください。storage signer のテストで、- と _ を含むヘッダー名、およびロケールに依存する並び順がカバーされているか確認してください。canonical headers ブロックがコードポイント順になり、signed headers のリストと一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
- Check the API's issue tracker: https://cloud.google.com/support/docs/issue-trackers
Library Name
@google-cloud/storage
A screenshot that you have tested with "Try this API".
Not applicable: V4 URL signing happens entirely in the client library; no API call is involved.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/trackoor/dc977f474cf9a692628c158959bbef2c
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
npm install(installs @google-cloud/storage 8.4.0), Node.js v26.13.0 (full ICU), Linux.node index.jsprints the canonical request that gets signed, forextensionHeaders: {"x-goog-meta-a_b": "1", "x-goog-meta-a-b": "2"}:
GET
/test-bucket/test-object
X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=test%40example.iam.gserviceaccount.com%2F20261107%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20261107T105715Z&X-Goog-Expires=60&X-Goog-SignedHeaders=host%3Bx-goog-meta-a-b%3Bx-goog-meta-a_b
host:storage.googleapis.com
x-goog-meta-a_b:1
x-goog-meta-a-b:2
host;x-goog-meta-a-b;x-goog-meta-a_b
UNSIGNED-PAYLOAD
LANG=lt_LT.UTF-8 node index.js ltdoes the same forx-goog-meta-yandx-goog-meta-j:
host:storage.googleapis.com
x-goog-meta-y:1
x-goog-meta-j:2
host;x-goog-meta-j;x-goog-meta-y
A clear and concise description of what the bug is, and what you expected to happen.
The canonical headers block is in a different order from the signed headers list in the same canonical request, so GCS computes a different signature and rejects the URL. Expected: canonical headers in code point order, matching X-Goog-SignedHeaders:
host:storage.googleapis.com
x-goog-meta-a-b:2
x-goog-meta-a_b:1
host;x-goog-meta-a-b;x-goog-meta-a_b
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
The V4 canonical request docs say headers are sorted by name "using a lexicographical sort by code point value": https://cloud.google.com/storage/docs/authentication/canonical-requests
URLSigner.getCanonicalHeaders in handwritten/storage/src/signer.ts (line 401 on main at 97b0d64daa8ea9407756aee646b8ac1bf19aec80) sorts with a[0].localeCompare(b[0]), which puts _ before - and follows the process locale, while signedHeaders uses a plain .sort().
Credit: https://ucsbplse.github.io/
- 主要言語
- TypeScript
- スター
- 3.2k
- フォーク
- 732
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 117
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/google-cloud-node のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
googleapis/google-cloud-node#9854 ·
メンテナーはふだん 1 日以内に返信
-
pubsub: "Operation attempted on ended Span" when a modack is flushed after the message was ackedオープンapi: pubsub
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
googleapis/google-cloud-node#9853 ·
メンテナーはふだん 1 日以内に返信
-
firestore: getPartitions() emits gax AutopaginateTrueWarning in every process対応中かも @TheRealDanii が 9 日前に担当しました。 オープンapi: firestore
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
googleapis/google-cloud-node#9736 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
googleapis/google-cloud-node#9723 ·
メンテナーはふだん 1 日以内に返信
-
spanner: requiring @google-cloud/spanner stops the process from exiting on SIGTERM/SIGINT再び着手できるかも @alkatrivedi が 31 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンapi: spanner
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/google-cloud-node#9513 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
googleapis/google-cloud-node の issue をすべて見る
似ている issue
-
bug UI
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
wardian-app/Wardian#1746 ·
メンテナーはふだん 1 日以内に返信
-
area: interop area: sip-core v3
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
fonoster/routr#705 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openclaw/openclaw#198551 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信