GetHostAuthenticationToken
client.Runners.Configurations.HostAuthenticationTokens.Get(ctx, body) (*RunnerConfigurationHostAuthenticationTokenGetResponse, error)
POST/gitpod.v1.RunnerConfigurationService/GetHostAuthenticationToken
Gets details about a specific host authentication token.
Use this method to:
- View token information
- Check token expiration
- Verify token validity
Examples
-
Get token details:
Retrieves information about a specific token.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
GetHostAuthenticationToken
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"),
)
hostAuthenticationToken, err := client.Runners.Configurations.HostAuthenticationTokens.Get(context.TODO(), gitpod.RunnerConfigurationHostAuthenticationTokenGetParams{
ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", hostAuthenticationToken.Token)
}
{
"token": {
"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
{
"token": {
"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"
}
}