-
Notifications
You must be signed in to change notification settings - Fork 7
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 Download API specification #1394
base: main
Are you sure you want to change the base?
Conversation
cf3c27d
to
b2398a3
Compare
type: integer | ||
responses: | ||
"200": | ||
content: |
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.
content: | |
headers: | |
'Content-Disposition: attachment; filename="filePath"' | |
content: |
?
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.
Not really, if you request a file by stable ID that should be the filename in the header.
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.
Fair, would this be useful enough that we should put the basename there or shall we skip?
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.
Let's skip this one. It's not likely that someone will try to download a file this way using a browser anyways.
description: Internal application error | ||
security: | ||
- bearerAuth: [] | ||
/file/{fileId}: |
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.
/file/{fileId}: | |
/file/{datasetId}/{fileId}: |
? Or should it explicitly be possible to fetch a file when knowing the fileId?
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.
File stable ID is a unique entity and since the authorization step checks whether or not the user has permission to access the file or not this should be ok.
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 agree that it should be okay from a security standpoint and normally I'm all for not being lazy if it helps down the line, but here I'm a bit uncertain if there is a benefit in supporting this worth the added complexity.
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.
Adding the datasetID
would make the authorization step easier/faster but then again is it really needed?
One problem that might arrive here is if the dataset ID is an URL.
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 think we agree that it's not strictly needed, but the flow gets easier (should not be overly complex but compared to other things in download it's a lot). We should maybe mull on it for a while.
(Values for datasetID
can be managed through encoding.)
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.
Looks nice! Added some comments.
description: Internal application error | ||
security: | ||
- bearerAuth: [] | ||
/ready: |
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.
Not /health
?
router.GET("/health", healthResponse) |
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.
health
or ready
serve the same purpose
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 know, I was just wondering if it would make sense to keep the same endpoint name 🙃
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.
If there's no special reason, I agree with @MalinAhlberg that it is better to keep the same endpoint name.
f2f809e
to
83e67cd
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.
Looks good!
In general, I think this looks very good!
true for the end of the range to? And exactly how should the range be formatted? |
Range headers has to adhere to the specification like what you wrote above. But also this is correct The query parameters on the other hand you can supply one or both, hence the logic about inferring the missing one. |
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.
Nice!
Co-authored-by: Pontus Freyhult <pontus_github@soua.net>
Co-authored-by: Malin Klang <ahlberg.malin@gmail.com>
Co-authored-by: Malin Klang <ahlberg.malin@gmail.com> Co-authored-by: Panos Chatzopoulos <panos.chatzopoulos@gmail.com>
Co-authored-by: Pontus Freyhult <pontus_github@soua.net>
Co-authored-by: Pontus Freyhult <pontus_github@soua.net>
1a7f135
to
5fbf562
Compare
Related issue(s) and PR(s)
This PR closes #1378 .
Description
The
/file/{fileId}:
is optional since the same functionality exists in the/file
endpoint. Although it provides a more convenient way to get a file out.Endpoints
/file
- endpoint that takes query arguments to return a file by ID or path, the dataset name is a required parameter./file/{file_stable_id}
- endpoint that returns the file withe the corresponding stable_id/info/datasets
- returns a list of datasets the user has access to/info/datasets/{dataset_name}
- returns information about the requested dataset/info/datasets/{dataset_name}/files
- returns information about the files in the datasetHow to test
Paste the contents of the yaml file into: https://editor-next.swagger.io/ for a nicer view