Update token metadata

Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
This commit is contained in:
2026-05-14 17:22:00 +02:00
parent abe4f26370
commit 7d655b593b
2 changed files with 111 additions and 17 deletions

124
README.md
View File

@@ -20,11 +20,13 @@
- [test/v1/test_v1.proto](#test_v1_test_v1-proto)
- [PingRequest](#test-v1-PingRequest)
- [PingResponse](#test-v1-PingResponse)
- [PingStreamResponse](#test-v1-PingStreamResponse)
- [PongRequest](#test-v1-PongRequest)
- [PongResponse](#test-v1-PongResponse)
- [PongStreamResponse](#test-v1-PongStreamResponse)
- [TestAuthService](#test-v1-TestAuthService)
- [TestNoAuthService](#test-v1-TestNoAuthService)
- [PublicTestService](#test-v1-PublicTestService)
- [TestService](#test-v1-TestService)
- [tokens/v1/tokens_v1.proto](#tokens_v1_tokens_v1-proto)
- [CreateTokenRequest](#tokens-v1-CreateTokenRequest)
@@ -32,11 +34,14 @@
- [ForceTokenExpirationRequest](#tokens-v1-ForceTokenExpirationRequest)
- [GetTokenRequest](#tokens-v1-GetTokenRequest)
- [GetTokenResponse](#tokens-v1-GetTokenResponse)
- [ListPermissionsResponse](#tokens-v1-ListPermissionsResponse)
- [ListTokensResponse](#tokens-v1-ListTokensResponse)
- [MethodList](#tokens-v1-MethodList)
- [RegenerateTokenRequest](#tokens-v1-RegenerateTokenRequest)
- [RegenerateTokenResponse](#tokens-v1-RegenerateTokenResponse)
- [TokenMetadata](#tokens-v1-TokenMetadata)
- [TokenPermissions](#tokens-v1-TokenPermissions)
- [TokenPermissions.PermissionsEntry](#tokens-v1-TokenPermissions-PermissionsEntry)
- [TokenUUID](#tokens-v1-TokenUUID)
- [TokenValue](#tokens-v1-TokenValue)
- [UpdateTokenRequest](#tokens-v1-UpdateTokenRequest)
@@ -254,6 +259,21 @@ Service for handling accounts that do not require authentication
<a name="test-v1-PingStreamResponse"></a>
### PingStreamResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| dummy | [string](#string) | | |
<a name="test-v1-PongRequest"></a>
### PongRequest
@@ -273,6 +293,21 @@ Service for handling accounts that do not require authentication
<a name="test-v1-PongStreamResponse"></a>
### PongStreamResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| dummy | [string](#string) | | |
@@ -280,24 +315,26 @@ Service for handling accounts that do not require authentication
<a name="test-v1-TestAuthService"></a>
<a name="test-v1-PublicTestService"></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
### PublicTestService
Service for handling environments
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Ping | [PingRequest](#test-v1-PingRequest) | [PingResponse](#test-v1-PingResponse) | |
| PingStream | [.google.protobuf.Empty](#google-protobuf-Empty) | [PingStreamResponse](#test-v1-PingStreamResponse) stream | |
<a name="test-v1-TestService"></a>
### TestService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Pong | [PongRequest](#test-v1-PongRequest) | [PongResponse](#test-v1-PongResponse) | |
| PongStream | [.google.protobuf.Empty](#google-protobuf-Empty) | [PongStreamResponse](#test-v1-PongStreamResponse) stream | |
@@ -334,9 +371,6 @@ Protobuf definitions for the accounts service.
| 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) | | |
@@ -391,6 +425,21 @@ Protobuf definitions for the accounts service.
<a name="tokens-v1-ListPermissionsResponse"></a>
### ListPermissionsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permissions | [TokenPermissions](#tokens-v1-TokenPermissions) | | |
<a name="tokens-v1-ListTokensResponse"></a>
### ListTokensResponse
@@ -408,6 +457,21 @@ Protobuf definitions for the accounts service.
<a name="tokens-v1-MethodList"></a>
### MethodList
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| methods | [string](#string) | repeated | |
<a name="tokens-v1-RegenerateTokenRequest"></a>
### RegenerateTokenRequest
@@ -448,6 +512,10 @@ Protobuf definitions for the accounts service.
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | A token name |
| expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Token expiration timestamp |
| last_used_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | When the token was used the last time |
| generated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | When was the current token generated |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | When was the current token entry created |
| revoked_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | When was the token revoked |
@@ -460,6 +528,27 @@ Protobuf definitions for the accounts service.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permissions | [TokenPermissions.PermissionsEntry](#tokens-v1-TokenPermissions-PermissionsEntry) | repeated | |
<a name="tokens-v1-TokenPermissions-PermissionsEntry"></a>
### TokenPermissions.PermissionsEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [MethodList](#tokens-v1-MethodList) | | |
@@ -548,6 +637,7 @@ For example CLI or terraform modules
| 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 |
| ListPermissions | [.google.protobuf.Empty](#google-protobuf-Empty) | [ListPermissionsResponse](#tokens-v1-ListPermissionsResponse) stream | List all available permissions |

View File

@@ -29,9 +29,13 @@ message TokenMetadata {
string name = 1;
// Token expiration timestamp
google.protobuf.Timestamp expires_at = 2;
// When the token was used the last time
google.protobuf.Timestamp last_used_at = 3;
// When was the current token generated
google.protobuf.Timestamp generated_at = 4;
// When was the current token entry created
google.protobuf.Timestamp created_at = 5;
// When was the token revoked
google.protobuf.Timestamp revoked_at = 6;
}