Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 23 additions & 3 deletions cs3/identity/group/v1beta1/group_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ service GroupAPI {
rpc GetMembers(GetMembersRequest) returns (GetMembersResponse);
// Tells if the group has certain member.
rpc HasMember(HasMemberRequest) returns (HasMemberResponse);
// Finds groups whose names match the specified filter.
// Finds groups whose names match the specified filters.
// MAY return CODE_RESOURCE_EXHAUSTED if the filters return too many responses.
rpc FindGroups(FindGroupsRequest) returns (FindGroupsResponse);
}

Expand Down Expand Up @@ -165,8 +166,8 @@ message FindGroupsRequest {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The filter to apply.
string filter = 2;
// The filters to apply.
repeated Filter filters = 2;
// OPTIONAL.
// Whether to skip fetching members along with the group object.
bool skip_fetching_members = 3;
Expand All @@ -183,3 +184,22 @@ message FindGroupsResponse {
// The groups matching the specified filter.
repeated Group groups = 3;
}


// Represents a filter to apply to the request.
message Filter {
// The filter to apply.
enum Type {
TYPE_INVALID = 0;
// extract all groups of a given GroupType
TYPE_GROUPTYPE = 1;
// extract all groups matching the given query
TYPE_QUERY = 2;
}
// REQUIRED.
Type type = 1;
oneof term {
GroupType grouptype = 2;
string query = 3;
}
}
17 changes: 9 additions & 8 deletions cs3/identity/user/v1beta1/user_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ service UserAPI {
rpc GetUserByClaim(GetUserByClaimRequest) returns (GetUserByClaimResponse);
// Gets the groups of a user.
rpc GetUserGroups(GetUserGroupsRequest) returns (GetUserGroupsResponse);
// Finds users by any attribute of the user.
// TODO(labkode): to define the filters that make more sense.
// Finds users that match the specified filters.
// MAY return CODE_RESOURCE_EXHAUSTED if the filters return too many responses.
rpc FindUsers(FindUsersRequest) returns (FindUsersResponse);
}

Expand Down Expand Up @@ -138,12 +138,9 @@ message FindUsersRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The search query to apply.
string query = 4;
// OPTIONAL.
// Optional filters on users, such as filtering for a specific UserType.
repeated Filter filter = 5;
// REQUIRED.
// The filters to apply.
repeated Filter filters = 2;
// OPTIONAL.
// Whether to skip fetching user groups along with the user object.
bool skip_fetching_user_groups = 3;
Expand All @@ -166,11 +163,15 @@ message Filter {
// The filter to apply.
enum Type {
TYPE_INVALID = 0;
// extract all users of a given UserType
TYPE_USERTYPE = 1;
// extract all users matching the given query
TYPE_QUERY = 2;
}
// REQUIRED.
Type type = 1;
oneof term {
UserType usertype = 2;
string query = 3;
}
}