-
Notifications
You must be signed in to change notification settings - Fork 122
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
RFC: Add a mechanism for passing authorization headers to child links #886
Comments
Your approach makes sense and is the currently-supported way of doing custom IO. Note that there is a StacIO.set_default method, which you can use to enable your custom StacIO without touching the "private" With respect to adding a class to PySTAC that handles this authorization automatically, it's not an unreasonable request. However, we (currently) try to keep PySTAC extermely low-dependency, with only one required dependency (python-dateutil) and two optional dependencies (jsonschema and orjson). An authorization-enabled StacIO that doesn't add any extra dependencies could be useful and would be a good PR. One that uses requests would probably not be included in the current version of PySTAC. However, there are discussions (e.g. #846) around adding more functionality that uses external libraries, and so there is a possibility of adding a requests-dependent StacIO in a future (probably v2) PySTAC. |
Thanks for the reply @gadomski - good to know about that
I can look into doing something like this. Perhaps simply allowing users to pass in their own headers would be sufficient. |
Closed by #889. |
I recently discovered this project and it's awesome! I am dealing with a STAC catalog that requires authentication and I noticed that there is no mechanism for me to pass an auth header for when I want to walk a STAC catalog.
As a simple scenario consider the following:
In this situation, we will get an exception at the first link with an exception:
coming from this line:
It would be great if we could add an auth header when we create the STAC object. As a workaround I created a class like
And then just set
catalog._stac_io = StacIOWithAuth(<api_key>)
.Thanks for reading - I'm happy to take this on as a first issue if no one has bandwidth to tackle it.
The text was updated successfully, but these errors were encountered: