From 32ab3c33613688025ca6756d4ecbc2d36c6e821b Mon Sep 17 00:00:00 2001 From: Rishabh Mishra Date: Mon, 14 Feb 2022 11:24:24 +0530 Subject: [PATCH] feat(shield): add api to list groups of a user (#99) --- odpf/shield/v1beta1/shield.proto | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/odpf/shield/v1beta1/shield.proto b/odpf/shield/v1beta1/shield.proto index 59e98c51..cf339a83 100644 --- a/odpf/shield/v1beta1/shield.proto +++ b/odpf/shield/v1beta1/shield.proto @@ -53,6 +53,16 @@ service ShieldService { }; } + rpc ListUserGroups(ListUserGroupsRequest) returns (ListUserGroupsResponse) { + option (google.api.http) = { + get: "/v1beta1/users/{id}/groups", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + tags: "User"; + summary: "List Groups of a User"; + }; + } + rpc GetCurrentUser(GetCurrentUserRequest) returns (GetCurrentUserResponse) { option (google.api.http) = { get: "/v1beta1/users/self", @@ -659,6 +669,10 @@ message GetUserRequest { string id = 1; } +message ListUserGroupsRequest { + string id = 1; +} + message GetCurrentUserRequest { } @@ -681,6 +695,10 @@ message CreateGroupRequest { GroupRequestBody body = 1; } +message ListUserGroupsResponse { + repeated Group groups = 1; +} + message Group { string id = 1; string name = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"];