Skip to content

Commit 230c190

Browse files
authored
[papi] add api to allow organization owner to create a temporary token (#19324)
* [papi] add token service to gitpod.v1 * Address feedback * Fix spice test cases * fix db tests
1 parent b655c99 commit 230c190

File tree

14 files changed

+995
-11
lines changed

14 files changed

+995
-11
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
syntax = "proto3";
2+
3+
package gitpod.v1;
4+
5+
option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1";
6+
7+
service TokenService {
8+
// CreateUserToken creates a new temporary access token for the specified user.
9+
// +admin – only to be used by installation admins
10+
rpc CreateTemporaryAccessToken(CreateTemporaryAccessTokenRequest) returns (CreateTemporaryAccessTokenResponse) {}
11+
}
12+
13+
message CreateTemporaryAccessTokenRequest {
14+
// user_id is the identifier of the user for which the token is created.
15+
string user_id = 1;
16+
17+
// expiry_seconds is the number of seconds the token is valid for.
18+
// value should in the range [1, 600]
19+
int32 expiry_seconds = 2;
20+
}
21+
22+
message CreateTemporaryAccessTokenResponse {
23+
// cookie_name is the name of the cookie to use for the token.
24+
string cookie_name = 1;
25+
26+
string token = 2;
27+
}

components/public-api/go/v1/token.pb.go

Lines changed: 250 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/public-api/go/v1/token_grpc.pb.go

Lines changed: 113 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)