fix: project grants (#4031)

* fix: filter granted memberships correctly

* fix: only show changes of granted project

* Apply suggestions from code review

Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com>

* Update internal/query/user_membership.go

Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com>

Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com>
This commit is contained in:
Livio Spring
2022-07-27 09:55:44 +02:00
committed by GitHub
parent c15577c1f9
commit 5bd9badbcf
14 changed files with 224 additions and 44 deletions

View File

@@ -1045,6 +1045,7 @@ service ManagementService {
option (zitadel.v1.auth_option) = {
permission: "project.read"
check_field_name: "ProjectId"
};
}
@@ -1470,6 +1471,19 @@ service ManagementService {
};
}
// Returns the history of the project grant (each event)
// Limit should always be set, there is a default limit set by the service
rpc ListProjectGrantChanges(ListProjectGrantChangesRequest) returns (ListProjectGrantChangesResponse) {
option (google.api.http) = {
post: "/projects/{project_id}/grants/{grant_id}/changes/_search"
};
option (zitadel.v1.auth_option) = {
permission: "project.grant.read"
check_field_name: "GrantId"
};
}
// Returns a project grant (ProjectGrant = Grant another organisation for my project)
rpc GetProjectGrantByID(GetProjectGrantByIDRequest) returns (GetProjectGrantByIDResponse) {
option (google.api.http) = {
@@ -4100,6 +4114,20 @@ message RemoveAppKeyResponse {
zitadel.v1.ObjectDetails details = 1;
}
message ListProjectGrantChangesRequest {
//list limitations and ordering
zitadel.change.v1.ChangeQuery query = 1;
string project_id = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
string grant_id = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
}
message ListProjectGrantChangesResponse {
reserved 1;
reserved "details";
// zitadel.v1.ListDetails details = 1; was always returned empty (as we cannot get the necessary infos)
repeated zitadel.change.v1.Change result = 2;
}
message GetProjectGrantByIDRequest {
string project_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
string grant_id = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];