fix: scim 2 filter: the username should be treated case-insensitive (#9257)

# Which Problems Are Solved
- when listing users via scim v2.0 filters applied to the username are
applied case-sensitive

# How the Problems Are Solved
- when a query filter is appleid on the username it is applied
case-insensitive

# Additional Context
Part of https://github.com/zitadel/zitadel/issues/8140
This commit is contained in:
Lars
2025-01-29 14:22:22 +01:00
committed by GitHub
parent b10428fb56
commit accfb7525a
5 changed files with 85 additions and 26 deletions

View File

@@ -288,6 +288,7 @@ func NewTextQuery(col Column, value string, compare TextComparison) (*textQuery,
// handle the comparisons which use (i)like and therefore need to escape potential wildcards in the value
switch compare {
case TextEqualsIgnoreCase,
TextNotEqualsIgnoreCase,
TextStartsWith,
TextStartsWithIgnoreCase,
TextEndsWith,
@@ -334,6 +335,8 @@ func (q *textQuery) comp() sq.Sqlizer {
return sq.NotEq{q.Column.identifier(): q.Text}
case TextEqualsIgnoreCase:
return sq.ILike{q.Column.identifier(): q.Text}
case TextNotEqualsIgnoreCase:
return sq.NotILike{q.Column.identifier(): q.Text}
case TextStartsWith:
return sq.Like{q.Column.identifier(): q.Text + "%"}
case TextStartsWithIgnoreCase:
@@ -368,6 +371,7 @@ const (
TextContainsIgnoreCase
TextListContains
TextNotEquals
TextNotEqualsIgnoreCase
textCompareMax
)