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

filemanager: add way to shorten attribute API querying #495

Closed
mmalenic opened this issue Aug 18, 2024 · 2 comments · Fixed by #515
Closed

filemanager: add way to shorten attribute API querying #495

mmalenic opened this issue Aug 18, 2024 · 2 comments · Fixed by #515
Assignees
Labels
feature New feature filemanager an issue relating to the filemanager

Comments

@mmalenic
Copy link
Member

As described in #462, ideally there would be a way to shorten querying top-level attributes:

E.g, instead of:
/api/v1/s3_objects?attributes[portal_run_id]=...

It could be:
/api/v1/s3_objects?portal_run_id=...

This is a bit of a challenge, as described in #492, because it involves capturing unknown parameters in the API.

This may not be the best idea, because it could lead to confusion and conflicts between the known parameters and unknown parameters. E.g. if the user typed ?object_id=... it might be better to reject this request rather than assuming that this request was for the attributes. Note, that currently unknown parameters are not rejected with an error status code, which should probably be changed.

Some ideas on how to implement this:

  • Allow any unknown parameters and assume that the user intends to query by attributes.
  • Add a list of "allowed" parameters which can be used to query attributes. For example, just allowing portal_run_id and other important attributes. These could be configurable during deployment.
@mmalenic mmalenic added filemanager an issue relating to the filemanager feature New feature labels Aug 18, 2024
@reisingerf
Copy link
Member

A shorter / dedicated way to query for attributes would be nice, yes.

I'd have thought something like this though:
/api/v1/s3_objects/attribute?portal_run_id=...

That should allow the differentiation between parameters of the s3_object itself and any additional parameters.

@mmalenic
Copy link
Member Author

Nice, yeah, I think that's a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature filemanager an issue relating to the filemanager
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants