Lowercase query parameter keys when parsing #753

Closed
asonix wants to merge 2 commits from asonix/garage:main into main
Contributor

fixes #752

fixes https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/752
asonix added 1 commit 2024-03-03 20:36:33 +00:00
Author
Contributor

Just this isn't enough. Getting the following now:

2024-03-03T21:28:18.033798Z  INFO garage_api::generic_server: [::ffff:10.42.7.110]:41580 HEAD /pict-rs/?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[redacted]&X-Amz-Date=20240303T212818Z&X-Amz-Expires=15&X-Amz-SignedHeaders=host&X-Amz-Signature=[redacted]
2024-03-03T21:28:18.034944Z  INFO garage_api::generic_server: Response: error 403 Forbidden, Forbidden: Invalid signature
Just this isn't enough. Getting the following now: ``` 2024-03-03T21:28:18.033798Z INFO garage_api::generic_server: [::ffff:10.42.7.110]:41580 HEAD /pict-rs/?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[redacted]&X-Amz-Date=20240303T212818Z&X-Amz-Expires=15&X-Amz-SignedHeaders=host&X-Amz-Signature=[redacted] 2024-03-03T21:28:18.034944Z INFO garage_api::generic_server: Response: error 403 Forbidden, Forbidden: Invalid signature ```
Author
Contributor

it seems the canonical_request has lowercased keys, which ends up generating a different signing string than the client which has title-cased keys

it seems the `canonical_request` has lowercased keys, which ends up generating a different signing string than the client which has title-cased keys
Author
Contributor

garage 0.9.1's canonical request:

HEAD
/pict-rs/
X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[redacted]&X-Amz-Date=20240303T215113Z&X-Amz-Expires=15&X-Amz-SignedHeaders=host
host:garage-daemon.garage.svc:3900

garage 0.9.2's canonical request:

HEAD
/pict-rs/
x-amz-algorithm=AWS4-HMAC-SHA256&x-amz-credential=[redacted]&x-amz-date=20240303T215553Z&x-amz-expires=15&x-amz-signedheaders=host
host:garage-daemon.garage.svc:3900
garage 0.9.1's canonical request: ``` HEAD /pict-rs/ X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[redacted]&X-Amz-Date=20240303T215113Z&X-Amz-Expires=15&X-Amz-SignedHeaders=host host:garage-daemon.garage.svc:3900 ``` garage 0.9.2's canonical request: ``` HEAD /pict-rs/ x-amz-algorithm=AWS4-HMAC-SHA256&x-amz-credential=[redacted]&x-amz-date=20240303T215553Z&x-amz-expires=15&x-amz-signedheaders=host host:garage-daemon.garage.svc:3900 ```
asonix added 1 commit 2024-03-03 22:27:05 +00:00
Author
Contributor

I've deployed this on my network and it seems to be working

I've deployed this on my network and it seems to be working
Owner

Hello, sorry for breaking this and thanks for fixing it.

@asonix Can you make your fork of the repo public? The CI is refusing to run currently as it cannot access your code.

Hello, sorry for breaking this and thanks for fixing it. @asonix Can you make your fork of the repo public? The CI is refusing to run currently as it cannot access your code.
Owner

Closing in favor of #756. I've kept your comits for the fix, thank you.

Closing in favor of #756. I've kept your comits for the fix, thank you.
lx closed this pull request 2024-03-04 12:30:16 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.