diff --git a/build.rs b/build.rs index b9f9a1c..c035671 100644 --- a/build.rs +++ b/build.rs @@ -1,7 +1,7 @@ fn main() -> Result<(), Box> { tonic_build::configure() // .build_client(cfg!(feature = "client")) - //.build_server(cfg!(feature = "server")) // FIXME if false, build fails???? + // .build_server(cfg!(feature = "server")) // FIXME if false, build fails???? // .build_transport(cfg!(feature = "transport")) .compile( &[ @@ -11,9 +11,10 @@ fn main() -> Result<(), Box> { "proto/workspace.proto", "proto/buffer_service.proto", "proto/cursor_service.proto", - "proto/workspace_service.proto" + "proto/workspace_service.proto", + "proto/auth_service.proto", ], - &["proto"] + &["proto"], )?; Ok(()) - } \ No newline at end of file + } diff --git a/proto/auth_service.proto b/proto/auth_service.proto new file mode 100644 index 0000000..4d5ef47 --- /dev/null +++ b/proto/auth_service.proto @@ -0,0 +1,19 @@ +syntax = "proto2"; + +package auth_service; + +// authenticates users, issuing tokens +service Auth { + // send credentials and join a workspace + rpc Login (WorkspaceJoinRequest) returns (Token); +} + +message Token { + required string token = 1; +} + +message WorkspaceJoinRequest { + required string workspace_id = 1; + required string username = 2; + required string password = 3; +} diff --git a/src/lib.rs b/src/lib.rs index c305f03..bcceca7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -173,7 +173,8 @@ pub mod proto { pub mod buffer_service { tonic::include_proto!("buffer_service"); } pub mod cursor_service { tonic::include_proto!("cursor_service"); } pub mod workspace_service { tonic::include_proto!("workspace_service"); } + pub mod auth_service { tonic::include_proto!("auth_service"); } } pub use errors::Error; -pub use errors::Result; \ No newline at end of file +pub use errors::Result;