Brijesh's Git Server — k3yst0n3 @ ef65151e3c786a8927a822d95a948038bb17bde4

auth/rpc/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
syntax = "proto3";

package auth;
option go_package = "keystone_auth/rpc";

service AuthService {
  rpc Login(Credentials) returns (AuthToken);
  rpc Register(User) returns (AuthToken);
  rpc VerifyToken(AuthToken) returns (VerifyTokenResponse);
}

// user's login credentials.
message Credentials {
  string username = 1;
  string password = 2;
}

// User represents a registered user.
message User {
  string id = 1;
  string username = 2;
  string email = 3;
  string password_hash = 4;
}

// AuthToken represents an access token.
message AuthToken {
  string token = 1;
  int32 expires_in = 2; // seconds
}

// VerifyTokenResponse indicates whether the token is valid.
message VerifyTokenResponse {
  bool valid = 1;
}