Skip to content

Support query parameters in HTTP objects #6989

Closed

Description

@drwelby

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

We are trying to access objects with query parameters, which can include things like formatting options for the object, or authentication keys.

An imaginary example would look like:

https://cats.server/kitten.jpg?color=black&api_key=1234 to get a picture of a black kitten.

At present, it appears the URI is parsed and the parameters are stripped.


Describe the solution you'd like

A basic solution would be to allow the URI parameters to pass through.

A more flexible implementation would allow for passing parameters as an argument.


Describe alternatives you've considered

I could not find any alternative, but have considered that objects described by parameters may be anti-pattern or out of scope.

Activity

  1. added
    enhancement
    on Jan 16, 2025
  2. drwelby commented on Jan 16, 2025

    @drwelby
    Author
  3. kylebarron commented on Jan 16, 2025

    @kylebarron
    Member

    I think there's a difference between query parameters for authentication can potentially be in line with the existing ObjectStore APIs, but using query parameters to find specific objects would be a departure from what the S3 API provides.

  4. tustvold commented on Jan 18, 2025

    @tustvold
    Contributor

    Could you perhaps expand upon the use-case for this. Why do you want to access an HTTP API as an ObjectStore? Are the query parameters static? Does the server support listing or any APIs other than basic retrieval?

    On the face of it this seems like a bit of an unusual ask, and might suggest a missing abstraction somewhere - e.g. using ObjectStore as opposed to a more targeted trait

  5. drwelby commented on Jan 18, 2025

    @drwelby
    Author

    The use case stems from @kylebarron's development of using object_store to achieve high-throughput, high-concurrency reading of geospatial images using a Rust-based core: https://github.com/developmentseed/aiocogeo-rs

    The structure of these files is especially suited for http access from cloud storage from S3 so object_store fits the base use case very well.

    However, in my case we have an API that emulates a file in cloud storage. It behaves like an image file stored in S3, but the image is processed on the fly as the file is accessed.

    At it's core, there is a single "object" - the raw sensor data of the image, but the processing options to create a final image are passed as parameters.

    So conceptually it's not a great fit for an object store abstraction, but if it's not problematic to allow parameters to slip through, we could use this library, understanding it's "out of spec". Allowing parameters for the stated goal of authorization feels like a harmless ask.

    I have also considered that we instead pack the parameters into a URL structure to make the API behave more RESTfully. Perhaps that's a better direction in general for these times but right now we have parameters.

    If it's simply not a good fit, that's OK, but I thought I'd ask anyway.

  6. tustvold commented on Jan 18, 2025

    @tustvold
    Contributor

    if it's not problematic to allow parameters to slip through

    The primary goal of this library is to provide portability across stores, introducing APIs that are inherently not portable is somewhat problematic.

    This sounds like the library in question is missing an abstraction like https://docs.rs/parquet/latest/parquet/arrow/async_reader/trait.AsyncFileReader.html that would allow you to provide your own IO implementation.

    In the short term you could implement the ObjectStore trait yourself, and leave a lot of the methods unimplemented, but this is a bit of an ugly solution. Ultimately your API is not an object store, nor does it behave like one.

  7. drwelby commented on Jan 18, 2025

    @drwelby
    Author

    Thanks for your insights and suggestions!

  8. added
    question
    and removed
    enhancement
    on Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions