feat: add project resource owner serch query (#2528)

This commit is contained in:
Fabi 2021-10-19 09:39:36 +02:00 committed by GitHub
parent 4c50b6dfa2
commit 6f984efb16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 1 deletions

View File

@ -102,6 +102,18 @@ title: zitadel/project.proto
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.name_query | ProjectNameQuery | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.project_resource_owner_query | ProjectResourceOwnerQuery | - | |
### ProjectResourceOwnerQuery
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| resource_owner | string | - | string.max_len: 200<br /> |

View File

@ -68,6 +68,8 @@ func ProjectQueryToModel(apiQuery *proj_pb.ProjectQuery) (query.SearchQuery, err
switch q := apiQuery.Query.(type) {
case *proj_pb.ProjectQuery_NameQuery:
return query.NewProjectNameSearchQuery(object.TextMethodToQuery(q.NameQuery.Method), q.NameQuery.Name)
case *proj_pb.ProjectQuery_ProjectResourceOwnerQuery:
return query.NewProjectResourceOwnerSearchQuery(q.ProjectResourceOwnerQuery.ResourceOwner)
default:
return nil, errors.ThrowInvalidArgument(nil, "ORG-vR9nC", "List.Query.Invalid")
}

View File

@ -61,7 +61,7 @@ message GrantedProject {
description: "current state of the project grant";
}
];
string project_id = 6 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"69629023906488334\""
@ -109,6 +109,7 @@ message ProjectQuery {
option (validate.required) = true;
ProjectNameQuery name_query = 1;
ProjectResourceOwnerQuery project_resource_owner_query = 2;
}
}
@ -127,6 +128,15 @@ message ProjectNameQuery {
];
}
message ProjectResourceOwnerQuery {
string resource_owner = 1 [
(validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"69629023906488334\""
}
];
}
message Role {
string key = 1 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {