-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add a mechanism for adding headers to StacIO requests #889
Add a mechanism for adding headers to StacIO requests #889
Conversation
@gadomski can you take a look? |
Yes, it's in my queue, thanks for the bump. Right now I'm working on PySTAC issues in my off time so responses may be a bit slower, apologies. |
Codecov ReportBase: 94.29% // Head: 94.31% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #889 +/- ##
==========================================
+ Coverage 94.29% 94.31% +0.01%
==========================================
Files 80 80
Lines 11909 11922 +13
Branches 1130 1130
==========================================
+ Hits 11230 11244 +14
Misses 496 496
+ Partials 183 182 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
7bd8605
to
66a7b06
Compare
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.
I've tested this with a real-world STAC server that requires authorization, and it appears to work. Thanks for the contribution! I'm going to request @matthewhanson's review as well, because he brought up the point in a side channel that you could just use pystac-client, which already supports authorization. In my opinion, this PR is still useful, as it doesn't add any extra dependencies to add functionality, but would like Matt to weigh in as well.
Thanks for the PR @john-dupuy . As @gadomski said, you could use pystac-client here which handles header auth and works fine on static catalogs. However I agree that since it requires no dependencies and is a simple addition it doesn't hurt to include it in PySTAC as well. |
Related Issue(s): #886
Description:
This PR aims to address #886 by adding a mechanism for adding headers for StacIO requests.
The suggested approach for using this:
You could also just directly instantiate the
StacIO
orDefaultStacIO
class, with headers included as an arg.PR Checklist:
pre-commit run --all-files
)scripts/test
)