From 914af2b44e5bcccdcfead9ddf770ffb6ee30b7f4 Mon Sep 17 00:00:00 2001
From: Ishank Arora
Date: Wed, 16 Jun 2021 15:23:53 +0200
Subject: [PATCH 1/3] Extend app registry with methods to add providers and
mimetype filters
---
cs3/app/registry/v1beta1/registry_api.proto | 79 ++++-
cs3/app/registry/v1beta1/resources.proto | 5 +-
cs3/gateway/v1beta1/gateway_api.proto | 6 +
docs/index.html | 316 ++++++++++++++++++--
proto.lock | 156 ++++++++--
5 files changed, 499 insertions(+), 63 deletions(-)
diff --git a/cs3/app/registry/v1beta1/registry_api.proto b/cs3/app/registry/v1beta1/registry_api.proto
index 3620f314..30e1a2e6 100644
--- a/cs3/app/registry/v1beta1/registry_api.proto
+++ b/cs3/app/registry/v1beta1/registry_api.proto
@@ -53,8 +53,14 @@ service RegistryAPI {
// Returns the app providers that are capable of handling this resource info.
// MUST return CODE_NOT_FOUND if no providers are available.
rpc GetAppProviders(GetAppProvidersRequest) returns (GetAppProvidersResponse);
+ // Registers a new app provider to the registry.
+ rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse);
// Returns a list of the available app providers known by this registry.
rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse);
+ // Returns the default app provider which serves a specified mime type.
+ rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse);
+ // Sets the default app provider for a specified mime type.
+ rpc SetDefaultAppProviderForMimeType(SetDefaultAppProviderForMimeTypeRequest) returns (SetDefaultAppProviderForMimeTypeResponse);
}
message GetAppProvidersRequest {
@@ -78,6 +84,24 @@ message GetAppProvidersResponse {
repeated ProviderInfo providers = 3;
}
+message AddAppProviderRequest {
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 1;
+ // REQUIRED.
+ // The app provider to be registered.
+ ProviderInfo provider = 2;
+}
+
+message AddAppProviderResponse {
+ // REQUIRED.
+ // The response status.
+ cs3.rpc.v1beta1.Status status = 1;
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 2;
+}
+
message ListAppProvidersRequest {
// OPTIONAL.
// Opaque information.
@@ -85,17 +109,8 @@ message ListAppProvidersRequest {
// REQUIRED.
// Represents a filter to apply to the request.
message Filter {
- // The filter to apply.
- enum Type {
- TYPE_INVALID = 0;
- TYPE_MIME_TYPE = 1;
- }
- // REQUIRED.
- Type type = 2;
- oneof term {
- // if present, the response MUST list all known app providers for the given mimetype.
- string mime_type = 3;
- }
+ // if present, the response MUST list all known app providers for the given mimetype.
+ string mime_type = 1;
}
// OPTIONAL.
// The list of filters to apply if any.
@@ -113,3 +128,45 @@ message ListAppProvidersResponse {
// The list of app providers this registry knows about.
repeated ProviderInfo providers = 3;
}
+
+message GetDefaultAppProviderForMimeTypeRequest {
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 1;
+ // REQUIRED.
+ // The mimetype for which the default app has to be returned.
+ string mime_type = 2;
+}
+
+message GetDefaultAppProviderForMimeTypeResponse {
+ // REQUIRED.
+ // The response status.
+ cs3.rpc.v1beta1.Status status = 1;
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 2;
+ // REQUIRED.
+ // The default app provider for the specified mime type.
+ ProviderInfo provider = 3;
+}
+
+message SetDefaultAppProviderForMimeTypeRequest {
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 1;
+ // REQUIRED.
+ // The mimetype for which the default app has to be returned.
+ string mime_type = 2;
+ // REQUIRED.
+ // The app provider to be marked as default for the specified mime type.
+ ProviderInfo provider = 3;
+}
+
+message SetDefaultAppProviderForMimeTypeResponse {
+ // REQUIRED.
+ // The response status.
+ cs3.rpc.v1beta1.Status status = 1;
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 2;
+}
diff --git a/cs3/app/registry/v1beta1/resources.proto b/cs3/app/registry/v1beta1/resources.proto
index 73ac1af4..0f65c2e6 100644
--- a/cs3/app/registry/v1beta1/resources.proto
+++ b/cs3/app/registry/v1beta1/resources.proto
@@ -43,8 +43,11 @@ message ProviderInfo {
// For example, tcp://localhost:1099.
string address = 3;
// OPTIONAL.
+ // A human-readable name of the app provider.
+ string name = 4;
+ // OPTIONAL.
// Information to describe the functionalities
// offered by the app provider. Meant to be read
// by humans.
- string description = 4;
+ string description = 5;
}
diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto
index 4338ee57..8e49fb78 100644
--- a/cs3/gateway/v1beta1/gateway_api.proto
+++ b/cs3/gateway/v1beta1/gateway_api.proto
@@ -287,8 +287,14 @@ service GatewayAPI {
// Returns the app providers that are capable of handling this resource info.
// MUST return CODE_NOT_FOUND if no providers are available.
rpc GetAppProviders(cs3.app.registry.v1beta1.GetAppProvidersRequest) returns (cs3.app.registry.v1beta1.GetAppProvidersResponse);
+ // Registers a new app provider to the registry.
+ rpc AddAppProvider(cs3.app.registry.v1beta1.AddAppProviderRequest) returns (cs3.app.registry.v1beta1.AddAppProviderResponse);
// Returns a list of the available app providers known by this registry.
rpc ListAppProviders(cs3.app.registry.v1beta1.ListAppProvidersRequest) returns (cs3.app.registry.v1beta1.ListAppProvidersResponse);
+ // Returns the default app provider which serves a specified mime type.
+ rpc GetDefaultAppProviderForMimeType(cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeRequest) returns (cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeResponse);
+ // Sets the default app provider for a specified mime type.
+ rpc SetDefaultAppProviderForMimeType(cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest) returns (cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeResponse);
// *****************************************************************/
// ************************ USER PROVIDER **************************/
// *****************************************************************/
diff --git a/docs/index.html b/docs/index.html
index 7c735f53..f54ae206 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -539,6 +539,14 @@ Table of Contents
cs3/app/registry/v1beta1/registry_api.proto
+
+ AddAppProvider |
+ .cs3.app.registry.v1beta1.AddAppProviderRequest |
+ .cs3.app.registry.v1beta1.AddAppProviderResponse |
+ Registers a new app provider to the registry. |
+
+
ListAppProviders |
.cs3.app.registry.v1beta1.ListAppProvidersRequest |
.cs3.app.registry.v1beta1.ListAppProvidersResponse |
- Returns a list of the available app providers known by this registry.
+ | Returns a list of the available app providers known by this registry. |
+
+
+
+ GetDefaultAppProviderForMimeType |
+ .cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeRequest |
+ .cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeResponse |
+ Returns the default app provider which serves a specified mime type. |
+
+
+
+ SetDefaultAppProviderForMimeType |
+ .cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest |
+ .cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeResponse |
+ Sets the default app provider for a specified mime type.
*****************************************************************/
************************ USER PROVIDER **************************/
@@ -5322,6 +5363,72 @@ cs3/app/registry/v1beta1/re
+ AddAppProviderRequest
+
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ provider |
+ ProviderInfo |
+ |
+ REQUIRED.
+The app provider to be registered. |
+
+
+
+
+
+
+
+
+
+ AddAppProviderResponse
+
+
+
+
+
+
+
+
+
GetAppProvidersRequest
@@ -5396,6 +5503,80 @@ GetAppProvidersRespons
+
+
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ mime_type |
+ string |
+ |
+ REQUIRED.
+The mimetype for which the default app has to be returned. |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ status |
+ cs3.rpc.v1beta1.Status |
+ |
+ REQUIRED.
+The response status. |
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ provider |
+ ProviderInfo |
+ |
+ REQUIRED.
+The default app provider for the specified mime type. |
+
+
+
+
+
+
+
+
+
ListAppProvidersRequest
@@ -5439,13 +5620,6 @@ ListAppProvider
-
- type |
- ListAppProvidersRequest.Filter.Type |
- |
- REQUIRED. |
-
-
mime_type |
string |
@@ -5501,30 +5675,81 @@ ListAppProvidersRespo
+
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ mime_type |
+ string |
+ |
+ REQUIRED.
+The mimetype for which the default app has to be returned. |
+
+
+
+ provider |
+ ProviderInfo |
+ |
+ REQUIRED.
+The app provider to be marked as default for the specified mime type. |
+
+
+
+
+
+
+
+
- ListAppProvidersRequest.Filter.Type
- The filter to apply.
-
-
- Name | Number | Description |
-
-
-
-
- TYPE_INVALID |
- 0 |
- |
-
-
-
- TYPE_MIME_TYPE |
- 1 |
- |
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -5546,6 +5771,13 @@ RegistryAPI
MUST return CODE_NOT_FOUND if no providers are available.
+
+ AddAppProvider |
+ AddAppProviderRequest |
+ AddAppProviderResponse |
+ Registers a new app provider to the registry. |
+
+
ListAppProviders |
ListAppProvidersRequest |
@@ -5553,6 +5785,20 @@ RegistryAPI
Returns a list of the available app providers known by this registry. |
+
+ GetDefaultAppProviderForMimeType |
+ GetDefaultAppProviderForMimeTypeRequest |
+ GetDefaultAppProviderForMimeTypeResponse |
+ Returns the default app provider which serves a specified mime type. |
+
+
+
+ SetDefaultAppProviderForMimeType |
+ SetDefaultAppProviderForMimeTypeRequest |
+ SetDefaultAppProviderForMimeTypeResponse |
+ Sets the default app provider for a specified mime type. |
+
+
@@ -5600,6 +5846,14 @@ ProviderInfo
For example, tcp://localhost:1099. |
+
+ name |
+ string |
+ |
+ OPTIONAL.
+A human-readable name of the app provider. |
+
+
description |
string |
diff --git a/proto.lock b/proto.lock
index ea209c41..ba6b7f50 100644
--- a/proto.lock
+++ b/proto.lock
@@ -557,20 +557,6 @@
{
"protopath": "cs3:/:app:/:registry:/:v1beta1:/:registry_api.proto",
"def": {
- "enums": [
- {
- "name": "Filter.Type",
- "enum_fields": [
- {
- "name": "TYPE_INVALID"
- },
- {
- "name": "TYPE_MIME_TYPE",
- "integer": 1
- }
- ]
- }
- ],
"messages": [
{
"name": "GetAppProvidersRequest",
@@ -608,6 +594,36 @@
}
]
},
+ {
+ "name": "AddAppProviderRequest",
+ "fields": [
+ {
+ "id": 1,
+ "name": "opaque",
+ "type": "cs3.types.v1beta1.Opaque"
+ },
+ {
+ "id": 2,
+ "name": "provider",
+ "type": "ProviderInfo"
+ }
+ ]
+ },
+ {
+ "name": "AddAppProviderResponse",
+ "fields": [
+ {
+ "id": 1,
+ "name": "status",
+ "type": "cs3.rpc.v1beta1.Status"
+ },
+ {
+ "id": 2,
+ "name": "opaque",
+ "type": "cs3.types.v1beta1.Opaque"
+ }
+ ]
+ },
{
"name": "ListAppProvidersRequest",
"fields": [
@@ -628,12 +644,7 @@
"name": "Filter",
"fields": [
{
- "id": 2,
- "name": "type",
- "type": "Type"
- },
- {
- "id": 3,
+ "id": 1,
"name": "mime_type",
"type": "string"
}
@@ -661,6 +672,76 @@
"is_repeated": true
}
]
+ },
+ {
+ "name": "GetDefaultAppProviderForMimeTypeRequest",
+ "fields": [
+ {
+ "id": 1,
+ "name": "opaque",
+ "type": "cs3.types.v1beta1.Opaque"
+ },
+ {
+ "id": 2,
+ "name": "mime_type",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "GetDefaultAppProviderForMimeTypeResponse",
+ "fields": [
+ {
+ "id": 1,
+ "name": "status",
+ "type": "cs3.rpc.v1beta1.Status"
+ },
+ {
+ "id": 2,
+ "name": "opaque",
+ "type": "cs3.types.v1beta1.Opaque"
+ },
+ {
+ "id": 3,
+ "name": "provider",
+ "type": "ProviderInfo"
+ }
+ ]
+ },
+ {
+ "name": "SetDefaultAppProviderForMimeTypeRequest",
+ "fields": [
+ {
+ "id": 1,
+ "name": "opaque",
+ "type": "cs3.types.v1beta1.Opaque"
+ },
+ {
+ "id": 2,
+ "name": "mime_type",
+ "type": "string"
+ },
+ {
+ "id": 3,
+ "name": "provider",
+ "type": "ProviderInfo"
+ }
+ ]
+ },
+ {
+ "name": "SetDefaultAppProviderForMimeTypeResponse",
+ "fields": [
+ {
+ "id": 1,
+ "name": "status",
+ "type": "cs3.rpc.v1beta1.Status"
+ },
+ {
+ "id": 2,
+ "name": "opaque",
+ "type": "cs3.types.v1beta1.Opaque"
+ }
+ ]
}
],
"services": [
@@ -672,10 +753,25 @@
"in_type": "GetAppProvidersRequest",
"out_type": "GetAppProvidersResponse"
},
+ {
+ "name": "AddAppProvider",
+ "in_type": "AddAppProviderRequest",
+ "out_type": "AddAppProviderResponse"
+ },
{
"name": "ListAppProviders",
"in_type": "ListAppProvidersRequest",
"out_type": "ListAppProvidersResponse"
+ },
+ {
+ "name": "GetDefaultAppProviderForMimeType",
+ "in_type": "GetDefaultAppProviderForMimeTypeRequest",
+ "out_type": "GetDefaultAppProviderForMimeTypeResponse"
+ },
+ {
+ "name": "SetDefaultAppProviderForMimeType",
+ "in_type": "SetDefaultAppProviderForMimeTypeRequest",
+ "out_type": "SetDefaultAppProviderForMimeTypeResponse"
}
]
}
@@ -754,6 +850,11 @@
},
{
"id": 4,
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "id": 5,
"name": "description",
"type": "string"
}
@@ -2155,11 +2256,26 @@
"in_type": "cs3.app.registry.v1beta1.GetAppProvidersRequest",
"out_type": "cs3.app.registry.v1beta1.GetAppProvidersResponse"
},
+ {
+ "name": "AddAppProvider",
+ "in_type": "cs3.app.registry.v1beta1.AddAppProviderRequest",
+ "out_type": "cs3.app.registry.v1beta1.AddAppProviderResponse"
+ },
{
"name": "ListAppProviders",
"in_type": "cs3.app.registry.v1beta1.ListAppProvidersRequest",
"out_type": "cs3.app.registry.v1beta1.ListAppProvidersResponse"
},
+ {
+ "name": "GetDefaultAppProviderForMimeType",
+ "in_type": "cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeRequest",
+ "out_type": "cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeResponse"
+ },
+ {
+ "name": "SetDefaultAppProviderForMimeType",
+ "in_type": "cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest",
+ "out_type": "cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeResponse"
+ },
{
"name": "GetUser",
"in_type": "cs3.identity.user.v1beta1.GetUserRequest",
From 621f1796d5708b422f0668b23cec5939df97226b Mon Sep 17 00:00:00 2001
From: Ishank Arora
Date: Wed, 16 Jun 2021 15:55:15 +0200
Subject: [PATCH 2/3] Remove filters from ListAppProvidersRequest
---
cs3/app/registry/v1beta1/registry_api.proto | 9 ------
docs/index.html | 36 ---------------------
proto.lock | 18 -----------
3 files changed, 63 deletions(-)
diff --git a/cs3/app/registry/v1beta1/registry_api.proto b/cs3/app/registry/v1beta1/registry_api.proto
index 30e1a2e6..8a8d5eed 100644
--- a/cs3/app/registry/v1beta1/registry_api.proto
+++ b/cs3/app/registry/v1beta1/registry_api.proto
@@ -106,15 +106,6 @@ message ListAppProvidersRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
- // REQUIRED.
- // Represents a filter to apply to the request.
- message Filter {
- // if present, the response MUST list all known app providers for the given mimetype.
- string mime_type = 1;
- }
- // OPTIONAL.
- // The list of filters to apply if any.
- repeated Filter filters = 2;
}
message ListAppProvidersResponse {
diff --git a/docs/index.html b/docs/index.html
index f54ae206..d4440dae 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -567,10 +567,6 @@ Table of Contents
MListAppProvidersRequest
-
- MListAppProvidersRequest.Filter
-
-
MListAppProvidersResponse
@@ -5595,38 +5591,6 @@ ListAppProvidersReques
Opaque information.
-
- filters |
- ListAppProvidersRequest.Filter |
- repeated |
- OPTIONAL.
-The list of filters to apply if any. |
-
-
-
-
-
-
-
-
-
- ListAppProvidersRequest.Filter
- REQUIRED.
Represents a filter to apply to the request.
-
-
-
-
- Field | Type | Label | Description |
-
-
-
-
- mime_type |
- string |
- |
- if present, the response MUST list all known app providers for the given mimetype. |
-
-
diff --git a/proto.lock b/proto.lock
index ba6b7f50..74ce525f 100644
--- a/proto.lock
+++ b/proto.lock
@@ -631,24 +631,6 @@
"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": "mime_type",
- "type": "string"
- }
- ]
}
]
},
From 9c1b8232fd423846503a898c49be2da0cc2d32db Mon Sep 17 00:00:00 2001
From: Ishank Arora
Date: Thu, 1 Jul 2021 14:21:50 +0200
Subject: [PATCH 3/3] Remove app field from app.provider.OpenInAppRequest
---
cs3/app/provider/v1beta1/provider_api.proto | 6 ------
cs3/gateway/v1beta1/gateway_api.proto | 6 ++++--
docs/index.html | 17 ++++-------------
proto.lock | 5 -----
4 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/cs3/app/provider/v1beta1/provider_api.proto b/cs3/app/provider/v1beta1/provider_api.proto
index 84b0f525..85d0415a 100644
--- a/cs3/app/provider/v1beta1/provider_api.proto
+++ b/cs3/app/provider/v1beta1/provider_api.proto
@@ -89,12 +89,6 @@ message OpenInAppRequest {
// The access token MUST be short-lived.
// TODO(labkode): investigate token derivation techniques.
string access_token = 4;
- // OPTIONAL.
- // A reference to the application to be used to open the resource, should the
- // default inferred from the resource's mimetype be overridden by user's choice.
- // If the targeted resource is a directory, this parameter is required and
- // in its absence the implementation MUST return INVALID_ARGUMENT.
- string app = 5;
}
message OpenInAppResponse {
diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto
index 8e49fb78..ae815dda 100644
--- a/cs3/gateway/v1beta1/gateway_api.proto
+++ b/cs3/gateway/v1beta1/gateway_api.proto
@@ -550,8 +550,10 @@ message OpenInAppRequest {
}
ViewMode view_mode = 3;
// OPTIONAL.
- // The application to be used to open the resource. Defaults to the primary application
- // registered for the mime type of the given resource.
+ // A reference to the application to be used to open the resource, should the
+ // default inferred from the resource's mimetype be overridden by user's choice.
+ // If the targeted resource is a directory, this parameter is required and
+ // in its absence the implementation MUST return INVALID_ARGUMENT.
string app = 4;
}
diff --git a/docs/index.html b/docs/index.html
index d4440dae..dd4d6967 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -2362,8 +2362,10 @@ OpenInAppRequest
string |
|
OPTIONAL.
-The application to be used to open the resource. Defaults to the primary application
-registered for the mime type of the given resource. |
+A reference to the application to be used to open the resource, should the
+default inferred from the resource's mimetype be overridden by user's choice.
+If the targeted resource is a directory, this parameter is required and
+in its absence the implementation MUST return INVALID_ARGUMENT.
@@ -5187,17 +5189,6 @@ OpenInAppRequest
TODO(labkode): investigate token derivation techniques.
-
- app |
- string |
- |
- OPTIONAL.
-A reference to the application to be used to open the resource, should the
-default inferred from the resource's mimetype be overridden by user's choice.
-If the targeted resource is a directory, this parameter is required and
-in its absence the implementation MUST return INVALID_ARGUMENT. |
-
-
diff --git a/proto.lock b/proto.lock
index 74ce525f..b6625e10 100644
--- a/proto.lock
+++ b/proto.lock
@@ -417,11 +417,6 @@
"id": 4,
"name": "access_token",
"type": "string"
- },
- {
- "id": 5,
- "name": "app",
- "type": "string"
}
]
},