rlamarche opened a new pull request, #931:
URL: https://github.com/apache/arrow-rs-object-store/pull/931

   # Which issue does this PR close?
   
   Closes #930.
   
   # Rationale for this change
   
   `GoogleCloudStorage::signed_url` and `GoogleCloudStorage::signed_url_opts` 
currently produce URLs rejected by GCS with `SignatureDoesNotMatch` when the 
object path contains RFC 3986 sub-delimiters such as `=` (e.g. Hive-partitioned 
keys like `data/year=2026/month=12/day=03/file.parquet`).
   
   `GoogleCloudStorageConfig::path_url` does not percent-encode path segments 
with `STRICT_PATH_ENCODE_SET` (unlike S3's `S3Config::path_url`), and 
`GCSAuthorizer::canonicalize_request` passes `url.path()` verbatim into the 
canonical request, whereas the [GCS V4 Canonical Request 
specification](https://cloud.google.com/storage/docs/authentication/canonical-requests#about-resource-path)
 requires percent-encoding all non-unreserved bytes except `/`.
   
   # What changes are included in this PR?
   
   - Share `STRICT_PATH_ENCODE_SET` in `src/util.rs` for reuse by both `aws` 
and `gcp`.
   - Percent-encode `bucket_name` (`STRICT_ENCODE_SET`) and `path` 
(`STRICT_PATH_ENCODE_SET`) in `GoogleCloudStorageConfig::path_url` 
(`src/gcp/client.rs`).
   - Canonicalize the resource path per `/`-delimited segment in 
`GCSAuthorizer::canonicalize_request` (`src/gcp/credential.rs`) using 
`percent_decode_str` + `percent_encode(..., &STRICT_ENCODE_SET)` so unencoded 
sub-delimiters are encoded without double-encoding existing `%XX` escapes or 
decoding `%2F`.
   - Add unit tests in `src/gcp/credential.rs` covering Hive-partitioned 
multipart `UploadPart` signed URLs (including SHA-256 canonical request digest 
verification) and non-double-encoding of spaces, `%`, and `%2F`.
   
   # Are there any user-facing changes?
   
   No breaking API changes. GCS V4 signed URLs generated by 
`GoogleCloudStorage::signed_url` and `GoogleCloudStorage::signed_url_opts` now 
percent-encode RFC 3986 sub-delimiters in the URL path so they match GCS V4 
signature verification.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to