Skip to content

Conversation

@zhangfengcdt
Copy link
Member

@zhangfengcdt zhangfengcdt commented Nov 24, 2025

Did you read the Contributor Guide?

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?

  • Added authentication methods (with_basic_auth, with_bearer_token) to Python Client class with method chaining support
  • Implemented header parsing and propagation through the Scala backend via JSON-encoded options
  • Added comprehensive test coverage for authentication scenarios including unit and integration tests

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

@zhangfengcdt zhangfengcdt changed the title [GH-2522] Implemented STAC authentication for both python and scala APIs WIP [GH-2522] Implemented STAC authentication for both python and scala APIs Nov 24, 2025
@zhangfengcdt zhangfengcdt changed the title WIP [GH-2522] Implemented STAC authentication for both python and scala APIs [GH-2522] Implemented STAC authentication for both python and scala APIs Nov 24, 2025
@zhangfengcdt zhangfengcdt marked this pull request as ready for review November 25, 2025 18:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements STAC authentication support for both Python and Scala APIs, enabling access to authenticated STAC services. The implementation adds HTTP Basic Authentication and Bearer Token authentication methods while maintaining backward compatibility with public services.

Key changes:

  • Added authentication methods (with_basic_auth, with_bearer_token) to Python Client class with method chaining support
  • Implemented header parsing and propagation through the Scala backend via JSON-encoded options
  • Added comprehensive test coverage for authentication scenarios including unit and integration tests

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
python/sedona/spark/stac/client.py Added authentication methods and headers parameter to Client class
python/sedona/spark/stac/collection_client.py Added headers parameter and JSON encoding for Spark integration
python/tests/stac/test_auth.py Unit tests for authentication methods and header propagation
python/tests/stac/test_auth_integration.py Integration tests with real STAC services using environment variables
spark/common/src/main/scala/.../StacUtils.scala Added parseHeaders method and header support in loadStacCollectionToJson
spark/common/src/main/scala/.../StacPartitionReader.scala Added header propagation to URL connections
spark/common/src/main/scala/.../StacBatch.scala Updated to pass headers through batch processing
spark/common/src/test/scala/.../StacUtilsTest.scala Unit tests for header parsing functionality
spark/common/src/test/scala/.../StacDataSourceTest.scala Integration tests for authentication with remote services
docs/tutorial/files/stac-sedona-spark.md Documentation for authentication usage and examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jiayuasu jiayuasu added this to the sedona-1.8.1 milestone Nov 25, 2025
@jiayuasu jiayuasu merged commit 47ed183 into apache:master Nov 25, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants