Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Needed changes for a minimal Hooks working example #94

Merged
merged 7 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions aruna/api/hooks/services/v2/hooks_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,31 @@ message ExternalHook {
string url = 1;
Credentials credentials = 2;
string json_template = 3;
Method method = 4;
}

enum InternalAction {
INTERNAL_ACTION_UNSPECIFIED = 0;
INTERNAL_ACTION_ADD_LABEL = 1;
INTERNAL_ACTION_ADD_HOOK = 2;
INTERNAL_ACTION_CREATE_RELATION = 3;
enum Method {
METHOD_UNSPECIFIED = 0;
METHOD_PUT = 1;
METHOD_POST = 2;
}

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 {
Expand Down Expand Up @@ -101,8 +111,12 @@ 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;
string pubkey_serial = 7;
}

message HookCallbackResponse{}
Expand All @@ -120,4 +134,4 @@ message HookInfo {

message ListHooksResponse{
repeated HookInfo infos = 1;
}
}
10 changes: 5 additions & 5 deletions aruna/api/storage/models/v2/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ enum DataClass {

// Which kind of endpoint
enum EndpointVariant {
ENDPOINT_VARIANT_UNSPECIFIED = 0;
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;
ENDPOINT_HOST_VARIANT_GRPC= 1;
ENDPOINT_HOST_VARIANT_S3= 2;
}

// Permission Levels
Expand Down Expand Up @@ -325,7 +325,7 @@ message Dataset {
}

message Object {
string id = 1;
string id = 1;
string name = 2;
string description = 3;
// Collection specific labels / hooks
Expand All @@ -341,4 +341,4 @@ message Object {
repeated DataEndpoint endpoints = 12;
// Object specific attributes
repeated Hash hashes = 13;
}
}
13 changes: 7 additions & 6 deletions aruna/api/storage/services/v2/search_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
};
}

Expand All @@ -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;
}
message GetResourceResponse {
storage.models.v2.GenericResource resource = 1;
storage.models.v2.PermissionLevel permission = 2;
}
Loading