refactor all proto files
This commit is contained in:
111
proto/twofa.proto
Normal file
111
proto/twofa.proto
Normal file
@@ -0,0 +1,111 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package twofa.v1;
|
||||
|
||||
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
|
||||
|
||||
service TwoFaService {
|
||||
rpc Verify2Fa (Verify2FaRequest) returns (Verify2FaResponse);
|
||||
rpc GetTwoFaStatus (GetTwoFaStatusRequest) returns (GetTwoFaStatusResponse);
|
||||
rpc StartTotpEnrollment (AuthenticatedAccessRequest) returns (StartTotpEnrollmentResponse);
|
||||
rpc ConfirmTotpErollment (ConfirmTotpEnrollmentRequest) returns (ConfirmTotpEnrollmentResponse);
|
||||
rpc CancelTotpEnrollment (AuthenticatedAccessRequest) returns (CancelTotpEnrollmentResponse);
|
||||
rpc DisableTotp (DisableTotpRequest) returns (DisableTotpResponse);
|
||||
rpc StartTelegramEnrollment (AuthenticatedAccessRequest) returns (StartTelegramEnrollmentResponse);
|
||||
rpc ConfirmTelegramEnrollment (ConfirmTelegramEnrollmentRequest) returns (ConfirmTelegramEnrollmentResponse);
|
||||
rpc DisableTelegram(DisableTelegramRequest) returns (DisableTelegramResponse);
|
||||
}
|
||||
|
||||
message Verify2FaRequest {
|
||||
string temp_token = 1;
|
||||
optional string totp_code = 2;
|
||||
optional string telegram_code = 3;
|
||||
}
|
||||
|
||||
message Verify2FaResponse {
|
||||
string access_token = 1;
|
||||
string refresh_token = 2;
|
||||
string status = 3;
|
||||
string message = 4;
|
||||
repeated string reserve_codes = 5;
|
||||
}
|
||||
|
||||
message AuthenticatedAccessRequest {
|
||||
string access_token = 1;
|
||||
}
|
||||
|
||||
message GetTwoFaStatusRequest {
|
||||
string access_token = 1;
|
||||
}
|
||||
|
||||
message GetTwoFaStatusResponse {
|
||||
bool totp_enabled = 1;
|
||||
bool telegram_enabled = 2;
|
||||
bool totp_enrollment_pending = 3;
|
||||
bool telegram_enrollment_pending = 4;
|
||||
}
|
||||
|
||||
message StartTotpEnrollmentResponse {
|
||||
string secret_base32 = 1;
|
||||
string otpauth_uri = 2;
|
||||
string issuer = 3;
|
||||
string account_label = 4;
|
||||
}
|
||||
|
||||
message ConfirmTotpEnrollmentRequest {
|
||||
string access_token = 1;
|
||||
string totp_code = 2;
|
||||
}
|
||||
|
||||
message ConfirmTotpEnrollmentResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
repeated string reserve_codes = 3;
|
||||
}
|
||||
|
||||
message CancelTotpEnrollmentResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message DisableTotpRequest {
|
||||
string access_token = 1;
|
||||
string password = 2;
|
||||
optional string totp_code = 3;
|
||||
}
|
||||
|
||||
message DisableTotpResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message StartTelegramEnrollmentResponse {
|
||||
string enrollment_token = 1;
|
||||
string deep_link = 2;
|
||||
string bot_username = 3;
|
||||
string expires_at_iso = 4;
|
||||
}
|
||||
|
||||
message ConfirmTelegramEnrollmentRequest {
|
||||
string access_token = 1;
|
||||
string enrollment_token = 2;
|
||||
string otp_code = 3;
|
||||
}
|
||||
|
||||
message ConfirmTelegramEnrollmentResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
repeated string reserve_codes=3;
|
||||
}
|
||||
|
||||
message DisableTelegramRequest {
|
||||
string access_token = 1;
|
||||
string password = 2;
|
||||
optional string telegram_otp_code = 3;
|
||||
}
|
||||
|
||||
message DisableTelegramResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user