storage: V4 getSignedUrl sorts canonical headers with localeCompare, so they disagree with X-Goog-SignedHeaders
Maintainer thường phản hồi trong vòng 1 ngày
@itsrayeedscodespace đang làm issue này rồi.
Từ ngày 8/11/2026.
- #9841 của @itsrayeedscodespace — đang mở
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Bắt đầu tại handwritten/storage/src/signer.ts, ở URLSigner.getCanonicalHeaders, và so sánh thứ tự các header với .sort() đơn giản được dùng cho signedHeaders. Kiểm tra các bài kiểm thử của storage signer xem đã bao phủ tên header chứa - và _, cũng như thứ tự phụ thuộc vào locale hay chưa. Hoàn tất khi khối canonical headers tuân theo thứ tự code point và khớp với danh sách signed headers.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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/
- Ngôn ngữ chính
- TypeScript
- Star
- 3.2k
- Fork
- 732
- Merge trung bình
- 3 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 117
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleapis/google-cloud-node
-
Broken deprecation chainĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
googleapis/google-cloud-node#9854 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pubsub: "Operation attempted on ended Span" when a modack is flushed after the message was ackedĐang mởapi: pubsub
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9853 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
firestore: getPartitions() emits gax AutopaginateTrueWarning in every processCó thể đã có người làm @TheRealDanii đã nhận 9 ngày trước. Đang mởapi: firestore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
googleapis/google-cloud-node#9736 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9723 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
spanner: requiring @google-cloud/spanner stops the process from exiting on SIGTERM/SIGINTCó thể làm lại được @alkatrivedi đã nhận 31 ngày trước và không có pull request nào đang mở. Đang mởapi: spanner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
googleapis/google-cloud-node#9513 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của googleapis/google-cloud-node
Issue tương tự
-
bug UI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
wardian-app/Wardian#1746 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: interop area: sip-core v3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
fonoster/routr#705 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openclaw/openclaw#198551 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày