vu-rdm-tech / yoda-pilot

A place to track issues we run into in the Yoda pilots
0 stars 0 forks source link

Investigate the web api #42

Open peer35 opened 3 years ago

peer35 commented 3 years ago

https://petstore.swagger.io/?url=https://utrechtuniversity.github.io/irods-ruleset-uu/api.json

peer35 commented 3 years ago

First attempt with basic authentication

curl -X POST https://portal.yoda.vu.nl/api/group_data -u <user> -H  "accept: application/json" -H  "Content-Type: multipart/form-data" -k

returns a html page with:

An Error Was Encountered

            <p>The action you have requested is not allowed.</p>
peer35 commented 3 years ago

Maybe if I run my own test server at https://yoda.test I can use swagger to test

peer35 commented 3 years ago

Lazlo pointed to https://github.com/UtrechtUniversity/irods-ruleset-uu/blob/4fe0c7c59baf0dfdbdbc8b4678f896ffe821a258/tests/conftest.py#L103 for ideas

peer35 commented 3 years ago

Created https://github.com/vu-rdm-tech/yoda_api_scripts which has a working authentication flow.

peer35 commented 3 years ago

Scratch that: The api calls for group_create, group_user_add and group_user_update_role are not implemented yet on 1.6

But it looks like it is possible with some reverse engineering: https://github.com/vu-rdm-tech/yoda_api_scripts/blob/master/test_api16.py