Skip to content

Commit

Permalink
feat(frontier): provide project and group member count (#327)
Browse files Browse the repository at this point in the history
Signed-off-by: Kush Sharma <[email protected]>
  • Loading branch information
kushsharma authored Dec 16, 2023
1 parent 28bea25 commit 6f4477c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 10 deletions.
23 changes: 21 additions & 2 deletions raystack/frontier/v1beta1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,16 @@ service AdminService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Platform";
summary: "Add platform user";
description: "Adds a user to a platform.";
description: "Adds a user to the platform.";
};
}

rpc ListPlatformUsers(ListPlatformUsersRequest) returns (ListPlatformUsersResponse) {
option (google.api.http) = {get: "/v1beta1/admin/platform/users"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Platform";
summary: "List platform users";
description: "Lists all the users added to the platform.";
};
}

Expand Down Expand Up @@ -365,7 +374,10 @@ message ListProjectsResponse {
repeated Project projects = 1;
}

message ListRelationsRequest {}
message ListRelationsRequest {
string subject = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The subject to filter by."}];
string object = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The object to filter by."}];
}

message ListRelationsResponse {
repeated Relation relations = 1;
Expand Down Expand Up @@ -508,6 +520,13 @@ message AddPlatformUserRequest {

message AddPlatformUserResponse {}

message ListPlatformUsersRequest {}

message ListPlatformUsersResponse {
repeated User users = 1;
repeated ServiceUser serviceusers = 2;
}

message DelegatedCheckoutRequest {
string org_id = 1 [(validate.rules).string.min_len = 3];
// ID of the billing account to update the subscription for
Expand Down
22 changes: 14 additions & 8 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,8 @@ message ListProjectsByCurrentUserRequest {
// only users who could have inherited these permissions from top but we only
// want explictly added ones.
bool non_inherited = 3;

bool with_member_count = 4;
}

message ListProjectsByCurrentUserResponse {
Expand Down Expand Up @@ -2172,6 +2174,7 @@ message ListCurrentUserGroupsRequest {
string org_id = 1;

repeated string with_permissions = 2;
bool with_member_count = 3;
}

message ListCurrentUserGroupsResponse {
Expand Down Expand Up @@ -2343,6 +2346,7 @@ message ListOrganizationGroupsRequest {

repeated string group_ids = 4;
bool with_members = 5;
bool with_member_count = 6;
}

message ListOrganizationGroupsResponse {
Expand Down Expand Up @@ -2702,17 +2706,11 @@ message CreateProjectResponse {
Project project = 1;
}

message GetProjectResponse {
Project project = 1;
}

message UpdateProjectResponse {
Project project = 1;
}

message ListOrganizationProjectsRequest {
string id = 1 [(validate.rules).string.min_len = 3];
string state = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Filter projects by state. If not specified, all projects are returned. <br/> *Possible values:* `enabled` or `disabled`"}];

bool with_member_count = 3;
}

message ListOrganizationProjectsResponse {
Expand All @@ -2723,11 +2721,19 @@ message GetProjectRequest {
string id = 1;
}

message GetProjectResponse {
Project project = 1;
}

message UpdateProjectRequest {
string id = 1;
ProjectRequestBody body = 2;
}

message UpdateProjectResponse {
Project project = 1;
}

message ListProjectAdminsRequest {
string id = 1 [(validate.rules).string.min_len = 3];
}
Expand Down
15 changes: 15 additions & 0 deletions raystack/frontier/v1beta1/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ message Group {
repeated User users = 10 [
(google.api.field_behavior) = OUTPUT_ONLY
];
int32 members_count = 8 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The number of members explicitly added in the project.",
example: "2"
},
(google.api.field_behavior) = OUTPUT_ONLY
];
}

message Role {
Expand Down Expand Up @@ -168,6 +175,14 @@ message Project {
description: "The time the project was last updated.",
example: "\"2023-06-07T05:39:56.961Z\""
}];

int32 members_count = 8 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The number of members explicitly added in the project.",
example: "2"
},
(google.api.field_behavior) = OUTPUT_ONLY
];
}

message Domain {
Expand Down

0 comments on commit 6f4477c

Please sign in to comment.