| 1 |
syntax = "proto3"; |
| 2 |
|
| 3 |
package svc.token.v1; |
| 4 |
|
| 5 |
import "google/protobuf/timestamp.proto"; |
| 6 |
import "types/v1/cursor.proto"; |
| 7 |
import "types/v1/environment_token.proto"; |
| 8 |
|
| 9 |
option go_package = "svc/token/v1;tokenv1"; |
| 10 |
|
| 11 |
service TokenService { |
| 12 |
rpc GenerateEnvironmentToken(GenerateEnvironmentTokenRequest) returns (GenerateEnvironmentTokenResponse) {} |
| 13 |
rpc RevokeEnvironmentToken(RevokeEnvironmentTokenRequest) returns (RevokeEnvironmentTokenResponse) {} |
| 14 |
rpc GetEnvironmentToken(GetEnvironmentTokenRequest) returns (GetEnvironmentTokenResponse) {} |
| 15 |
rpc ListEnvironmentToken(ListEnvironmentTokenRequest) returns (ListEnvironmentTokenResponse) {} |
| 16 |
} |
| 17 |
|
| 18 |
message GenerateEnvironmentTokenRequest { |
| 19 |
int64 environment_id = 1; |
| 20 |
google.protobuf.Timestamp expires_at = 2; |
| 21 |
repeated types.v1.EnvironmentRole roles = 3; |
| 22 |
} |
| 23 |
|
| 24 |
message GenerateEnvironmentTokenResponse { |
| 25 |
types.v1.EnvironmentToken token = 1; |
| 26 |
} |
| 27 |
|
| 28 |
message RevokeEnvironmentTokenRequest { |
| 29 |
int64 environment_id = 1; |
| 30 |
int64 token_id = 2; |
| 31 |
} |
| 32 |
|
| 33 |
message RevokeEnvironmentTokenResponse {} |
| 34 |
|
| 35 |
message GetEnvironmentTokenRequest { |
| 36 |
int64 environment_id = 1; |
| 37 |
int64 token_id = 2; |
| 38 |
} |
| 39 |
|
| 40 |
message GetEnvironmentTokenResponse { |
| 41 |
types.v1.EnvironmentToken token = 1; |
| 42 |
} |
| 43 |
|
| 44 |
message ListEnvironmentTokenRequest { |
| 45 |
types.v1.Cursor cursor = 1; |
| 46 |
int32 limit = 2; |
| 47 |
int64 environment_id = 3; |
| 48 |
} |
| 49 |
|
| 50 |
message ListEnvironmentTokenResponse { |
| 51 |
types.v1.Cursor next = 1; |
| 52 |
message ListItem { |
| 53 |
types.v1.EnvironmentToken token = 1; |
| 54 |
} |
| 55 |
repeated ListItem items = 2; |
| 56 |
} |