{"action":"created","issue":{"url":"https://api.github.com/repos/hydroshare/hydroshare/issues/415","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/415/comments","events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/415/events","html_url":"https://github.com/hydroshare/hydroshare/issues/415","id":81733629,"number":415,"title":"Errors using REST API with new iRODS BagIt workflow","user":{"login":"selimnairb","id":2529681,"avatar_url":"https://avatars.githubusercontent.com/u/2529681?v=3","gravatar_id":"","url":"https://api.github.com/users/selimnairb","html_url":"https://github.com/selimnairb","followers_url":"https://api.github.com/users/selimnairb/followers","following_url":"https://api.github.com/users/selimnairb/following{/other_user}","gists_url":"https://api.github.com/users/selimnairb/gists{/gist_id}","starred_url":"https://api.github.com/users/selimnairb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selimnairb/subscriptions","organizations_url":"https://api.github.com/users/selimnairb/orgs","repos_url":"https://api.github.com/users/selimnairb/repos","events_url":"https://api.github.com/users/selimnairb/events{/privacy}","received_events_url":"https://api.github.com/users/selimnairb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hydroshare/hydroshare/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"hyi","id":476302,"avatar_url":"https://avatars.githubusercontent.com/u/476302?v=3","gravatar_id":"","url":"https://api.github.com/users/hyi","html_url":"https://github.com/hyi","followers_url":"https://api.github.com/users/hyi/followers","following_url":"https://api.github.com/users/hyi/following{/other_user}","gists_url":"https://api.github.com/users/hyi/gists{/gist_id}","starred_url":"https://api.github.com/users/hyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyi/subscriptions","organizations_url":"https://api.github.com/users/hyi/orgs","repos_url":"https://api.github.com/users/hyi/repos","events_url":"https://api.github.com/users/hyi/events{/privacy}","received_events_url":"https://api.github.com/users/hyi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hydroshare/hydroshare/milestones/11","html_url":"https://github.com/hydroshare/hydroshare/milestones/HydroShare%20NFIE%20(Release%201.5.1)%20RC","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones/11/labels","id":1097186,"number":11,"title":"HydroShare NFIE (Release 1.5.1) RC","description":"Recommend no new access control be implemented for NFIE Release 1.5.1\r\n\r\n- Continue to use current single iRODS proxy-user approach\r\n- This is consistent with HydroShare release planning which doesn’t have iRODS Access Control\r\nand individual iRODS user accounts available until Release 1.7\r\n- Also appears that key individuals working on access control may have limited availability /\r\ncommitted to other NFIE priorities during May 2015\r\n\r\nDon’t do any new feature releases during NFIE summer camp June 1 – July 17\r\n\r\n- Don't do anything that erodes NFIE student user confidence\r\n- Get student user buy-in with a good consistent experience with HydroShare\r\n- Avoid any complications posed by new releases\r\n- Fixing critical bugs identified during NFIE summer camp is okay","creator":{"login":"mjstealey","id":5332509,"avatar_url":"https://avatars.githubusercontent.com/u/5332509?v=3","gravatar_id":"","url":"https://api.github.com/users/mjstealey","html_url":"https://github.com/mjstealey","followers_url":"https://api.github.com/users/mjstealey/followers","following_url":"https://api.github.com/users/mjstealey/following{/other_user}","gists_url":"https://api.github.com/users/mjstealey/gists{/gist_id}","starred_url":"https://api.github.com/users/mjstealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjstealey/subscriptions","organizations_url":"https://api.github.com/users/mjstealey/orgs","repos_url":"https://api.github.com/users/mjstealey/repos","events_url":"https://api.github.com/users/mjstealey/events{/privacy}","received_events_url":"https://api.github.com/users/mjstealey/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":11,"state":"open","created_at":"2015-05-05T16:33:56Z","updated_at":"2015-05-28T03:12:53Z","due_on":"2015-05-22T04:00:00Z","closed_at":null},"comments":4,"created_at":"2015-05-28T03:12:53Z","updated_at":"2015-05-28T15:29:05Z","closed_at":null,"body":"In particular, there are at least two problems with the new iRODS BagIt workflow and the REST API.\r\n\r\n1. When using the Python client library to download a resource that is not public, the creator/owner of the resource gets a \"You do not have permission to download this resource!\" error.  Example code is:\r\n\r\n    from hs_restclient import HydroShare, HydroShareAuthBasic\r\n    auth = HydroShareAuthBasic(username='myusername', password='mypassword')\r\n    hs = HydroShare('myhostname', port=8000, auth=auth)\r\n    resource = hs.getResource('e62a438bec384087b6c00ddcd1b6475a')\r\n    with open('/tmp/myresource.zip', 'wb') as fd:\r\n        for chunk in resource:\r\n        fd.write(chunk)\r\n\r\nThe result will be a file containing \"You do not have permission to download this resource!\" instead of a BagIt zip file.  I'm not sure why this is happening, and it's too late and I'm too tired to debug it now.  Also, you are more expert in the auth and the django_irods code than I am.\r\n\r\n2. Adding resource files to an existing resource using the REST API fails.  Example code would be:\r\n\r\n    from hs_restclient import HydroShare, HydroShareAuthBasic\r\n    auth = HydroShareAuthBasic(username='myusername', password='mypassword')\r\n    hs = HydroShare('myhostname', port=8000, auth=auth)\r\n    fpath = '/path/to/somefile.txt'\r\n    resource_id = hs.addResourceFile('ID OF RESOURCE GOES HERE', fpath)"},"comment":{"url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments/106411177","html_url":"https://github.com/hydroshare/hydroshare/issues/415#issuecomment-106411177","issue_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/415","id":106411177,"user":{"login":"pkdash","id":2523434,"avatar_url":"https://avatars.githubusercontent.com/u/2523434?v=3","gravatar_id":"","url":"https://api.github.com/users/pkdash","html_url":"https://github.com/pkdash","followers_url":"https://api.github.com/users/pkdash/followers","following_url":"https://api.github.com/users/pkdash/following{/other_user}","gists_url":"https://api.github.com/users/pkdash/gists{/gist_id}","starred_url":"https://api.github.com/users/pkdash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkdash/subscriptions","organizations_url":"https://api.github.com/users/pkdash/orgs","repos_url":"https://api.github.com/users/pkdash/repos","events_url":"https://api.github.com/users/pkdash/events{/privacy}","received_events_url":"https://api.github.com/users/pkdash/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T15:29:05Z","updated_at":"2015-05-28T15:29:05Z","body":"I assume the REST API is not using API KEY for authentication at this time. Then I am not sure why the get_user() would fail? "}}