This is an automated email from the ASF dual-hosted git repository.

mneumann pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git


The following commit(s) were added to refs/heads/main by this push:
     new ebaee78  Support --xa-s3 suffix for S3 Express One Zone bucket access 
points (#663)
ebaee78 is described below

commit ebaee78c8bd05235b4ceb2a5125a125faae5da86
Author: Prashant Deva <[email protected]>
AuthorDate: Thu Mar 19 04:04:53 2026 -0700

    Support --xa-s3 suffix for S3 Express One Zone bucket access points (#663)
    
    AWS recently introduced a new `--xa-s3` suffix for S3 Express One Zone
    directory buckets (in addition to the existing `--x-s3` suffix).
    `parse_bucket_az` only recognized `--x-s3`, causing a `ZoneSuffix` error
    for buckets using the new suffix.
    
    Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
 src/aws/builder.rs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/aws/builder.rs b/src/aws/builder.rs
index 8b767db..1b9204c 100644
--- a/src/aws/builder.rs
+++ b/src/aws/builder.rs
@@ -1261,7 +1261,10 @@ impl AmazonS3Builder {
 ///
 /// 
<https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html>
 fn parse_bucket_az(bucket: &str) -> Option<&str> {
-    Some(bucket.strip_suffix("--x-s3")?.rsplit_once("--")?.1)
+    let base = bucket
+        .strip_suffix("--x-s3")
+        .or_else(|| bucket.strip_suffix("--xa-s3"))?;
+    Some(base.rsplit_once("--")?.1)
 }
 
 /// Encryption configuration options for S3.
@@ -1787,8 +1790,11 @@ mod tests {
         let cases = [
             ("bucket-base-name--usw2-az1--x-s3", Some("usw2-az1")),
             ("bucket-base--name--azid--x-s3", Some("azid")),
+            ("bucket-base-name--use1-az4--xa-s3", Some("use1-az4")),
+            ("bucket-base--name--azid--xa-s3", Some("azid")),
             ("bucket-base-name", None),
             ("bucket-base-name--x-s3", None),
+            ("bucket-base-name--xa-s3", None),
         ];
 
         for (bucket, expected) in cases {

Reply via email to