From c098de095ab1d51875249793883b84f570ec1772 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte <39946305+gmgigi96@users.noreply.github.com> Date: Tue, 17 Jan 2023 13:24:11 +0100 Subject: [PATCH] Add error codes to InviteAPIs (#198) * add error codes to InviteAPIs * add doc --- cs3/ocm/invite/v1beta1/invite_api.proto | 10 ++++++- docs/index.html | 38 +++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/cs3/ocm/invite/v1beta1/invite_api.proto b/cs3/ocm/invite/v1beta1/invite_api.proto index 189848e..bf5840b 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); @@ -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. 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.