Skip to content

Include signed query string in awsFetch URL to fix SigV4 403s#389

Merged
bmquinn merged 1 commit into
deploy/stagingfrom
sign-fetch-requests
Jun 4, 2026
Merged

Include signed query string in awsFetch URL to fix SigV4 403s#389
bmquinn merged 1 commit into
deploy/stagingfrom
sign-fetch-requests

Conversation

@bmquinn

@bmquinn bmquinn commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

awsFetch built the request URL as https://${signed.hostname}${signed.path}, dropping the query string. SigV4 includes the canonical query string in the signature, so any request with query params (e.g. ?search_pipeline=dc-v2-work-pipeline) was signed with the query but sent without it. OpenSearch recomputed the signature from what it actually received and rejected the request:

403 — The request signature we calculated does not match the signature you provided.

Fix

Build the fetch URL with formatUrl from @aws-sdk/util-format-url (already a transitive dep of the SigV4 signer, now declared explicitly). It serializes the query string the same way @smithy/signature-v4 does when signing, so the URL sent matches the URL signed.

@bmquinn bmquinn requested review from kdid and mbklein June 4, 2026 02:15
@bmquinn bmquinn merged commit ffc3520 into deploy/staging Jun 4, 2026
2 checks passed
@bmquinn bmquinn deleted the sign-fetch-requests branch June 4, 2026 15:02
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