From 76a233dcfdb1e87c355159891fa64c64bd935e05 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 05:44:55 +0200 Subject: [PATCH 01/21] Update account services proto Signed-off-by: Nikolai Rodionov --- proto/accounts/v1/accounts_v1.proto | 53 +++++++++++++---------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/proto/accounts/v1/accounts_v1.proto b/proto/accounts/v1/accounts_v1.proto index 6c8fe28..a62ad05 100644 --- a/proto/accounts/v1/accounts_v1.proto +++ b/proto/accounts/v1/accounts_v1.proto @@ -1,60 +1,53 @@ /// This file has messages for describing environments syntax = "proto3"; -package accounts; +package accounts.v1; import "google/protobuf/empty.proto"; -option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts"; +option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts/v1"; /** * Service for handling environments */ -service Accounts { - rpc SignUp (AccountWithPassword) returns (AccountFullWithToken) {} - rpc SignIn (AccountWithPassword) returns (AccountFullWithToken) {} - rpc ResetPassword (AccountData) returns (google.protobuf.Empty) {} - rpc NewPassword (AccountWithPasswordAndCode) returns (google.protobuf.Empty) {} - rpc IsEmailVerified (AccountData) returns (EmailVerified) {} -} - -message EmailVerified { - bool verified = 1; -} -/** - * Represents a environment UUID only - */ -message AccountId { - string id = 1; // Contour ID: UUID +service AccountsService { + rpc SignUp (SignUpRequest) returns (google.protobuf.Empty) {} + rpc SignIn (SignInRequest) returns (google.protobuf.Empty) {} + rpc ResetPassword (ResetPasswordRequest) returns (google.protobuf.Empty) {} + rpc NewPassword (NewPasswordRequest) returns (google.protobuf.Empty) {} + rpc IsEmailVerified (IsEmailVerifiedRequest) returns (IsEmailVerifiedResponse) {} } message AccountPassword { string password = 1; } - message AccountData { string name = 1; // Account name string email = 2; // Account email } -message AccountWithPassword { +message SignUpRequest { AccountData data = 1; AccountPassword password = 2; } -message AccountWithPasswordAndCode { +message SignInRequest { + AccountData data = 1; + AccountPassword password = 2; +}; + +message ResetPasswordRequest { + AccountData data = 1; +} + +message NewPasswordRequest { AccountData data = 1; AccountPassword password = 2; string code = 3; } - -message AccountFull { - AccountId id = 1; - AccountData data = 2; +message IsEmailVerifiedRequest { + AccountData data = 1; } -message AccountFullWithToken { - AccountId id = 1; - AccountData data = 2; - string token = 3; +message IsEmailVerifiedResponse { + bool verified = 1; } - -- 2.49.1 From 73cf6f5a8e4422545b9dd0e7aa9b6166eb4c9bb4 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 06:34:56 +0200 Subject: [PATCH 02/21] Generate the dist for ts proto Signed-off-by: Nikolai Rodionov --- .woodpecker/js-generate.yaml | 9 ++++++--- buf.yaml | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.woodpecker/js-generate.yaml b/.woodpecker/js-generate.yaml index 8bb0e49..7ce403d 100644 --- a/.woodpecker/js-generate.yaml +++ b/.woodpecker/js-generate.yaml @@ -21,7 +21,12 @@ steps: - buf generate - rm -rf ./target/src/api - cp -r ./gen/ts/* ./target/src/api - - name: Clone go repo + - name: Compile typescript + image: docker.io/library/node:25.9.0-alpine3.22 + commands: + - npm install + - npx tsc + - name: Push the typescrip repo image: alpine environment: GITEA_USER: devops-bot @@ -29,8 +34,6 @@ steps: from_secret: gitea_repo_access commands: - apk update && apk add git - - git config user.name "woodpecker-ci" - - git config user.email "bot@badhouseplants.net" - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - git -C ./target add . - |- diff --git a/buf.yaml b/buf.yaml index ba5ddf5..e8c6c4b 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,3 +1,11 @@ version: v2 modules: - path: proto + +lint: + use: + - STANDARD + enum_zero_value_suffix: _UNSPECIFIED + rpc_allow_same_request_response: true + rpc_allow_google_protobuf_empty_requests: false + rpc_allow_google_protobuf_empty_responses: true -- 2.49.1 From b5bf05905130816e9fb422ff9f08e33c0892adbe Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 06:36:35 +0200 Subject: [PATCH 03/21] Generate the dist for ts proto Signed-off-by: Nikolai Rodionov --- .woodpecker/js-generate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker/js-generate.yaml b/.woodpecker/js-generate.yaml index 7ce403d..9e110f9 100644 --- a/.woodpecker/js-generate.yaml +++ b/.woodpecker/js-generate.yaml @@ -20,6 +20,7 @@ steps: commands: - buf generate - rm -rf ./target/src/api + - mkdir -p ./target/src/api - cp -r ./gen/ts/* ./target/src/api - name: Compile typescript image: docker.io/library/node:25.9.0-alpine3.22 -- 2.49.1 From d633fdf84540ecd5eb01d14fa2546a9d43dff77e Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 06:38:35 +0200 Subject: [PATCH 04/21] Generate the dist for ts proto Signed-off-by: Nikolai Rodionov --- .woodpecker/js-generate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker/js-generate.yaml b/.woodpecker/js-generate.yaml index 9e110f9..d37d234 100644 --- a/.woodpecker/js-generate.yaml +++ b/.woodpecker/js-generate.yaml @@ -25,6 +25,7 @@ steps: - name: Compile typescript image: docker.io/library/node:25.9.0-alpine3.22 commands: + - cd ./target - npm install - npx tsc - name: Push the typescrip repo -- 2.49.1 From 2b17a96dc568dff17efe4e9524596524391112e6 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 06:42:23 +0200 Subject: [PATCH 05/21] Remove dist from the gitignore Signed-off-by: Nikolai Rodionov --- .woodpecker/go-generate.yaml | 4 +--- .woodpecker/js-generate.yaml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.woodpecker/go-generate.yaml b/.woodpecker/go-generate.yaml index d4562bd..d38c40c 100644 --- a/.woodpecker/go-generate.yaml +++ b/.woodpecker/go-generate.yaml @@ -15,6 +15,7 @@ steps: - git clone https://$GITEA_USER:$GITEA_TOKEN@gitea.badhouseplants.net/softplayer/softplayer-go-proto.git target - git -C ./target config user.name "devops-bot" - git -C ./target config user.email "bot@badhouseplants.net" + - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - name: Generate go code image: bufbuild/buf commands: @@ -29,9 +30,6 @@ steps: from_secret: gitea_repo_access commands: - apk update && apk add git - - git config user.name "woodpecker-ci" - - git config user.email "bot@badhouseplants.net" - - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - git -C ./target add . - |- git -C ./target commit --allow-empty \ diff --git a/.woodpecker/js-generate.yaml b/.woodpecker/js-generate.yaml index d37d234..47c184e 100644 --- a/.woodpecker/js-generate.yaml +++ b/.woodpecker/js-generate.yaml @@ -15,6 +15,7 @@ steps: - git clone https://$GITEA_USER:$GITEA_TOKEN@gitea.badhouseplants.net/softplayer/softplayer-js-proto.git target - git -C ./target config user.name "devops-bot" - git -C ./target config user.email "bot@badhouseplants.net" + - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - name: Generate go code image: bufbuild/buf commands: @@ -36,7 +37,6 @@ steps: from_secret: gitea_repo_access commands: - apk update && apk add git - - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - git -C ./target add . - |- git -C ./target commit --allow-empty \ -- 2.49.1 From 4119ac8e9f6ceb6be9267706ed9e8da67b0a63ba Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 08:56:23 +0200 Subject: [PATCH 06/21] Rebuild with disy Signed-off-by: Nikolai Rodionov --- .woodpecker/js-generate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/js-generate.yaml b/.woodpecker/js-generate.yaml index 47c184e..6f2751b 100644 --- a/.woodpecker/js-generate.yaml +++ b/.woodpecker/js-generate.yaml @@ -28,7 +28,7 @@ steps: commands: - cd ./target - npm install - - npx tsc + - npm run prepare - name: Push the typescrip repo image: alpine environment: -- 2.49.1 From 75bcee4b5c229e4ad780a314036b540bd4f7f4f4 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 11:19:46 +0200 Subject: [PATCH 07/21] Generate dart code Signed-off-by: Nikolai Rodionov --- .woodpecker/dart-generate.yaml | 41 ++++++++ README.md | 176 ++++++++++++++++----------------- buf.gen.yaml | 4 + 3 files changed, 132 insertions(+), 89 deletions(-) create mode 100644 .woodpecker/dart-generate.yaml diff --git a/.woodpecker/dart-generate.yaml b/.woodpecker/dart-generate.yaml new file mode 100644 index 0000000..f27529f --- /dev/null +++ b/.woodpecker/dart-generate.yaml @@ -0,0 +1,41 @@ +--- +when: + event: + - push + +steps: + - name: Clone dart repo + image: alpine + environment: + GITEA_USER: devops-bot + GITEA_TOKEN: + from_secret: gitea_repo_access + commands: + - apk update && apk add git + - git clone https://$GITEA_USER:$GITEA_TOKEN@gitea.badhouseplants.net/softplayer/softplayer-dart-proto.git target + - git -C ./target config user.name "devops-bot" + - git -C ./target config user.email "bot@badhouseplants.net" + - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH + - name: Generate go code + image: bufbuild/buf + commands: + - buf generate + - rm -rf ./target/lib/src + - mkdir -p ./target/lib/src + - cp -r ./gen/dart/* ./target/ + - name: Push the typescrip repo + image: alpine + environment: + GITEA_USER: devops-bot + GITEA_TOKEN: + from_secret: gitea_repo_access + commands: + - apk update && apk add git + - git -C ./target add . + - |- + git -C ./target commit --allow-empty \ + -m "Update protobuf definitions: ${CI_COMMIT_SHA:0:8}" \ + -m "By ${CI_COMMIT_AUTHOR}" \ + -m "Commit link: ${CI_REPO_URL}/commit/${CI_COMMIT_SHA}" \ + -m "Pipeline link: ${CI_PIPELINE_URL}" + - git -C ./target push --set-upstream origin $CI_COMMIT_BRANCH diff --git a/README.md b/README.md index 13a6796..9f7a2c9 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ ## Table of Contents - [accounts/v1/accounts_v1.proto](#accounts_v1_accounts_v1-proto) - - [AccountData](#accounts-AccountData) - - [AccountFull](#accounts-AccountFull) - - [AccountFullWithToken](#accounts-AccountFullWithToken) - - [AccountId](#accounts-AccountId) - - [AccountPassword](#accounts-AccountPassword) - - [AccountWithPassword](#accounts-AccountWithPassword) - - [AccountWithPasswordAndCode](#accounts-AccountWithPasswordAndCode) - - [EmailVerified](#accounts-EmailVerified) + - [AccountData](#accounts-v1-AccountData) + - [AccountPassword](#accounts-v1-AccountPassword) + - [IsEmailVerifiedRequest](#accounts-v1-IsEmailVerifiedRequest) + - [IsEmailVerifiedResponse](#accounts-v1-IsEmailVerifiedResponse) + - [NewPasswordRequest](#accounts-v1-NewPasswordRequest) + - [ResetPasswordRequest](#accounts-v1-ResetPasswordRequest) + - [SignInRequest](#accounts-v1-SignInRequest) + - [SignUpRequest](#accounts-v1-SignUpRequest) - - [Accounts](#accounts-Accounts) + - [AccountsService](#accounts-v1-AccountsService) - [applications/v1/applications_v1.proto](#applications_v1_applications_v1-proto) - [ApplicationFull](#applications-ApplicationFull) @@ -76,7 +76,7 @@ This file has messages for describing environments - + ### AccountData @@ -92,55 +92,7 @@ This file has messages for describing environments - - -### AccountFull - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [AccountId](#accounts-AccountId) | | | -| data | [AccountData](#accounts-AccountData) | | | - - - - - - - - -### AccountFullWithToken - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [AccountId](#accounts-AccountId) | | | -| data | [AccountData](#accounts-AccountData) | | | -| token | [string](#string) | | | - - - - - - - - -### AccountId -Represents a environment UUID only - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [string](#string) | | Contour ID: UUID | - - - - - - - + ### AccountPassword @@ -155,42 +107,24 @@ Represents a environment UUID only - + -### AccountWithPassword +### IsEmailVerifiedRequest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| data | [AccountData](#accounts-AccountData) | | | -| password | [AccountPassword](#accounts-AccountPassword) | | | +| data | [AccountData](#accounts-v1-AccountData) | | | - + -### AccountWithPasswordAndCode - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| data | [AccountData](#accounts-AccountData) | | | -| password | [AccountPassword](#accounts-AccountPassword) | | | -| code | [string](#string) | | | - - - - - - - - -### EmailVerified +### IsEmailVerifiedResponse @@ -202,6 +136,70 @@ Represents a environment UUID only + + + +### NewPasswordRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [AccountData](#accounts-v1-AccountData) | | | +| password | [AccountPassword](#accounts-v1-AccountPassword) | | | +| code | [string](#string) | | | + + + + + + + + +### ResetPasswordRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [AccountData](#accounts-v1-AccountData) | | | + + + + + + + + +### SignInRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [AccountData](#accounts-v1-AccountData) | | | +| password | [AccountPassword](#accounts-v1-AccountPassword) | | | + + + + + + + + +### SignUpRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [AccountData](#accounts-v1-AccountData) | | | +| password | [AccountPassword](#accounts-v1-AccountPassword) | | | + + + + + @@ -209,18 +207,18 @@ Represents a environment UUID only - + -### Accounts +### AccountsService Service for handling environments | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| -| SignUp | [AccountWithPassword](#accounts-AccountWithPassword) | [AccountFullWithToken](#accounts-AccountFullWithToken) | | -| SignIn | [AccountWithPassword](#accounts-AccountWithPassword) | [AccountFullWithToken](#accounts-AccountFullWithToken) | | -| ResetPassword | [AccountData](#accounts-AccountData) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| NewPassword | [AccountWithPasswordAndCode](#accounts-AccountWithPasswordAndCode) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| IsEmailVerified | [AccountData](#accounts-AccountData) | [EmailVerified](#accounts-EmailVerified) | | +| SignUp | [SignUpRequest](#accounts-v1-SignUpRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| SignIn | [SignInRequest](#accounts-v1-SignInRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| ResetPassword | [ResetPasswordRequest](#accounts-v1-ResetPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| NewPassword | [NewPasswordRequest](#accounts-v1-NewPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| IsEmailVerified | [IsEmailVerifiedRequest](#accounts-v1-IsEmailVerifiedRequest) | [IsEmailVerifiedResponse](#accounts-v1-IsEmailVerifiedResponse) | | diff --git a/buf.gen.yaml b/buf.gen.yaml index 49c570a..27aba36 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -20,3 +20,7 @@ plugins: out: . opt: - markdown,README.md + - remote: buf.build/protocolbuffers/dart:v25.0.0 + out: gen/dart/lib/src + opt: + - grpc -- 2.49.1 From 63296224668fee1720b8bb810a40637fda0d8fed Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 18:35:34 +0200 Subject: [PATCH 08/21] 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) {} } -- 2.49.1 From 852179593dc6d67e87a6696d75be7feb561537f8 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 19:11:39 +0200 Subject: [PATCH 09/21] Add test for auth/noauth Signed-off-by: Nikolai Rodionov --- proto/test/v1/test_v1.proto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proto/test/v1/test_v1.proto b/proto/test/v1/test_v1.proto index 149c8ed..ea26408 100644 --- a/proto/test/v1/test_v1.proto +++ b/proto/test/v1/test_v1.proto @@ -5,8 +5,11 @@ option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg /** * Service for handling environments */ -service TestService { +service TestNoAuthService { rpc Ping (PingRequest) returns (PingResponse) {} +} + +service TestAuthService { rpc Pong (PongRequest) returns (PongResponse) {} } -- 2.49.1 From 9e2dcbd5995c0fcf99e5fbed2643e4b4e8f1c5d7 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 27 Apr 2026 19:16:57 +0200 Subject: [PATCH 10/21] Update workflows Signed-off-by: Nikolai Rodionov --- .woodpecker/dart-generate.yaml | 4 +-- .woodpecker/go-generate.yaml | 2 +- .woodpecker/js-generate.yaml | 10 ++----- README.md | 50 ++++++++++++++++++++++++---------- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/.woodpecker/dart-generate.yaml b/.woodpecker/dart-generate.yaml index f27529f..d0c7d43 100644 --- a/.woodpecker/dart-generate.yaml +++ b/.woodpecker/dart-generate.yaml @@ -16,14 +16,14 @@ steps: - git -C ./target config user.name "devops-bot" - git -C ./target config user.email "bot@badhouseplants.net" - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - - name: Generate go code + - name: Generate code image: bufbuild/buf commands: - buf generate - rm -rf ./target/lib/src - mkdir -p ./target/lib/src - cp -r ./gen/dart/* ./target/ - - name: Push the typescrip repo + - name: Push the dart repo image: alpine environment: GITEA_USER: devops-bot diff --git a/.woodpecker/go-generate.yaml b/.woodpecker/go-generate.yaml index d38c40c..ed4b0d8 100644 --- a/.woodpecker/go-generate.yaml +++ b/.woodpecker/go-generate.yaml @@ -16,7 +16,7 @@ steps: - git -C ./target config user.name "devops-bot" - git -C ./target config user.email "bot@badhouseplants.net" - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - - name: Generate go code + - name: Generate code image: bufbuild/buf commands: - buf generate diff --git a/.woodpecker/js-generate.yaml b/.woodpecker/js-generate.yaml index 6f2751b..fa1f5e5 100644 --- a/.woodpecker/js-generate.yaml +++ b/.woodpecker/js-generate.yaml @@ -16,20 +16,14 @@ steps: - git -C ./target config user.name "devops-bot" - git -C ./target config user.email "bot@badhouseplants.net" - git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH - - name: Generate go code + - name: Generate code image: bufbuild/buf commands: - buf generate - rm -rf ./target/src/api - mkdir -p ./target/src/api - cp -r ./gen/ts/* ./target/src/api - - name: Compile typescript - image: docker.io/library/node:25.9.0-alpine3.22 - commands: - - cd ./target - - npm install - - npm run prepare - - name: Push the typescrip repo + - name: Push the typescript repo image: alpine environment: GITEA_USER: devops-bot diff --git a/README.md b/README.md index 9f7a2c9..fc1c78d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ - [SignInRequest](#accounts-v1-SignInRequest) - [SignUpRequest](#accounts-v1-SignUpRequest) - - [AccountsService](#accounts-v1-AccountsService) + - [AccountAuthService](#accounts-v1-AccountAuthService) + - [AccountsNoAuthService](#accounts-v1-AccountsNoAuthService) - [applications/v1/applications_v1.proto](#applications_v1_applications_v1-proto) - [ApplicationFull](#applications-ApplicationFull) @@ -63,7 +64,8 @@ - [PongRequest](#test-v1-PongRequest) - [PongResponse](#test-v1-PongResponse) - - [TestService](#test-v1-TestService) + - [TestAuthService](#test-v1-TestAuthService) + - [TestNoAuthService](#test-v1-TestNoAuthService) - [Scalar Value Types](#scalar-value-types) @@ -73,7 +75,7 @@

Top

## accounts/v1/accounts_v1.proto -This file has messages for describing environments +Protobuf definitions for the accounts service. @@ -207,18 +209,29 @@ This file has messages for describing environments - + -### AccountsService -Service for handling environments +### AccountAuthService +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 | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| -| SignUp | [SignUpRequest](#accounts-v1-SignUpRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| SignIn | [SignInRequest](#accounts-v1-SignInRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| ResetPassword | [ResetPasswordRequest](#accounts-v1-ResetPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| NewPassword | [NewPasswordRequest](#accounts-v1-NewPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| IsEmailVerified | [IsEmailVerifiedRequest](#accounts-v1-IsEmailVerifiedRequest) | [IsEmailVerifiedResponse](#accounts-v1-IsEmailVerifiedResponse) | | +| IsEmailVerified | [IsEmailVerifiedRequest](#accounts-v1-IsEmailVerifiedRequest) | [IsEmailVerifiedResponse](#accounts-v1-IsEmailVerifiedResponse) | Is email for the current account verified | + + + + +### AccountsNoAuthService +Service for handling accounts that do not require authentication + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| SignUp | [SignUpRequest](#accounts-v1-SignUpRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Create a new user | +| SignIn | [SignInRequest](#accounts-v1-SignInRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Sing in into an existing account | +| ResetPassword | [ResetPasswordRequest](#accounts-v1-ResetPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Reset the password, if it was lost | +| NewPassword | [NewPasswordRequest](#accounts-v1-NewPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Set the new password after reset | +| RefreshToken | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#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 | @@ -842,15 +855,24 @@ Service for handling environments - + -### TestService +### TestAuthService + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Pong | [PongRequest](#test-v1-PongRequest) | [PongResponse](#test-v1-PongResponse) | | + + + + +### TestNoAuthService Service for handling environments | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| | Ping | [PingRequest](#test-v1-PingRequest) | [PingResponse](#test-v1-PingResponse) | | -| Pong | [PongRequest](#test-v1-PongRequest) | [PongResponse](#test-v1-PongResponse) | | -- 2.49.1 From 7e9a30a974632a66985dbb7c7c2db815cde3a2f0 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 28 Apr 2026 13:06:51 +0200 Subject: [PATCH 11/21] Fix the service name for accounts auth Signed-off-by: Nikolai Rodionov --- proto/accounts/v1/accounts_v1.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/accounts/v1/accounts_v1.proto b/proto/accounts/v1/accounts_v1.proto index 67b14c2..48cff34 100644 --- a/proto/accounts/v1/accounts_v1.proto +++ b/proto/accounts/v1/accounts_v1.proto @@ -26,7 +26,7 @@ service AccountsNoAuthService { * 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 { +service AccountsAuthService { // Is email for the current account verified rpc IsEmailVerified (IsEmailVerifiedRequest) returns (IsEmailVerifiedResponse) {} } -- 2.49.1 From 7661c9ff9cef7cd07886011886d84e8bff6b645b Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 28 Apr 2026 13:08:15 +0200 Subject: [PATCH 12/21] Trigger build Signed-off-by: Nikolai Rodionov -- 2.49.1 From 8261805950d762dde47bf413112058f66911d838 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 28 Apr 2026 13:09:38 +0200 Subject: [PATCH 13/21] Trigger build Signed-off-by: Nikolai Rodionov -- 2.49.1 From 57e41f031b358e4c9d5f9cd451968b2da60040a4 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 28 Apr 2026 13:09:40 +0200 Subject: [PATCH 14/21] Trigger build Signed-off-by: Nikolai Rodionov -- 2.49.1 From c276a0a8e1be5c374e92ec262a9fd6b9c39695d6 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 28 Apr 2026 21:13:33 +0200 Subject: [PATCH 15/21] Refresh token require auth Signed-off-by: Nikolai Rodionov --- proto/accounts/v1/accounts_v1.proto | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/proto/accounts/v1/accounts_v1.proto b/proto/accounts/v1/accounts_v1.proto index 48cff34..1552235 100644 --- a/proto/accounts/v1/accounts_v1.proto +++ b/proto/accounts/v1/accounts_v1.proto @@ -16,10 +16,6 @@ service AccountsNoAuthService { 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) {} } /** @@ -29,6 +25,7 @@ service AccountsNoAuthService { service AccountsAuthService { // Is email for the current account verified rpc IsEmailVerified (IsEmailVerifiedRequest) returns (IsEmailVerifiedResponse) {} + rpc RefreshToken (google.protobuf.Empty) returns (google.protobuf.Empty) {} } message AccountPassword { -- 2.49.1 From 239ffcd6c606ca1df080492744d5b11923bca607 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 30 Apr 2026 14:51:36 +0200 Subject: [PATCH 16/21] Switch to SSO kind of login Signed-off-by: Nikolai Rodionov --- proto/accounts/v1/accounts_v1.proto | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/proto/accounts/v1/accounts_v1.proto b/proto/accounts/v1/accounts_v1.proto index 1552235..27bec35 100644 --- a/proto/accounts/v1/accounts_v1.proto +++ b/proto/accounts/v1/accounts_v1.proto @@ -8,14 +8,8 @@ option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg * Service for handling accounts that do not require authentication */ 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) {} } /** @@ -43,8 +37,7 @@ message SignUpRequest { } message SignInRequest { - AccountData data = 1; - AccountPassword password = 2; + string code = 1; }; message ResetPasswordRequest { -- 2.49.1 From a3b5800626e5863f1727dbe48d2017f10c0c690e Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 30 Apr 2026 14:52:20 +0200 Subject: [PATCH 17/21] Trigger build -- 2.49.1 From 06fe8e63d34227938a3c0197ba9f78fc836bcc5d Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 30 Apr 2026 15:39:35 +0200 Subject: [PATCH 18/21] Add minecraft server -- 2.49.1 From 814c1f8ccacdc044f2e82fac5765334b4aff2b8d Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 30 Apr 2026 15:40:07 +0200 Subject: [PATCH 19/21] Trigger build -- 2.49.1 From 2833761b45d444f5e7d9f8eaa906f15099cb286e Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 30 Apr 2026 15:43:10 +0200 Subject: [PATCH 20/21] Trigger build -- 2.49.1 From d43b1383aabff6449d1ed0542671ff8a724bb50f Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 30 Apr 2026 15:45:10 +0200 Subject: [PATCH 21/21] Add code verifier to the sign in service Signed-off-by: Nikolai Rodionov --- proto/accounts/v1/accounts_v1.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/proto/accounts/v1/accounts_v1.proto b/proto/accounts/v1/accounts_v1.proto index 27bec35..af1ef9a 100644 --- a/proto/accounts/v1/accounts_v1.proto +++ b/proto/accounts/v1/accounts_v1.proto @@ -38,6 +38,7 @@ message SignUpRequest { message SignInRequest { string code = 1; + string verifier = 2; }; message ResetPasswordRequest { -- 2.49.1