blob: 5271d15c941ca90b475ecf0b976de18d4db32d4a (
plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
syntax = "proto3";
package auth;
import "google/protobuf/timestamp.proto";
// A message representing a user
message User {
// Unique identifier for the user
string id = 1;
// Email address of the user
string email = 2;
// Timestamp for when the user was created
google.protobuf.Timestamp created_at = 3;
// Timestamp for when the user was last updated
google.protobuf.Timestamp updated_at = 4;
// Private key
string private_key = 5;
}
message Account {
// Unique identifier for the user
string provider_id = 1;
// Email address of the user
string provider_user_id = 2;
// Email address of the user
string user_id = 3;
}
// Define a message for sending a token to be validated
message ValidationRequest {
// The token to validate
string token = 1;
}
// Define a message for the result of a token validation
message ValidationResponse {
// Indicates whether the token is valid
bool valid = 1;
}
// Define a message for the result of a token validation
message GetPrivateKeyRequest {
// Indicates whether the token is valid
string email = 1;
}
// Define a message for the result of a token validation
message GetPrivateKeyResponse {
// Indicates whether the token is valid
string private_key = 1;
}
// Define a message for the result of a token validation
message RegisterUserResponse {
// Indicates whether the token is valid
string profile_id = 1;
// Indicates whether the token is valid
string auth_id = 2;
}
// Define a message for the result of a token validation
message RegisterUserRequest {
// Indicates whether the token is valid
string email = 1;
message AccountDetails {
// Unique identifier for the user
string provider_id = 1;
// Email address of the user
string provider_user_id = 2;
}
optional AccountDetails account = 2;
}
// Define the AuthServer gRPC service
service Auth {
// Validate a token
rpc ValidateAuthToken (ValidationRequest) returns (ValidationResponse);
// Register User
rpc RegisterUser (RegisterUserRequest) returns (RegisterUserResponse);
// Register User
rpc GetPrivateKey (GetPrivateKeyRequest) returns (GetPrivateKeyResponse);
}
|