Brijesh's Git Server — argus-core @ 7fe70b23373de45a57bafd87ca06a5688da4c3f6

Logging service

rpc/auth/service.proto (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
syntax = "proto3";

package auth;
option go_package = "argus-core/rpc/auth";

// Authentication service handles user registration, login, and token validation.
service AuthService {
  // Register creates a new user account
  rpc Register(RegisterRequest) returns (RegisterResponse);

  // Login authenticates a user and returns a JWT token
  rpc Login(LoginRequest) returns (LoginResponse);

  // ValidateToken checks if a JWT token is valid and returns user information
  rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
}

// Request and Response messages
message RegisterRequest {
  string email = 1;
  string password = 2;
}

message RegisterResponse {
  User user = 1;
}

message LoginRequest {
  string email = 1;
  string password = 2;
}

message LoginResponse {
  string token = 1;
  User user = 2;
}

message ValidateTokenRequest {
  string token = 1;
}

message ValidateTokenResponse {
  User user = 1;
}

// Common messages
message User {
  string id = 1;
  string email = 2;
  string created_at = 3;
  string updated_at = 4;
}