ocis: file_target does not contain Share folder
Describe the bug
As compared to oc10 backend, if system config share_folder
is set, share create response data value file_target
contains share_folder
path before resource path, but ocis response only contains resource path
Steps to reproduce
Steps to reproduce the behavior:
- create three users
uu1
,uu2
,uu3
- using user
uu1
create a file with the filenametestfile.txt
- using user
uu2
create a file with the filenametestfile.txt
- using user
uu1
share filetestfile.txt
with useruu3
curl -k -u uu1:uu1 https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d 'path=testfile.txt' -d 'shareWith=uu3' -d 'shareType=0' | xmllint --format -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1332 100 1289 100 43 6748 225 --:--:-- --:--:-- --:--:-- 6937
<?xml version="1.0" encoding="UTF-8"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message>OK</message>
</meta>
<data>
<id>0cb58b99-bae9-4f10-9396-a3e95ec370f3</id>
<share_type>0</share_type>
<uid_owner>uu1</uid_owner>
<displayname_owner>uu1</displayname_owner>
<additional_info_owner>uu1@uu.cc</additional_info_owner>
<permissions>19</permissions>
<stime>1623074243</stime>
<parent/>
<expiration/>
<token/>
<uid_file_owner>uu1</uid_file_owner>
<displayname_file_owner>uu1</displayname_file_owner>
<additional_info_file_owner>uu1@uu.cc</additional_info_file_owner>
<state>0</state>
<path>/testfile.txt</path>
<item_type>file</item_type>
<mimetype>text/plain</mimetype>
<storage_id>1284d238-aa92-42ce-bdc4-0b0000009157</storage_id>
<storage>0</storage>
<item_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OmI0YzgyYmFmLWQ4NGQtNGU3MS1iMzBiLWEwM2E1NzQ4YjAzMQ==</item_source>
<file_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OmI0YzgyYmFmLWQ4NGQtNGU3MS1iMzBiLWEwM2E1NzQ4YjAzMQ==</file_source>
<file_parent/>
<file_target>/testfile.txt</file_target>
<share_with>uu3</share_with>
<share_with_displayname>uu3</share_with_displayname>
<share_with_additional_info>uu3@uu.cc</share_with_additional_info>
<mail_send>0</mail_send>
<name/>
</data>
</ocs>
Expected behavior
create share response in oc10:
curl -k -u admin:admin http://localhost/core/ocs/v1.php/apps/files_sharing/api/v1/shares -d 'path=lorem.txt' -d 'shareWith=uu2' -d 'shareType=0' | xmllint --format -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1085 100 1045 100 40 2542 97 --:--:-- --:--:-- --:--:-- 2633
<?xml version="1.0"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message/>
<totalitems/>
<itemsperpage/>
</meta>
<data>
<id>1790</id>
<share_type>0</share_type>
<uid_owner>admin</uid_owner>
<displayname_owner>admin</displayname_owner>
<permissions>19</permissions>
<stime>1623075023</stime>
<parent/>
<expiration/>
<token/>
<uid_file_owner>admin</uid_file_owner>
<displayname_file_owner>admin</displayname_file_owner>
<additional_info_owner/>
<additional_info_file_owner/>
<path>/lorem.txt</path>
<mimetype>text/plain</mimetype>
<storage_id>home::admin</storage_id>
<storage>1</storage>
<item_type>file</item_type>
<item_source>2147523314</item_source>
<file_source>2147523314</file_source>
<file_parent>3</file_parent>
<file_target>/Shares/lorem.txt</file_target>
<share_with>uu2</share_with>
<share_with_displayname>uu2</share_with_displayname>
<share_with_additional_info/>
<mail_send>0</mail_send>
<attributes/>
</data>
</ocs>
Actual behavior
- same file_target for both backends
if this is expected feature, please close the issue
Setup
Please describe how you started the server and provide a list of relevant environment variables.
OCIS_VERSION=latest
BRANCH=master
STORAGE_FRONTEND_UPLOAD_DISABLE_TUS=false
Additional context
related test is covered here
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 17 (17 by maintainers)
If this is the expected behavior from now on. Maybe we should refactor the tests again.