From fb514c2ff189227b75341a9cc8b61938dcf99a99 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Fri, 1 Dec 2023 11:28:40 +0100 Subject: [PATCH] allow whitespaces in contains & startsWith Filter Signed-off-by: Christian Richter --- services/graph/pkg/service/v0/users_filter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/graph/pkg/service/v0/users_filter.go b/services/graph/pkg/service/v0/users_filter.go index 0a434a059d..fd3768b27b 100644 --- a/services/graph/pkg/service/v0/users_filter.go +++ b/services/graph/pkg/service/v0/users_filter.go @@ -73,7 +73,7 @@ func (g Graph) applyFilterFunctionStartsWith(ctx context.Context, req *godata.Go switch operand1.Token.Value { case "displayName": var retUsers []*libregraph.User - filterValue := operand2.Token.Value + filterValue := strings.Trim(operand2.Token.Value, "'") logger.Debug().Str("property", operand2.Token.Value).Str("value", filterValue).Msg("Filtering displayName by startsWith") if users, err := g.identityBackend.GetUsers(ctx, req); err == nil { for _, user := range users { @@ -99,7 +99,7 @@ func (g Graph) applyFilterFunctionContains(ctx context.Context, req *godata.GoDa switch operand1.Token.Value { case "displayName": var retUsers []*libregraph.User - filterValue := operand2.Token.Value + filterValue := strings.Trim(operand2.Token.Value, "'") logger.Debug().Str("property", operand2.Token.Value).Str("value", filterValue).Msg("Filtering displayName by contains") if users, err := g.identityBackend.GetUsers(ctx, req); err == nil { for _, user := range users {