Skip to content

Searching sharee with displayname #547

Closed

Description

@jesmrec

Only posible to get sharees by using the username:

Username: einstein
Display Name: Albert Einstein

results are fetched only matching einstein
Albert, Einstein, Ein, Albe do not match and response is empty (always forgetting the case sensitiveness)

oC10: matches with both.

Backend: EOS storage via via https://github.com/owncloud-docker/compose-playground/blob/master/examples/hetzner-deploy/make_ocis_eos_compose_test.sh
Version: v1.0.0-rc1
Client: iOS App v11.4 over iOS13

CC @pmaier1

Activity

  1. refs commented on Jan 13, 2021

    @refs
    Contributor

    I added the EOS storage tag but most likely is related with the Reva userprovider.

  2. micbar commented on Jul 14, 2022

    @micbar
    Contributor

    re tested:

    Created User

    Username: hans
    Display Name: Peter Dampf
    E-Mail: [email protected]

    We can find:

    hans
    Peter
    pd@

    We cannot find:

    Hans (should not be case sensitive)
    ans(middle of the username)
    Dampf (End of the string Displayname)
    example.com (End of the email address)

    Expectation

    at least
    Hans (username search should not be case sensitive)
    Dampf (End or middle of the string Displayname)

    Should work.

  3. added
    Priority:p2-high
    and removed on Jul 14, 2022
  4. rhafer commented on Jul 14, 2022

    @rhafer
    Contributor

    Expectation

    at least
    Hans (username search should not be case sensitive)

    This is caused by a bug in idm. Fix is on its way.

    Dampf (End or middle of the string Displayname)

    This is currently not working "on purpose". At some point we agreed on limiting search to prefix searches. As doing full substring searches will get pretty expensive easily. We can of course change that (just need to adjust the filter https://github.com/cs3org/reva/blob/75f2c2f836578f8280749569f7f01a3e7d2b5939/pkg/utils/ldap/identity.go#L480).

    @micbar If you still want it. Should we maybe make that configurable?

  5. rhafer commented on Jul 14, 2022

    @rhafer
    Contributor

    Hans (username search should not be case sensitive)

    This part should be fixed with libregraph/idm#75

  6. 27 remaining items

  7. added and removed
    Priority:p2-high
    on Jul 21, 2022
  8. self-assigned this
    on Jul 21, 2022
  9. SwikritiT commented on Jul 21, 2022

    @SwikritiT
    Contributor

    The tests are failing because they search for the exact match for a searched string but this field is always empty for OCIS

    <exact>
          <users/>
          <groups/>
          <remotes/>
        </exact>
    
    

    For instance if I create a multiple variations of user einstein in OC10 and search it with curl

    curl -vk -uadmin:admin http://localhost/core/ocs/v1.php/apps/files_sharing/api/v1/sharees\?search\=einstein\&itemType\=file -H"OCS-APIREQUEST:1" | xmllint --format -

    It responds with

    <?xml version="1.0"?>
    <ocs>
      <meta>
        <status>ok</status>
        <statuscode>100</statuscode>
        <message>OK</message>
        <totalitems/>
        <itemsperpage/>
      </meta>
      <data>
        <exact>
          <users>
            <element>
              <label>einstein</label>
              <value>
                <shareType>0</shareType>
                <shareWith>einstein</shareWith>
                <userType>0</userType>
              </value>
            </element>
          </users>
          <groups/>
          <remotes/>
        </exact>
        <users>
          <element>
            <label>Albert Einstein</label>
            <value>
              <shareType>0</shareType>
              <shareWith>Albert Einstein</shareWith>
              <userType>0</userType>
            </value>
          </element>
          <element>
            <label>einstein-einstein</label>
            <value>
              <shareType>0</shareType>
              <shareWith>einstein-einstein</shareWith>
              <userType>0</userType>
            </value>
          </element>
          <element>
            <label>einstein1</label>
            <value>
              <shareType>0</shareType>
              <shareWith>einstein1</shareWith>
              <userType>0</userType>
            </value>
          </element>
        </users>
        <groups/>
        <remotes/>
      </data>
    </ocs>
    

    Inside <exact><users> there's exact match of the string

    But in the case of OCIS if i do the same

    curl -vk -uadmin:admin https://host.docker.internal:9200/ocs/v1.php/apps/files_sharing/api/v1/sharees\?search\=einstein\&itemType\=file -H"OCS-APIREQUEST:1" | xmllint --format - 
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ocs>
      <meta>
        <status>ok</status>
        <statuscode>100</statuscode>
        <message>OK</message>
      </meta>
      <data>
        <exact>
          <users/>
          <groups/>
          <remotes/>
        </exact>
        <users>
          <element>
            <label>Albert Einstein</label>
            <value>
              <shareType>0</shareType>
              <shareWith>einstein</shareWith>
              <shareWithAdditionalInfo>[email protected]</shareWithAdditionalInfo>
            </value>
          </element>
          <element>
            <label>Einstein Albert</label>
            <value>
              <shareType>0</shareType>
              <shareWith>einstein-einstein</shareWith>
              <shareWithAdditionalInfo>[email protected]</shareWithAdditionalInfo>
            </value>
          </element>
          <element>
            <label>Einstein</label>
            <value>
              <shareType>0</shareType>
              <shareWith>einstein1</shareWith>
              <shareWithAdditionalInfo>[email protected]</shareWithAdditionalInfo>
            </value>
          </element>
        </users>
        <groups/>
        <remotes/>
      </data>
    </ocs>

    The exact match is rather given in <users>

    curl -vk -uadmin:admin https://host.docker.internal:9200/ocs/v1.php/apps/files_sharing/api/v1/sharees\?search\=einstein-einstein\&itemType\=file -H"OCS-APIREQUEST:1" | xmllint --format -
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ocs>
      <meta>
        <status>ok</status>
        <statuscode>100</statuscode>
        <message>OK</message>
      </meta>
      <data>
        <exact>
          <users/>
          <groups/>
          <remotes/>
        </exact>
        <users>
          <element>
            <label>Einstein Albert</label>
            <value>
              <shareType>0</shareType>
              <shareWith>einstein-einstein</shareWith>
              <shareWithAdditionalInfo>[email protected]</shareWithAdditionalInfo>
            </value>
          </element>
        </users>
        <groups/>
        <remotes/>
      </data>
    </ocs>

    The tests are looking inside exact and they don't find the expected value there.

    Is this expected behaviour?

    cc: @micbar @rhafer @phil-davis

  10. rhafer commented on Jul 22, 2022

    @rhafer
    Contributor

    @SwikritiT thanks for looking into that. I think this deserves a separate issue though, would you mind creating a new one for this?

    I think the original bug reported here (which was about broken substring and case-sensitiveness) was solved.

    It seems the new issue is basically caused by an incomplete implementation of the ocs sharing api in ocis/reva. It always returns an empty exact list and stuffs all the results into the top level users list (https://github.com/cs3org/reva/blob/master/internal/http/services/owncloud/ocs/handlers/apps/sharing/sharees/sharees.go#L91)

  11. SwikritiT commented on Jul 25, 2022

    @SwikritiT
    Contributor

    @SwikritiT thanks for looking into that. I think this deserves a separate issue though, would you mind creating a new one for this?

    I think the original bug reported here (which was about broken substring and case-sensitiveness) was solved.

    It seems the new issue is basically caused by an incomplete implementation of the ocs sharing api in ocis/reva. It always returns an empty exact list and stuffs all the results into the top level users list (https://github.com/cs3org/reva/blob/master/internal/http/services/owncloud/ocs/handlers/apps/sharing/sharees/sharees.go#L91)

    Okay I'll create a separate issue and close this one

  12. SwikritiT commented on Jul 25, 2022

    @SwikritiT
    Contributor

    @rhafer new issue created here #4265

  13. SwikritiT commented on Jul 25, 2022

    @SwikritiT
    Contributor

    This PR got merged #4229 fixing this issue and needs a follow-up for the expected to fail.

    #### [Searching sharee with displayname](https://github.com/owncloud/ocis/issues/547)
    - [apiSharees/sharees.feature:350](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L350)
    - [apiSharees/sharees.feature:351](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L351)
    - [apiSharees/sharees.feature:370](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L370)
    - [apiSharees/sharees.feature:371](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L371)
    - [apiSharees/sharees.feature:390](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L390)
    - [apiSharees/sharees.feature:391](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L391)
    - [apiSharees/sharees.feature:410](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L410)
    - [apiSharees/sharees.feature:411](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L411)
    - [apiSharees/sharees.feature:430](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L430)
    - [apiSharees/sharees.feature:431](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L431)

    TODO QA-team

    Closing this issue. I'll make a PR changing the issue link in expected to fail file

  14. added 3 commits that reference this issue on Jul 27, 2022
    6a15c8d
    ff25bf9
    73113cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions