selfpass/protobuf/credentials.proto

68 lines
1.6 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package selfpass;
import "google/protobuf/timestamp.proto";
option go_package = "protobuf";
service Credentials {
rpc GetAllMetadata (SourceHostRequest) returns (stream Metadata);
rpc Get (IdRequest) returns (Credential);
rpc Create (CredentialRequest) returns (Credential);
rpc Update (UpdateRequest) returns (Credential);
rpc Delete (IdRequest) returns (SuccessResponse);
}
message SuccessResponse {
bool success = 1;
}
message SourceHostRequest {
string source_host = 1;
}
message IdRequest {
string id = 1;
}
message UpdateRequest {
string id = 1;
CredentialRequest credential = 2;
}
message Metadata {
string id = 1;
google.protobuf.Timestamp created_at = 2;
google.protobuf.Timestamp updated_at = 3;
string primary = 4;
string source_host = 5;
string login_url = 6;
string tag = 7;
}
message Credential {
string id = 1;
google.protobuf.Timestamp created_at = 2;
google.protobuf.Timestamp updated_at = 3;
string primary = 4;
string username = 5;
string email = 6;
string password = 7;
string source_host = 8;
string login_url = 9;
string tag = 10;
string otp_secret = 11;
}
message CredentialRequest {
string primary = 1;
string username = 2;
string email = 3;
string password = 4;
string source_host = 5;
string login_url = 6;
string tag = 7;
string otp_secret = 8;
}