codemp-proto/proto/auth.proto
zaaarf 966e4c6211
docs: written docs
Co-authored-by: alemi <me@alemi.dev>
2024-09-05 00:08:07 +02:00

30 lines
768 B
Protocol Buffer

syntax = "proto2";
package auth;
import "common.proto";
// Server entrypoint, authenticates users and grants initial session token.
service Auth {
// Send credentials, returns valid session token.
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.
required string username = 1;
// The password to log in with.
required string password = 2;
}
// The login response message.
message LoginResponse {
// The newly created session token.
required common.Token token = 1;
// The user profile that has been authenticated.
required common.User user = 2;
}