Skip to content
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

Name of public link is empty and not "Public link" when not specified in the create request #1237

Closed
dbergstrom8 opened this issue Jul 20, 2020 · 10 comments · Fixed by #3834
Closed
Assignees
Labels
Category:Defect Existing functionality is not working as expected Priority:p3-medium Normal priority Type:Bug

Comments

@dbergstrom8
Copy link
Contributor

dbergstrom8 commented Jul 20, 2020

Steps to reproduce

webUI

  1. from ocis repo start ocis bin/ocis server . For details about the setup, check the section run tests > with Ocis backend https://owncloud.github.io/clients/web/testing/
  2. Using webUI create public link for a file or folder
  3. Now check the link of the created public share
    Here public link's name in my case is EJYhMuvpVSBuXyZ:
    Screenshot from 2020-07-20 13-33-37

Using api:

  1. from ocis repo start phoenix bin/ocis server . For details about the setup, check the section run tests > with Ocis backend https://owncloud.github.io/clients/web/testing/

  2. upload a file or a folder

curl -X PUT http://localhost:9140/remote.php/webdav/hari.txt -d "123" -u user1:1234

  1. make sure the file is uploaded

curl -X PROPFIND http://localhost:9140/remote.php/webdav/hari.txt -u user1:1234 | xmllint --format -

  1. create a public share

curl -X POST http://localhost:9140/ocs/v1.php/apps/files_sharing/api/v1/shares -u user1:1234 -d "permission=31&path=hari.txt&shareType=3" | xmllint --format -

  1. Now get the info of public share
    curl -X GET http://localhost:9140/ocs/v2.php/apps/files_sharing/api/v1/shares -u user1:1234 | xmllint --format -

Response:

<?xml version="1.0" encoding="UTF-8"?>
<ocs>
  <meta>
    <status>ok</status>
    <statuscode>200</statuscode>
    <message>OK</message>
  </meta>
  <data>
    <element>
      <id>SsInZvPdwNZsBhj</id>
      <share_type>3</share_type>
      <uid_owner>user1</uid_owner>
      <displayname_owner>User One</displayname_owner>
      <permissions>1</permissions>
      <stime>1595231914</stime>
      <parent/>
      <expiration/>
      <token>AZLsBDSMUTcrRsx</token>
      <uid_file_owner>user1</uid_file_owner>
      <displayname_file_owner>User One</displayname_file_owner>
      <additional_info_owner/>
      <additional_info_file_owner/>
      <state>0</state>
      <path>/hari.txt</path>
      <item_type>file</item_type>
      <mimetype>text/plain</mimetype>
      <storage_id>1284d238-aa92-42ce-bdc4-0b0000009154</storage_id>
      <storage>0</storage>
      <item_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU0OjYzMGYyOWQ1LThmMjQtNDA2ZC04NTc1LWM3NTZjMmMzZTEwNg==</item_source>
      <file_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU0OjYzMGYyOWQ1LThmMjQtNDA2ZC04NTc1LWM3NTZjMmMzZTEwNg==</file_source>
      <file_parent/>
      <file_target>/hari.txt</file_target>
      <share_with_additional_info/>
      <mail_send>0</mail_send>
      <name/>
      <url>https://localhost:9200/#/s/AZLsBDSMUTcrRsx</url>
    </element>
  </data>
</ocs>

Here as you can see <name /> is empty.

Expected Behavior

  1. Create public link in phoenix webUI
  2. Check the name of last created public share:
    Screenshot from 2020-07-20 13-52-22

As you can see in above screen shot the name of public share is Public link

using api

If you get the info of the last public share:
curl -X GET http://localhost/core2/ocs/v2.php/apps/files_sharing/api/v1/shares -u hari:admin | xmllint --format -

Response:

<?xml version="1.0"?>
<ocs>
  <meta>
    <status>ok</status>
    <statuscode>200</statuscode>
    <message/>
    <totalitems/>
    <itemsperpage/>
  </meta>
  <data>
    <element>
      <id>251</id>
      <share_type>3</share_type>
      <uid_owner>hari</uid_owner>
      <displayname_owner>hari</displayname_owner>
      <permissions>1</permissions>
      <stime>1595232043</stime>
      <parent/>
      <expiration/>
      <token>PjDt5quoBjwD8Zn</token>
      <uid_file_owner>admin</uid_file_owner>
      <displayname_file_owner>admin</displayname_file_owner>
      <additional_info_owner/>
      <additional_info_file_owner/>
      <path>/test.txt</path>
      <item_type>file</item_type>
      <mimetype>text/plain</mimetype>
      <storage_id>shared::/test.txt</storage_id>
      <storage>1</storage>
      <item_source>2147485106</item_source>
      <file_source>2147485106</file_source>
      <file_parent>2147483955</file_parent>
      <file_target>/test.txt</file_target>
      <name>Public link</name>
      <url>http://localhost/core2/index.php/s/PjDt5quoBjwD8Zn</url>
      <mail_send>0</mail_send>
      <attributes/>
    </element>
  </data>
</ocs>

You can clearly see the name in response is Public link i.e. <name>Public link</name>

@individual-it individual-it changed the title Name of public link is different name of public link is empty and not "Public link" when not specified in the create request Jul 20, 2020
@butonic butonic transferred this issue from owncloud/ocis-reva Jan 18, 2021
@refs refs changed the title name of public link is empty and not "Public link" when not specified in the create request Name of public link is empty and not "Public link" when not specified in the create request Jan 18, 2021
@refs
Copy link
Member

refs commented Jan 18, 2021

can confirm still happens in the current master.

@refs refs added Category:Defect Existing functionality is not working as expected Type:Bug labels Jan 18, 2021
@settings settings bot removed the p3-medium label Apr 7, 2021
@ScharfViktor
Copy link
Contributor

ScharfViktor commented Aug 31, 2021

checked with a version oCIS 1.11.0:

it continues to happen:
Screenshot 2021-08-31 at 12 50 52

There are 3 links in the screenshot:
1- created using api (without name)
2- created using web (create link from main page (name=Quick action link added to request by default))
3- created using web (with name)

The problem is that the web does not fill in the default field "name" as it does in the OC10

@ScharfViktor ScharfViktor added the Priority:p3-medium Normal priority label Aug 31, 2021
@ScharfViktor
Copy link
Contributor

ScharfViktor commented May 18, 2022

That is low bug but it blocks UI test that we are running 2 years every day in web CI and ocis CI(because has tag smokeTest)

test: https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L15-L35

I suggest some solutions:

  1. fix bug. Web is sending name "Public link" by default as in oc10

Screenshot 2022-05-18 at 17 14 14

  1. I can skip test for ocis (stop wasting time in CI)
  2. I can change test. Drop checking And a link named "Public link" should be listed with role "<role>" in the public link list of folder "simple-folder" on the webUI and | name | Public link | for ocis. test continues to be useful

@individual-it @pascalwengerter what do you think about?

@individual-it
Copy link
Member

If that is easy to fix I would prefer to fix the issue

@pascalwengerter pascalwengerter self-assigned this May 19, 2022
@pascalwengerter
Copy link
Contributor

This is a capability which needs to be set, opening a PR in a second

@SwikritiT
Copy link
Contributor

Reopening as it's still reproducible in current master

curl -vk -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -u admin:admin -d "permission=31&path=test.txt&shareType=3" | xmllint --format -
Note: Unnecessary use of -X or --request, POST is already inferred.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1:9200...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9200 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [6 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [835 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [36 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [36 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: O=Acme Corp; CN=OCIS
*  start date: May 23 08:10:51 2022 GMT
*  expire date: May 23 08:10:51 2023 GMT
*  issuer: O=Acme Corp; CN=OCIS
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Server auth using Basic with user 'admin'
} [5 bytes data]
> POST /ocs/v1.php/apps/files_sharing/api/v1/shares HTTP/1.1
> Host: localhost:9200
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 39
> Content-Type: application/x-www-form-urlencoded
> 
} [39 bytes data]
* upload completely sent off: 39 out of 39 bytes
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [130 bytes data]
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 1307
< Content-Type: text/xml; charset=utf-8
< Date: Mon, 23 May 2022 08:17:24 GMT
< Ocs-Api-Version: 1
< Vary: Origin
< 
{ [1035 bytes data]
100  1346  100  1307  100    39  18671    557 --:--:-- --:--:-- --:--:-- 19228
* Connection #0 to host localhost left intact
<?xml version="1.0" encoding="UTF-8"?>
<ocs>
  <meta>
    <status>ok</status>
    <statuscode>100</statuscode>
    <message>OK</message>
  </meta>
  <data>
    <id>NOrpePcySKhOFDL</id>
    <share_type>3</share_type>
    <uid_owner>admin</uid_owner>
    <displayname_owner>Admin</displayname_owner>
    <additional_info_owner>admin@example.org</additional_info_owner>
    <permissions>1</permissions>
    <stime>1653293844</stime>
    <parent/>
    <expiration/>
    <token>zFpfTrYcEQZhJJB</token>
    <uid_file_owner>admin</uid_file_owner>
    <displayname_file_owner>Admin</displayname_file_owner>
    <additional_info_file_owner>admin@example.org</additional_info_file_owner>
    <state>0</state>
    <path>/test.txt</path>
    <item_type>file</item_type>
    <mimetype>text/plain</mimetype>
    <storage_id>shared::/test.txt</storage_id>
    <storage>0</storage>
    <item_source>1284d238-aa92-42ce-bdc4-0b0000009157$a89a7294-887b-4ab6-8314-37b324fafcb3!5228a30b-b943-4c9f-bf75-3ea73461c5f0</item_source>
    <file_source>1284d238-aa92-42ce-bdc4-0b0000009157$a89a7294-887b-4ab6-8314-37b324fafcb3!5228a30b-b943-4c9f-bf75-3ea73461c5f0</file_source>
    <file_parent/>
    <file_target>/test.txt</file_target>
    <share_with_user_type>0</share_with_user_type>
    <share_with_additional_info/>
    <mail_send>0</mail_send>
    <name/>
    <url>https://localhost:9200/s/zFpfTrYcEQZhJJB</url>
  </data>
</ocs>

And the related tests are still in expected to fail

### [name of public link is empty and not "Public link" when not specified in the create request](https://github.com/owncloud/ocis/issues/1237)
- [webUISharingPublicBasic/publicLinkCreate.feature:11](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L11)
- [webUISharingPublicBasic/publicLinkCreate.feature:28](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L28)

### [name of public link is empty and not "Public link" when not specified in the create request](https://github.com/owncloud/ocis/issues/1237)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L33)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:34](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L34)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:35](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L35)

@SwikritiT SwikritiT reopened this May 23, 2022
@ScharfViktor
Copy link
Contributor

You're right, it's still relevant.
Screenshot 2022-05-23 at 14 48 44

@pascalwengerter
Copy link
Contributor

You're right, it's still relevant. Screenshot 2022-05-23 at 14 48 44

Please note that the web UI part will be resolved via owncloud/web#6961 (filling that field client-side). What @SwikritiT shows perhaps needs some minor tweak to the link-creation in oCIS which needs to take the capability introduced in #3834 into account

@pascalwengerter
Copy link
Contributor

@kulmann could you take a look and potentially close this issue? (Just checked and I'm still assigned)

@kulmann
Copy link
Member

kulmann commented Dec 19, 2022

Doing the request via curl the link name is not empty anymore, but instead shows the public link token as name of the link. Which looks weird, but solves the issue and is somewhat ok, given that we don't have translations backend-wise. Expected failures mentioned by @SwikritiT also have been removed in the meantime. Closing here, thanks for the pointer.

@kulmann kulmann closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Defect Existing functionality is not working as expected Priority:p3-medium Normal priority Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants