From 414d8eb214703fc6113495011bd6e6d2332aed0d Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Wed, 10 Mar 2021 14:33:32 +0100 Subject: [PATCH] Add FindAcceptedUsers to OCM Invite API (#111) --- cs3/gateway/v1beta1/gateway_api.proto | 4 +- cs3/ocm/invite/v1beta1/invite_api.proto | 20 +- cs3/ocm/invite/v1beta1/resources.proto | 6 +- docs/index.html | 129 ++++---- proto.lock | 411 +++++++++++++++++++++++- 5 files changed, 487 insertions(+), 83 deletions(-) diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto index 1d934309..ef6b7cc7 100644 --- a/cs3/gateway/v1beta1/gateway_api.proto +++ b/cs3/gateway/v1beta1/gateway_api.proto @@ -324,7 +324,9 @@ service GatewayAPI { // Completes an invitation acceptance. rpc AcceptInvite(cs3.ocm.invite.v1beta1.AcceptInviteRequest) returns (cs3.ocm.invite.v1beta1.AcceptInviteResponse); // Retrieves details about a remote user who has accepted an invite to share. - rpc GetRemoteUser(cs3.ocm.invite.v1beta1.GetRemoteUserRequest) returns (cs3.ocm.invite.v1beta1.GetRemoteUserResponse); + rpc GetAcceptedUser(cs3.ocm.invite.v1beta1.GetAcceptedUserRequest) returns (cs3.ocm.invite.v1beta1.GetAcceptedUserResponse); + // Finds users who accepted invite tokens by their attributes. + rpc FindAcceptedUsers(cs3.ocm.invite.v1beta1.FindAcceptedUsersRequest) returns (cs3.ocm.invite.v1beta1.FindAcceptedUsersResponse); // *****************************************************************/ // ******************** OCM PROVIDER AUTHORIZER ********************/ // *****************************************************************/ diff --git a/cs3/ocm/invite/v1beta1/invite_api.proto b/cs3/ocm/invite/v1beta1/invite_api.proto index d931a93d..994e6484 100644 --- a/cs3/ocm/invite/v1beta1/invite_api.proto +++ b/cs3/ocm/invite/v1beta1/invite_api.proto @@ -58,9 +58,9 @@ service InviteAPI { // Completes an invitation acceptance. rpc AcceptInvite(AcceptInviteRequest) returns (AcceptInviteResponse); // Retrieves details about a remote user who has accepted an invite to share. - rpc GetRemoteUser(GetRemoteUserRequest) returns (GetRemoteUserResponse); - // Retrieves a list of users that accepted a certain invite token. - rpc GetAcceptedUsers(GetAcceptedUsersRequest) returns (GetAcceptedUsersResponse); + rpc GetAcceptedUser(GetAcceptedUserRequest) returns (GetAcceptedUserResponse); + // Finds users who accepted invite tokens by their attributes. + rpc FindAcceptedUsers(FindAcceptedUsersRequest) returns (FindAcceptedUsersResponse); } message GenerateInviteTokenRequest { @@ -123,7 +123,7 @@ message AcceptInviteResponse { cs3.types.v1beta1.Opaque opaque = 2; } -message GetRemoteUserRequest { +message GetAcceptedUserRequest { // OPTIONAL. // Opaque information. cs3.types.v1beta1.Opaque opaque = 1; @@ -132,7 +132,7 @@ message GetRemoteUserRequest { cs3.identity.user.v1beta1.UserId remote_user_id = 2; } -message GetRemoteUserResponse { +message GetAcceptedUserResponse { // REQUIRED. // The response status. cs3.rpc.v1beta1.Status status = 1; @@ -144,16 +144,16 @@ message GetRemoteUserResponse { cs3.identity.user.v1beta1.User remote_user = 3; } -message GetAcceptedUsersRequest { +message FindAcceptedUsersRequest { // OPTIONAL. // Opaque information. cs3.types.v1beta1.Opaque opaque = 1; // REQUIRED. - // The token name to search accepted users for. - string token_name = 2; + // The filter to apply. + string filter = 2; } -message GetAcceptedUsersResponse { +message FindAcceptedUsersResponse { // REQUIRED. // The response status. cs3.rpc.v1beta1.Status status = 1; @@ -161,6 +161,6 @@ message GetAcceptedUsersResponse { // Opaque information. cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. - // The users that accepted the token with the given name. + // The accepted users matching the specified filter. repeated cs3.identity.user.v1beta1.User accepted_users = 3; } diff --git a/cs3/ocm/invite/v1beta1/resources.proto b/cs3/ocm/invite/v1beta1/resources.proto index cf7ca517..dbe282c0 100644 --- a/cs3/ocm/invite/v1beta1/resources.proto +++ b/cs3/ocm/invite/v1beta1/resources.proto @@ -44,7 +44,7 @@ message InviteToken { // OPTIONAL. // The time when the token will expire. cs3.types.v1beta1.Timestamp expiration = 3; - // REQUIRED. - // User-defined token name for token identification. - string name = 4; + // OPTIONAL. + // User-defined description to be forwarded to the invitees. + string description = 4; } diff --git a/docs/index.html b/docs/index.html index fff3d7ab..9adaba33 100644 --- a/docs/index.html +++ b/docs/index.html @@ -743,35 +743,35 @@

Table of Contents

  • - MForwardInviteRequest + MFindAcceptedUsersRequest
  • - MForwardInviteResponse + MFindAcceptedUsersResponse
  • - MGenerateInviteTokenRequest + MForwardInviteRequest
  • - MGenerateInviteTokenResponse + MForwardInviteResponse
  • - MGetAcceptedUsersRequest + MGenerateInviteTokenRequest
  • - MGetAcceptedUsersResponse + MGenerateInviteTokenResponse
  • - MGetRemoteUserRequest + MGetAcceptedUserRequest
  • - MGetRemoteUserResponse + MGetAcceptedUserResponse
  • @@ -2841,10 +2841,17 @@

    GatewayAPI

    - GetRemoteUser - .cs3.ocm.invite.v1beta1.GetRemoteUserRequest - .cs3.ocm.invite.v1beta1.GetRemoteUserResponse -

    Retrieves details about a remote user who has accepted an invite to share. + GetAcceptedUser + .cs3.ocm.invite.v1beta1.GetAcceptedUserRequest + .cs3.ocm.invite.v1beta1.GetAcceptedUserResponse +

    Retrieves details about a remote user who has accepted an invite to share.

    + + + + FindAcceptedUsers + .cs3.ocm.invite.v1beta1.FindAcceptedUsersRequest + .cs3.ocm.invite.v1beta1.FindAcceptedUsersResponse +

    Finds users who accepted invite tokens by their attributes. *****************************************************************/ ******************** OCM PROVIDER AUTHORIZER ********************/ @@ -6234,7 +6241,7 @@

    AcceptInviteResponse

    -

    ForwardInviteRequest

    +

    FindAcceptedUsersRequest

    @@ -6253,19 +6260,11 @@

    ForwardInviteRequest

    - invite_token - InviteToken - -

    REQUIRED. -The token to authenticate with.

    - - - - origin_system_provider - cs3.ocm.provider.v1beta1.ProviderInfo + filter + string

    REQUIRED. -The details of the sync'n'share system provider of the user who sent the invite.

    +The filter to apply.

    @@ -6275,7 +6274,7 @@

    ForwardInviteRequest

    -

    ForwardInviteResponse

    +

    FindAcceptedUsersResponse

    @@ -6301,6 +6300,14 @@

    ForwardInviteResponse

    Opaque information.

    + + accepted_users + cs3.identity.user.v1beta1.User + repeated +

    REQUIRED. +The accepted users matching the specified filter.

    + + @@ -6308,7 +6315,7 @@

    ForwardInviteResponse

    -

    GenerateInviteTokenRequest

    +

    ForwardInviteRequest

    @@ -6326,6 +6333,22 @@

    GenerateInviteTokenRe Opaque information.

    + + invite_token + InviteToken + +

    REQUIRED. +The token to authenticate with.

    + + + + origin_system_provider + cs3.ocm.provider.v1beta1.ProviderInfo + +

    REQUIRED. +The details of the sync'n'share system provider of the user who sent the invite.

    + + @@ -6333,7 +6356,7 @@

    GenerateInviteTokenRe -

    GenerateInviteTokenResponse

    +

    ForwardInviteResponse

    @@ -6359,14 +6382,6 @@

    GenerateInviteTokenR Opaque information.

    - - invite_token - InviteToken - -

    REQUIRED. -The generated token.

    - - @@ -6374,7 +6389,7 @@

    GenerateInviteTokenR -

    GetAcceptedUsersRequest

    +

    GenerateInviteTokenRequest

    @@ -6392,14 +6407,6 @@

    GetAcceptedUsersRequest< Opaque information.

    - - token_name - string - -

    REQUIRED. -The token name to search accepted users for.

    - - @@ -6407,7 +6414,7 @@

    GetAcceptedUsersRequest< -

    GetAcceptedUsersResponse

    +

    GenerateInviteTokenResponse

    @@ -6434,11 +6441,11 @@

    GetAcceptedUsersRespons - accepted_users - cs3.identity.user.v1beta1.User - repeated + invite_token + InviteToken +

    REQUIRED. -The users that accepted the token with the given name.

    +The generated token.

    @@ -6448,7 +6455,7 @@

    GetAcceptedUsersRespons -

    GetRemoteUserRequest

    +

    GetAcceptedUserRequest

    @@ -6481,7 +6488,7 @@

    GetRemoteUserRequest

    -

    GetRemoteUserResponse

    +

    GetAcceptedUserResponse

    @@ -6558,17 +6565,17 @@

    InviteAPI

    - GetRemoteUser - GetRemoteUserRequest - GetRemoteUserResponse + GetAcceptedUser + GetAcceptedUserRequest + GetAcceptedUserResponse

    Retrieves details about a remote user who has accepted an invite to share.

    - GetAcceptedUsers - GetAcceptedUsersRequest - GetAcceptedUsersResponse -

    Retrieves a list of users that accepted a certain invite token.

    + FindAcceptedUsers + FindAcceptedUsersRequest + FindAcceptedUsersResponse +

    Finds users who accepted invite tokens by their attributes.

    @@ -6618,11 +6625,11 @@

    InviteToken

    - name + description string -

    REQUIRED. -User-defined token name for token identification.

    +

    OPTIONAL. +User-defined description to be forwarded to the invitees.

    diff --git a/proto.lock b/proto.lock index 71cbbb82..0a23fe36 100644 --- a/proto.lock +++ b/proto.lock @@ -1032,6 +1032,26 @@ "in_type": "cs3.storage.provider.v1beta1.CreateHomeRequest", "out_type": "cs3.storage.provider.v1beta1.CreateHomeResponse" }, + { + "name": "CreateStorageSpace", + "in_type": "cs3.storage.provider.v1beta1.CreateStorageSpaceRequest", + "out_type": "cs3.storage.provider.v1beta1.CreateStorageSpaceResponse" + }, + { + "name": "ListStorageSpaces", + "in_type": "cs3.storage.provider.v1beta1.ListStorageSpacesRequest", + "out_type": "cs3.storage.provider.v1beta1.ListStorageSpacesResponse" + }, + { + "name": "UpdateStorageSpace", + "in_type": "cs3.storage.provider.v1beta1.UpdateStorageSpaceRequest", + "out_type": "cs3.storage.provider.v1beta1.UpdateStorageSpaceResponse" + }, + { + "name": "DeleteStorageSpace", + "in_type": "cs3.storage.provider.v1beta1.DeleteStorageSpaceRequest", + "out_type": "cs3.storage.provider.v1beta1.DeleteStorageSpaceResponse" + }, { "name": "OpenFileInAppProvider", "in_type": "OpenFileInAppProviderRequest", @@ -1238,9 +1258,14 @@ "out_type": "cs3.ocm.invite.v1beta1.AcceptInviteResponse" }, { - "name": "GetRemoteUser", - "in_type": "cs3.ocm.invite.v1beta1.GetRemoteUserRequest", - "out_type": "cs3.ocm.invite.v1beta1.GetRemoteUserResponse" + "name": "GetAcceptedUser", + "in_type": "cs3.ocm.invite.v1beta1.GetAcceptedUserRequest", + "out_type": "cs3.ocm.invite.v1beta1.GetAcceptedUserResponse" + }, + { + "name": "FindAcceptedUsers", + "in_type": "cs3.ocm.invite.v1beta1.FindAcceptedUsersRequest", + "out_type": "cs3.ocm.invite.v1beta1.FindAcceptedUsersResponse" }, { "name": "IsProviderAllowed", @@ -2495,7 +2520,7 @@ ] }, { - "name": "GetRemoteUserRequest", + "name": "GetAcceptedUserRequest", "fields": [ { "id": 1, @@ -2510,7 +2535,7 @@ ] }, { - "name": "GetRemoteUserResponse", + "name": "GetAcceptedUserResponse", "fields": [ { "id": 1, @@ -2528,6 +2553,42 @@ "type": "cs3.identity.user.v1beta1.User" } ] + }, + { + "name": "FindAcceptedUsersRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "filter", + "type": "string" + } + ] + }, + { + "name": "FindAcceptedUsersResponse", + "fields": [ + { + "id": 1, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + }, + { + "id": 2, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 3, + "name": "accepted_users", + "type": "cs3.identity.user.v1beta1.User", + "is_repeated": true + } + ] } ], "services": [ @@ -2550,9 +2611,14 @@ "out_type": "AcceptInviteResponse" }, { - "name": "GetRemoteUser", - "in_type": "GetRemoteUserRequest", - "out_type": "GetRemoteUserResponse" + "name": "GetAcceptedUser", + "in_type": "GetAcceptedUserRequest", + "out_type": "GetAcceptedUserResponse" + }, + { + "name": "FindAcceptedUsers", + "in_type": "FindAcceptedUsersRequest", + "out_type": "FindAcceptedUsersResponse" } ] } @@ -2630,6 +2696,11 @@ "id": 3, "name": "expiration", "type": "cs3.types.v1beta1.Timestamp" + }, + { + "id": 4, + "name": "description", + "type": "string" } ] } @@ -5061,6 +5132,22 @@ "protopath": "cs3:/:sharing:/:ocm:/:v1beta1:/:resources.proto", "def": { "enums": [ + { + "name": "Share.ShareType", + "enum_fields": [ + { + "name": "SHARE_TYPE_INVALID" + }, + { + "name": "SHARE_TYPE_REGULAR", + "integer": 1 + }, + { + "name": "SHARE_TYPE_TRANSFER", + "integer": 2 + } + ] + }, { "name": "ShareState", "enum_fields": [ @@ -5130,6 +5217,11 @@ "id": 9, "name": "mtime", "type": "cs3.types.v1beta1.Timestamp" + }, + { + "id": 10, + "name": "share_type", + "type": "ShareType" } ] }, @@ -5273,6 +5365,32 @@ { "protopath": "cs3:/:storage:/:provider:/:v1beta1:/:provider_api.proto", "def": { + "enums": [ + { + "name": "Filter.Type", + "enum_fields": [ + { + "name": "TYPE_INVALID" + }, + { + "name": "TYPE_NO", + "integer": 1 + }, + { + "name": "TYPE_ID", + "integer": 2 + }, + { + "name": "TYPE_OWNER", + "integer": 3 + }, + { + "name": "TYPE_SPACE_TYPE", + "integer": 4 + } + ] + } + ], "messages": [ { "name": "GetHomeRequest", @@ -6193,6 +6311,185 @@ "type": "cs3.types.v1beta1.Opaque" } ] + }, + { + "name": "CreateStorageSpaceRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "owner", + "type": "cs3.identity.user.v1beta1.User" + }, + { + "id": 3, + "name": "type", + "type": "string" + }, + { + "id": 4, + "name": "name", + "type": "string" + }, + { + "id": 5, + "name": "quota", + "type": "Quota" + } + ] + }, + { + "name": "CreateStorageSpaceResponse", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + }, + { + "id": 3, + "name": "storage_space", + "type": "StorageSpace" + } + ] + }, + { + "name": "ListStorageSpacesRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "filters", + "type": "Filter", + "is_repeated": true + } + ], + "messages": [ + { + "name": "Filter", + "fields": [ + { + "id": 1, + "name": "type", + "type": "Type" + }, + { + "id": 2, + "name": "id", + "type": "StorageSpaceId" + }, + { + "id": 3, + "name": "owner", + "type": "cs3.identity.user.v1beta1.UserId" + }, + { + "id": 4, + "name": "space_type", + "type": "string" + } + ] + } + ] + }, + { + "name": "ListStorageSpacesResponse", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + }, + { + "id": 3, + "name": "storage_spaces", + "type": "StorageSpace", + "is_repeated": true + } + ] + }, + { + "name": "UpdateStorageSpaceRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "storage_space", + "type": "StorageSpace" + } + ] + }, + { + "name": "UpdateStorageSpaceResponse", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + }, + { + "id": 3, + "name": "storage_space", + "type": "StorageSpace" + } + ] + }, + { + "name": "DeleteStorageSpaceRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "id", + "type": "StorageSpaceId" + } + ] + }, + { + "name": "DeleteStorageSpaceResponse", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + } + ] } ], "services": [ @@ -6330,11 +6627,34 @@ "name": "GetHome", "in_type": "GetHomeRequest", "out_type": "GetHomeResponse" + }, + { + "name": "CreateStorageSpace", + "in_type": "CreateStorageSpaceRequest", + "out_type": "CreateStorageSpaceResponse" + }, + { + "name": "ListStorageSpaces", + "in_type": "ListStorageSpacesRequest", + "out_type": "ListStorageSpacesResponse" + }, + { + "name": "UpdateStorageSpace", + "in_type": "UpdateStorageSpaceRequest", + "out_type": "UpdateStorageSpaceResponse" + }, + { + "name": "DeleteStorageSpace", + "in_type": "DeleteStorageSpaceRequest", + "out_type": "DeleteStorageSpaceResponse" } ] } ], "imports": [ + { + "path": "cs3/identity/user/v1beta1/resources.proto" + }, { "path": "cs3/rpc/v1beta1/status.proto" }, @@ -6862,6 +7182,81 @@ "type": "bool" } ] + }, + { + "name": "StorageSpace", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "id", + "type": "StorageSpaceId" + }, + { + "id": 3, + "name": "owner", + "type": "cs3.identity.user.v1beta1.User" + }, + { + "id": 4, + "name": "root", + "type": "ResourceId" + }, + { + "id": 5, + "name": "name", + "type": "string" + }, + { + "id": 6, + "name": "quota", + "type": "Quota" + }, + { + "id": 7, + "name": "space_type", + "type": "string" + }, + { + "id": 8, + "name": "mtime", + "type": "cs3.types.v1beta1.Timestamp" + } + ] + }, + { + "name": "StorageSpaceId", + "fields": [ + { + "id": 1, + "name": "opaque_id", + "type": "string" + } + ] + }, + { + "name": "Quota", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "quota_max_bytes", + "type": "uint64" + }, + { + "id": 3, + "name": "quota_max_files", + "type": "uint64" + } + ] } ], "imports": [