You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by pa...@apache.org on 2026/06/30 21:40:36 UTC

(sedona-db) branch main updated: fix(rust/sedona): accept aws.allow_http / aws.session_token; reject dead AWS options (#1013)

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

paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sedona-db.git


The following commit(s) were added to refs/heads/main by this push:
     new 28c06bb63 fix(rust/sedona): accept aws.allow_http / aws.session_token; reject dead AWS options (#1013)
28c06bb63 is described below

commit 28c06bb636390b7b565e99b9523eb40f68a80256
Author: Adon Metcalfe <ad...@fastmail.fm>
AuthorDate: Wed Jul 1 05:40:30 2026 +0800

    fix(rust/sedona): accept aws.allow_http / aws.session_token; reject dead AWS options (#1013)
    
    Co-authored-by: adonm <ad...@users.noreply.github.com>
---
 rust/sedona-geoparquet/src/provider.rs | 57 +++++++++++++++++++++++++++++++---
 1 file changed, 53 insertions(+), 4 deletions(-)

diff --git a/rust/sedona-geoparquet/src/provider.rs b/rust/sedona-geoparquet/src/provider.rs
index a9b1911fa..cd5dca1b6 100644
--- a/rust/sedona-geoparquet/src/provider.rs
+++ b/rust/sedona-geoparquet/src/provider.rs
@@ -125,16 +125,23 @@ impl GeoParquetReadOptions<'_> {
     pub fn from_table_options(options: HashMap<String, String>) -> Result<Self, String> {
         for key in options.keys() {
             if key.starts_with("aws.") {
+                // Keep this list in sync with the options consumed by
+                // `AwsOptions::set` in `sedona::object_storage`. The previous
+                // list accepted several options (`aws.bucket_name`,
+                // `aws.use_ssl`, `aws.force_path_style`, `aws.nosign`) that are
+                // never consumed there -- they passed validation here but were
+                // silently dropped by `to_listing_options`, so a user setting
+                // them got no effect and no error. Conversely it rejected
+                // `aws.allow_http` and `aws.session_token`, which _are_
+                // consumed. The list below now matches the consumer exactly.
                 let common_aws_options = [
                     "aws.access_key_id",
                     "aws.secret_access_key",
+                    "aws.session_token",
                     "aws.region",
                     "aws.endpoint",
+                    "aws.allow_http",
                     "aws.skip_signature",
-                    "aws.nosign",
-                    "aws.bucket_name",
-                    "aws.use_ssl",
-                    "aws.force_path_style",
                 ];
 
                 if !common_aws_options.contains(&key.as_str()) {
@@ -358,6 +365,48 @@ mod test {
 
     use super::*;
 
+    #[test]
+    fn aws_option_allowlist_matches_consumer() {
+        // Options consumed by AwsOptions::set in sedona::object_storage must be
+        // accepted here; options NOT consumed there must be rejected (otherwise
+        // they are silently dropped in to_listing_options and mislead users).
+        for accepted in [
+            "aws.access_key_id",
+            "aws.secret_access_key",
+            "aws.session_token",
+            "aws.region",
+            "aws.endpoint",
+            "aws.allow_http",
+            "aws.skip_signature",
+        ] {
+            let mut opts = HashMap::new();
+            opts.insert(accepted.to_string(), "x".to_string());
+            GeoParquetReadOptions::from_table_options(opts)
+                .unwrap_or_else(|e| panic!("{accepted} should be accepted, got: {e}"));
+        }
+
+        for rejected in [
+            "aws.bucket_name",
+            "aws.use_ssl",
+            "aws.force_path_style",
+            "aws.nosign",
+        ] {
+            let mut opts = HashMap::new();
+            opts.insert(rejected.to_string(), "x".to_string());
+            // Avoid `expect_err`/`unwrap_err`: they require `Debug` on the
+            // `Ok` type, but `GeoParquetReadOptions` (via `ParquetReadOptions`)
+            // does not implement `Debug`.
+            let err = match GeoParquetReadOptions::from_table_options(opts) {
+                Ok(_) => panic!("{rejected} should be rejected"),
+                Err(e) => e,
+            };
+            assert!(
+                err.contains("Unknown AWS option"),
+                "{rejected} should be rejected, got: {err}"
+            );
+        }
+    }
+
     #[tokio::test]
     async fn listing_table() {
         let ctx = SessionContext::new();