init auth-service

This commit is contained in:
2023-09-27 16:01:41 +01:00
parent 7192f11059
commit 0ae3ee3af4
40 changed files with 2616 additions and 2 deletions

View File

33
protobufs/auth.proto Normal file
View File

@@ -0,0 +1,33 @@
syntax = "proto3";
package panels.auth.v1;
import "google/protobuf/empty.proto";
service AuthService {
rpc AuthWithPassword(PasswordAuthRequest) returns (AuthToken) {}
rpc SetPasswordAuth(SetPasswordAuthMethod) returns (google.protobuf.Empty) {}
rpc DeletePasswordAuth(DeletePasswordAuthMethod) returns (google.protobuf.Empty) {}
}
message SetPasswordAuthMethod {
string user_id = 1; // External Ref: User Id
string password = 2;
}
message DeletePasswordAuthMethod {
string user_id = 1; // External Ref: User Id
}
message PasswordAuthRequest {
string user_id = 1; // External Ref: User Id
string password = 2;
}
message AuthToken {
string token_type = 1;
string access_token = 2;
string refresh_token = 3;
int64 expires_in = 4;
}

64
protobufs/comment.proto Normal file
View File

@@ -0,0 +1,64 @@
syntax = "proto3";
package panels.comment.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
service CommentService {
rpc CreateComment(CreateCommentRequest) returns (Comment) {}
rpc UpdateComment(UpdateCommentRequest) returns (Comment) {}
rpc DeleteComment(DeleteCommentRequest) returns (google.protobuf.Empty) {}
rpc GetComment(GetCommentRequest) returns (Comment) {}
rpc GetPostComments(GetPostCommentsRequest) returns (PostComments) {}
}
message Comment {
string id = 1;
string post_id = 2; // External Ref: Post Id
string author_id = 3; // External Ref: User Id
string message = 4;
google.protobuf.Timestamp created_at = 5;
google.protobuf.Timestamp updated_at = 6;
}
message CommentMutable {
string message = 1;
}
message CreateCommentRequest {
string post_id = 1; // External Ref: Post Id
string author_id = 2; // External Ref: User Id
CommentMutable data = 3;
}
message UpdateCommentRequest {
string id = 1;
CommentMutable data = 2;
}
message DeleteCommentRequest {
string id = 1;
}
message GetCommentRequest {
string id = 1;
}
message GetPostCommentsRequest {
string post_id = 1;
}
message PostComments {
repeated Comment comments = 1;
}
// Kafka Event Schema
message CommentEvent {
string type = 1;
Comment data = 2;
}

69
protobufs/panel.proto Normal file
View File

@@ -0,0 +1,69 @@
syntax = "proto3";
package panels.panel.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
service PanelService {
rpc CreatePanel(CreatePanelRequest) returns (Panel) {}
rpc GetPanel(GetPanelByIdRequest) returns (Panel) {}
rpc GetPanelByName(GetPanelByNameRequest) returns (Panel) {}
rpc UpdatePanel(UpdatePanelByIdRequest) returns (Panel) {}
rpc UpdatePanelByName(UpdatePanelByNameRequest) returns (Panel) {}
rpc DeletePanel(DeletePanelByIdRequest) returns (google.protobuf.Empty) {}
rpc DeletePanelByName(DeletePanelByNameRequest) returns (google.protobuf.Empty) {}
}
message Panel {
string id = 1;
string name = 2;
string description = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
}
message PanelMutable {
optional string name = 1;
optional string description = 2;
}
message CreatePanelRequest {
PanelMutable data = 1;
}
message GetPanelByIdRequest {
string id = 1;
}
message GetPanelByNameRequest {
string name = 1;
}
message UpdatePanelByIdRequest {
string id = 1;
PanelMutable data = 2;
}
message UpdatePanelByNameRequest {
string name = 1;
PanelMutable data = 2;
}
message DeletePanelByIdRequest {
string id = 1;
}
message DeletePanelByNameRequest {
string name = 1;
}
// Kafka Event Schema
message PanelEvent {
string type = 1;
Panel data = 2;
}

93
protobufs/post.proto Normal file
View File

@@ -0,0 +1,93 @@
syntax = "proto3";
package panels.post.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
service PostService {
rpc CreatePost(CreatePostRequest) returns (Post) {}
rpc GetPost(GetPostRequest) returns (Post) {}
rpc GetPanelPost(GetPanelPostRequest) returns (Post) {}
rpc UpdatePost(UpdatePostRequest) returns (Post) {}
rpc DeletePost(DeletePostRequest) returns (google.protobuf.Empty) {}
rpc GetFeedPosts(GetFeedPostsRequest) returns (FeedPosts) {}
rpc GetUserPosts(GetUserPostsRequest) returns (UserPosts) {}
rpc GetPanelPosts(GetPanelPostsRequest) returns (PanelPosts) {}
}
message Post {
string id = 1;
string panel_id = 2; // External Ref: Panel Id
string author_id = 3; // External Ref: User Id
string title = 4;
string content = 5;
google.protobuf.Timestamp created_at = 6;
google.protobuf.Timestamp updated_at = 7;
}
message PostMutable {
optional string title = 1;
optional string content = 2;
}
message CreatePostRequest {
string panel_id = 1; // External Ref: Panel Id
string user_id = 2; // External Ref: User Id
PostMutable data = 3;
}
message GetPostRequest {
string id = 1;
}
message GetPanelPostRequest {
string panel_id = 1; // External Ref: Panel Id
string id = 2;
}
message UpdatePostRequest {
string id = 1;
PostMutable data = 2;
}
message DeletePostRequest {
string id = 1;
}
message GetFeedPostsRequest {
}
message FeedPosts {
repeated Post posts = 1;
}
message GetUserPostsRequest {
string user_id = 1; // External Ref: User Id
}
message UserPosts {
repeated Post posts = 1;
}
message GetPanelPostsRequest {
string panel_id = 1; // External Ref: Panel Id
}
message PanelPosts {
repeated Post posts = 1;
}
// Kafka Event Schema
message PostEvent {
string type = 1;
Post data = 2;
}

68
protobufs/user.proto Normal file
View File

@@ -0,0 +1,68 @@
syntax = "proto3";
package panels.user.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
service UserService {
rpc CreateUser(CreateUserRequest) returns (User) {}
rpc GetUser(GetUserByIdRequest) returns (User) {}
rpc GetUserByName(GetUserByNameRequest) returns (User) {}
rpc UpdateUser(UpdateUserByIdRequest) returns (User) {}
rpc UpdateUserByName(UpdateUserByNameRequest) returns (User) {}
rpc DeleteUser(DeleteUserByIdRequest) returns (google.protobuf.Empty) {}
rpc DeleteUserByName(DeleteUserByNameRequest) returns (google.protobuf.Empty) {}
}
message User {
string id = 1;
string username = 2;
bool is_admin = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
}
message UserMutable {
optional string username = 1;
}
message CreateUserRequest {
UserMutable data = 1;
}
message GetUserByIdRequest {
string id = 1;
}
message GetUserByNameRequest {
string username = 1;
}
message UpdateUserByIdRequest {
string id = 1;
UserMutable data = 2;
}
message UpdateUserByNameRequest {
string username = 1;
UserMutable data = 2;
}
message DeleteUserByIdRequest {
string id = 1;
}
message DeleteUserByNameRequest {
string username = 1;
}
// Kafka Event Schema
message UserEvent {
string type = 1;
User data = 2;
}