Open kulmann opened 3 years ago
@kulmann currently, we don't return the updated received share from the POST /ocs/v2.php/apps/files_sharing/api/v1/shares/pending/$shareID
endpoint. @C0rby's PR https://github.com/cs3org/reva/pull/1685 will add that.
I tried it from the CLI by adding a new command and seems to work for me (note that the share-get-received
command isn't present atm, I added it for testing)
>> share-get-received -id 64ba0d8a-80e7-4a17-a48e-9cf2f07fb086
+--------------------------------------+-----------------+--------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-------------------+-----------------+--------------------------------------+--------------------------------+--------------------------------+---------------------+
| # | OWNER.IDP | OWNER.OPAQUEID | RESOURCEID | PERMISSIONS | TYPE | GRANTEE.IDP | GRANTEE.OPAQUEID | CREATED | UPDATED | STATE |
+--------------------------------------+-----------------+--------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-------------------+-----------------+--------------------------------------+--------------------------------+--------------------------------+---------------------+
| 64ba0d8a-80e7-4a17-a48e-9cf2f07fb086 | localhost:20080 | 4c510ada-c86b-4815-8820-42cdf82c3d51 | storage_id:"123e4567-e89b-12d3-a456-426655440000" opaque_id:"fileid-einstein%2Fdef" | permissions:<get_path:true initiate_file_download:true list_container:true list_file_versions:true stat:true > | GRANTEE_TYPE_USER | localhost:20080 | 932b4540-8d16-481e-8ef4-588e4b6b151c | 2021-05-06 14:32:12 +0200 CEST | 2021-05-06 14:32:12 +0200 CEST | SHARE_STATE_PENDING |
+--------------------------------------+-----------------+--------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-------------------+-----------------+--------------------------------------+--------------------------------+--------------------------------+---------------------+
>> share-update-received -state accepted 64ba0d8a-80e7-4a17-a48e-9cf2f07fb086
OK
>> share-get-received -id 64ba0d8a-80e7-4a17-a48e-9cf2f07fb086
+--------------------------------------+-----------------+--------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-------------------+-----------------+--------------------------------------+--------------------------------+--------------------------------+----------------------+
| # | OWNER.IDP | OWNER.OPAQUEID | RESOURCEID | PERMISSIONS | TYPE | GRANTEE.IDP | GRANTEE.OPAQUEID | CREATED | UPDATED | STATE |
+--------------------------------------+-----------------+--------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-------------------+-----------------+--------------------------------------+--------------------------------+--------------------------------+----------------------+
| 64ba0d8a-80e7-4a17-a48e-9cf2f07fb086 | localhost:20080 | 4c510ada-c86b-4815-8820-42cdf82c3d51 | storage_id:"123e4567-e89b-12d3-a456-426655440000" opaque_id:"fileid-einstein%2Fdef" | permissions:<get_path:true initiate_file_download:true list_container:true list_file_versions:true stat:true > | GRANTEE_TYPE_USER | localhost:20080 | 932b4540-8d16-481e-8ef4-588e4b6b151c | 2021-05-06 14:32:12 +0200 CEST | 2021-05-06 14:32:12 +0200 CEST | SHARE_STATE_ACCEPTED |
+--------------------------------------+-----------------+--------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-------------------+-----------------+--------------------------------------+--------------------------------+--------------------------------+----------------------+
Can be closed since #1685 has been merged? :)
@individual-it do we have API tests which cover getting a share by id?
The test steps that accept/decline a share use the /apps/files_sharing/api/v*/shares/pending/$shareId
end point with POST
or DELETE
to accept or decline a share.
Test steps like When user "Alice" updates the last share using the sharing API with
use the share-id to update attributes of the share.
Lots of test scenarios were removed from expected-failures in PR #1685 so there were lots of scenarios that used the behaviour that has been fixed.
I just had a look and I could not find tests that explicitly get shares by ID, just using that functionality inside of the test-code as @phil-davis mentioned Should we add explicit tests?
@individual-it yes, that would be awesome. An API test which checks the response of getting a share by id. Current issue we're facing is that the share state is always pending
and the file target doesn't have the /Shares
prefix. At least when I use it in web. @ishank011 has other results (see above). Would be good to have a test in any case.
Issue https://github.com/owncloud/ocis/issues/2059 raised to add "get shares by ID" test coverage.
Getting a share by id (at least with the json provider) returns state="0". Independent of the actual share state.
Used here: https://github.com/owncloud/web/pull/4988/files#diff-e6e62cfb9c3e1f6005163a9ce3192fb388add4b86d6537cebfd4fecac886d6efR251