Rishabh Daim created OAK-12487:
----------------------------------

             Summary: S3 accelerated presigned URLs use an unsupported regional 
endpoint
                 Key: OAK-12487
                 URL: https://issues.apache.org/jira/browse/OAK-12487
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: blob-cloud
            Reporter: Rishabh Daim
            Assignee: Rishabh Daim


S3 direct upload/download URLs use an unsupported hostname when transfer 
acceleration is enabled and no custom endpoint is configured.

h3. Cause and impact
{{Utils.createPresigner(..., true)}} sets an endpoint override from 
{{getEndPointUri}}. The endpoint builder returns 
{{s3-accelerate.<region>.amazonaws.com}}, producing an invalid accelerated URL 
instead of {{<bucket>.s3-accelerate.amazonaws.com}}. This affects accelerated 
direct binary access; ordinary non-accelerated access is outside this issue.

Present on trunk at {{aeff1ea56039f5bfca6ec74995427d8e4991b0df}}:
* [Presigner endpoint 
override|https://github.com/apache/jackrabbit-oak/blob/aeff1ea56039f5bfca6ec74995427d8e4991b0df/oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/Utils.java#L169-L182]
* [Endpoint 
construction|https://github.com/apache/jackrabbit-oak/blob/aeff1ea56039f5bfca6ec74995427d8e4991b0df/oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/Utils.java#L365-L383]

h3. Reproduction
Build a presigner with static test credentials, a region such as {{us-east-1}}, 
acceleration requested, and no custom endpoint. Presign a GET or PUT for a 
DNS-compatible bucket and inspect the hostname. No live AWS call is needed to 
observe the malformed URL.

h3. Expected behavior and fix
Use the SDK acceleration configuration or the supported global acceleration 
endpoint. Keep the signing region configured separately and preserve 
non-accelerated/custom-endpoint behavior. Add regression coverage asserting the 
exact supported host for accelerated GET and PUT URLs, rather than only 
checking for the substring {{s3-accelerate}}. Update the existing 
endpoint-builder test that expects the regional acceleration hostname.

[AWS Transfer Acceleration 
requirements|https://docs.aws.amazon.com/AmazonS3/latest/userguide/transfer-acceleration.html]
Related credential/presigner changes: OAK-12476.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to