Skip to content

Commit

Permalink
Add error codes to InviteAPIs (#198)
Browse files Browse the repository at this point in the history
* add error codes to InviteAPIs

* add doc
  • Loading branch information
gmgigi96 authored Jan 17, 2023
1 parent de86908 commit c098de0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
10 changes: 9 additions & 1 deletion cs3/ocm/invite/v1beta1/invite_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ service InviteAPI {
// Generates a new token for the user with a validity of 24 hours.
rpc GenerateInviteToken(GenerateInviteTokenRequest) returns (GenerateInviteTokenResponse);
// Forwards a received invite to the sync'n'share system provider.
// MUST return CODE_NOT_FOUND if the token does not exist.
// MUST return CODE_INVALID_ARGUMENT if the token expired.
// MUST return CODE_ALREADY_EXISTS if the user already accepted an invite.
// MUST return CODE_PERMISSION_DENIED if the remote service is not trusted to accept invitations.
rpc ForwardInvite(ForwardInviteRequest) returns (ForwardInviteResponse);
// Completes an invitation acceptance.
// MUST return CODE_NOT_FOUND if the token does not exist.
// MUST return CODE_INVALID_ARGUMENT if the token expired.
// MUST return CODE_ALREADY_EXISTS if the user already accepted an invite.
rpc AcceptInvite(AcceptInviteRequest) returns (AcceptInviteResponse);
// Retrieves details about a remote user who has accepted an invite to share.
// MUST return CODE_NOT_FOUND if the user does not exist.
rpc GetAcceptedUser(GetAcceptedUserRequest) returns (GetAcceptedUserResponse);
// Finds users who accepted invite tokens by their attributes.
rpc FindAcceptedUsers(FindAcceptedUsersRequest) returns (FindAcceptedUsersResponse);
Expand Down Expand Up @@ -103,7 +111,7 @@ message ForwardInviteResponse {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// REQUIRED.
// The initiator's user id of the workflow.
cs3.identity.user.v1beta1.UserId user_id = 3;
// REQUIRED.
Expand Down
38 changes: 35 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9143,6 +9143,30 @@ <h3 id="cs3.ocm.invite.v1beta1.ForwardInviteResponse">ForwardInviteResponse</h3>
Opaque information. </p></td>
</tr>

<tr>
<td>user_id</td>
<td><a href="#cs3.identity.user.v1beta1.UserId">cs3.identity.user.v1beta1.UserId</a></td>
<td></td>
<td><p>REQUIRED.
The initiator&#39;s user id of the workflow. </p></td>
</tr>

<tr>
<td>email</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The initiator&#39;s email of the workflow. </p></td>
</tr>

<tr>
<td>display_name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The initiator&#39;s display name of the workflow. </p></td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -9315,21 +9339,29 @@ <h3 id="cs3.ocm.invite.v1beta1.InviteAPI">InviteAPI</h3>
<td>ForwardInvite</td>
<td><a href="#cs3.ocm.invite.v1beta1.ForwardInviteRequest">ForwardInviteRequest</a></td>
<td><a href="#cs3.ocm.invite.v1beta1.ForwardInviteResponse">ForwardInviteResponse</a></td>
<td><p>Forwards a received invite to the sync&#39;n&#39;share system provider.</p></td>
<td><p>Forwards a received invite to the sync&#39;n&#39;share system provider.
MUST return CODE_NOT_FOUND if the token does not exist.
MUST return CODE_INVALID_ARGUMENT if the token expired.
MUST return CODE_ALREADY_EXISTS if the user already accepted an invite.
MUST return CODE_PERMISSION_DENIED if the remote service is not trusted to accept invitations.</p></td>
</tr>

<tr>
<td>AcceptInvite</td>
<td><a href="#cs3.ocm.invite.v1beta1.AcceptInviteRequest">AcceptInviteRequest</a></td>
<td><a href="#cs3.ocm.invite.v1beta1.AcceptInviteResponse">AcceptInviteResponse</a></td>
<td><p>Completes an invitation acceptance.</p></td>
<td><p>Completes an invitation acceptance.
MUST return CODE_NOT_FOUND if the token does not exist.
MUST return CODE_INVALID_ARGUMENT if the token expired.
MUST return CODE_ALREADY_EXISTS if the user already accepted an invite.</p></td>
</tr>

<tr>
<td>GetAcceptedUser</td>
<td><a href="#cs3.ocm.invite.v1beta1.GetAcceptedUserRequest">GetAcceptedUserRequest</a></td>
<td><a href="#cs3.ocm.invite.v1beta1.GetAcceptedUserResponse">GetAcceptedUserResponse</a></td>
<td><p>Retrieves details about a remote user who has accepted an invite to share.</p></td>
<td><p>Retrieves details about a remote user who has accepted an invite to share.
MUST return CODE_NOT_FOUND if the user does not exist.</p></td>
</tr>

<tr>
Expand Down

0 comments on commit c098de0

Please sign in to comment.