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

Search location filter. doesn't search by shares jail #6825

Closed
ScharfViktor opened this issue Jul 17, 2023 · 7 comments
Closed

Search location filter. doesn't search by shares jail #6825

ScharfViktor opened this issue Jul 17, 2023 · 7 comments
Labels

Comments

@ScharfViktor
Copy link
Contributor

ScharfViktor commented Jul 17, 2023

steps:

  • admin creates f1/f2/test.txt
  • admin shares folder f1 to einstein
  • einstein accepts f1 and goes inside the folder f1
  • einstein searches by test using search filter current folder

using api:

  • einstein gets uuid f1: curl https://host.docker.internal:9200/graph/v1.0/drives -ueinstein:relativity -vk | jq --raw-output '.value'
    einstein searches by test oc:patterntest scope:UUID</oc:pattern>:
curl -XREPORT https://host.docker.internal:9200/remote.php/dav/files/einstein/ -ueinstein:relativity -vk --data '<?xml version="1.0"?>
<oc:search-files  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:prop>
    <oc:permissions />
    <oc:favorite />
    <oc:fileid />
    <oc:file-parent />
    <oc:name />
    <oc:owner-id />
    <oc:owner-display-name />
    <oc:shareid />
    <oc:shareroot />
    <oc:share-types />
    <oc:privatelink />
    <d:getcontentlength />
    <oc:size />
    <d:getlastmodified />
    <d:getetag />
    <d:getcontenttype />
    <d:resourcetype />
    <oc:downloadURL />
    <oc:tags />
  </d:prop>
  <oc:search>
    <oc:pattern>test scope:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!1284d238-aa92-42ce-bdc4-0b0000009157:some-admin-user-id-0000-000000000000:dc90b19b-4886-400e-93b3-152ada0c5b4d</oc:pattern>
    <oc:limit>8</oc:limit>
  </oc:search>
</oc:search-files>'

Actual: no search result
Expected: it's possible to find objects in the accepted shared folder

CC @2403905

@2403905
Copy link
Contributor

2403905 commented Jul 18, 2023

@ScharfViktor @janackermann
For search by shares, we have to use the nodeid
<oc:pattern>file scope:storage-users-1$some-admin-user-id-0000-000000000000!nodeid</oc:pattern>
instead of
<oc:pattern>file scope:storage-users-1$some-admin-user-id-0000-000000000000</oc:pattern>

See #6713

@ScharfViktor
Copy link
Contributor Author

I searched by 3 ids (see scren) but couldn't find nothing.
Screenshot 2023-07-18 at 16 53 22

@ScharfViktor
Copy link
Contributor Author

@2403905 what identifier should I use? looking at my screen

@2403905
Copy link
Contributor

2403905 commented Jul 18, 2023

For a shared folder f2 we are using fileId (1) like a scope
And add the \f3 if we want to search in a subfolder

@ScharfViktor
Copy link
Contributor Author

For a shared folder f2 we are using fileId (1) like a scope And add the \f3 if we want to search in a subfolder

empty result
image

@2403905
Copy link
Contributor

2403905 commented Jul 19, 2023

There are two examples of the same request

curl 'https://localhost:9200/remote.php/dav/files/einstein/' \
  -X 'REPORT' \
  --data-raw $'<?xml version="1.0"?>\n<oc:search-files  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n  <d:prop>\n    <oc:permissions />\n    <oc:favorite />\n    <oc:fileid />\n    <oc:file-parent />\n    <oc:name />\n    <oc:owner-id />\n    <oc:owner-display-name />\n    <oc:shareid />\n    <oc:shareroot />\n    <oc:share-types />\n    <oc:privatelink />\n    <d:getcontentlength />\n    <oc:size />\n    <d:getlastmodified />\n    <d:getetag />\n    <d:getcontenttype />\n    <d:resourcetype />\n    <oc:downloadURL />\n    <oc:tags />\n  </d:prop>\n  <oc:search>\n    <oc:pattern>file scope:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!storage-users-1:some-admin-user-id-0000-000000000000:8003d521-f9eb-4698-ace9-f18093443fe3</oc:pattern>\n    <oc:limit>8</oc:limit>\n  </oc:search>\n</oc:search-files>' \
  -ik \
  -ueinstein:relativity




curl 'https://localhost:9200/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!storage-users-1:some-admin-user-id-0000-000000000000:8003d521-f9eb-4698-ace9-f18093443fe3' \
  -X 'REPORT' \
  --data-raw $'<?xml version="1.0"?>\n<oc:search-files  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n  <d:prop>\n    <oc:permissions />\n    <oc:favorite />\n    <oc:fileid />\n    <oc:file-parent />\n    <oc:name />\n    <oc:owner-id />\n    <oc:owner-display-name />\n    <oc:shareid />\n    <oc:shareroot />\n    <oc:share-types />\n    <oc:privatelink />\n    <d:getcontentlength />\n    <oc:size />\n    <d:getlastmodified />\n    <d:getetag />\n    <d:getcontenttype />\n    <d:resourcetype />\n    <oc:downloadURL />\n    <oc:tags />\n  </d:prop>\n  <oc:search>\n    <oc:pattern>file scope:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!storage-users-1:some-admin-user-id-0000-000000000000:8003d521-f9eb-4698-ace9-f18093443fe3</oc:pattern>\n    <oc:limit>8</oc:limit>\n  </oc:search>\n</oc:search-files>' \
  -ik \
  -ueinstein:relativity

The id we can retrieve from here curl https://host.docker.internal:9200/graph/v1.0/me/drives -ueinstein:relativity -vk | jq --raw-output '.value'

@ScharfViktor
Copy link
Contributor Author

works fine on backend side
I close in favor of owncloud/web#9439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants