From d8bdf10365aed149eeae435443ee424b89fc9e05 Mon Sep 17 00:00:00 2001 From: St4NNi Date: Wed, 21 Jun 2023 20:19:32 +0200 Subject: [PATCH 1/6] fix: Added missing collection_id to AddKeyValuesToCollectionRequest --- aruna/api/storage/services/v1/collection_service.proto | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aruna/api/storage/services/v1/collection_service.proto b/aruna/api/storage/services/v1/collection_service.proto index 94133782..797c39bf 100644 --- a/aruna/api/storage/services/v1/collection_service.proto +++ b/aruna/api/storage/services/v1/collection_service.proto @@ -320,8 +320,9 @@ message DeleteCollectionResponse {} message AddKeyValuesToCollectionRequest { - repeated storage.models.v1.KeyValue labels = 1; - repeated storage.models.v1.KeyValue hooks = 2; + string collection_id = 1; + repeated storage.models.v1.KeyValue labels = 2; + repeated storage.models.v1.KeyValue hooks = 3; } message AddKeyValuesToCollectionResponse { From 701dafa1d6e9b68f7b2f24195faaf378d0d16d7c Mon Sep 17 00:00:00 2001 From: St4NNi Date: Thu, 22 Jun 2023 09:23:35 +0200 Subject: [PATCH 2/6] feat: Expanded bundler service by rest annotations, collection_id and endpoint_id --- .../bundler/services/v1/bundler_service.proto | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/aruna/api/bundler/services/v1/bundler_service.proto b/aruna/api/bundler/services/v1/bundler_service.proto index 32506edf..ae75bb63 100644 --- a/aruna/api/bundler/services/v1/bundler_service.proto +++ b/aruna/api/bundler/services/v1/bundler_service.proto @@ -7,6 +7,7 @@ option java_package = "com.github.ArunaStorage.java_api.aruna.api.storage.servic option java_outer_classname = "BundlerService"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; // BundlerService // @@ -14,8 +15,18 @@ import "google/protobuf/timestamp.proto"; // // A service that enables bundled downloads service BundlerService { - rpc CreateBundle(CreateBundleRequest) returns (CreateBundleResponse) {} - rpc DeleteBundle(DeleteBundleRequest) returns (DeleteBundleResponse) {} + rpc CreateBundle(CreateBundleRequest) returns (CreateBundleResponse) { + option (google.api.http) = { + post : "/v1/collection/{collection_id}/bundle" + body : "*" + }; + } + rpc DeleteBundle(DeleteBundleRequest) returns (DeleteBundleResponse) { + option (google.api.http) = { + delete : "/v1/collection/{collection_id}/bundle/{bundle_id}" + body : "*" + }; + } } // An resourcetype used to identify generic authorizations @@ -27,18 +38,23 @@ enum ArchiveType { } message CreateBundleRequest { - repeated string object_ids = 1; - string filename = 2; - ArchiveType archive_type = 3; - google.protobuf.Timestamp expires_at = 4; + string collection_id = 1; + repeated string object_ids = 2; + string filename = 3; + ArchiveType archive_type = 4; + google.protobuf.Timestamp expires_at = 5; + // Optional endpoint_id + string endpoint_id = 6; } message CreateBundleResponse { - string url = 1; + string bundle_id = 1; + string url = 2; } message DeleteBundleRequest { - string bundle_id = 1; + string collection_id = 1; + string bundle_id = 2; } message DeleteBundleResponse {} \ No newline at end of file From 1667715ec2a9da12dbc884c0f2b9625c1884cd7d Mon Sep 17 00:00:00 2001 From: St4NNi Date: Thu, 22 Jun 2023 10:51:33 +0200 Subject: [PATCH 3/6] feat: Expanded endpoint service to contain boolean flag for is_bundler --- aruna/api/internal/v1/bundler.proto | 4 +++- aruna/api/storage/models/v1/models.proto | 1 + aruna/api/storage/services/v1/endpoint_service.proto | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aruna/api/internal/v1/bundler.proto b/aruna/api/internal/v1/bundler.proto index aee161c9..1ab1706e 100644 --- a/aruna/api/internal/v1/bundler.proto +++ b/aruna/api/internal/v1/bundler.proto @@ -48,7 +48,9 @@ message EnableBundleRequest{ message EnableBundleResponse{} -message GetBundlesRequest {} +message GetBundlesRequest { + string endpoint_id = 1; +} message GetBundlesResponse { repeated Bundle bundles = 1; diff --git a/aruna/api/storage/models/v1/models.proto b/aruna/api/storage/models/v1/models.proto index fed5f49e..d74a3260 100644 --- a/aruna/api/storage/models/v1/models.proto +++ b/aruna/api/storage/models/v1/models.proto @@ -157,6 +157,7 @@ message Endpoint { bool is_public = 7; bool is_default = 8; EndpointStatus status = 9; + bool is_bundler = 10; } // RULES for Objects: diff --git a/aruna/api/storage/services/v1/endpoint_service.proto b/aruna/api/storage/services/v1/endpoint_service.proto index 94afe9b1..7fdf3b13 100644 --- a/aruna/api/storage/services/v1/endpoint_service.proto +++ b/aruna/api/storage/services/v1/endpoint_service.proto @@ -93,6 +93,8 @@ message AddEndpointRequest { bool is_public = 6; // (optional) ED25519 Pubkey -> Pubkey to validate endpoint authenticated tokens string pubkey = 7; + // Added option to make a Dataproxy a bundler + bool is_bundler = 8; } message AddEndpointResponse { From 9786ed425eec81a7b26ed6777d018e96d421a40e Mon Sep 17 00:00:00 2001 From: St4NNi Date: Thu, 22 Jun 2023 11:02:09 +0200 Subject: [PATCH 4/6] feat: Added ssl flag to endpoint to indicate https vs http --- aruna/api/storage/models/v1/models.proto | 1 + aruna/api/storage/services/v1/endpoint_service.proto | 2 ++ 2 files changed, 3 insertions(+) diff --git a/aruna/api/storage/models/v1/models.proto b/aruna/api/storage/models/v1/models.proto index d74a3260..425dc03b 100644 --- a/aruna/api/storage/models/v1/models.proto +++ b/aruna/api/storage/models/v1/models.proto @@ -158,6 +158,7 @@ message Endpoint { bool is_default = 8; EndpointStatus status = 9; bool is_bundler = 10; + bool ssl = 11; } // RULES for Objects: diff --git a/aruna/api/storage/services/v1/endpoint_service.proto b/aruna/api/storage/services/v1/endpoint_service.proto index 7fdf3b13..c9509e0f 100644 --- a/aruna/api/storage/services/v1/endpoint_service.proto +++ b/aruna/api/storage/services/v1/endpoint_service.proto @@ -95,6 +95,8 @@ message AddEndpointRequest { string pubkey = 7; // Added option to make a Dataproxy a bundler bool is_bundler = 8; + // Is ssl / https enabled ? + bool ssl_enabled = 9; } message AddEndpointResponse { From 94e185820a22c230cde9c856ab935242afffa00b Mon Sep 17 00:00:00 2001 From: St4NNi Date: Thu, 22 Jun 2023 19:35:27 +0200 Subject: [PATCH 5/6] feat: Refactor and expanded Endpoint config --- aruna/api/storage/models/v1/models.proto | 18 +++++++++++++++--- .../storage/services/v1/endpoint_service.proto | 8 ++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/aruna/api/storage/models/v1/models.proto b/aruna/api/storage/models/v1/models.proto index 425dc03b..1f92849c 100644 --- a/aruna/api/storage/models/v1/models.proto +++ b/aruna/api/storage/models/v1/models.proto @@ -147,18 +147,30 @@ enum EndpointType { ENDPOINT_TYPE_FILE = 2; } +enum EndpointHostType { + ENDPOINT_HOST_TYPE_UNSPECIFIED = 0; + ENDPOINT_HOST_TYPE_PROXY = 1; + ENDPOINT_HOST_TYPE_INTERNAL = 2; + ENDPOINT_HOST_TYPE_BUNDLER = 3; +} + +message EndpointHostConfig { + string url = 1; + bool is_primary = 2; + bool ssl = 3; + EndpointHostType host_type = 4; +} + message Endpoint { string id = 1; EndpointType ep_type = 2; string name = 3; - string proxy_hostname = 4; - string internal_hostname = 5; string documentation_path = 6; bool is_public = 7; bool is_default = 8; EndpointStatus status = 9; bool is_bundler = 10; - bool ssl = 11; + repeated EndpointHostConfig host_configs = 11; } // RULES for Objects: diff --git a/aruna/api/storage/services/v1/endpoint_service.proto b/aruna/api/storage/services/v1/endpoint_service.proto index c9509e0f..8f4e1d33 100644 --- a/aruna/api/storage/services/v1/endpoint_service.proto +++ b/aruna/api/storage/services/v1/endpoint_service.proto @@ -83,10 +83,6 @@ message AddEndpointRequest { string name = 1; // Endpoint type storage.models.v1.EndpointType ep_type = 2; - // Public hostname of the proxy - string proxy_hostname = 3; - // Internal hostname for the proxy - string internal_hostname = 4; // (optional) URL to a offsite documentation string documentation_path = 5; // Is this endpoint public @@ -95,8 +91,8 @@ message AddEndpointRequest { string pubkey = 7; // Added option to make a Dataproxy a bundler bool is_bundler = 8; - // Is ssl / https enabled ? - bool ssl_enabled = 9; + // List of EndpointHostConfigs + repeated storage.models.v1.EndpointHostConfig host_configs = 9; } message AddEndpointResponse { From e027fb3d1a9becb36503ce8f986b45b341407137 Mon Sep 17 00:00:00 2001 From: St4NNi Date: Thu, 22 Jun 2023 19:43:54 +0200 Subject: [PATCH 6/6] feat: Added public bool for EndpointHostConfig --- aruna/api/storage/models/v1/models.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aruna/api/storage/models/v1/models.proto b/aruna/api/storage/models/v1/models.proto index 1f92849c..06a6545b 100644 --- a/aruna/api/storage/models/v1/models.proto +++ b/aruna/api/storage/models/v1/models.proto @@ -158,7 +158,8 @@ message EndpointHostConfig { string url = 1; bool is_primary = 2; bool ssl = 3; - EndpointHostType host_type = 4; + bool public = 4; + EndpointHostType host_type = 5; } message Endpoint {