Skip to content

Commit

Permalink
Add FindGroups method to UserProvider API (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 authored Oct 6, 2020
1 parent 77a2022 commit a6cf2aa
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 15 deletions.
6 changes: 4 additions & 2 deletions cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,19 @@ service GatewayAPI {
// ************************ USER PROVIDER **************************/
// *****************************************************************/

// Gets the information about a user by its user id.
// Gets the information about a user by the user id.
rpc GetUser(cs3.identity.user.v1beta1.GetUserRequest) returns (cs3.identity.user.v1beta1.GetUserResponse);
// Gets the information about a user based on a specified claim.
rpc GetUserByClaim(cs3.identity.user.v1beta1.GetUserByClaimRequest) returns (cs3.identity.user.v1beta1.GetUserByClaimResponse);
// Gets the groups of a user.
rpc GetUserGroups(cs3.identity.user.v1beta1.GetUserGroupsRequest) returns (cs3.identity.user.v1beta1.GetUserGroupsResponse);
// Tells if the user is in a certain group.
rpc IsInGroup(cs3.identity.user.v1beta1.IsInGroupRequest) returns (cs3.identity.user.v1beta1.IsInGroupResponse);
// Finds users by any attribute of the user?
// Finds users by any attribute of the user.
// TODO(labkode): to define the filters that make more sense.
rpc FindUsers(cs3.identity.user.v1beta1.FindUsersRequest) returns (cs3.identity.user.v1beta1.FindUsersResponse);
// Finds groups whose names match the specified filter.
rpc FindGroups(cs3.identity.user.v1beta1.FindGroupsRequest) returns (cs3.identity.user.v1beta1.FindGroupsResponse);
// *****************************************************************/
// ************************ AUTH REGISTRY **************************/
// *****************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion cs3/identity/user/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ message UserId {
string opaque_id = 2;
}

// Represents an user of the system.
// Represents a user of the system.
message User {
UserId id = 1;
string username = 2;
Expand Down
31 changes: 27 additions & 4 deletions cs3/identity/user/v1beta1/user_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ import "cs3/types/v1beta1/types.proto";

// Provides an API for managing users.
service UserAPI {
// Gets the information about a user by its user id.
// Gets the information about a user by the user id.
rpc GetUser(GetUserRequest) returns (GetUserResponse);
// Gets the information about a user based on a specified claim.
rpc GetUserByClaim(GetUserByClaimRequest) returns (GetUserByClaimResponse);
// Gets the groups of a user.
rpc GetUserGroups(GetUserGroupsRequest) returns (GetUserGroupsResponse);
// Tells if the user is in a certain group.
rpc IsInGroup(IsInGroupRequest) returns (IsInGroupResponse);
// Finds users by any attribute of the user?
// Finds users by any attribute of the user.
// TODO(labkode): to define the filters that make more sense.
rpc FindUsers(FindUsersRequest) returns (FindUsersResponse);
// Finds groups whose names match the specified filter.
rpc FindGroups(FindGroupsRequest) returns (FindGroupsResponse);
}

message GetUserRequest {
Expand Down Expand Up @@ -158,7 +160,7 @@ message FindUsersRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED. TODO(labkode): create propper filters for most common searchs.
// REQUIRED. TODO(labkode): create proper filters for most common searches.
// The filter to apply.
string filter = 2;
}
Expand All @@ -171,6 +173,27 @@ message FindUsersResponse {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The groups for the user.
// The users matching the specified filter.
repeated User users = 3;
}

message FindGroupsRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The filter to apply.
string filter = 2;
}

message FindGroupsResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The groups matching the specified filter.
repeated string groups = 3;
}
112 changes: 104 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,14 @@ <h2>Table of Contents</h2>
<a href="#cs3%2fidentity%2fuser%2fv1beta1%2fuser_api.proto">cs3/identity/user/v1beta1/user_api.proto</a>
<ul>

<li>
<a href="#cs3.identity.user.v1beta1.FindGroupsRequest"><span class="badge">M</span>FindGroupsRequest</a>
</li>

<li>
<a href="#cs3.identity.user.v1beta1.FindGroupsResponse"><span class="badge">M</span>FindGroupsResponse</a>
</li>

<li>
<a href="#cs3.identity.user.v1beta1.FindUsersRequest"><span class="badge">M</span>FindUsersRequest</a>
</li>
Expand Down Expand Up @@ -2583,7 +2591,7 @@ <h3 id="cs3.gateway.v1beta1.GatewayAPI">GatewayAPI</h3>
<td>GetUser</td>
<td><a href="#cs3.identity.user.v1beta1.GetUserRequest">.cs3.identity.user.v1beta1.GetUserRequest</a></td>
<td><a href="#cs3.identity.user.v1beta1.GetUserResponse">.cs3.identity.user.v1beta1.GetUserResponse</a></td>
<td><p>Gets the information about a user by its user id.</p></td>
<td><p>Gets the information about a user by the user id.</p></td>
</tr>

<tr>
Expand Down Expand Up @@ -2611,8 +2619,15 @@ <h3 id="cs3.gateway.v1beta1.GatewayAPI">GatewayAPI</h3>
<td>FindUsers</td>
<td><a href="#cs3.identity.user.v1beta1.FindUsersRequest">.cs3.identity.user.v1beta1.FindUsersRequest</a></td>
<td><a href="#cs3.identity.user.v1beta1.FindUsersResponse">.cs3.identity.user.v1beta1.FindUsersResponse</a></td>
<td><p>Finds users by any attribute of the user?
TODO(labkode): to define the filters that make more sense.
<td><p>Finds users by any attribute of the user.
TODO(labkode): to define the filters that make more sense.</p></td>
</tr>

<tr>
<td>FindGroups</td>
<td><a href="#cs3.identity.user.v1beta1.FindGroupsRequest">.cs3.identity.user.v1beta1.FindGroupsRequest</a></td>
<td><a href="#cs3.identity.user.v1beta1.FindGroupsResponse">.cs3.identity.user.v1beta1.FindGroupsResponse</a></td>
<td><p>Finds groups whose names match the specified filter.

*****************************************************************/
************************ AUTH REGISTRY **************************/
Expand Down Expand Up @@ -4595,7 +4610,7 @@ <h2 id="cs3/identity/user/v1beta1/resources.proto">cs3/identity/user/v1beta1/res


<h3 id="cs3.identity.user.v1beta1.User">User</h3>
<p>Represents an user of the system.</p>
<p>Represents a user of the system.</p>


<table class="field-table">
Expand Down Expand Up @@ -4708,6 +4723,80 @@ <h2 id="cs3/identity/user/v1beta1/user_api.proto">cs3/identity/user/v1beta1/user
<p></p>


<h3 id="cs3.identity.user.v1beta1.FindGroupsRequest">FindGroupsRequest</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>opaque</td>
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
<td></td>
<td><p>OPTIONAL.
Opaque information. </p></td>
</tr>

<tr>
<td>filter</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The filter to apply. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.identity.user.v1beta1.FindGroupsResponse">FindGroupsResponse</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>status</td>
<td><a href="#cs3.rpc.v1beta1.Status">cs3.rpc.v1beta1.Status</a></td>
<td></td>
<td><p>REQUIRED.
The response status. </p></td>
</tr>

<tr>
<td>opaque</td>
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
<td></td>
<td><p>OPTIONAL.
Opaque information. </p></td>
</tr>

<tr>
<td>groups</td>
<td><a href="#string">string</a></td>
<td>repeated</td>
<td><p>REQUIRED.
The groups matching the specified filter. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.identity.user.v1beta1.FindUsersRequest">FindUsersRequest</h3>
<p></p>

Expand All @@ -4730,7 +4819,7 @@ <h3 id="cs3.identity.user.v1beta1.FindUsersRequest">FindUsersRequest</h3>
<td>filter</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED. TODO(labkode): create propper filters for most common searchs.
<td><p>REQUIRED. TODO(labkode): create proper filters for most common searches.
The filter to apply. </p></td>
</tr>

Expand Down Expand Up @@ -4772,7 +4861,7 @@ <h3 id="cs3.identity.user.v1beta1.FindUsersResponse">FindUsersResponse</h3>
<td><a href="#cs3.identity.user.v1beta1.User">User</a></td>
<td>repeated</td>
<td><p>REQUIRED.
The groups for the user. </p></td>
The users matching the specified filter. </p></td>
</tr>

</tbody>
Expand Down Expand Up @@ -5112,7 +5201,7 @@ <h3 id="cs3.identity.user.v1beta1.UserAPI">UserAPI</h3>
<td>GetUser</td>
<td><a href="#cs3.identity.user.v1beta1.GetUserRequest">GetUserRequest</a></td>
<td><a href="#cs3.identity.user.v1beta1.GetUserResponse">GetUserResponse</a></td>
<td><p>Gets the information about a user by its user id.</p></td>
<td><p>Gets the information about a user by the user id.</p></td>
</tr>

<tr>
Expand Down Expand Up @@ -5140,10 +5229,17 @@ <h3 id="cs3.identity.user.v1beta1.UserAPI">UserAPI</h3>
<td>FindUsers</td>
<td><a href="#cs3.identity.user.v1beta1.FindUsersRequest">FindUsersRequest</a></td>
<td><a href="#cs3.identity.user.v1beta1.FindUsersResponse">FindUsersResponse</a></td>
<td><p>Finds users by any attribute of the user?
<td><p>Finds users by any attribute of the user.
TODO(labkode): to define the filters that make more sense.</p></td>
</tr>

<tr>
<td>FindGroups</td>
<td><a href="#cs3.identity.user.v1beta1.FindGroupsRequest">FindGroupsRequest</a></td>
<td><a href="#cs3.identity.user.v1beta1.FindGroupsResponse">FindGroupsResponse</a></td>
<td><p>Finds groups whose names match the specified filter.</p></td>
</tr>

</tbody>
</table>

Expand Down

0 comments on commit a6cf2aa

Please sign in to comment.