From aab79085e69ebcfb0650e54dc9db25ba29453afc Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 21 Mar 2024 16:07:25 +0100 Subject: [PATCH] Add email validation service --- Makefile | 2 +- proto/accounts/accounts_v1.proto | 6 +----- proto/email/email_v1.proto | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 proto/email/email_v1.proto diff --git a/Makefile b/Makefile index b15f3fa..7194c08 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ docker-docs-gen: docker-lint: $(CONTAINER_TOOL) run --rm \ - -v $$(pwd):/workspace \ + -v $$(pwd):/workspace:z \ --workdir /workspace \ yoheimuta/protolint lint \ $$(find . -type f -iname "*.proto") diff --git a/proto/accounts/accounts_v1.proto b/proto/accounts/accounts_v1.proto index 45ad26d..e147854 100644 --- a/proto/accounts/accounts_v1.proto +++ b/proto/accounts/accounts_v1.proto @@ -10,9 +10,9 @@ option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/a service Accounts { rpc SignUp (AccountWithPassword) returns (AccountFullWithToken) {} rpc SignIn (AccountWithPassword) returns (AccountFullWithToken) {} - rpc ValidateEmail(AccountDataWithEmailCode) returns (google.protobuf.Empty) {} } + /** * Represents a environment UUID only */ @@ -46,7 +46,3 @@ message AccountFullWithToken { string token = 3; } -message AccountDataWithEmailCode { - AccountData data = 1; - int32 code = 2; -} diff --git a/proto/email/email_v1.proto b/proto/email/email_v1.proto new file mode 100644 index 0000000..d3da5c0 --- /dev/null +++ b/proto/email/email_v1.proto @@ -0,0 +1,23 @@ +/// This file has messages for describing environments +syntax = "proto3"; +package email; +import "google/protobuf/empty.proto"; +option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/email"; + +/* + * A service that should handle email validation + */ +service EmailValidation { + rpc SendRequest (RequestValidation) returns (google.protobuf.Empty) {} + rpc ValidateEmail (Code) returns (google.protobuf.Empty) {} +} + +message RequestValidation { + string user_id = 0; +} + +message ConfirmValidation { + string user_id = 0; + int32 code = 1; +} +