feat: all project grant search query (#2581)

* feat: all project grant search query

* feat: all project grant search query
This commit is contained in:
Fabi
2021-10-27 11:26:01 +02:00
committed by GitHub
parent 802fbf175b
commit cd65fd8c17
7 changed files with 196 additions and 7 deletions

View File

@@ -1437,6 +1437,19 @@ service ManagementService {
};
}
// Returns all project grants matching the query, (ProjectGrant = Grant another organisation for my project)
// Limit should always be set, there is a default limit set by the service
rpc ListAllProjectGrants(ListAllProjectGrantsRequest) returns (ListAllProjectGrantsResponse) {
option (google.api.http) = {
post: "/projectgrants/_search"
body: "*"
};
option (zitadel.v1.auth_option) = {
permission: "project.grant.read"
};
}
// Add a new project grant (ProjectGrant = Grant another organisation for my project)
// Project Grant will be listed in granted project of the other organisation
rpc AddProjectGrant(AddProjectGrantRequest) returns (AddProjectGrantResponse) {
@@ -4027,6 +4040,18 @@ message ListProjectGrantsResponse {
repeated zitadel.project.v1.GrantedProject result = 2;
}
message ListAllProjectGrantsRequest {
//list limitations and ordering
zitadel.v1.ListQuery query = 1;
//criterias the client is looking for
repeated zitadel.project.v1.AllProjectGrantQuery queries = 2;
}
message ListAllProjectGrantsResponse {
zitadel.v1.ListDetails details = 1;
repeated zitadel.project.v1.GrantedProject result = 2;
}
message AddProjectGrantRequest {
string project_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
string granted_org_id = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];

View File

@@ -204,6 +204,17 @@ message ProjectGrantQuery {
}
}
message AllProjectGrantQuery {
oneof query {
option (validate.required) = true;
GrantProjectNameQuery project_name_query = 1;
GrantRoleKeyQuery role_key_query = 2;
ProjectIDQuery project_id_query = 3;
GrantedOrgIDQuery granted_org_id_query = 4;
}
}
message GrantProjectNameQuery {
string name = 1 [
(validate.rules).string = {max_len: 200},
@@ -232,4 +243,22 @@ message GrantRoleKeyQuery {
description: "defines which text equality method is used"
}
];
}
message ProjectIDQuery {
string project_id = 1 [
(validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"69629023906488334\""
}
];
}
message GrantedOrgIDQuery {
string granted_org_id = 1 [
(validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"69629023906488334\""
}
];
}