-
Notifications
You must be signed in to change notification settings - Fork 746
[GH-2522] Implemented STAC authentication for both python and scala APIs #2523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GH-2522] Implemented STAC authentication for both python and scala APIs #2523
Conversation
There was a problem hiding this 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.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes #<issue_number>What changes were proposed in this PR?
How was this patch tested?
Did this PR include necessary documentation updates?