renamed proto file

This commit is contained in:
Paul Zinselmeyer 2023-04-28 22:48:48 +02:00
parent 0e6eb1668c
commit 47ab190761
Signed by: pfzetto
GPG key ID: 4EEF46A5B276E648
8 changed files with 20 additions and 40 deletions

28
Cargo.lock generated
View file

@ -571,20 +571,6 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "permission"
version = "0.1.0"
dependencies = [
"dotenvy",
"log",
"pretty_env_logger",
"prost",
"serde",
"tokio",
"tonic",
"tonic-build",
]
[[package]] [[package]]
name = "petgraph" name = "petgraph"
version = "0.6.3" version = "0.6.3"
@ -988,6 +974,20 @@ dependencies = [
"winapi-util", "winapi-util",
] ]
[[package]]
name = "themis"
version = "0.1.0"
dependencies = [
"dotenvy",
"log",
"pretty_env_logger",
"prost",
"serde",
"tokio",
"tonic",
"tonic-build",
]
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.27.0" version = "1.27.0"

View file

@ -1,6 +1,6 @@
fn main() { fn main() {
tonic_build::configure() tonic_build::configure()
.build_server(true) .build_server(true)
.compile(&["proto/graph.proto"], &["proto"]) .compile(&["proto/themis.proto"], &["proto"])
.unwrap(); .unwrap();
} }

View file

@ -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;
}

View file

@ -1,5 +1,5 @@
syntax = "proto3"; syntax = "proto3";
package eu.zettoit.graph; package eu.zettoit.themis;
service ObjectService{ service ObjectService{
rpc Create(Object) returns (Empty); rpc Create(Object) returns (Empty);

View file

@ -1 +0,0 @@
tonic::include_proto!("eu.zettoit.graph");

View file

@ -6,7 +6,7 @@ use tokio::sync::Mutex;
use tonic::{Request, Response, Status}; use tonic::{Request, Response, Status};
use crate::graph::{self, Graph, ObjectRelation}; use crate::graph::{self, Graph, ObjectRelation};
use crate::graph_permissions::{ use crate::themis_proto::{
object_service_server::ObjectService, query_service_server::QueryService, relation::Src, object_service_server::ObjectService, query_service_server::QueryService, relation::Src,
relation_service_server::RelationService, Empty, ExistsResponse, GetRelatedToResponse, relation_service_server::RelationService, Empty, ExistsResponse, GetRelatedToResponse,
GetRelationsRequest, GetRelationsResponse, IsRelatedToResponse, Object, Relation, Set, GetRelationsRequest, GetRelationsResponse, IsRelatedToResponse, Object, Relation, Set,

View file

@ -10,10 +10,10 @@ use tokio::{
use tonic::transport::Server; use tonic::transport::Server;
pub mod graph; pub mod graph;
pub mod graph_permissions;
pub mod grpc_service; pub mod grpc_service;
pub mod themis_proto;
use crate::graph_permissions::{ use crate::themis_proto::{
object_service_server::ObjectServiceServer, query_service_server::QueryServiceServer, object_service_server::ObjectServiceServer, query_service_server::QueryServiceServer,
relation_service_server::RelationServiceServer, relation_service_server::RelationServiceServer,
}; };

1
src/themis_proto.rs Normal file
View file

@ -0,0 +1 @@
tonic::include_proto!("eu.zettoit.themis");