Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions java/lance-jni/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion java/lance-jni/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lance-linalg = { path = "../../rust/lance-linalg" }
lance-index = { path = "../../rust/lance-index" }
lance-io = { path = "../../rust/lance-io" }
lance-namespace = { path = "../../rust/lance-namespace" }
lance-namespace-impls = { path = "../../rust/lance-namespace-impls", features = ["rest", "rest-adapter", "dir-goosefs"] }
lance-namespace-impls = { path = "../../rust/lance-namespace-impls", features = ["rest", "rest-adapter", "dir-goosefs", "rest-auth-sigv4"] }
lance-core = { path = "../../rust/lance-core" }
lance-file = { path = "../../rust/lance-file" }
lance-table = { path = "../../rust/lance-table" }
Expand Down
7 changes: 6 additions & 1 deletion java/lance-jni/src/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,12 @@ fn create_rest_namespace_internal(
builder = builder.context_provider(Arc::new(java_provider));
}

let namespace = builder.build();
let namespace = builder.build().map_err(|e| {
Error::runtime_error(format!("Failed to build RestNamespace: {}", e))
})?;

RT.block_on(namespace.warm_up_auth())
.map_err(|e| Error::runtime_error(format!("Auth initialization failed: {}", e)))?;

let blocking_namespace = BlockingRestNamespace {
inner: Arc::new(namespace),
Expand Down
16 changes: 14 additions & 2 deletions java/src/main/java/org/lance/namespace/RestNamespace.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@
* <li>uri (required): REST API endpoint URL
* <li>delimiter (optional): Namespace delimiter (default: "$")
* <li>header.* (optional): HTTP headers (e.g., header.Authorization=Bearer token)
* <li>rest.auth.type (optional): Authentication type — "sigv4" or "none" (default: none)
* <li>rest.auth.sigv4.region (required if sigv4): AWS region
* <li>rest.auth.sigv4.service (optional): AWS service name (default: "execute-api")
* <li>rest.auth.sigv4.access-key-id (optional): Explicit AWS access key ID
* <li>rest.auth.sigv4.secret-access-key (optional): Explicit AWS secret access key
* <li>rest.auth.sigv4.session-token (optional): STS session token
* </ul>
*
* <p>Note: {@code rest.auth.*} and {@code header.Authorization} are mutually exclusive.
* Setting both will throw an error at initialization time.
*
* <ul>
* <li>tls.cert_file (optional): Path to client certificate file
* <li>tls.key_file (optional): Path to client key file
* <li>tls.ssl_ca_cert (optional): Path to CA certificate file
Expand All @@ -131,8 +143,8 @@
* <pre>{@code
* Map<String, String> properties = new HashMap<>();
* properties.put("uri", "https://api.example.com");
* properties.put("delimiter", ".");
* properties.put("header.Authorization", "Bearer my-token");
* properties.put("rest.auth.type", "sigv4");
* properties.put("rest.auth.sigv4.region", "us-east-1");
*
* RestNamespace namespace = new RestNamespace();
* namespace.initialize(properties, allocator);
Expand Down
Loading
Loading