From 98ed583b89a467319dddc6de6eda7cecd88cebec Mon Sep 17 00:00:00 2001 From: Ilja Neumann Date: Wed, 14 Oct 2020 14:30:14 +0200 Subject: [PATCH] Add or query to query regexes --- accounts/pkg/service/v0/accounts.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/accounts/pkg/service/v0/accounts.go b/accounts/pkg/service/v0/accounts.go index dfdb7f28d..6c6598187 100644 --- a/accounts/pkg/service/v0/accounts.go +++ b/accounts/pkg/service/v0/accounts.go @@ -184,6 +184,13 @@ func (s Service) ListAccounts(ctx context.Context, in *proto.ListAccountsRequest } + // id eq 'marie' or on_premises_sam_account_name eq 'marie' + var idOrQuery = regexp.MustCompile(`^$id eq '(.*)' or on_premises_sam_account_name eq '(.*)'`) + match = idOrQuery.FindStringSubmatch(in.Query) + if len(match) == 3 { + searchResults, err = s.index.FindBy(&proto.Account{}, "OnPremisesSamAccountName", match[2]) + } + if in.Query == "" { searchResults, _ = s.index.FindByPartial(&proto.Account{}, "Mail", "*") }