2022-11-04 00:49:07 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
message User {
|
2022-11-29 07:47:25 +08:00
|
|
|
int32 id = 1;
|
2022-11-04 00:49:07 +08:00
|
|
|
string email = 2;
|
|
|
|
}
|
|
|
|
|
2023-02-28 00:45:14 +08:00
|
|
|
message Secret {
|
|
|
|
string name = 1;
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
2022-11-04 00:49:07 +08:00
|
|
|
message Error {
|
|
|
|
string details = 1;
|
|
|
|
}
|
|
|
|
|
2023-01-11 04:12:35 +08:00
|
|
|
message FieldError {
|
|
|
|
string field = 1;
|
|
|
|
repeated string details = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ChangesetError {
|
|
|
|
repeated FieldError errors = 1;
|
|
|
|
}
|
|
|
|
|
2022-12-27 08:16:47 +08:00
|
|
|
message SecretCreated {
|
|
|
|
string name = 1;
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SecretUpdated {
|
|
|
|
string name = 1;
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
2023-02-28 00:45:14 +08:00
|
|
|
message SecretDeleted {
|
|
|
|
string name = 1;
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UserSynchronized {
|
|
|
|
string id = 1;
|
|
|
|
string name = 2;
|
|
|
|
repeated Secret secrets = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message HandshakeRequest {
|
2022-11-04 00:49:07 +08:00
|
|
|
string app_version = 1;
|
|
|
|
}
|
|
|
|
|
2023-02-28 00:45:14 +08:00
|
|
|
message HandshakeResponse {
|
2022-11-04 00:49:07 +08:00
|
|
|
string id = 1;
|
2023-02-28 00:45:14 +08:00
|
|
|
string name = 2;
|
|
|
|
User user = 3;
|
2022-11-04 00:49:07 +08:00
|
|
|
}
|
|
|
|
|
2023-01-07 03:14:44 +08:00
|
|
|
message CreateSecretRequest {
|
|
|
|
string name = 1;
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateSecretResponse {
|
|
|
|
}
|
|
|
|
|
2022-11-04 00:49:07 +08:00
|
|
|
message Request {
|
2022-12-21 22:28:27 +08:00
|
|
|
int32 id = 1;
|
|
|
|
|
2022-11-04 00:49:07 +08:00
|
|
|
oneof type {
|
2023-02-28 00:45:14 +08:00
|
|
|
HandshakeRequest handshake = 2;
|
2023-01-07 03:14:44 +08:00
|
|
|
CreateSecretRequest create_secret = 3;
|
2022-11-04 00:49:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message Response {
|
2022-12-21 22:28:27 +08:00
|
|
|
int32 id = 1;
|
|
|
|
|
2022-11-04 00:49:07 +08:00
|
|
|
oneof type {
|
2022-12-21 22:28:27 +08:00
|
|
|
Error error = 2;
|
2023-01-11 04:12:35 +08:00
|
|
|
ChangesetError changeset = 3;
|
2022-11-04 00:49:07 +08:00
|
|
|
|
2023-02-28 00:45:14 +08:00
|
|
|
HandshakeResponse handshake = 4;
|
2023-01-11 04:12:35 +08:00
|
|
|
CreateSecretResponse create_secret = 5;
|
2022-11-04 00:49:07 +08:00
|
|
|
}
|
|
|
|
}
|
2022-12-27 08:16:47 +08:00
|
|
|
|
|
|
|
message Event {
|
|
|
|
oneof type {
|
|
|
|
SecretCreated secret_created = 100;
|
|
|
|
SecretUpdated secret_updated = 101;
|
2023-02-28 00:45:14 +08:00
|
|
|
SecretDeleted secret_deleted = 102;
|
|
|
|
UserSynchronized user_synchronized = 103;
|
2022-12-27 08:16:47 +08:00
|
|
|
}
|
|
|
|
}
|