Skip to content

Commit

Permalink
fix(protos): add backup and reset for totp
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Jan 10, 2025
1 parent 8e8e59f commit 5a680c9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/protos/io/restorecommerce/template.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ enum TemplateUseCase {
INVOICE_EMAIL_SUBJECT = 3;
INVITATION_EMAIL_BODY = 4;
INVITATION_EMAIL_SUBJECT = 5;
REGISTRATION_EMAIL_BODY = 5;
REGISTRATION_EMAIL_SUBJECT = 6;
CHANGE_PASSWORD_EMAIL_BODY = 7;
CHANGE_PASSWORD_EMAIL_SUBJECT = 8;
REGISTRATION_EMAIL_BODY = 6;
REGISTRATION_EMAIL_SUBJECT = 7;
CHANGE_PASSWORD_EMAIL_BODY = 8;
CHANGE_PASSWORD_EMAIL_SUBJECT = 9;
}

message Deleted {
Expand Down
18 changes: 18 additions & 0 deletions packages/protos/io/restorecommerce/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ service UserService {
rpc SetupTOTP (SetupTOTPRequest) returns (SetupTOTPResponse);
rpc CompleteTOTPSetup (CompleteTOTPSetupRequest) returns (io.restorecommerce.status.OperationStatusObj);
rpc ExchangeTOTP (ExchangeTOTPRequest) returns (UserResponse);
rpc CreateBackupTOTPCodes (CreateBackupTOTPCodesRequest) returns (CreateBackupTOTPCodesResponse);
rpc ResetTOTP (ResetTOTPRequest) returns (io.restorecommerce.status.OperationStatusObj);
rpc GetUnauthenticatedSubjectTokenForTenant(TenantRequest) returns (TenantResponse);
}

Expand Down Expand Up @@ -94,6 +96,21 @@ message ExchangeTOTPRequest {
optional string totp_session_token = 3;
}

message CreateBackupTOTPCodesRequest {
optional string identifier = 1;
optional io.restorecommerce.auth.Subject subject = 2;
}

message CreateBackupTOTPCodesResponse {
repeated string backup_codes = 1;
optional io.restorecommerce.status.OperationStatus operation_status = 2;
}

message ResetTOTPRequest {
optional string identifier = 1;
optional io.restorecommerce.auth.Subject subject = 2;
}

message TenantRequest {
optional string domain = 1;
}
Expand Down Expand Up @@ -350,6 +367,7 @@ message User {
optional string totp_secret_processing = 28; /// TOTP Secret before being confirmed
repeated string totp_session_tokens = 29; /// TOTP Login session tokens
repeated string password_hash_history = 30; // List of historical password hashes
repeated string totp_recovery_codes = 31; // List of TOTP recovery codes
}

/**
Expand Down

0 comments on commit 5a680c9

Please sign in to comment.