codemp-proto/proto/auth.proto

31 lines
768 B
Protocol Buffer
Raw Normal View History

syntax = "proto2";
package auth;
import "common.proto";
// Server entrypoint, authenticates users and grants initial session token.
service Auth {
// Send credentials, returns valid session token.
2024-08-22 01:01:25 +02:00
rpc Login (LoginRequest) returns (LoginResponse);
// If the given token has recently expired, get a new valid one.
rpc Refresh (common.Token) returns (common.Token);
}
// The login request message.
message LoginRequest {
// The username to log in with.
2024-03-09 19:07:23 +01:00
required string username = 1;
// The password to log in with.
2024-03-09 19:07:23 +01:00
required string password = 2;
}
2024-08-22 01:01:25 +02:00
// The login response message.
2024-08-22 01:01:25 +02:00
message LoginResponse {
// The newly created session token.
2024-08-22 01:01:25 +02:00
required common.Token token = 1;
// The user profile that has been authenticated.
2024-08-22 01:01:25 +02:00
required common.User user = 2;
}