Add kubeconfig to account api

This commit is contained in:
Nikolai Rodionov 2024-03-18 14:20:24 +01:00
parent 98dcb24a8b
commit bb0752f03e
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
4 changed files with 68 additions and 18 deletions

View File

@ -0,0 +1,30 @@
---
when:
event:
- push
steps:
lint:
name: Generate docs
image: pseudomuto/protoc-gen-doc
secrets:
- softplayer_bot_ssh_key
- git_known_hosts
commands:
- mkdir -p ~/.ssh
- apk update && apk add git openssh
- echo $SOFTPLAYER_BOT_SSH_KEY | base64 -d > ~/.ssh/id_ed25519
- echo $GIT_KNOWN_HOSTS > ~/.ssh/known_hosts
- cat ~/.ssh/id_ed25519
- chmod 0600 ~/.ssh/id_ed25519
- protoc --proto_path=./proto --doc_out=. --doc_opt=markdown,readme.md $(find ./proto -type f -iname "*.proto")
- eval `ssh-agent`
- ssh-add ~/.ssh/id_ed25519
- git config --global user.email "allanger@badhouseplants.net"
- git config --global user.name "Softplayer Bot"
- git clone git@git.badhouseplants.net:softplayer/softplayer-proto.git /tmp/repo
- git -C /tmp/repo checkout generated-documentation
- mv README.md /tmp/repo/README.md
- git -C /tmp/repo add .
- git -C /tmp/repo commit -m "Update documentation"
- git -C /tmp/repo push

11
.woodpecker/lint.yaml Normal file
View File

@ -0,0 +1,11 @@
---
when:
event:
- push
steps:
lint:
name: Lint protobufs
image: yoheimuta/protolint
commands:
- protolint lint $(find . -type f -iname "*.proto")

View File

@ -15,9 +15,9 @@
- [accounts/accounts_v1.proto](#accounts_accounts_v1-proto) - [accounts/accounts_v1.proto](#accounts_accounts_v1-proto)
- [AccountData](#accounts-AccountData) - [AccountData](#accounts-AccountData)
- [AccountFull](#accounts-AccountFull) - [AccountFull](#accounts-AccountFull)
- [AccountFullWithToken](#accounts-AccountFullWithToken)
- [AccountId](#accounts-AccountId) - [AccountId](#accounts-AccountId)
- [AccountPassword](#accounts-AccountPassword) - [AccountPassword](#accounts-AccountPassword)
- [AccountWithKubeConfig](#accounts-AccountWithKubeConfig)
- [AccountWithPassword](#accounts-AccountWithPassword) - [AccountWithPassword](#accounts-AccountWithPassword)
- [Accounts](#accounts-Accounts) - [Accounts](#accounts-Accounts)
@ -130,6 +130,7 @@ This file has messages for describing environments
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Account name | | name | [string](#string) | | Account name |
| email | [string](#string) | | Account email |
@ -152,6 +153,23 @@ This file has messages for describing environments
<a name="accounts-AccountFullWithToken"></a>
### AccountFullWithToken
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [AccountId](#accounts-AccountId) | | |
| data | [AccountData](#accounts-AccountData) | | |
| Token | [string](#string) | | |
<a name="accounts-AccountId"></a> <a name="accounts-AccountId"></a>
### AccountId ### AccountId
@ -182,16 +200,6 @@ Represents a environment UUID only
<a name="accounts-AccountWithKubeConfig"></a>
### AccountWithKubeConfig
<a name="accounts-AccountWithPassword"></a> <a name="accounts-AccountWithPassword"></a>
### AccountWithPassword ### AccountWithPassword
@ -221,8 +229,8 @@ Service for handling environments
| Method Name | Request Type | Response Type | Description | | Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------| | ----------- | ------------ | ------------- | ------------|
| SignUp | [AccountWithPassword](#accounts-AccountWithPassword) | [AccountFull](#accounts-AccountFull) | | | SignUp | [AccountWithPassword](#accounts-AccountWithPassword) | [AccountFullWithToken](#accounts-AccountFullWithToken) | |
| SignIn | [AccountWithPassword](#accounts-AccountWithPassword) | [.google.protobuf.Empty](#google-protobuf-Empty) | | | SignIn | [AccountWithPassword](#accounts-AccountWithPassword) | [AccountFullWithToken](#accounts-AccountFullWithToken) | |

View File

@ -1,15 +1,14 @@
/// This file has messages for describing environments /// This file has messages for describing environments
syntax = "proto3"; syntax = "proto3";
package accounts; package accounts;
import "google/protobuf/empty.proto";
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts"; option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts";
/** /**
* Service for handling environments * Service for handling environments
*/ */
service Accounts { service Accounts {
rpc SignUp (AccountWithPassword) returns (AccountFull) {} rpc SignUp (AccountWithPassword) returns (AccountFullWithToken) {}
rpc SignIn (AccountWithPassword) returns (google.protobuf.Empty) {} rpc SignIn (AccountWithPassword) returns (AccountFullWithToken) {}
} }
/** /**
@ -39,7 +38,9 @@ message AccountFull {
AccountData data = 2; AccountData data = 2;
} }
message AccountWithKubeConfig { message AccountFullWithToken {
AccountId id = 1;
AccountData data = 2;
string Token = 3;
} }