ListHostAuthenticationTokens
client.Runners.Configurations.HostAuthenticationTokens.List(ctx, params) (*TokensPage[HostAuthenticationToken], error)
POST/gitpod.v1.RunnerConfigurationService/ListHostAuthenticationTokens
Lists host authentication tokens with optional filtering.
Use this method to:
- View all tokens
- Filter by runner or user
- Monitor token status
Examples
-
List all tokens:
Shows all tokens with pagination.
pagination: pageSize: 20 -
Filter by runner:
Lists tokens for a specific runner.
filter: runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" pagination: pageSize: 20
ListHostAuthenticationTokens
package main
import (
"context"
"fmt"
"github.com/gitpod-io/gitpod-sdk-go"
"github.com/gitpod-io/gitpod-sdk-go/option"
)
func main() {
client := gitpod.NewClient(
option.WithBearerToken("My Bearer Token"),
)
page, err := client.Runners.Configurations.HostAuthenticationTokens.List(context.TODO(), gitpod.RunnerConfigurationHostAuthenticationTokenListParams{
Filter: gitpod.F(gitpod.RunnerConfigurationHostAuthenticationTokenListParamsFilter{
RunnerID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
}),
Pagination: gitpod.F(gitpod.RunnerConfigurationHostAuthenticationTokenListParamsPagination{
PageSize: gitpod.F(int64(20)),
}),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"pagination": {
"nextToken": "nextToken"
},
"tokens": [
{
"id": "id",
"expiresAt": "2019-12-27T18:11:19.117Z",
"host": "host",
"integrationId": "integrationId",
"runnerId": "runnerId",
"scopes": [
"string"
],
"source": "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED",
"subject": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"principal": "PRINCIPAL_UNSPECIFIED"
},
"userId": "userId"
}
]
}Returns Examples
{
"pagination": {
"nextToken": "nextToken"
},
"tokens": [
{
"id": "id",
"expiresAt": "2019-12-27T18:11:19.117Z",
"host": "host",
"integrationId": "integrationId",
"runnerId": "runnerId",
"scopes": [
"string"
],
"source": "HOST_AUTHENTICATION_TOKEN_SOURCE_UNSPECIFIED",
"subject": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"principal": "PRINCIPAL_UNSPECIFIED"
},
"userId": "userId"
}
]
}