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

fix: make groups index case sensitive #2109

Merged
merged 1 commit into from
Jun 1, 2021
Merged

fix: make groups index case sensitive #2109

merged 1 commit into from
Jun 1, 2021

Conversation

C0rby
Copy link
Contributor

@C0rby C0rby commented Jun 1, 2021

When multiple groups are created like:
group1 Group1 and GROUP1 they are separate groups for the accounts service but the index saw them as the same group.

First noticed it in the reva update PR: #2104
The tests were failing because of this 'bug'.

@C0rby C0rby requested review from butonic, kulmann and fschade June 1, 2021 11:35
@C0rby C0rby self-assigned this Jun 1, 2021
Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return err
}

if err := idx.AddIndex(&proto.Group{}, "DisplayName", "Id", "groups", "non_unique", nil, true); err != nil {
if err := idx.AddIndex(&proto.Group{}, "DisplayName", "Id", "groups", "non_unique", nil, false); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, why is searching for display names supposed to be case sensitive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if you are creating a new group with via the OCS API like this

curl -sk -u moss:vista -X POST 'https://localhost:9200/ocs/v2.php/cloud/groups' -d 'groupid=Group1'

Then the OnPremisesSamAccountName and DisplayName are the same. And if there would be the groups Group1 and group1 then you couldn't search for them using the DisplayName if it was case insensitive.

@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@butonic
Copy link
Member

butonic commented Jun 1, 2021

well ... how does ocis want to treat them? user and group names should be treated in the same way, but oc10 already treats usernames case insensitive but group names case sensitive 🤪

so, at least on the ocs api we need to be compatible. when moving to an ldap server as the user backend this becomes a different topic. for now I think we should change the type of the index.

@butonic butonic requested a review from kulmann June 1, 2021 12:44
Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me then 👍

@C0rby C0rby merged commit 99b517a into master Jun 1, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix-groups-index branch June 1, 2021 12:46
ownclouders pushed a commit that referenced this pull request Jun 1, 2021
Merge: 06da18c 03aa641
Author: David Christofas <dchristofas@owncloud.com>
Date:   Tue Jun 1 14:46:09 2021 +0200

    Merge pull request #2109 from owncloud/fix-groups-index

    fix: make groups index case sensitive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants