Changeset View
Changeset View
Standalone View
Standalone View
native/cpp/CommonCpp/grpc/protos/backup.proto
syntax = "proto3"; | syntax = "proto3"; | ||||
package backup; | package backup; | ||||
import "google/protobuf/empty.proto"; | import "google/protobuf/empty.proto"; | ||||
service BackupService { | service BackupService { | ||||
rpc ResetKey(stream ResetKeyRequest) returns (google.protobuf.Empty) {} | rpc CreateNewBackup(stream CreateNewBackupRequest) returns (stream CreateNewBackupResponse) {} | ||||
rpc SendLog(SendLogRequest) returns (google.protobuf.Empty) {} | rpc SendLog(stream SendLogRequest) returns (google.protobuf.Empty) {} | ||||
rpc PullBackupKey(PullBackupKeyRequest) returns (PullBackupKeyResponse) {} | rpc RecoverBackupKey(stream RecoverBackupKeyRequest) returns (stream RecoverBackupKeyResponse) {} | ||||
rpc PullCompaction(PullCompactionRequest) returns (stream PullCompactionResponse) {} | rpc PullBackup(stream PullBackupRequest) returns (stream PullBackupResponse) {} | ||||
} | } | ||||
// ResetKey | // Helper types | ||||
message ResetKeyRequest { | message PakeRegistrationRequestAndUserID { | ||||
string userId = 1; | string userID = 1; | ||||
bytes pakeRegistrationRequest = 2; | |||||
} | |||||
message PakeAuthenticationRequestData { | |||||
oneof data { | |||||
PakeRegistrationRequestAndUserID pakeRegistrationRequestAndUserID = 1; | |||||
bytes pakeRegistrationUpload = 2; | |||||
bytes pakeCredentialRequest = 3; | |||||
bytes pakeCredentialFinalization = 4; | |||||
bytes pakeClientMAC = 5; | |||||
} | |||||
} | |||||
message WalletAuthenticationRequestData { | |||||
string userID = 1; | |||||
string walletAddress = 2; | |||||
bytes signedMessage = 3; | |||||
} | |||||
message FullAuthenticationRequestData { | |||||
oneof data { | |||||
PakeAuthenticationRequestData pakeAuthenticationRequestData = 1; | |||||
WalletAuthenticationRequestData walletAuthenticationRequestData = 2; | |||||
} | |||||
} | |||||
message WalletAuthenticationResponseData { | |||||
bool success = 1; | |||||
} | |||||
message PakeAuthenticationResponseData { | |||||
oneof data { | |||||
bytes pakeRegistrationResponse = 1; | |||||
bool pakeRegistrationSuccess = 2; | |||||
bytes pakeCredentialResponse = 3; | |||||
bytes pakeServerMAC = 4; | |||||
} | |||||
} | |||||
message FullAuthenticationResponseData { | |||||
oneof data { | oneof data { | ||||
bytes newKey = 2; | PakeAuthenticationResponseData pakeAuthenticationResponseData = 1; | ||||
bytes compactionChunk = 3; | WalletAuthenticationResponseData walletAuthenticationResponseData = 2; | ||||
} | |||||
} | |||||
message SimpleAuthenticationRequestData { | |||||
string backupID = 1; | |||||
string userID = 2; | |||||
} | |||||
message BackupKeyEntropy { | |||||
oneof data { | |||||
bytes nonce = 1; | |||||
bytes rawMessage = 2; | |||||
} | |||||
} | |||||
// CreateNewBackup | |||||
message CreateNewBackupRequest { | |||||
oneof data { | |||||
FullAuthenticationRequestData authenticationRequestData = 1; | |||||
BackupKeyEntropy backupKeyEntropy = 2; | |||||
bytes newCompactionChunk = 3; | |||||
} | |||||
} | |||||
message CreateNewBackupResponse { | |||||
oneof data { | |||||
FullAuthenticationResponseData authenticationResponseData = 1; | |||||
bool entropyValid = 2; | |||||
string backupID = 3; | |||||
} | } | ||||
} | } | ||||
// SendLog | // SendLog | ||||
message SendLogRequest { | message SendLogRequest { | ||||
string userId = 1; | SimpleAuthenticationRequestData authenticationData = 1; | ||||
bytes data = 2; | bytes logData = 2; | ||||
} | } | ||||
// PullBackupKey | // RecoverBackupKey | ||||
message PullBackupKeyRequest { | message RecoverBackupKeyRequest { | ||||
string userId = 1; | FullAuthenticationRequestData authenticationData = 1; | ||||
bytes pakeKey = 2; | |||||
} | } | ||||
message PullBackupKeyResponse { | message RecoverBackupKeyResponse { | ||||
bytes encryptedBackupKey = 1; | oneof data { | ||||
FullAuthenticationResponseData authenticationResponseData = 1; | |||||
BackupKeyEntropy backupKeyEntropy = 2; | |||||
string backupID = 4; | |||||
} | |||||
} | } | ||||
// PullCompaction | // PullBackup | ||||
message PullCompactionRequest { | message PullBackupRequest { | ||||
string userId = 1; | SimpleAuthenticationRequestData authenticationData = 1; | ||||
bytes message = 2; | |||||
} | } | ||||
message PullCompactionResponse { | message PullBackupResponse { | ||||
oneof data { | oneof data { | ||||
bytes compactionChunk = 1; | bytes compactionChunk = 1; | ||||
bytes logChunk = 2; | bytes logChunk = 2; | ||||
} | } | ||||
} | } |