Skip to content

Commit

Permalink
fix(frontier): move list policies out of admin service (#325)
Browse files Browse the repository at this point in the history
Signed-off-by: Kush Sharma <[email protected]>
  • Loading branch information
kushsharma authored Dec 2, 2023
1 parent ec5b658 commit dec3dbe
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
22 changes: 0 additions & 22 deletions raystack/frontier/v1beta1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,6 @@ service AdminService {
};
}

// Policies
rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse) {
option (google.api.http) = {get: "/v1beta1/policies"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Policy";
summary: "List all policies";
description: "Lists all the policies from all the organizations in a Frontier instance. It can be filtered by organization, project, user, role and group.";
};
}

// Roles
rpc CreateRole(CreateRoleRequest) returns (CreateRoleResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -382,18 +372,6 @@ message ListResourcesResponse {
repeated Resource resources = 1;
}

message ListPoliciesRequest {
string org_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The organization id to filter by."}];
string project_id = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The project id to filter by."}];
string user_id = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The user id to filter by."}];
string role_id = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The role id to filter by."}];
string group_id = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The group id to filter by."}];
}

message ListPoliciesResponse {
repeated Policy policies = 1;
}

message CreateRoleRequest {
RoleRequestBody body = 1;
}
Expand Down
21 changes: 21 additions & 0 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,15 @@ service FrontierService {
};
}

rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse) {
option (google.api.http) = {get: "/v1beta1/policies"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Policy";
summary: "List all policies";
description: "Lists all the policies from all the organizations in a Frontier instance. It can be filtered by organization, project, user, role and group.";
};
}

rpc UpdatePolicy(UpdatePolicyRequest) returns (UpdatePolicyResponse) {
option (google.api.http) = {
put: "/v1beta1/policies/{id}",
Expand Down Expand Up @@ -2857,6 +2866,18 @@ message GetPolicyResponse {
Policy policy = 1;
}

message ListPoliciesRequest {
string org_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The organization id to filter by."}];
string project_id = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The project id to filter by."}];
string user_id = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The user id to filter by."}];
string role_id = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The role id to filter by."}];
string group_id = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The group id to filter by."}];
}

message ListPoliciesResponse {
repeated Policy policies = 1;
}

message UpdatePolicyRequest {
string id = 1;
PolicyRequestBody body = 2;
Expand Down

0 comments on commit dec3dbe

Please sign in to comment.