-
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
Admin API part 3 #983
Admin API part 3 #983
Conversation
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!
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.
Great work!
Apart from the comments in the code, I have a few other comments:
- When I tested with the following command
$ curl -s -w "%{http_code}\n" -H "Authorization: Bearer $token" -H "Content-Type: application/json" -X POST -d '{"accession_id": "my-id-01", "filepath": "/uploads/file.c4gh", "user": "testuser"}' http://localhost:8090/file/accession
It's a bit weird that the return code is 000
.
- I got an empty list for the following command
curl -H "Authorization: Bearer $token" "http://localhost:8090/users/[email protected]/files"
However, I got
$ curl -H "Authorization: Bearer $token" "http://localhost:8090/files"
[{"inboxPath":"requester_demo.org/data/file1.c4gh","fileStatus":"uploaded","createAt":"2024-08-09T14:28:14.43718Z"}]
and
$ curl -H "Authorization: Bearer $token" "http://localhost:8090/users"
["[email protected]","[email protected]"]
What did I do wrong?
- Formatting in the README:
Error code
for each API endpoint section should be under the section, for example
* /file/ingest
- accepts POST requests with JSON data with the format: {"filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}
- triggers the ingestion of the file.
* Error codes
- 200 Query execute ok.
- 400 Error due to bad payload i.e. wrong user + filepath combination.
should be changed to
- /file/ingest
- accepts POST requests with JSON data with the format: {"filepath": "</PATH/TO/FILE/IN/INBOX>", "user": "<USERNAME>"}
- triggers the ingestion of the file.
* Error codes
- 200 Query execute ok.
- 400 Error due to bad payload i.e. wrong user + filepath combination.
Would |
02bc0ad
to
898e3a7
Compare
Yes, that would improve readability. |
API needs the schema location
ba98238
to
1d3af59
Compare
1d3af59
to
4f85c27
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.
Minor suggestions :-)
Co-authored-by: Alex Aperis <[email protected]>
87f8a7f
c9f58aa
to
1f1b0ec
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 :-)
Related issue(s) and PR(s)
None
Description
This PR mainly adds the ways to define which users should have admin access.
How to test