From 63296224668fee1720b8bb810a40637fda0d8fed Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 18:35:34 +0200 Subject: [PATCH] Start updating proto definitions Signed-off-by: Nikolai Rodionov --- buf.yaml | 2 +- proto/accounts/v1/accounts_v1.proto | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/buf.yaml b/buf.yaml index e8c6c4b..342cd48 100644 --- a/buf.yaml +++ b/buf.yaml @@ -7,5 +7,5 @@ lint: - STANDARD enum_zero_value_suffix: _UNSPECIFIED rpc_allow_same_request_response: true - rpc_allow_google_protobuf_empty_requests: false + rpc_allow_google_protobuf_empty_requests: true rpc_allow_google_protobuf_empty_responses: true diff --git a/proto/accounts/v1/accounts_v1.proto b/proto/accounts/v1/accounts_v1.proto index a62ad05..67b14c2 100644 --- a/proto/accounts/v1/accounts_v1.proto +++ b/proto/accounts/v1/accounts_v1.proto @@ -1,17 +1,33 @@ -/// This file has messages for describing environments +/// Protobuf definitions for the accounts service. syntax = "proto3"; package accounts.v1; import "google/protobuf/empty.proto"; option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts/v1"; /** - * Service for handling environments + * Service for handling accounts that do not require authentication */ -service AccountsService { +service AccountsNoAuthService { + // Create a new user rpc SignUp (SignUpRequest) returns (google.protobuf.Empty) {} + // Sing in into an existing account rpc SignIn (SignInRequest) returns (google.protobuf.Empty) {} + // Reset the password, if it was lost rpc ResetPassword (ResetPasswordRequest) returns (google.protobuf.Empty) {} + // Set the new password after reset rpc NewPassword (NewPasswordRequest) returns (google.protobuf.Empty) {} + // Send the refresh token request, token should be passed in the metadata. + // This rpc does requier auth, but it should be handled not on the middleware level, + // that's why it set in the NoAuth service + rpc RefreshToken (google.protobuf.Empty) returns (google.protobuf.Empty) {} +} + +/** + * Service for handling accounts that do require authentication + * Tokens should be sent via metadata, so the service is able to authenticate a user for a request + */ +service AccountAuthService { + // Is email for the current account verified rpc IsEmailVerified (IsEmailVerifiedRequest) returns (IsEmailVerifiedResponse) {} }