From 920143aa3ff54a2c3281241c47d143bf8c94b6b9 Mon Sep 17 00:00:00 2001 From: lfbrehm <97600985+lfbrehm@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:49:08 +0200 Subject: [PATCH 1/7] feat: Needed changes for a minimal Hooks working example --- .../api/hooks/services/v2/hooks_service.proto | 6 +++++- aruna/api/storage/models/v2/models.proto | 18 +++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/aruna/api/hooks/services/v2/hooks_service.proto b/aruna/api/hooks/services/v2/hooks_service.proto index 7c4c42d3..ce117b42 100644 --- a/aruna/api/hooks/services/v2/hooks_service.proto +++ b/aruna/api/hooks/services/v2/hooks_service.proto @@ -103,6 +103,10 @@ message HookCallbackRequest { bool success = 1; repeated aruna.api.storage.models.v2.KeyValue add_key_values = 2; repeated aruna.api.storage.models.v2.KeyValue remove_key_values = 3; + string secret = 4; + string hook_id = 5; + string object_id = 6; + string pubkey_serial = 7; } message HookCallbackResponse{} @@ -120,4 +124,4 @@ message HookInfo { message ListHooksResponse{ repeated HookInfo infos = 1; -} \ No newline at end of file +} diff --git a/aruna/api/storage/models/v2/models.proto b/aruna/api/storage/models/v2/models.proto index 78a977e7..712f4f2f 100644 --- a/aruna/api/storage/models/v2/models.proto +++ b/aruna/api/storage/models/v2/models.proto @@ -17,16 +17,15 @@ enum DataClass { // Which kind of endpoint enum EndpointVariant { - ENDPOINT_VARIANT_UNSPECIFIED = 0; - ENDPOINT_VARIANT_PERSISTENT = 1; + ENDPOINT_VARIANT_UNSPECIFIED = 0; ENDPOINT_VARIANT_PERSISTENT = 1; ENDPOINT_VARIANT_VOLATILE = 2; } // Which features does the endpoint have -enum EndpointHostVariant { - ENDPOINT_HOST_VARIANT_UNSPECIFIED = 0; - ENDPOINT_HOST_VARIANT_PROXY = 1; - ENDPOINT_HOST_VARIANT_BUNDLER = 2; +enum EndpointHostType { + ENDPOINT_HOST_TYPE_UNSPECIFIED = 0; + ENDPOINT_HOST_TYPE_GRPC= 1; + ENDPOINT_HOST_TYPE_S3= 2; } // Permission Levels @@ -340,5 +339,10 @@ message Object { bool dynamic = 11; repeated DataEndpoint endpoints = 12; // Object specific attributes +<<<<<<< Updated upstream repeated Hash hashes = 13; -} \ No newline at end of file +} +======= + repeated Hash hashes = 12; +} +>>>>>>> Stashed changes From 2794482bf8bcd9067d511aff986386b7b5054dc2 Mon Sep 17 00:00:00 2001 From: lfbrehm <97600985+lfbrehm@users.noreply.github.com> Date: Thu, 31 Aug 2023 10:17:56 +0200 Subject: [PATCH 2/7] feat: Consistent relation handling for hooks --- .../api/hooks/services/v2/hooks_service.proto | 27 ++++++++++--------- aruna/api/storage/models/v2/models.proto | 12 +++------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/aruna/api/hooks/services/v2/hooks_service.proto b/aruna/api/hooks/services/v2/hooks_service.proto index ce117b42..998b4260 100644 --- a/aruna/api/hooks/services/v2/hooks_service.proto +++ b/aruna/api/hooks/services/v2/hooks_service.proto @@ -56,19 +56,22 @@ message ExternalHook { string json_template = 3; } -enum InternalAction { - INTERNAL_ACTION_UNSPECIFIED = 0; - INTERNAL_ACTION_ADD_LABEL = 1; - INTERNAL_ACTION_ADD_HOOK = 2; - INTERNAL_ACTION_CREATE_RELATION = 3; +message AddLabel { + string key = 1; + string value = 2; +} + +message AddHook { + string key = 1; + string value = 2; } message InternalHook { - InternalAction internal_action = 1; - // Either key or target ID - string target_id = 2; - // Optional value - string value = 3; + oneof internal_action { + AddLabel add_label = 1; + AddHook add_hook = 2; + storage.models.v2.Relation add_relation = 3; + } } message Hook { @@ -101,8 +104,8 @@ message DeleteHookResponse {} message HookCallbackRequest { bool success = 1; - repeated aruna.api.storage.models.v2.KeyValue add_key_values = 2; - repeated aruna.api.storage.models.v2.KeyValue remove_key_values = 3; + repeated storage.models.v2.KeyValue add_key_values = 2; + repeated storage.models.v2.KeyValue remove_key_values = 3; string secret = 4; string hook_id = 5; string object_id = 6; diff --git a/aruna/api/storage/models/v2/models.proto b/aruna/api/storage/models/v2/models.proto index 712f4f2f..dccf3c97 100644 --- a/aruna/api/storage/models/v2/models.proto +++ b/aruna/api/storage/models/v2/models.proto @@ -17,12 +17,13 @@ enum DataClass { // Which kind of endpoint enum EndpointVariant { - ENDPOINT_VARIANT_UNSPECIFIED = 0; ENDPOINT_VARIANT_PERSISTENT = 1; + ENDPOINT_VARIANT_UNSPECIFIED = 0; + ENDPOINT_VARIANT_PERSISTENT = 1; ENDPOINT_VARIANT_VOLATILE = 2; } // Which features does the endpoint have -enum EndpointHostType { +enum EndpointHostVariant { ENDPOINT_HOST_TYPE_UNSPECIFIED = 0; ENDPOINT_HOST_TYPE_GRPC= 1; ENDPOINT_HOST_TYPE_S3= 2; @@ -324,7 +325,7 @@ message Dataset { } message Object { - string id = 1; + string id = 1; string name = 2; string description = 3; // Collection specific labels / hooks @@ -339,10 +340,5 @@ message Object { bool dynamic = 11; repeated DataEndpoint endpoints = 12; // Object specific attributes -<<<<<<< Updated upstream repeated Hash hashes = 13; } -======= - repeated Hash hashes = 12; -} ->>>>>>> Stashed changes From 4ad933f969c521bbf47f4fc84c43d01c07dc5a5c Mon Sep 17 00:00:00 2001 From: lfbrehm <97600985+lfbrehm@users.noreply.github.com> Date: Thu, 31 Aug 2023 10:20:03 +0200 Subject: [PATCH 3/7] fix: Linting error --- aruna/api/storage/models/v2/models.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aruna/api/storage/models/v2/models.proto b/aruna/api/storage/models/v2/models.proto index dccf3c97..ae5ae7a7 100644 --- a/aruna/api/storage/models/v2/models.proto +++ b/aruna/api/storage/models/v2/models.proto @@ -24,9 +24,9 @@ enum EndpointVariant { // Which features does the endpoint have enum EndpointHostVariant { - ENDPOINT_HOST_TYPE_UNSPECIFIED = 0; - ENDPOINT_HOST_TYPE_GRPC= 1; - ENDPOINT_HOST_TYPE_S3= 2; + ENDPOINT_HOST_VARIANT_UNSPECIFIED = 0; + ENDPOINT_HOST_VARIANT_GRPC= 1; + ENDPOINT_HOST_VARIANT_S3= 2; } // Permission Levels From 3d7e387c785b0cdb8cbb33932a703666e579d149 Mon Sep 17 00:00:00 2001 From: lfbrehm <97600985+lfbrehm@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:03:31 +0200 Subject: [PATCH 4/7] feat: Added http method enum for hook replies --- aruna/api/hooks/services/v2/hooks_service.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aruna/api/hooks/services/v2/hooks_service.proto b/aruna/api/hooks/services/v2/hooks_service.proto index 998b4260..83a5823b 100644 --- a/aruna/api/hooks/services/v2/hooks_service.proto +++ b/aruna/api/hooks/services/v2/hooks_service.proto @@ -54,6 +54,12 @@ message ExternalHook { string url = 1; Credentials credentials = 2; string json_template = 3; + Method method = 4; +} + +enum Method { + METHOD_PUT = 0; + METHOD_POST = 1; } message AddLabel { From d9783ffee3d2961278b72b0c543279fe0355f33c Mon Sep 17 00:00:00 2001 From: lfbrehm <97600985+lfbrehm@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:28:20 +0200 Subject: [PATCH 5/7] fix: Fixed linting error --- aruna/api/hooks/services/v2/hooks_service.proto | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aruna/api/hooks/services/v2/hooks_service.proto b/aruna/api/hooks/services/v2/hooks_service.proto index 83a5823b..64def827 100644 --- a/aruna/api/hooks/services/v2/hooks_service.proto +++ b/aruna/api/hooks/services/v2/hooks_service.proto @@ -58,8 +58,9 @@ message ExternalHook { } enum Method { - METHOD_PUT = 0; - METHOD_POST = 1; + METHOD_UNSPECIFIED = 0; + METHOD_PUT = 1; + METHOD_POST = 2; } message AddLabel { From 3006fb3c971a84b5e3fd06aead0c071835de0a42 Mon Sep 17 00:00:00 2001 From: lfbrehm <97600985+lfbrehm@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:40:57 +0200 Subject: [PATCH 6/7] feat: Search permission addition --- aruna/api/storage/services/v2/search_service.proto | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/aruna/api/storage/services/v2/search_service.proto b/aruna/api/storage/services/v2/search_service.proto index c379d972..61e4239b 100644 --- a/aruna/api/storage/services/v2/search_service.proto +++ b/aruna/api/storage/services/v2/search_service.proto @@ -27,9 +27,9 @@ service SearchService { // Status: BETA // // Retrieves a public resource by its ID. - rpc GetPublicResource(GetPublicResourceRequest) returns (GetPublicResourceResponse){ + rpc GetResource(GetResourceRequest) returns (GetResourceResponse){ option (google.api.http) = { - get : "/v2/public/{resource_id}" + get : "/v2/resource/{resource_id}" }; } @@ -52,10 +52,11 @@ message SearchResourcesResponse { int64 last_index = 3; } -message GetPublicResourceRequest { +message GetResourceRequest { string resource_id = 1; } -message GetPublicResourceResponse { - storage.models.v2.GenericResource resources = 1; -} \ No newline at end of file +message GetResourceResponse { + storage.models.v2.GenericResource resource = 1; + storage.models.v2.PermissionLevel permisson = 2; +} From 72c8431c55d0bd2ed740e8cab26ff7696e9a751d Mon Sep 17 00:00:00 2001 From: lfbrehm <97600985+lfbrehm@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:47:40 +0200 Subject: [PATCH 7/7] fix: Typo --- aruna/api/storage/services/v2/search_service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aruna/api/storage/services/v2/search_service.proto b/aruna/api/storage/services/v2/search_service.proto index 61e4239b..03f80425 100644 --- a/aruna/api/storage/services/v2/search_service.proto +++ b/aruna/api/storage/services/v2/search_service.proto @@ -58,5 +58,5 @@ message GetResourceRequest { message GetResourceResponse { storage.models.v2.GenericResource resource = 1; - storage.models.v2.PermissionLevel permisson = 2; + storage.models.v2.PermissionLevel permission = 2; }