Skip to Content
kosemdocs
ReferenceAPIEnvironments

Mint environment workload token

Mints a short-lived workload identity token for a running local sandbox environment. Returns a 15-minute environment-scoped workload identity token that kosem sbx mounts at /run/kosem/identity/token so kosem-envd inside the local container can open its tunnel and issue granted credentials without exposing the user's sign-in token. Only the creator of a running local sandbox can mint its workload token.

POST
/v1/projects/{project}/environments/{environment}/workloadToken

Mints a short-lived workload identity token for a running local sandbox environment.

Returns a 15-minute environment-scoped workload identity token that kosem sbx mounts at /run/kosem/identity/token so kosem-envd inside the local container can open its tunnel and issue granted credentials without exposing the user's sign-in token. Only the creator of a running local sandbox can mint its workload token.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
environment*string

The environment's ID.

Match^env_[0-7][0-9a-hjkmnp-tv-z]{25}$

Response Body

OK

application/json
  1. response
environment*string

Resource name of the local environment.

expireTime*string

When the workload identity token expires.

Formatdate-time
token*string

Short-lived workload identity token written to /run/kosem/identity/token inside the local sandbox.

Example Request
curl -X POST 'https://api.kosem.ai/v1/projects/string/environments/string/workloadToken'
Example Response
{
  "environment": "string",
  "expireTime": "2019-08-24T14:15:22Z",
  "token": "string"
}