From dd028f17ea3b8d580b86a1e2e568428ca492376e Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Tue, 3 Aug 2021 17:00:58 +0200 Subject: [PATCH 1/3] Use a URL object in OpenInAppResponse --- cs3/app/provider/v1beta1/provider_api.proto | 3 +- cs3/app/provider/v1beta1/resources.proto | 46 +++++ cs3/app/registry/v1beta1/resources.proto | 2 +- docs/index.html | 153 ++++++++++++++++- proto.lock | 179 +++++++++++++++++++- 5 files changed, 378 insertions(+), 5 deletions(-) create mode 100644 cs3/app/provider/v1beta1/resources.proto diff --git a/cs3/app/provider/v1beta1/provider_api.proto b/cs3/app/provider/v1beta1/provider_api.proto index e5138d54..6eea2d4d 100644 --- a/cs3/app/provider/v1beta1/provider_api.proto +++ b/cs3/app/provider/v1beta1/provider_api.proto @@ -28,6 +28,7 @@ option java_package = "com.cs3.app.provider.v1beta1"; option objc_class_prefix = "CAP"; option php_namespace = "Cs3\\App\\Provider\\V1Beta1"; +import "cs3/app/provider/v1beta1/resources.proto"; import "cs3/rpc/v1beta1/status.proto"; import "cs3/storage/provider/v1beta1/resources.proto"; import "cs3/types/v1beta1/types.proto"; @@ -98,5 +99,5 @@ message OpenInAppResponse { // REQUIRED. // The url that user agents will render to clients. // Usually the rendering happens by using HTML iframes or in separate browser tabs. - string app_url = 3; + OpenInAppURL app_url = 3; } diff --git a/cs3/app/provider/v1beta1/resources.proto b/cs3/app/provider/v1beta1/resources.proto new file mode 100644 index 00000000..c7cc08f2 --- /dev/null +++ b/cs3/app/provider/v1beta1/resources.proto @@ -0,0 +1,46 @@ +// Copyright 2018-2019 CERN +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// In applying this license, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +syntax = "proto3"; + +package cs3.app.provider.v1beta1; + +option csharp_namespace = "Cs3.App.Provider.V1Beta1"; +option go_package = "providerv1beta1"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.cs3.app.provider.v1beta1"; +option objc_class_prefix = "CAP"; +option php_namespace = "Cs3\\App\\Provider\\V1Beta1"; + +// Represents the information for the app URL to be called by the clients. +message OpenInAppURL { + // REQUIRED. + // The URL that clients will perform requests to. + string app_url = 1; + // REQUIRED. + // The method for the request to be made. + string method = 2; + // OPTIONAL. + // The form parameters which have to be passed along with the request. + // These are sent only if the method is 'POST'. + map form_parameters = 3; + // OPTIONAL. + // The headers to be added to the request. + map headers = 4; +} diff --git a/cs3/app/registry/v1beta1/resources.proto b/cs3/app/registry/v1beta1/resources.proto index 9c62d466..9250bff0 100644 --- a/cs3/app/registry/v1beta1/resources.proto +++ b/cs3/app/registry/v1beta1/resources.proto @@ -54,5 +54,5 @@ message ProviderInfo { // Holds a list of app names which can open a particular mime type. message AppProviderNameList { - repeated string app_provider_name = 1; + repeated string app_provider_names = 1; } diff --git a/docs/index.html b/docs/index.html index 13da95b6..3a9ae48b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -515,6 +515,29 @@

Table of Contents

+
  • + cs3/app/provider/v1beta1/resources.proto + +
  • + +
  • cs3/app/registry/v1beta1/registry_api.proto
      @@ -5055,7 +5078,7 @@

      OpenInAppResponse

      app_url - string + OpenInAppURL

      REQUIRED. The url that user agents will render to clients. @@ -5132,6 +5155,132 @@

      ProviderAPI

      +
      +

      cs3/app/provider/v1beta1/resources.proto

      Top +
      +

      + + +

      OpenInAppURL

      +

      Represents the information for the app URL to be called by the clients.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      FieldTypeLabelDescription
      app_urlstring

      REQUIRED. +The URL that clients will perform requests to.

      methodstring

      REQUIRED. +The method for the request to be made.

      form_parametersOpenInAppURL.FormParametersEntryrepeated

      OPTIONAL. +The form parameters which have to be passed along with the request. +These are sent only if the method is 'POST'.

      headersOpenInAppURL.HeadersEntryrepeated

      OPTIONAL. +The headers to be added to the request.

      + + + + + +

      OpenInAppURL.FormParametersEntry

      +

      + + + + + + + + + + + + + + + + + + + + + + + +
      FieldTypeLabelDescription
      keystring

      valuestring

      + + + + + +

      OpenInAppURL.HeadersEntry

      +

      + + + + + + + + + + + + + + + + + + + + + + + +
      FieldTypeLabelDescription
      keystring

      valuestring

      + + + + + + + + + + + + +

      cs3/app/registry/v1beta1/registry_api.proto

      Top
      @@ -5669,7 +5818,7 @@

      AppProviderNameList

      - app_provider_name + app_provider_names string repeated

      diff --git a/proto.lock b/proto.lock index 29711fe2..39f0cecb 100644 --- a/proto.lock +++ b/proto.lock @@ -416,7 +416,7 @@ { "id": 3, "name": "app_url", - "type": "string" + "type": "OpenInAppURL" } ] } @@ -434,6 +434,9 @@ } ], "imports": [ + { + "path": "cs3/app/provider/v1beta1/resources.proto" + }, { "path": "cs3/rpc/v1beta1/status.proto" }, @@ -479,6 +482,79 @@ ] } }, + { + "protopath": "cs3:/:app:/:provider:/:v1beta1:/:resources.proto", + "def": { + "messages": [ + { + "name": "OpenInAppURL", + "fields": [ + { + "id": 1, + "name": "app_url", + "type": "string" + }, + { + "id": 2, + "name": "method", + "type": "string" + } + ], + "maps": [ + { + "key_type": "string", + "field": { + "id": 3, + "name": "form_parameters", + "type": "string" + } + }, + { + "key_type": "string", + "field": { + "id": 4, + "name": "headers", + "type": "string" + } + } + ] + } + ], + "package": { + "name": "cs3.app.provider.v1beta1" + }, + "options": [ + { + "name": "csharp_namespace", + "value": "Cs3.App.Provider.V1Beta1" + }, + { + "name": "go_package", + "value": "providerv1beta1" + }, + { + "name": "java_multiple_files", + "value": "true" + }, + { + "name": "java_outer_classname", + "value": "ResourcesProto" + }, + { + "name": "java_package", + "value": "com.cs3.app.provider.v1beta1" + }, + { + "name": "objc_class_prefix", + "value": "CAP" + }, + { + "name": "php_namespace", + "value": "Cs3\\\\App\\\\Provider\\\\V1Beta1" + } + ] + } + }, { "protopath": "cs3:/:app:/:registry:/:v1beta1:/:registry_api.proto", "def": { @@ -580,6 +656,41 @@ } ] }, + { + "name": "ListSupportedMimeTypesRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + } + ] + }, + { + "name": "ListSupportedMimeTypesResponse", + "fields": [ + { + "id": 1, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + }, + { + "id": 2, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + } + ], + "maps": [ + { + "key_type": "string", + "field": { + "id": 3, + "name": "mime_types", + "type": "AppProviderNameList" + } + } + ] + }, { "name": "GetDefaultAppProviderForMimeTypeRequest", "fields": [ @@ -670,6 +781,11 @@ "in_type": "ListAppProvidersRequest", "out_type": "ListAppProvidersResponse" }, + { + "name": "ListSupportedMimeTypes", + "in_type": "ListSupportedMimeTypesRequest", + "out_type": "ListSupportedMimeTypesResponse" + }, { "name": "GetDefaultAppProviderForMimeType", "in_type": "GetDefaultAppProviderForMimeTypeRequest", @@ -766,6 +882,17 @@ "type": "string" } ] + }, + { + "name": "AppProviderNameList", + "fields": [ + { + "id": 1, + "name": "app_provider_names", + "type": "string", + "is_repeated": true + } + ] } ], "imports": [ @@ -2128,6 +2255,11 @@ "in_type": "cs3.app.registry.v1beta1.ListAppProvidersRequest", "out_type": "cs3.app.registry.v1beta1.ListAppProvidersResponse" }, + { + "name": "ListSupportedMimeTypes", + "in_type": "cs3.app.registry.v1beta1.ListSupportedMimeTypesRequest", + "out_type": "cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse" + }, { "name": "GetDefaultAppProviderForMimeType", "in_type": "cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeRequest", @@ -6523,6 +6655,41 @@ } ] }, + { + "name": "DenyGrantRequest", + "fields": [ + { + "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "ref", + "type": "Reference" + }, + { + "id": 3, + "name": "grantee", + "type": "Grantee" + } + ] + }, + { + "name": "DenyGrantResponse", + "fields": [ + { + "id": 1, + "name": "status", + "type": "cs3.rpc.v1beta1.Status" + }, + { + "id": 2, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + } + ] + }, { "name": "CreateContainerRequest", "fields": [ @@ -7597,6 +7764,11 @@ "in_type": "DeleteRequest", "out_type": "DeleteResponse" }, + { + "name": "DenyGrant", + "in_type": "DenyGrantRequest", + "out_type": "DenyGrantResponse" + }, { "name": "GetPath", "in_type": "GetPathRequest", @@ -8110,6 +8282,11 @@ "id": 19, "name": "update_grant", "type": "bool" + }, + { + "id": 20, + "name": "deny_grant", + "type": "bool" } ] }, From 9233b847da97b3eba0acb62cc193f6ba0a79b26e Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Tue, 3 Aug 2021 17:29:32 +0200 Subject: [PATCH 2/3] Add comment for supported methods --- cs3/app/provider/v1beta1/resources.proto | 1 + docs/index.html | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cs3/app/provider/v1beta1/resources.proto b/cs3/app/provider/v1beta1/resources.proto index c7cc08f2..b27901d8 100644 --- a/cs3/app/provider/v1beta1/resources.proto +++ b/cs3/app/provider/v1beta1/resources.proto @@ -35,6 +35,7 @@ message OpenInAppURL { string app_url = 1; // REQUIRED. // The method for the request to be made. + // Only GET and POST are supported. string method = 2; // OPTIONAL. // The form parameters which have to be passed along with the request. diff --git a/docs/index.html b/docs/index.html index 3a9ae48b..84dca317 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5184,7 +5184,8 @@

      OpenInAppURL

      string

      REQUIRED. -The method for the request to be made.

      +The method for the request to be made. +Only GET and POST are supported.

      From 9f8b90334eb11b2b6d12e5ae61620d5432dda59f Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Fri, 6 Aug 2021 15:36:37 +0200 Subject: [PATCH 3/3] Add icon and desktop_only fields to app provider and return full object in ListSupportedMimeTypes --- cs3/app/registry/v1beta1/registry_api.proto | 2 +- cs3/app/registry/v1beta1/resources.proto | 12 ++++++--- docs/index.html | 28 ++++++++++++++++----- proto.lock | 18 ++++++++++--- 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/cs3/app/registry/v1beta1/registry_api.proto b/cs3/app/registry/v1beta1/registry_api.proto index 6aa89efb..6deabf1b 100644 --- a/cs3/app/registry/v1beta1/registry_api.proto +++ b/cs3/app/registry/v1beta1/registry_api.proto @@ -137,7 +137,7 @@ message ListSupportedMimeTypesResponse { cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. // The list of supported mime types with the apps which they can be opened with. - map mime_types = 3; + map mime_types = 3; } message GetDefaultAppProviderForMimeTypeRequest { diff --git a/cs3/app/registry/v1beta1/resources.proto b/cs3/app/registry/v1beta1/resources.proto index 9250bff0..b80d7b0a 100644 --- a/cs3/app/registry/v1beta1/resources.proto +++ b/cs3/app/registry/v1beta1/resources.proto @@ -50,9 +50,15 @@ message ProviderInfo { // offered by the app provider. Meant to be read // by humans. string description = 5; + // OPTIONAL. + // A URI to a static asset which represents the app icon. + string icon = 6; + // OPTIONAL. + // Whether the app can be opened only on desktop + bool desktop_only = 7; } -// Holds a list of app names which can open a particular mime type. -message AppProviderNameList { - repeated string app_provider_names = 1; +// Holds a list of app providers which can open a particular mime type. +message AppProviderList { + repeated ProviderInfo app_providers = 1; } diff --git a/docs/index.html b/docs/index.html index 84dca317..a400e511 100644 --- a/docs/index.html +++ b/docs/index.html @@ -610,7 +610,7 @@

      Table of Contents

      • - MAppProviderNameList + MAppProviderList
      • @@ -5653,7 +5653,7 @@

        value - AppProviderNameList + AppProviderList

        @@ -5808,8 +5808,8 @@

        cs3/app/registry/v1beta1/resou

        -

        AppProviderNameList

        -

        Holds a list of app names which can open a particular mime type.

        +

        AppProviderList

        +

        Holds a list of app providers which can open a particular mime type.

        @@ -5819,8 +5819,8 @@

        AppProviderNameList

        - - + + @@ -5885,6 +5885,22 @@

        ProviderInfo

        by humans.

        + + + + + + + + + + + + + +
        app_provider_namesstringapp_providersProviderInfo repeated

        iconstring

        OPTIONAL. +A URI to a static asset which represents the app icon.

        desktop_onlybool

        OPTIONAL. +Whether the app can be opened only on desktop

        diff --git a/proto.lock b/proto.lock index 39f0cecb..e4644342 100644 --- a/proto.lock +++ b/proto.lock @@ -686,7 +686,7 @@ "field": { "id": 3, "name": "mime_types", - "type": "AppProviderNameList" + "type": "AppProviderList" } } ] @@ -880,16 +880,26 @@ "id": 5, "name": "description", "type": "string" + }, + { + "id": 6, + "name": "icon", + "type": "string" + }, + { + "id": 7, + "name": "desktop_only", + "type": "bool" } ] }, { - "name": "AppProviderNameList", + "name": "AppProviderList", "fields": [ { "id": 1, - "name": "app_provider_names", - "type": "string", + "name": "app_providers", + "type": "ProviderInfo", "is_repeated": true } ]