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

[2.0.0 beta.6] Licenses & Visibility annotations #99

Merged
merged 10 commits into from
Oct 20, 2023
593 changes: 310 additions & 283 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
[package]
authors = ["Sebastian Beyvers <sebastian.beyvers@computational.bio.uni-giessen.de>"]
description = "Tests building the Rust grpc stubs for ArunaAPI"
edition = "2018"
edition = "2021"
name = "aruna_api_buildtests"
version = "2.0.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
name = "aruna_api_buildtests"
path = "./tests/build.rs"

[dependencies]
bytes = "1.4.0"
tonic = "0.9.0"
prost = "0.11.0"
tonic-build = "0.9.0"
uuid = "1.4.0"
bytes = "1.5.0"
tonic = "0.10.2"
prost = "0.12.1"
tonic-build = "0.10.2"
uuid = "1.5.0"
2 changes: 2 additions & 0 deletions aruna/api/dataproxy/services/v2/bundler_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ option java_package = "com.github.ArunaStorage.java_api.aruna.api.dataproxy.serv
option java_outer_classname = "BundlerService";

import "google/protobuf/timestamp.proto";
import "google/api/visibility.proto";
import "google/api/annotations.proto";


service BundlerService {
option (google.api.api_visibility).restriction = "PROXY";
rpc CreateBundle(CreateBundleRequest) returns (CreateBundleResponse) {
option (google.api.http) = {
post : "/v2/bundle"
Expand Down
5 changes: 4 additions & 1 deletion aruna/api/dataproxy/services/v2/dataproxy_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ option java_package = "com.github.ArunaStorage.java_api.aruna.api.dataproxy.serv
option java_outer_classname = "DataProxyService";

import "google/api/annotations.proto";

import "google/api/visibility.proto";


service DataproxyService {
option (google.api.api_visibility).restriction = "PROXY";

// RequestReplication
//
Expand All @@ -29,6 +30,7 @@ service DataproxyService {


service DataproxyBackendService {
option (google.api.api_visibility).restriction = "PROXY";
rpc PutObject(stream PutObjectRequest) returns (PutObjectResponse) {}
rpc GetObject(GetObjectRequest) returns (stream GetObjectResponse) {}
rpc HeadObject(HeadObjectRequest) returns (HeadObjectResponse) {}
Expand All @@ -42,6 +44,7 @@ service DataproxyBackendService {
}

service DataproxyUserService {
option (google.api.api_visibility).restriction = "PROXY";
// GetCredentials
//
// Status: BETA
Expand Down
3 changes: 3 additions & 0 deletions aruna/api/hooks/services/v2/hooks_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option java_package = "com.github.ArunaStorage.java_api.aruna.api.storage.servic
option java_outer_classname = "HooksService";
import "google/api/annotations.proto";
import "aruna/api/storage/models/v2/models.proto";
import "google/api/visibility.proto";


// HooksService
Expand All @@ -15,6 +16,8 @@ import "aruna/api/storage/models/v2/models.proto";
//
// A service that enables automatic Hook scheduling
service HooksService {
option (google.api.api_visibility).restriction = "SERVER";

// Created Hooks are always associated with the owner that creates the hook
rpc CreateHook(CreateHookRequest) returns (CreateHookResponse) {
option (google.api.http) = {
Expand Down
35 changes: 30 additions & 5 deletions aruna/api/notification/services/v2/notification_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,74 @@ option java_package = "com.github.ArunaStorage.java_api.aruna.api.notification.s
option java_outer_classname = "UpdateNotificationServices";

import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
import "aruna/api/storage/models/v2/models.proto";
import "google/api/visibility.proto";



// EventNotificationService
//
// A service to receive events in the AOS storage
service EventNotificationService {
option (google.api.api_visibility).restriction = "SERVER";

// CreateStreamConsumer
//
// Creates a new event stream consumer.
rpc CreateStreamConsumer(CreateStreamConsumerRequest)
returns (CreateStreamConsumerResponse) {}
returns (CreateStreamConsumerResponse) {
option (google.api.http) = {
post : "/v2/notifications"
St4NNi marked this conversation as resolved.
Show resolved Hide resolved
body : "*"
};
}

// GetEventMessageBatch
//
// Reads a set of messages from a given stream group
// Each message contains a separate acknowledgement message thatis protected by a salt and an hmac for verification.
// The message can be send directly through the AcknowledgeMessageBatch call to acknowledge the message.
rpc GetEventMessageBatch(GetEventMessageBatchRequest)
returns (GetEventMessageBatchResponse) {}
returns (GetEventMessageBatchResponse) {
option (google.api.http) = {
get : "/v2/notifications/{stream_consumer}/batch"
};
}

// GetEventMessageBatch
//
// Opens a stream which pushes each received notification individual and just-in-time.
// Each message contains a separate acknowledgement message that is protected by a salt and an hmac for verification.
// The message can be send directly through the AcknowledgeMessageBatch call to acknowledge the message.
rpc GetEventMessageStream(GetEventMessageStreamRequest)
returns (stream GetEventMessageStreamResponse) {}
returns (stream GetEventMessageStreamResponse) {
option (google.api.http) = {
get : "/v2/notifications/{stream_consumer}/stream"
};
}

// AcknowledgeMessageBatch
//
// List of messages to acknowledge
// Each reply is protected by a salt and and hmac that verifies the message
rpc AcknowledgeMessageBatch(AcknowledgeMessageBatchRequest)
returns (AcknowledgeMessageBatchResponse) {}
returns (AcknowledgeMessageBatchResponse) {
option (google.api.http) = {
patch : "/v2/notifications/{stream_consumer}/ack"
body: "*"
};
}

// DeleteEventStreamingGroup
//
// Deletes an existing event stream consumer by ID.
rpc DeleteStreamConsumer(DeleteStreamConsumerRequest)
returns (DeleteStreamConsumerResponse) {}
returns (DeleteStreamConsumerResponse) {
option (google.api.http) = {
delete : "/v2/notifications/{stream_consumer}"
};
}
}


Expand Down
15 changes: 15 additions & 0 deletions aruna/api/storage/models/v2/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@ message Context {
}
}

message License {
string tag = 1; // CC-BY-SA-4.0
string name = 2; // Creative Commons Attribution-ShareAlike 4.0 International
string text = 3;
// url is optional
string url = 4; // https://creativecommons.org/licenses/by-sa/4.0/
}

// ------ Resources ----------

Expand Down Expand Up @@ -288,6 +295,8 @@ message Project {
Status status = 10;
bool dynamic = 11;
repeated DataEndpoint endpoints = 12;
string metadata_license_tag = 13;
string default_data_license_tag = 14;
}


Expand All @@ -306,6 +315,8 @@ message Collection {
Status status = 10;
bool dynamic = 11;
repeated DataEndpoint endpoints = 12;
string metadata_license_tag = 13;
string default_data_license_tag = 14;
}

message Dataset {
Expand All @@ -323,6 +334,8 @@ message Dataset {
Status status = 10;
bool dynamic = 11;
repeated DataEndpoint endpoints = 12;
string metadata_license_tag = 13;
string default_data_license_tag = 14;
}

message Object {
Expand All @@ -342,4 +355,6 @@ message Object {
repeated DataEndpoint endpoints = 12;
// Object specific attributes
repeated Hash hashes = 13;
string metadata_license_tag = 14;
string default_data_license_tag = 15;
St4NNi marked this conversation as resolved.
Show resolved Hide resolved
}
30 changes: 28 additions & 2 deletions aruna/api/storage/services/v2/collection_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ option java_package = "com.github.ArunaStorage.java_api.aruna.api.storage.servic
option java_outer_classname = "CollectionService";
import "aruna/api/storage/models/v2/models.proto";
import "google/api/annotations.proto";
import "google/api/visibility.proto";

// CollectionService
//
// Contains all methods that get/create or update Collection and associated resources
service CollectionService {
option (google.api.api_visibility).restriction = "SERVER";

// CreateNewCollection
//
Expand Down Expand Up @@ -120,6 +122,18 @@ service CollectionService {
body : "*"
};
}

// UpdateLicenses
//
// Status: BETA
//
// Updates the collections metadata license and/or default data license.
rpc UpdateCollectionLicenses(UpdateCollectionLicensesRequest) returns (UpdateCollectionLicensesResponse) {
option (google.api.http) = {
patch : "/v2/collection/{collection_id}/licenses"
body : "*"
};
}
}

message CreateCollectionRequest {
Expand All @@ -130,13 +144,15 @@ message CreateCollectionRequest {
// collection specific labels / hooks
repeated storage.models.v2.KeyValue key_values = 3;
// External relations (URLs / IDs from external sources)
St4NNi marked this conversation as resolved.
Show resolved Hide resolved
repeated storage.models.v2.ExternalRelation external_relations = 4;
repeated storage.models.v2.Relation relations = 4;
// DataClass
storage.models.v2.DataClass data_class = 5;
// Parent_id MUST be collection
// Parent_id MUST be project
oneof parent {
string project_id = 6;
}
string metadata_license_tag = 7;
string default_data_license_tag = 8;
}

message CreateCollectionResponse {
Expand Down Expand Up @@ -213,4 +229,14 @@ message SnapshotCollectionRequest {
message SnapshotCollectionResponse {
// This collection will be returned via an Persistent Identifier! Updates will be impossible
storage.models.v2.Collection collection = 1;
}

message UpdateCollectionLicensesRequest {
string collection_id = 1;
string metadata_license_tag = 2;
string default_data_license_tag = 3;
}

message UpdateCollectionLicensesResponse {
storage.models.v2.Collection collection = 1;
}
30 changes: 28 additions & 2 deletions aruna/api/storage/services/v2/dataset_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ option java_package = "com.github.ArunaStorage.java_api.aruna.api.storage.servic
option java_outer_classname = "DatasetService";
import "aruna/api/storage/models/v2/models.proto";
import "google/api/annotations.proto";
import "google/api/visibility.proto";

// DatasetService
//
// Contains all methods that get/create or update Dataset and associated resources
service DatasetService {
option (google.api.api_visibility).restriction = "SERVER";

// CreateNewDataset
//
Expand Down Expand Up @@ -120,6 +122,18 @@ service DatasetService {
body : "*"
};
}

// UpdateLicenses
//
// Status: BETA
//
// Updates the dataset metadata license and/or default data license.
rpc UpdateDatasetLicenses(UpdateDatasetLicensesRequest) returns (UpdateDatasetLicensesResponse) {
option (google.api.http) = {
patch : "/v2/dataset/{dataset_id}/licenses"
body : "*"
};
}
}

message CreateDatasetRequest {
Expand All @@ -129,15 +143,17 @@ message CreateDatasetRequest {
string description = 2;
// dataset specific labels / hooks
repeated storage.models.v2.KeyValue key_values = 3;
// External relations (URLs / IDs from external sources)
repeated storage.models.v2.ExternalRelation external_relations = 4;
// External / Internal relations (URLs / IDs from external sources)
St4NNi marked this conversation as resolved.
Show resolved Hide resolved
repeated storage.models.v2.Relation relations = 4;
// DataClass
storage.models.v2.DataClass data_class = 5;
// Parent_id MUST be dataset
oneof parent {
string project_id = 6;
string collection_id = 7;
}
string metadata_license_tag = 8;
string default_data_license_tag = 9;
}

message CreateDatasetResponse {
Expand Down Expand Up @@ -214,4 +230,14 @@ message SnapshotDatasetRequest {
message SnapshotDatasetResponse {
// This dataset will be returned via an Persistent Identifier! Updates will be impossible
storage.models.v2.Dataset dataset = 1;
}

message UpdateDatasetLicensesRequest {
string dataset_id = 1;
string metadata_license_tag = 2;
string default_data_license_tag = 3;
}

message UpdateDatasetLicensesResponse {
storage.models.v2.Dataset dataset = 1;
}
Loading