mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-08 18:27:40 +00:00
feat: search users by list of emails (users/_search) (#6983)
Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
This commit is contained in:
parent
e769b163ef
commit
17153b694e
@ -46,6 +46,8 @@ func UserQueryToQuery(query *user_pb.SearchQuery, level uint8) (query.SearchQuer
|
|||||||
return ResourceOwnerQueryToQuery(q.ResourceOwner)
|
return ResourceOwnerQueryToQuery(q.ResourceOwner)
|
||||||
case *user_pb.SearchQuery_InUserIdsQuery:
|
case *user_pb.SearchQuery_InUserIdsQuery:
|
||||||
return InUserIdsQueryToQuery(q.InUserIdsQuery)
|
return InUserIdsQueryToQuery(q.InUserIdsQuery)
|
||||||
|
case *user_pb.SearchQuery_InUserEmailsQuery:
|
||||||
|
return InUserEmailsQueryToQuery(q.InUserEmailsQuery)
|
||||||
case *user_pb.SearchQuery_OrQuery:
|
case *user_pb.SearchQuery_OrQuery:
|
||||||
return OrQueryToQuery(q.OrQuery, level)
|
return OrQueryToQuery(q.OrQuery, level)
|
||||||
case *user_pb.SearchQuery_AndQuery:
|
case *user_pb.SearchQuery_AndQuery:
|
||||||
@ -100,6 +102,11 @@ func ResourceOwnerQueryToQuery(q *user_pb.ResourceOwnerQuery) (query.SearchQuery
|
|||||||
func InUserIdsQueryToQuery(q *user_pb.InUserIDQuery) (query.SearchQuery, error) {
|
func InUserIdsQueryToQuery(q *user_pb.InUserIDQuery) (query.SearchQuery, error) {
|
||||||
return query.NewUserInUserIdsSearchQuery(q.UserIds)
|
return query.NewUserInUserIdsSearchQuery(q.UserIds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func InUserEmailsQueryToQuery(q *user_pb.InUserEmailsQuery) (query.SearchQuery, error) {
|
||||||
|
return query.NewUserInUserEmailsSearchQuery(q.UserEmails)
|
||||||
|
}
|
||||||
|
|
||||||
func OrQueryToQuery(q *user_pb.OrQuery, level uint8) (query.SearchQuery, error) {
|
func OrQueryToQuery(q *user_pb.OrQuery, level uint8) (query.SearchQuery, error) {
|
||||||
mappedQueries, err := UserQueriesToQuery(q.Queries, level+1)
|
mappedQueries, err := UserQueriesToQuery(q.Queries, level+1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -656,6 +656,9 @@ func NewUserNotSearchQuery(value SearchQuery) (SearchQuery, error) {
|
|||||||
func NewUserInUserIdsSearchQuery(values []string) (SearchQuery, error) {
|
func NewUserInUserIdsSearchQuery(values []string) (SearchQuery, error) {
|
||||||
return NewInTextQuery(UserIDCol, values)
|
return NewInTextQuery(UserIDCol, values)
|
||||||
}
|
}
|
||||||
|
func NewUserInUserEmailsSearchQuery(values []string) (SearchQuery, error) {
|
||||||
|
return NewInTextQuery(HumanEmailCol, values)
|
||||||
|
}
|
||||||
|
|
||||||
func NewUserResourceOwnerSearchQuery(value string, comparison TextComparison) (SearchQuery, error) {
|
func NewUserResourceOwnerSearchQuery(value string, comparison TextComparison) (SearchQuery, error) {
|
||||||
return NewTextQuery(UserResourceOwnerCol, value, comparison)
|
return NewTextQuery(UserResourceOwnerCol, value, comparison)
|
||||||
|
@ -188,6 +188,7 @@ message SearchQuery {
|
|||||||
OrQuery or_query = 11;
|
OrQuery or_query = 11;
|
||||||
AndQuery and_query = 12;
|
AndQuery and_query = 12;
|
||||||
NotQuery not_query = 13;
|
NotQuery not_query = 13;
|
||||||
|
InUserEmailsQuery in_user_emails_query = 14;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,6 +224,15 @@ message InUserIDQuery {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message InUserEmailsQuery {
|
||||||
|
repeated string user_emails = 1 [
|
||||||
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
|
description: "the emails of the users to include"
|
||||||
|
example: "[\"test@example.com\",\"test@example.org\"]";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
message UserNameQuery {
|
message UserNameQuery {
|
||||||
string user_name = 1 [
|
string user_name = 1 [
|
||||||
(validate.rules).string = {max_len: 200},
|
(validate.rules).string = {max_len: 200},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user