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

Provide space_ref to share requests when using spaces #10845

Closed
2 tasks done
individual-it opened this issue Apr 26, 2023 · 31 comments
Closed
2 tasks done

Provide space_ref to share requests when using spaces #10845

individual-it opened this issue Apr 26, 2023 · 31 comments
Assignees
Labels
p2-high Escalation, on top of current planning, release blocker
Milestone

Comments

@individual-it
Copy link
Member

individual-it commented Apr 26, 2023

Pre-submission Checks

  • I checked for similar issues, but could not find any. I also checked the closed issues. I could not contribute additional information to any existing issue.
  • I will take the time to fill in all the required fields. I know that the bug report may be dismissed otherwise due to lack of information.

Describe the bug

When clicking on "Create and copy public link to clipboard" from the context menu the user is lead to the webUI of ocis instead of a link being created.
This happens only after the first start of the client after connecting a new space, after a restart it works fine.

Expected behavior

I expect to get a public link in my clipboard

Steps to reproduce the issue

  1. start ocis, in my case OCIS_URL=https://192.168.56.1:9200 ./ocis-3.0.0-rc.1-linux-amd64 server
  2. connect the desktop client to ocis using the admin user
  3. login to the webUI as admin
  4. create a new space (in my case ict)
  5. connect the new space to the desktop client
  6. via webUI upload some files to the space
  7. wait till the files are synced to the client
  8. open the context menu of one of the files and select Create and copy public link to clipboard

=> browser opens and leads to the webUI

If the desktop client is restarted, the action works as intended

Screenshots

No response

Logs

ownCloud.log

Client version number

ownCloud 4.0.0.10732-rc1
image

Desktop environment (Linux only)

No response

Client package version and origin (Linux only)

No response

Installation path (Windows only)

c:\Program Files\ownCloud\

Server information

ocis 3.0.0-rc.1

Additional context

No response

@TheOneRing
Copy link
Contributor

Ocis responds with an error and we fallback to "displaying the share ui" which with ocis is the web.

23-04-26 11:14:15:331 [ info sync.httplogger ]:	"782f767f-b2e7-475f-941b-18c27969c9bd: Request: GET https://ocis.owncloud.test/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2FownCloud-4.0.0.10732-rc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Yok6iigiE_o5KoGEVb8LemA7y0rE3ka3tDz3YmG0CGuVcwUZywnS2lE3UZ60bBkNCbon0GL8PJSzd1tg9lPRmNcBQXqbC0NvqRwYHm1OlIwq-uaSnXGa3ULXANHI0JDq1wWhjzy7tKAkhmkMHAR5oVjaNQcM-6pw6OQ3lf7YRsZp2r6kCElsHaLI1jfvt0DeZnKDt8DXwwocQZzk5EjOOoHVbvM6-PsW42UTq1GOfpP-noR-wqNz9XOokjPMOOB9s8bC4TRaDzTk4ZTVsZd94wdmwiHUfuWCDA3XOyTdgWGd8bOR6ctE0ExYI_N1WWLJvqySVCSVf6b8, User-Agent: Mozilla/5.0 (Windows) mirall/4.0.0-git (ownCloud, windows-10.0.22621 ClientArchitecture: x86_64 OsArchitecture: x86_64), Accept: */*, X-Request-ID: 782f767f-b2e7-475f-941b-18c27969c9bd, Original-Request-ID: 782f767f-b2e7-475f-941b-18c27969c9bd, } Data: []"
23-04-26 11:14:15:350 [ info sync.httplogger ]:	"782f767f-b2e7-475f-941b-18c27969c9bd: Response: GET 200 (19ms) https://ocis.owncloud.test/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2FownCloud-4.0.0.10732-rc1.x64.msi&reshares=true&format=json Header: { Content-Length: 74, Content-Type: 

@individual-it
Copy link
Member Author

On the same space, some files work others not.
In this log. 01.jpg refers to the webUI, but 04.jpg generates a link
ownCloud.log

@TheOneRing
Copy link
Contributor

@wkloucek or @micbar can we have a look together?

@micbar
Copy link
Contributor

micbar commented Apr 26, 2023

Ocis responds with an error and we fallback to "displaying the share ui" which with ocis is the web.

Where is the error?

@TheOneRing
Copy link
Contributor

TheOneRing commented Apr 26, 2023

Ocis responds with an error and we fallback to "displaying the share ui" which with ocis is the web.

Where is the error?

"5980b257-3fb9-4a4d-86b4-23a1edc0360e", X-Request-ID: "5980b257-3fb9-4a4d-86b4-23a1edc0360e") for OCC::ShareManager(0x18e32a554b0)
23-04-26 02:53:13:612 [ info sync.httplogger ]:	"5980b257-3fb9-4a4d-86b4-23a1edc0360e:
Response: GET 200 (11ms) https://192.168.56.1:9200/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2F01.jpg&reshares=true&format=json
Header: { Content-Length: 74, Content-Type: application/json; charset=utf-8, Date: Wed, 26 Apr 2023 09:53:16 GMT, Ocs-Api-Version: 1, Vary: Origin, }
Data: [{\"ocs\":{\"meta\":{\"status\":\"error\",\"statuscode\":998,\"message\":\"not found\"}}}]"
23-04-26 02:53:13:612 [ warning gui.socketapi.publiclink ]:	Share fetch/create error 998 "not found"

@HanaGemela HanaGemela mentioned this issue May 2, 2023
51 tasks
@michaelstingl
Copy link
Contributor

@individual-it @ScharfViktor please re-test with the oCIS 3.0-rc2 later today. (rc1 had a caching issue)

@individual-it
Copy link
Member Author

retried with ocis 3.0 rc2 and client 4.0 rc2 and the issue persists
ownCloud.zip

@TheOneRing TheOneRing changed the title "create and copy public link" leads to webUI for newly connected spaces "create and copy public link" results in server error 998 May 9, 2023
@michaelstingl michaelstingl transferred this issue from owncloud/client May 9, 2023
@butonic
Copy link
Member

butonic commented May 9, 2023

We noticed that using the path parameter is very slow, because oCIS then has to discover the space that is responsible for the path.

I only see /01.jpg in the request but how should the server know which space is meant? Web now uses a space_ref to exactly identify the resource.

I'll take another look Tomorrow...

@butonic
Copy link
Member

butonic commented May 11, 2023

This is definitely a missing space form value in the request. The easiest is to just take the oc:fileid from a propfind and send it as the space form value instead of a path. They can be combined, clients can use the space root id as space and a path relative to the space root. Technically path is always relative to space. and if space is unset the users home is assumed. That is why it works for personal spaces.

@michaelstingl
Copy link
Contributor

@butonic how can clients know? oCIS announces oC10-style public links in /ocs/v1.php/cloud/capabilities?format=json

                    "public": {
                        "enabled": true,
                        "send_mail": true,
                        "social_share": true,
                        "upload": true,
                        "multiple": true,
                        "supports_upload_only": true,
                        "password": {
                            "enforced_for": {
                                "read_only": false,
                                "read_write": false,
                                "read_write_delete": false,
                                "upload_only": false
                            },
                            "enforced": false
                        },
                        "expire_date": {
                            "enabled": false
                        },
                        "can_edit": true,
                        "alias": true
                    },

@butonic
Copy link
Member

butonic commented May 12, 2023

Well, how do they detect that spaces are available? Space support makes it necessary to send a space in addition to the path so the server knows which space the path belongs to.

@micbar
Copy link
Contributor

micbar commented May 15, 2023

Conclusion: not a blocker because the user experience does not break.

Opening the WebUI is a good fallback.

To achieve creating a public link on the client side would need client side changes.

@micbar
Copy link
Contributor

micbar commented May 15, 2023

@michaelstingl Can you transfer the issue to the client repo?

@micbar
Copy link
Contributor

micbar commented May 15, 2023

Addition: needs to be documented -> Server Team
Other clients need to be checked.

@butonic butonic removed their assignment May 15, 2023
@TheOneRing TheOneRing transferred this issue from owncloud/ocis May 16, 2023
@TheOneRing TheOneRing changed the title "create and copy public link" results in server error 998 Provide space_ref to share requests when using spaces May 16, 2023
@TheOneRing TheOneRing added the p2-high Escalation, on top of current planning, release blocker label May 16, 2023
@TheOneRing TheOneRing added this to the Desktop Client 5.0 milestone May 16, 2023
@michaelstingl
Copy link
Contributor

@TheOneRing @fmoc so, we'll send the space_ref when "public": { "enabled": true, AND /graph/v1.0/me/drives is present?

@fmoc fmoc assigned erikjv and unassigned fmoc Jun 16, 2023
@TheOneRing
Copy link
Contributor

To check for spaces support:

bool AccountState::supportsSpaces() const

@erikjv
Copy link
Collaborator

erikjv commented Jul 11, 2023

When I send a get request with the space_ref set, I get no data in response:

23-07-11 17:22:32:094 [ info sync.httplogger ]:	"6d9efed9-c01b-4154-bf7f-8d406183fd30: Request: GET https://ocis.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2FREADME.md&reshares=true&space_ref=166d1210-cdb9-50ab-9f1e-ecb9ef12a304%24f89c99f6-281d-4b81-8d56-10d2ed14f612&format=json Header: { OCS-APIREQUEST
: true, Authorization: Bearer [redacted], User-Agent: Mozilla/5.0 (Macintosh) mirall/5.0.0-git (ownCloud, macos-21.6.0 ClientArchitecture: x86_64 OsArchitecture: x86_64), Accept: */*, Accept-Language: en_DE, X-Request-ID: 6d9efed9-c01b-4154-bf7f-8d406183fd30, Original-Request-ID: 6d9efed9-c01b-4154-bf7f-8d406183fd30, } Data: []"
23-07-11 17:22:32:149 [ info sync.httplogger ]:	"6d9efed9-c01b-4154-bf7f-8d406183fd30: Response: GET 200 (54ms) https://ocis.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2FREADME.md&reshares=true&space_ref=166d1210-cdb9-50ab-9f1e-ecb9ef12a304%24f89c99f6-281d-4b81-8d56-10d2ed14f612&format=json Header: { Content-Length: 74, Content-Type: application/json; charset=utf-8, Date: Tue, 11 Jul 2023 15:22:32 GMT, Ocs-Api-Version: 1, Referrer-Policy: strict-origin-when-cross-origin, Strict-Transport-Security: max-age=315360000; preload, Vary: Origin, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, X-Xss-Protection: 0, } Data: [{\"ocs\":{\"meta\":{\"status\":\"ok
\",\"statuscode\":100,\"message\":\"OK\"},\"data\":[]}}]"

Note: I created a new space called "New space", and put a file "README.md" in it.

@TheOneRing
Copy link
Contributor

api/v1/shares

Oh the old code performs two requests, it lists the existing shares and creates a new one if it didn't exist.
So we only did the listing.

@erikjv
Copy link
Collaborator

erikjv commented Jul 12, 2023

Oh the old code performs two requests, it lists the existing shares and creates a new one if it didn't exist.
So we only did the listing.

Can you point out where the two requests are made in the old code?

@TheOneRing
Copy link
Contributor

TheOneRing commented Jul 13, 2023

(

AccountPtr account = fileData.folder->accountState()->account();

_shareManager.createLinkShare(_serverPath, shareName, noPassword, expireDate);

Please don't use the deprecated ShareManager

@TheOneRing
Copy link
Contributor

This is definitely a missing space form value in the request. The easiest is to just take the oc:fileid from a propfind and send it as the space form value instead of a path. They can be combined, clients can use the space root id as space and a path relative to the space root. Technically path is always relative to space. and if space is unset the users home is assumed. That is why it works for personal spaces.

Could you please provide an example query?
I've seen different parameter names and argument definitions discussed in this issue and am lost now.

@fmoc
Copy link
Contributor

fmoc commented Aug 1, 2023

@micbar ^

@michaelstingl
Copy link
Contributor

What we did before:

23-08-02 10:09:46:707 [ info sync.httplogger ]:	"0e177d5a-8e16-4b80-a09a-d69dc4a14460:
Request: GET https://ocis.ocis-traefik.daily.owncloud.works/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2FHacker-Songs&reshares=true&format=json
Header: { OCS-APIREQUEST: true, Authorization: Bearer [redacted], User-Agent: Mozilla/5.0 (Macintosh) mirall/5.0.0.11632-daily20230802 (testpilotcloud, macos-22.6.0 ClientArchitecture: arm64 OsArchitecture: arm64), Accept: */*, Accept-Language: en_DE, X-Request-ID: 0e177d5a-8e16-4b80-a09a-d69dc4a14460, Original-Request-ID: 0e177d5a-8e16-4b80-a09a-d69dc4a14460, }
Data: []"

23-08-02 10:09:46:760 [ info sync.httplogger ]:	"0e177d5a-8e16-4b80-a09a-d69dc4a14460:
Response: GET 200 (52ms) https://ocis.ocis-traefik.daily.owncloud.works/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2FHacker-Songs&reshares=true&format=json
Header: { Content-Length: 74, Content-Type: application/json; charset=utf-8, Date: Wed, 02 Aug 2023 08:09:46 GMT, Ocs-Api-Version: 1, Vary: Origin, X-Request-Id: 0e177d5a-8e16-4b80-a09a-d69dc4a14460, }
Data: [{\"ocs\":{\"meta\":{\"status\":\"error\",\"statuscode\":998,\"message\":\"not found\"}}}]"

Now, we ask for existing Shares, and the response look sane:

23-07-28 16:52:19:340 [ info sync.httplogger ]:	"b642efc9-75f2-4e8f-9e7e-7cd17f2b2e90: 
Request: GET https://ocis.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2Funtitled folder%2Fasdf.txt&reshares=true&space_ref=166d1210-cdb9-50ab-9f1e-ecb9ef12a304%24534bb038-6f9d-4093-946f-133be61fa4e7&format=json 
Header: { OCS-API
REQUEST: true, Authorization: Bearer [redacted], User-Agent: Mozilla/5.0 (Macintosh) mirall/5.0.0-git (ownCloud, macos-21.6.0 ClientArchitecture: x86_64 OsArchitecture: x86_64), Accept: */*, Accept-Language: en_DE, X-Request-ID: b642efc9-75f2-4e8f-9e7e-7cd17f2b2e90, Original-Request-ID: b642efc9-75f2-4e8f-9e7e-7cd17f2b2e90, } 
Data: []"

23-07-28 16:52:19:387 [ info sync.httplogger ]:	"b642efc9-75f2-4e8f-9e7e-7cd17f2b2e90: 
Response: GET 200 (46ms) https://ocis.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?path=%2Funtitled folder%2Fasdf.txt&reshares=true&space_ref=166d1210-cdb9-50ab-9f1e-ecb9ef12a304%24534bb038-6f9d-4093-946f-133be61fa4e7&format=json 
Header: { Content-Length: 74, Content-Type: application/json; charset=utf-8, Date: Fri, 28 Jul 2023 14:52:19 GMT, Ocs-Api-Version: 1, Referrer-Policy: strict-origin-when-cross-origin, Strict-Transport-Security: max-age=315360000; preload, Vary: Origin, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, X-Xss-Protection: 0, } 
Data: [{\"ocs\":{\"meta\":{\"status\":\"ok\",\"statuscode\":100,\"message\":\"OK\"},\"data\":[]}}]"

(no existing share ✅ )

@michaelstingl
Copy link
Contributor

michaelstingl commented Aug 2, 2023

The easiest is to just take the oc:fileid from a propfind and send it as the space form value instead of a path. They can be combined, clients can use the space root id as space and a path relative to the space root. Technically path is always relative to space. and if space is unset the users home is assumed. That is why it works for personal spaces.

Creating the Share with space_ref added also fails:

Data: [
path=%2Funtitled%20folder%2Fasdf.txt
&shareType=3
&name=Context%20menu%20share
&space_ref=166d1210-cdb9-50ab-9f1e-ecb9ef12a304%24534bb038-6f9d-4093-946f-133be61fa4e7
]"

@micbar @butonic how should the request look like? Link to docs?

Full HTTP:

23-07-28 16:52:19:389 [ info sync.httplogger ]:	"64ba3a19-eb98-40f7-8344-7ddfe39eb42e: 
Request: POST https://ocis.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?format=json 
Header: { Content-Type: application/x-www-form-urlencoded; charset=UTF-8, OCS-API
REQUEST: true, Authorization: Bearer [redacted], User-Agent: Mozilla/5.0 (Macintosh) mirall/5.0.0-git (ownCloud, macos-21.6.0 ClientArchitecture: x86_64 OsArchitecture: x86_64), Accept: */*, Accept-Language: en_DE, X-Request-ID: 64ba3a19-eb98-40f7-8344-7ddfe39eb42e, Original-Request-ID: 64ba3a19-eb98-40f7-8344-7ddfe39eb42e, Content-Length: 162, } 
Data: [path=%2Funtitled%20folder%2Fasdf.txt&shareType=3&name=Context%20menu%20share&space_ref=166d1210-cdb9-50ab-9f1e-ecb9ef12a304%24534bb038-6f9d-4093-946f-133be61fa4e7]"

23-07-28 16:52:19:419 [ info sync.httplogger ]:	"64ba3a19-eb98-40f7-8344-7ddfe39eb42e: 
Response: POST 200 (29ms) https://ocis.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?format=json 
Header: { Content-Length: 89, Content-Type: application/json; charset=utf-8, Date: Fri, 28 Jul 2023 14:52:19 GMT, Ocs-Api-Version: 1, Referrer-Policy: strict-origin-when-cross-origin, Strict-Transport-Security: max-age=315360000; preload, Vary: Origin, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, X-Xss-Protection: 0, } 
Data: [{\"ocs\":{\"meta\":{\"status\":\"error\",\"statuscode\":400,\"message\":\"Can not share space root\"}}}]"

@michaelstingl
Copy link
Contributor

Web does this:

--data '
shareType=3
&path=%2FHacker-Songs
&space_ref=e51de7b9-c2c2-4719-ac38-1d933cf03e67%24c4f11913-eaa6-4c7d-bb60-ce5cf8d25b38!428f6a92-486a-4f65-9252-e32216e0509c
&permissions=1
&name=Link
&quicklink=true
&attributes%5B0%5D%5Bkey%5D=isQuickLink
&attributes%5B0%5D%5Bscope%5D=files_sharing
&attributes%5B0%5D%5Bvalue%5D=true'

Copy as cURL from Web Inspector:

curl 'https://ocis.ocis-traefik.daily.owncloud.works/ocs/v1.php/apps/files_sharing/api/v1/shares' \
-X 'POST' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Bearer eyJhbGciOiJQUzI1NiIsIm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wf56XFDUXm2F7XmNa1frpp0LgB0HcqNE8NDFoKGJQ2e29SGKV18IT_-Th6hva6HvyWOfDhDKFV0sA7IXV-U4afDymaoEQZsh7OlMHEnTKA2o4lv8ceYqFDbzt6UE6A3jz7Hadn6-BJUMHuC8pLjiWhsvMDtE1gB07rAQZJaiMOo7NBWU7-R-5MYOVFfR91HQWy6c' \
-H 'Accept: */*' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Accept-Language: en' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Origin: https://ocis.ocis-traefik.daily.owncloud.works' \
-H 'Referer: https://ocis.ocis-traefik.daily.owncloud.works/files/spaces/project/ict?fileId=e51de7b9-c2c2-4719-ac38-1d933cf03e67%24c4f11913-eaa6-4c7d-bb60-ce5cf8d25b38%21c4f11913-eaa6-4c7d-bb60-ce5cf8d25b38&items-per-page=100&files-spaces-generic-view-mode=resource-table&tiles-size=1&sort-by=name&sort-dir=asc' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15' \
-H 'Content-Length: 310' \
-H 'Connection: keep-alive' \
-H 'Host: ocis.ocis-traefik.daily.owncloud.works' \
-H 'Sec-Fetch-Dest: empty' \
-H 'ocs-apirequest: true' \
-H 'x-requested-with: XMLHttpRequest' \
-H 'x-request-id: d52b2d98-565c-4149-8933-4a77761eb7b5' \
--data 'shareType=3&path=%2FHacker-Songs&space_ref=e51de7b9-c2c2-4719-ac38-1d933cf03e67%24c4f11913-eaa6-4c7d-bb60-ce5cf8d25b38!428f6a92-486a-4f65-9252-e32216e0509c&permissions=1&name=Link&quicklink=true&attributes%5B0%5D%5Bkey%5D=isQuickLink&attributes%5B0%5D%5Bscope%5D=files_sharing&attributes%5B0%5D%5Bvalue%5D=true'

Tested with:

[Log]  ownCloud Web UI 7.1.0-rc.4  (index.html-25ddd689.mjs, line 7)
[Log]  Infinite Scale 3.1.0-beta.1+d65476ff0 Community  (index.html-25ddd689.mjs, line 7)

@michaelstingl
Copy link
Contributor

michaelstingl commented Aug 2, 2023

@michaelstingl
Copy link
Contributor

michaelstingl commented Aug 2, 2023

Seems space parameter also didn't work?

-data-binary '
path=/A/land2.jpg
&shareType=3
&permissions=1
&name=link1
&space=52c34980-e15f-49bf-a47f-c151c7d6ec9a$d45835cb-8606-4075-9488-076d315119f5
' | json_pp

What exactly does cs3org/reva#4004 fix?

@micbar
Copy link
Contributor

micbar commented Aug 2, 2023

Conclusion

space and space_ref are currently treated equal.

oc10 compatibility

The path parameter is there to stay compatible with oc10
It can be used by clients which know "nothing about spaces"

ocis (bad ocs API experience, will be replaced by graph ASAP)

On the backend, we identify resources by a Reference (https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.Reference)

Easiest solution

Use the id of the target resource and no path

So the easiest way to go, is to use the OC-FileID from WebDAV and no path.

Optional

Like in the mentioned CS3 Api docs, you could also use the id and a relative path.
The combination needs to be a valid resource, which means the id needs to point to a resource which is in the correct relative location to the path.

@michaelstingl
Copy link
Contributor

michaelstingl commented Aug 2, 2023

@micbar thanks for the recommendation. I'll coordinate across clients.

Desktop client team decided to kill the /ocs/ for accounts setup with /graph/v1.0/me/drives , and they'll build a shiny future based on a new API.

@TheOneRing
Copy link
Contributor

@erikjv please disable the context menu entry if account->supportsSpaces is true.

@fmoc
Copy link
Contributor

fmoc commented Aug 4, 2023

Resolved by and tested in #11079.

@fmoc fmoc closed this as completed Aug 4, 2023
@github-project-automation github-project-automation bot moved this from Prio 3 or less to Done in Infinite Scale Team Board Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-high Escalation, on top of current planning, release blocker
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants