Skip to content
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

avoid using local paths as "href" #926

Open
soxofaan opened this issue Nov 5, 2024 · 3 comments
Open

avoid using local paths as "href" #926

soxofaan opened this issue Nov 5, 2024 · 3 comments

Comments

@soxofaan
Copy link
Member

soxofaan commented Nov 5, 2024

in various places (mainly around batch job result/asset handling) we are putting local (absolute) paths in a "href" field. This is quite confusing as there is no indication that this is about local paths (e.g. at least a "file://" protocol would make that more explicit). It's also not ideal that at some point that "href" probably has to be overwritten with a relative/absolute (HTTP/S3) URL to be usable by end user and the original location is lost. Overall it makes it hard to reason about how assets are handled in our code

@bossie
Copy link
Collaborator

bossie commented Nov 6, 2024

It's clear from the STAC spec that "href" should be a URI with a scheme so I would even call this a bug.

Re: technical debt I would also avoid passing URIs around as strings and instead use a dedicated type as it will probably get rid of a great deal of implicit assumptions and workarounds like (think // vs /).

I haven't found a dedicated URI class in Python like java.net.URI; maybe we could look into https://pypi.org/project/uri/. Automatic translation between the two by py4j should be trivial.

@soxofaan
Copy link
Member Author

another symptom: #929 (comment)

@bossie
Copy link
Collaborator

bossie commented Nov 19, 2024

FYI I've been playing with https://pypi.org/project/uri/ and it has some surprising behavior (marrow/uri#30 and marrow/uri#31) so doesn't look mature enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants