From 4143845467ba49de8a6c43ac8a6c306bf32f5d41 Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Thu, 30 Jul 2020 10:50:33 +0200 Subject: [PATCH 1/2] Update related to a previous commit --- proto.lock | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/proto.lock b/proto.lock index 3842719c..207c678f 100644 --- a/proto.lock +++ b/proto.lock @@ -1144,6 +1144,11 @@ "in_type": "cs3.identity.user.v1beta1.GetUserRequest", "out_type": "cs3.identity.user.v1beta1.GetUserResponse" }, + { + "name": "GetUserByClaim", + "in_type": "cs3.identity.user.v1beta1.GetUserByClaimRequest", + "out_type": "cs3.identity.user.v1beta1.GetUserByClaimResponse" + }, { "name": "GetUserGroups", "in_type": "cs3.identity.user.v1beta1.GetUserGroupsRequest", @@ -1437,6 +1442,46 @@ } ] }, + { + "name": "GetUserByClaimRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "claim", + "type": "string" + }, + { + "id": 3, + "name": "value", + "type": "string" + } + ] + }, + { + "name": "GetUserByClaimResponse", + "fields": [ + { + "id": 1, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + }, + { + "id": 2, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 3, + "name": "user", + "type": "User" + } + ] + }, { "name": "GetUserGroupsRequest", "fields": [ @@ -1559,6 +1604,11 @@ "in_type": "GetUserRequest", "out_type": "GetUserResponse" }, + { + "name": "GetUserByClaim", + "in_type": "GetUserByClaimRequest", + "out_type": "GetUserByClaimResponse" + }, { "name": "GetUserGroups", "in_type": "GetUserGroupsRequest", @@ -6127,6 +6177,11 @@ "id": 2, "name": "id", "type": "cs3.identity.user.v1beta1.UserId" + }, + { + "id": 3, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" } ] }, From 0fd34428fe0aa524bed5bb9164f4c4523f1d6f0b Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Wed, 29 Jul 2020 18:46:20 +0200 Subject: [PATCH 2/2] Split external (gateway) protocol from the appprovider one, and enriched the latter --- cs3/app/provider/v1beta1/provider_api.proto | 32 +++--- cs3/gateway/v1beta1/gateway_api.proto | 26 ++++- docs/index.html | 114 +++++++++++++++++--- proto.lock | 56 ++++++++-- 4 files changed, 186 insertions(+), 42 deletions(-) diff --git a/cs3/app/provider/v1beta1/provider_api.proto b/cs3/app/provider/v1beta1/provider_api.proto index 8b75163a..dc8c9e8d 100644 --- a/cs3/app/provider/v1beta1/provider_api.proto +++ b/cs3/app/provider/v1beta1/provider_api.proto @@ -52,7 +52,7 @@ import "cs3/types/v1beta1/types.proto"; // Any method MAY return UNKNOWN. // Any method MAY return UNAUTHENTICATED. service ProviderAPI { - // Returns the iframe url + // Returns the App provider URL // MUST return CODE_NOT_FOUND if the resource does not exist. rpc OpenFileInAppProvider(OpenFileInAppProviderRequest) returns (OpenFileInAppProviderResponse); } @@ -62,19 +62,8 @@ message OpenFileInAppProviderRequest { // Opaque information. cs3.types.v1beta1.Opaque opaque = 1; // REQUIRED. - // The resource reference. If a path is given, it will be resolved via Stat() to a ResourceId - // when a call to the WOPI server is to be issued. - storage.provider.v1beta1.Reference ref = 2; - // REQUIRED. - // The access token this application provider will use when contacting - // the storage provider to read and write. - // Service implementors MUST make sure that the access token only grants - // access to the requested resource. - // Service implementors should use a ResourceId rather than a filename to grant access, as - // ResourceIds MUST NOT change when a resource is renamed. - // The access token MUST be short-lived. - // TODO(labkode): investigate token derivation techniques. - string access_token = 3; + // The resourceInfo to be opened. The gateway grpc message has a ref instead. + storage.provider.v1beta1.ResourceInfo resource_info = 2; // REQUIRED. // View mode. enum ViewMode { @@ -86,7 +75,17 @@ message OpenFileInAppProviderRequest { // The file can be downloaded and updated. VIEW_MODE_READ_WRITE = 3; } - ViewMode view_mode = 4; + ViewMode view_mode = 3; + // REQUIRED. + // The access token this application provider will use when contacting + // the storage provider to read and write. + // Service implementors MUST make sure that the access token only grants + // access to the requested resource. + // Service implementors should use a ResourceId rather than a filename to grant access, as + // ResourceIds MUST NOT change when a resource is renamed. + // The access token MUST be short-lived. + // TODO(labkode): investigate token derivation techniques. + string access_token = 4; } message OpenFileInAppProviderResponse { @@ -98,7 +97,6 @@ message OpenFileInAppProviderResponse { cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. // The url that user agents will render to clients. - // Usually the rendering happens by using HTML iframes, - // at least, Office 365, Collabora, OnlyOffice do like that. + // Usually the rendering happens by using HTML iframes or in separate browser tabs. string app_provider_url = 3; } diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto index 87771bba..0e486338 100644 --- a/cs3/gateway/v1beta1/gateway_api.proto +++ b/cs3/gateway/v1beta1/gateway_api.proto @@ -152,8 +152,8 @@ service GatewayAPI { // ************************ APP PROVIDER ********************/ // *****************************************************************/ - // Returns the iframe url from the WOPI server. The iframe url will let you open the document in the correct online document editor. - rpc OpenFileInAppProvider(cs3.app.provider.v1beta1.OpenFileInAppProviderRequest) returns (cs3.app.provider.v1beta1.OpenFileInAppProviderResponse); + // Returns the App provider URL, which lets the user open a file in the correct online document editor. + rpc OpenFileInAppProvider(OpenFileInAppProviderRequest) returns (cs3.app.provider.v1beta1.OpenFileInAppProviderResponse); // *****************************************************************/ // ************************ USER SHARE PROVIDER ********************/ // *****************************************************************/ @@ -488,3 +488,25 @@ message ListAuthProvidersResponse { // TODO(labkode): maybe add description? repeated string types = 3; } + +message OpenFileInAppProviderRequest { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The resource reference. If a path is given, it will be resolved via Stat() to a ResourceInfo + // when a call to the WOPI server is to be issued (cf. the provider grpc message) + storage.provider.v1beta1.Reference ref = 2; + // REQUIRED. + // View mode. + enum ViewMode { + VIEW_MODE_INVALID = 0; + // The file can be opened but not downloaded. + VIEW_MODE_VIEW_ONLY = 1; + // The file can be downloaded. + VIEW_MODE_READ_ONLY = 2; + // The file can be downloaded and updated. + VIEW_MODE_READ_WRITE = 3; + } + ViewMode view_mode = 3; +} diff --git a/docs/index.html b/docs/index.html index 3dd3dee5..c2aa7909 100644 --- a/docs/index.html +++ b/docs/index.html @@ -210,6 +210,10 @@

Table of Contents

MListRecycleStreamRequest +
  • + MOpenFileInAppProviderRequest +
  • +
  • MPurgeRecycleRequest
  • @@ -223,6 +227,10 @@

    Table of Contents

    +
  • + EOpenFileInAppProviderRequest.ViewMode +
  • +
  • @@ -1860,6 +1868,47 @@

    ListRecycleStreamRequestOpenFileInAppProviderRequest

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    opaquecs3.types.v1beta1.Opaque

    OPTIONAL. +Opaque information.

    refcs3.storage.provider.v1beta1.Reference

    REQUIRED. +The resource reference. If a path is given, it will be resolved via Stat() to a ResourceInfo +when a call to the WOPI server is to be issued (cf. the provider grpc message)

    view_modeOpenFileInAppProviderRequest.ViewMode

    + + + + +

    PurgeRecycleRequest

    @@ -1969,6 +2018,41 @@

    WhoAmIResponse

    +

    OpenFileInAppProviderRequest.ViewMode

    +

    REQUIRED.

    View mode.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameNumberDescription
    VIEW_MODE_INVALID0

    VIEW_MODE_VIEW_ONLY1

    The file can be opened but not downloaded.

    VIEW_MODE_READ_ONLY2

    The file can be downloaded.

    VIEW_MODE_READ_WRITE3

    The file can be downloaded and updated.

    + @@ -2173,9 +2257,9 @@

    GatewayAPI

    OpenFileInAppProvider - .cs3.app.provider.v1beta1.OpenFileInAppProviderRequest + OpenFileInAppProviderRequest .cs3.app.provider.v1beta1.OpenFileInAppProviderResponse -

    Returns the iframe url from the WOPI server. The iframe url will let you open the document in the correct online document editor. +

    Returns the App provider URL, which lets the user open a file in the correct online document editor. *****************************************************************/ ************************ USER SHARE PROVIDER ********************/ @@ -3184,12 +3268,18 @@

    OpenFileInAppProv - ref - cs3.storage.provider.v1beta1.Reference + resource_info + cs3.storage.provider.v1beta1.ResourceInfo

    REQUIRED. -The resource reference. If a path is given, it will be resolved via Stat() to a ResourceId -when a call to the WOPI server is to be issued.

    +The resourceInfo to be opened. The gateway grpc message has a ref instead.

    + + + + view_mode + OpenFileInAppProviderRequest.ViewMode + +

    @@ -3207,13 +3297,6 @@

    OpenFileInAppProv TODO(labkode): investigate token derivation techniques.

    - - view_mode - OpenFileInAppProviderRequest.ViewMode - -

    - - @@ -3253,8 +3336,7 @@

    OpenFileInAppPro

    REQUIRED. The url that user agents will render to clients. -Usually the rendering happens by using HTML iframes, -at least, Office 365, Collabora, OnlyOffice do like that.

    +Usually the rendering happens by using HTML iframes or in separate browser tabs.

    @@ -3317,7 +3399,7 @@

    ProviderAPI

    OpenFileInAppProvider OpenFileInAppProviderRequest OpenFileInAppProviderResponse -

    Returns the iframe url +

    Returns the App provider URL MUST return CODE_NOT_FOUND if the resource does not exist.

    diff --git a/proto.lock b/proto.lock index 207c678f..954bb391 100644 --- a/proto.lock +++ b/proto.lock @@ -36,18 +36,18 @@ }, { "id": 2, - "name": "ref", - "type": "storage.provider.v1beta1.Reference" + "name": "resource_info", + "type": "storage.provider.v1beta1.ResourceInfo" }, { "id": 3, - "name": "access_token", - "type": "string" + "name": "view_mode", + "type": "ViewMode" }, { "id": 4, - "name": "view_mode", - "type": "ViewMode" + "name": "access_token", + "type": "string" } ] }, @@ -644,6 +644,28 @@ { "protopath": "cs3:/:gateway:/:v1beta1:/:gateway_api.proto", "def": { + "enums": [ + { + "name": "OpenFileInAppProviderRequest.ViewMode", + "enum_fields": [ + { + "name": "VIEW_MODE_INVALID" + }, + { + "name": "VIEW_MODE_VIEW_ONLY", + "integer": 1 + }, + { + "name": "VIEW_MODE_READ_ONLY", + "integer": 2 + }, + { + "name": "VIEW_MODE_READ_WRITE", + "integer": 3 + } + ] + } + ], "messages": [ { "name": "AuthenticateRequest", @@ -891,6 +913,26 @@ "is_repeated": true } ] + }, + { + "name": "OpenFileInAppProviderRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "ref", + "type": "storage.provider.v1beta1.Reference" + }, + { + "id": 3, + "name": "view_mode", + "type": "ViewMode" + } + ] } ], "services": [ @@ -1006,7 +1048,7 @@ }, { "name": "OpenFileInAppProvider", - "in_type": "cs3.app.provider.v1beta1.OpenFileInAppProviderRequest", + "in_type": "OpenFileInAppProviderRequest", "out_type": "cs3.app.provider.v1beta1.OpenFileInAppProviderResponse" }, {