mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 07:41:25 +00:00
add otp service (#88)
This commit is contained in:
34
otp/proto/otp.proto
Normal file
34
otp/proto/otp.proto
Normal file
@@ -0,0 +1,34 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package otp;
|
||||
|
||||
option go_package = "./proto;otp";
|
||||
|
||||
service Otp {
|
||||
rpc Generate(GenerateRequest) returns (GenerateResponse) {}
|
||||
rpc Validate(ValidateRequest) returns (ValidateResponse) {}
|
||||
}
|
||||
|
||||
// Generate an OTP (one time pass) code
|
||||
message GenerateRequest {
|
||||
// unique id, email or user to generate an OTP for
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GenerateResponse {
|
||||
// 6 digit one time pass code
|
||||
string code = 1;
|
||||
}
|
||||
|
||||
// Validate the code
|
||||
message ValidateRequest {
|
||||
// unique id, email or user for which the code was generated
|
||||
string id = 1;
|
||||
// 6 digit one time pass code to validate
|
||||
string code = 2;
|
||||
}
|
||||
|
||||
message ValidateResponse {
|
||||
// returns true if successful
|
||||
bool success = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user