Files
softplayer-proto/README.md
Nikolai Rodionov 52f43e57ad
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Add a token service
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-10 22:10:32 +02:00

576 lines
14 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Protocol Documentation
<a name="top"></a>
## Table of Contents
- [accounts/v1/accounts_v1.proto](#accounts_v1_accounts_v1-proto)
- [AccountData](#accounts-v1-AccountData)
- [AccountPassword](#accounts-v1-AccountPassword)
- [IsEmailVerifiedRequest](#accounts-v1-IsEmailVerifiedRequest)
- [IsEmailVerifiedResponse](#accounts-v1-IsEmailVerifiedResponse)
- [NewPasswordRequest](#accounts-v1-NewPasswordRequest)
- [RefreshTokenRequest](#accounts-v1-RefreshTokenRequest)
- [ResetPasswordRequest](#accounts-v1-ResetPasswordRequest)
- [SignInRequest](#accounts-v1-SignInRequest)
- [SignUpRequest](#accounts-v1-SignUpRequest)
- [AccountsService](#accounts-v1-AccountsService)
- [PublicAccountsService](#accounts-v1-PublicAccountsService)
- [test/v1/test_v1.proto](#test_v1_test_v1-proto)
- [PingRequest](#test-v1-PingRequest)
- [PingResponse](#test-v1-PingResponse)
- [PongRequest](#test-v1-PongRequest)
- [PongResponse](#test-v1-PongResponse)
- [TestAuthService](#test-v1-TestAuthService)
- [TestNoAuthService](#test-v1-TestNoAuthService)
- [tokens/v1/tokens_v1.proto](#tokens_v1_tokens_v1-proto)
- [CreateTokenRequest](#tokens-v1-CreateTokenRequest)
- [CreateTokenResponse](#tokens-v1-CreateTokenResponse)
- [ForceTokenExpirationRequest](#tokens-v1-ForceTokenExpirationRequest)
- [GetTokenRequest](#tokens-v1-GetTokenRequest)
- [GetTokenResponse](#tokens-v1-GetTokenResponse)
- [ListTokensResponse](#tokens-v1-ListTokensResponse)
- [RegenerateTokenRequest](#tokens-v1-RegenerateTokenRequest)
- [RegenerateTokenResponse](#tokens-v1-RegenerateTokenResponse)
- [TokenMetadata](#tokens-v1-TokenMetadata)
- [TokenPermissions](#tokens-v1-TokenPermissions)
- [TokenUUID](#tokens-v1-TokenUUID)
- [TokenValue](#tokens-v1-TokenValue)
- [UpdateTokenRequest](#tokens-v1-UpdateTokenRequest)
- [UpdateTokenResponse](#tokens-v1-UpdateTokenResponse)
- [TokensService](#tokens-v1-TokensService)
- [Scalar Value Types](#scalar-value-types)
<a name="accounts_v1_accounts_v1-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## accounts/v1/accounts_v1.proto
Protobuf definitions for the accounts service.
<a name="accounts-v1-AccountData"></a>
### AccountData
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Account name |
| email | [string](#string) | | Account email |
<a name="accounts-v1-AccountPassword"></a>
### AccountPassword
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| password | [string](#string) | | |
<a name="accounts-v1-IsEmailVerifiedRequest"></a>
### IsEmailVerifiedRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| data | [AccountData](#accounts-v1-AccountData) | | |
<a name="accounts-v1-IsEmailVerifiedResponse"></a>
### IsEmailVerifiedResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| verified | [bool](#bool) | | |
<a name="accounts-v1-NewPasswordRequest"></a>
### NewPasswordRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| data | [AccountData](#accounts-v1-AccountData) | | |
| password | [AccountPassword](#accounts-v1-AccountPassword) | | |
| code | [string](#string) | | |
<a name="accounts-v1-RefreshTokenRequest"></a>
### RefreshTokenRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| session_id | [string](#string) | | |
<a name="accounts-v1-ResetPasswordRequest"></a>
### ResetPasswordRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| data | [AccountData](#accounts-v1-AccountData) | | |
<a name="accounts-v1-SignInRequest"></a>
### SignInRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| email | [string](#string) | | |
| password | [string](#string) | | |
<a name="accounts-v1-SignUpRequest"></a>
### SignUpRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| email | [string](#string) | | |
| password | [string](#string) | | |
<a name="accounts-v1-AccountsService"></a>
### AccountsService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| IsEmailVerified | [IsEmailVerifiedRequest](#accounts-v1-IsEmailVerifiedRequest) | [IsEmailVerifiedResponse](#accounts-v1-IsEmailVerifiedResponse) | Is email for the current account verified |
| RefreshSession | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| TokenAuthorization | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | Authorize using long living tokens |
<a name="accounts-v1-PublicAccountsService"></a>
### PublicAccountsService
Service for handling accounts that do not require authentication
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| SignIn | [SignInRequest](#accounts-v1-SignInRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Sing in into an existing account |
| SignUp | [SignUpRequest](#accounts-v1-SignUpRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Create a new account |
<a name="test_v1_test_v1-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## test/v1/test_v1.proto
<a name="test-v1-PingRequest"></a>
### PingRequest
<a name="test-v1-PingResponse"></a>
### PingResponse
<a name="test-v1-PongRequest"></a>
### PongRequest
<a name="test-v1-PongResponse"></a>
### PongResponse
<a name="test-v1-TestAuthService"></a>
### TestAuthService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Pong | [PongRequest](#test-v1-PongRequest) | [PongResponse](#test-v1-PongResponse) | |
<a name="test-v1-TestNoAuthService"></a>
### TestNoAuthService
Service for handling environments
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Ping | [PingRequest](#test-v1-PingRequest) | [PingResponse](#test-v1-PingResponse) | |
<a name="tokens_v1_tokens_v1-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## tokens/v1/tokens_v1.proto
Protobuf definitions for the accounts service.
<a name="tokens-v1-CreateTokenRequest"></a>
### CreateTokenRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_metadata | [TokenMetadata](#tokens-v1-TokenMetadata) | | |
| token_permissions | [TokenPermissions](#tokens-v1-TokenPermissions) | | |
<a name="tokens-v1-CreateTokenResponse"></a>
### CreateTokenResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
| token_metadata | [TokenMetadata](#tokens-v1-TokenMetadata) | | |
| token_permissions | [TokenPermissions](#tokens-v1-TokenPermissions) | | |
| token_value | [TokenValue](#tokens-v1-TokenValue) | | |
<a name="tokens-v1-ForceTokenExpirationRequest"></a>
### ForceTokenExpirationRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
<a name="tokens-v1-GetTokenRequest"></a>
### GetTokenRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
<a name="tokens-v1-GetTokenResponse"></a>
### GetTokenResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
| token_metadata | [TokenMetadata](#tokens-v1-TokenMetadata) | | |
| token_permissions | [TokenPermissions](#tokens-v1-TokenPermissions) | | |
<a name="tokens-v1-ListTokensResponse"></a>
### ListTokensResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
| token_metadata | [TokenMetadata](#tokens-v1-TokenMetadata) | | |
| token_permissions | [TokenPermissions](#tokens-v1-TokenPermissions) | | |
<a name="tokens-v1-RegenerateTokenRequest"></a>
### RegenerateTokenRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
<a name="tokens-v1-RegenerateTokenResponse"></a>
### RegenerateTokenResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_value | [TokenValue](#tokens-v1-TokenValue) | | |
<a name="tokens-v1-TokenMetadata"></a>
### TokenMetadata
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | A token name |
| expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Token expiration timestamp |
<a name="tokens-v1-TokenPermissions"></a>
### TokenPermissions
<a name="tokens-v1-TokenUUID"></a>
### TokenUUID
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| uuid | [string](#string) | | An ID of a token |
<a name="tokens-v1-TokenValue"></a>
### TokenValue
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token | [string](#string) | | Token value Can be only retrieved once after the generation |
<a name="tokens-v1-UpdateTokenRequest"></a>
### UpdateTokenRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
| token_metadata | [TokenMetadata](#tokens-v1-TokenMetadata) | | |
| token_permissions | [TokenPermissions](#tokens-v1-TokenPermissions) | | |
<a name="tokens-v1-UpdateTokenResponse"></a>
### UpdateTokenResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token_uuid | [TokenUUID](#tokens-v1-TokenUUID) | | |
| token_metadata | [TokenMetadata](#tokens-v1-TokenMetadata) | | |
| token_permissions | [TokenPermissions](#tokens-v1-TokenPermissions) | | |
<a name="tokens-v1-TokensService"></a>
### TokensService
Tokens should be used for programmatic access
For example CLI or terraform modules
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| CreateToken | [CreateTokenRequest](#tokens-v1-CreateTokenRequest) | [CreateTokenResponse](#tokens-v1-CreateTokenResponse) | Create a new token |
| UpdateToken | [UpdateTokenRequest](#tokens-v1-UpdateTokenRequest) | [UpdateTokenResponse](#tokens-v1-UpdateTokenResponse) | Update an existing token |
| ForceTokenExpiration | [ForceTokenExpirationRequest](#tokens-v1-ForceTokenExpirationRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Expire an existing token |
| RegenerateToken | [RegenerateTokenRequest](#tokens-v1-RegenerateTokenRequest) | [RegenerateTokenResponse](#tokens-v1-RegenerateTokenResponse) | Create a new token with the same UUID |
| GetToken | [GetTokenRequest](#tokens-v1-GetTokenRequest) | [GetTokenResponse](#tokens-v1-GetTokenResponse) | Get an existing token |
| ListTokens | [.google.protobuf.Empty](#google-protobuf-Empty) | [ListTokensResponse](#tokens-v1-ListTokensResponse) stream | List all existing tokens |
## Scalar Value Types
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> int32 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="int64" /> int64 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sint64" /> sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="fixed32" /> fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="fixed64" /> fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |