-
Notifications
You must be signed in to change notification settings - Fork 189
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
Conversation
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Kudos, SonarCloud Quality Gate passed! |
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. |
There was a problem hiding this 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 👍
When multiple groups are created like:
group1
Group1
andGROUP1
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'.