zhangfengcdt opened a new pull request, #2523: URL: https://github.com/apache/sedona/pull/2523
## Did you read the Contributor Guide? - Yes, I have read the [Contributor Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest/community/develop/) ## Is this PR related to a ticket? - Yes, and the PR name follows the format `[GH-XXX] my subject`. Closes #<issue_number> ## What changes were proposed in this PR? ### Python API - Added optional `headers` parameter to `Client` and `CollectionClient` constructors - Added `with_basic_auth(username, password)` method for HTTP Basic Authentication - Added `with_bearer_token(token)` method for Bearer Token/OAuth2 authentication - Support for method chaining for clean, readable code - Headers are JSON-encoded and passed to Spark via `.option("headers", json)` ### Scala Backend - Added `parseHeaders()` method in `StacUtils` to parse JSON-encoded headers - Updated `loadStacCollectionToJson()` to use `URLConnection` with custom headers - Updated `StacBatch` to propagate headers through batch processing - Maintained backward compatibility with overloaded methods ## How was this patch tested? - **Python**: 15 new unit tests covering basic auth, bearer tokens, header propagation, and edge cases - **Scala**: 7 new tests for header parsing and JSON handling - **Integration**: Framework for testing with real STAC services (Planet, Sentinel Hub) ## Did this PR include necessary documentation updates? - Yes, I have updated the documentation (TBA) -- 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]
