Skip to content

Commit

Permalink
fix: MFA
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenSheep402 committed Oct 8, 2023
1 parent 82b369e commit cb20a67
Showing 1 changed file with 8 additions and 60 deletions.
68 changes: 8 additions & 60 deletions proto/auth/v1/auth_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,6 @@ service AuthService {
body: "*"
};
}

// SMS
// 启用SMS
rpc EnableSMS(EnableSMSRequest) returns (EnableSMSResponse) {
option (google.api.http) = {
post: "/gapi/auth/v1/mfa/sms/enable
body: "*"
};
}
// 激活SMS
rpc ActivateSMS(ActivateSMSRequest) returns (ActivateSMSResponse) {
option (google.api.http) = {
post: "/gapi/auth/v1/mfa/sms/activate",
body: "*"
};
}
rpc DisableSMS(DisableSMSRequest) returns (DisableSMSResponse) {
option (google.api.http) = {
post: "/gapi/auth/v1/mfa/sms/disable",
body: "*"
};
}
rpc CheckSMS(CheckSMSRequest) returns (CheckSMSResponse) {
option (google.api.http) = {
post: "/gapi/auth/v1/mfa/sms/check",
body: "*"
};
}
}

message RegisterRequest {
Expand Down Expand Up @@ -120,19 +92,20 @@ message RefreshTokenResponse {

message GetMFAStatusRequest {}

// 为后期拓展可能做保留
message GetMFAStatusResponse {
TOTPStatus totp_status = 1;
SMSStatus sms_status = 2;
// SMSStatus sms_status = 2;
}

message TOTPStatus {
bool is_active = 1;
}

message SMSStatus { // SMS状态
bool is_active = 1;
string phone_number = 2;
}
//message SMSStatus { // SMS状态
// bool is_active = 1;
// string phone_number = 2;
//}

// TOTP
message EnableTOTPRequest {
Expand All @@ -141,7 +114,7 @@ message EnableTOTPRequest {
}
message EnableTOTPResponse {
string qr_code_url = 1;
string manual_entry_key = 2;
string secret_key = 2;
repeated string recovery_code = 3;
}

Expand All @@ -153,29 +126,4 @@ message DisableTOTPResponse {}
message CheckTOTPRequest {
string totp_code = 1;
}
message CheckTOTPResponse {}

// SMS
message EnableSMSRequest {
string email = 1;
string verify_code = 2;
string phone = 3;
}
message EnableSMSResponse {}

message ActivateSMSRequest {
string phone = 1;
string sms_code = 2;
}
message ActivateSMSResponse {}

message DisableSMSRequest {
string phone = 1;
string sms_code = 2;
}
message DisableSMSResponse {}

message CheckSMSRequest {
string sms_code = 1;
}
message CheckSMSResponse {}
message CheckTOTPResponse {}

0 comments on commit cb20a67

Please sign in to comment.