diff --git a/Cargo.lock b/Cargo.lock index 1c1f626..9424323 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -571,20 +571,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" -[[package]] -name = "permission" -version = "0.1.0" -dependencies = [ - "dotenvy", - "log", - "pretty_env_logger", - "prost", - "serde", - "tokio", - "tonic", - "tonic-build", -] - [[package]] name = "petgraph" version = "0.6.3" @@ -988,6 +974,20 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "themis" +version = "0.1.0" +dependencies = [ + "dotenvy", + "log", + "pretty_env_logger", + "prost", + "serde", + "tokio", + "tonic", + "tonic-build", +] + [[package]] name = "tokio" version = "1.27.0" diff --git a/build.rs b/build.rs index 6672921..f7de9b7 100644 --- a/build.rs +++ b/build.rs @@ -1,6 +1,6 @@ fn main() { tonic_build::configure() .build_server(true) - .compile(&["proto/graph.proto"], &["proto"]) + .compile(&["proto/themis.proto"], &["proto"]) .unwrap(); } diff --git a/proto/graph_permissions.proto b/proto/graph_permissions.proto deleted file mode 100644 index 652bcb4..0000000 --- a/proto/graph_permissions.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package eu.zettoit.graph; - -message Object{ - string namespace = 1; - string id = 2; -} -message ObjectSet{ - Object object = 1; - string relation = 2; -} - - -message Relation{ - oneof src{ - Object object = 1; - ObjectSet object_set = 2; - } - ObjectSet dst = 3; -} diff --git a/proto/graph.proto b/proto/themis.proto similarity index 98% rename from proto/graph.proto rename to proto/themis.proto index 4981f83..2f16b25 100644 --- a/proto/graph.proto +++ b/proto/themis.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package eu.zettoit.graph; +package eu.zettoit.themis; service ObjectService{ rpc Create(Object) returns (Empty); diff --git a/src/graph_permissions.rs b/src/graph_permissions.rs deleted file mode 100644 index 4af7974..0000000 --- a/src/graph_permissions.rs +++ /dev/null @@ -1 +0,0 @@ -tonic::include_proto!("eu.zettoit.graph"); diff --git a/src/grpc_service.rs b/src/grpc_service.rs index 4c26440..0d8856a 100644 --- a/src/grpc_service.rs +++ b/src/grpc_service.rs @@ -6,7 +6,7 @@ use tokio::sync::Mutex; use tonic::{Request, Response, Status}; use crate::graph::{self, Graph, ObjectRelation}; -use crate::graph_permissions::{ +use crate::themis_proto::{ object_service_server::ObjectService, query_service_server::QueryService, relation::Src, relation_service_server::RelationService, Empty, ExistsResponse, GetRelatedToResponse, GetRelationsRequest, GetRelationsResponse, IsRelatedToResponse, Object, Relation, Set, diff --git a/src/main.rs b/src/main.rs index 19f9131..b444145 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,10 +10,10 @@ use tokio::{ use tonic::transport::Server; pub mod graph; -pub mod graph_permissions; pub mod grpc_service; +pub mod themis_proto; -use crate::graph_permissions::{ +use crate::themis_proto::{ object_service_server::ObjectServiceServer, query_service_server::QueryServiceServer, relation_service_server::RelationServiceServer, }; diff --git a/src/themis_proto.rs b/src/themis_proto.rs new file mode 100644 index 0000000..57cdbe0 --- /dev/null +++ b/src/themis_proto.rs @@ -0,0 +1 @@ +tonic::include_proto!("eu.zettoit.themis");