k2v-client does not work with partition keys that require urlencoding #573

Closed
opened 2023-05-17 21:49:24 +00:00 by lx · 0 comments
Owner

https://docs.rs/rusoto_signature/latest/src/rusoto_signature/signature.rs.html#464 : we learn that for all AWS services except S3, the canonical URL must be urlencoded twice (wtf???). The k2v-client library is using rusoto_signature that abides to this: since the service is not s3, it urlencodes twice the canonical URL and then computes the signature. On the server side, we use the same code for S3 and K2V, therefore we only urlencode once, and signatures therefore don't match when they contain characters that require encoding.

Official source: https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html makes no mention of the "S3 exception", and actually makes no mention of the double-URLencoding.

<https://docs.rs/rusoto_signature/latest/src/rusoto_signature/signature.rs.html#464> : we learn that for all AWS services except S3, the canonical URL must be urlencoded twice (wtf???). The k2v-client library is using rusoto_signature that abides to this: since the service is not `s3`, it urlencodes twice the canonical URL and then computes the signature. On the server side, we use the same code for S3 and K2V, therefore we only urlencode once, and signatures therefore don't match when they contain characters that require encoding. Official source: <https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html> makes no mention of the "S3 exception", and actually makes no mention of the double-URLencoding.
lx changed title from k2v-client does not urlencode correctly when computing signature to k2v-client does not work with partition keys that require urlencoding 2023-05-17 21:49:52 +00:00
lx added the
Bug
label 2023-05-17 22:08:18 +00:00
lx closed this issue 2023-05-18 09:33:04 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#573
No description provided.