From 0567900b9efe236507a147227d66f828b9ca833e Mon Sep 17 00:00:00 2001
From: Gianmaria Del Monte
Date: Tue, 17 Jan 2023 12:03:45 +0100
Subject: [PATCH 1/2] add error codes to InviteAPIs
---
cs3/ocm/invite/v1beta1/invite_api.proto | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/cs3/ocm/invite/v1beta1/invite_api.proto b/cs3/ocm/invite/v1beta1/invite_api.proto
index 0c00659..b2122ca 100644
--- a/cs3/ocm/invite/v1beta1/invite_api.proto
+++ b/cs3/ocm/invite/v1beta1/invite_api.proto
@@ -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);
From 0c0f6fd087d033e505e0e49555f71d35701c4675 Mon Sep 17 00:00:00 2001
From: Gianmaria Del Monte
Date: Tue, 17 Jan 2023 12:07:02 +0100
Subject: [PATCH 2/2] add doc
---
cs3/ocm/invite/v1beta1/invite_api.proto | 2 +-
docs/index.html | 38 +++++++++++++++++++++++--
2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/cs3/ocm/invite/v1beta1/invite_api.proto b/cs3/ocm/invite/v1beta1/invite_api.proto
index 3b2cf35..bf5840b 100644
--- a/cs3/ocm/invite/v1beta1/invite_api.proto
+++ b/cs3/ocm/invite/v1beta1/invite_api.proto
@@ -111,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.
diff --git a/docs/index.html b/docs/index.html
index a5baec8..2c659b5 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -9143,6 +9143,30 @@ ForwardInviteResponse
Opaque information.
+
+ user_id |
+ cs3.identity.user.v1beta1.UserId |
+ |
+ REQUIRED.
+The initiator's user id of the workflow. |
+
+
+
+ email |
+ string |
+ |
+ REQUIRED.
+The initiator's email of the workflow. |
+
+
+
+ display_name |
+ string |
+ |
+ REQUIRED.
+The initiator's display name of the workflow. |
+
+
@@ -9315,21 +9339,29 @@ InviteAPI
ForwardInvite |
ForwardInviteRequest |
ForwardInviteResponse |
- Forwards a received invite to the sync'n'share system provider. |
+ 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. |
AcceptInvite |
AcceptInviteRequest |
AcceptInviteResponse |
- Completes an invitation acceptance. |
+ 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. |
GetAcceptedUser |
GetAcceptedUserRequest |
GetAcceptedUserResponse |
- Retrieves details about a remote user who has accepted an invite to share. |
+ Retrieves details about a remote user who has accepted an invite to share.
+MUST return CODE_NOT_FOUND if the user does not exist. |