Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shield): add api to list groups of a user #99

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions odpf/shield/v1beta1/shield.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -659,6 +669,10 @@ message GetUserRequest {
string id = 1;
}

message ListUserGroupsRequest {
string id = 1;
}

message GetCurrentUserRequest {
}

Expand All @@ -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_-]+$"];
Expand Down