Kitaru

ControlPlaneSession

Control plane tokens for one control plane, refreshed as they expire.

Functions

func__init__(self, api_url, store, timeout=30.0, retries=3, pool_size=20) -> None

Initialize the session.

paramself
paramapi_urlstr

Control plane API base URL.

paramstoreCredentialStore

Credential store holding the token and the API key that renews it.

paramtimeoutfloat
= 30.0

Request timeout in seconds.

paramretriesint
= 3

Retry count for failed requests.

parampool_sizeint
= 20

Connection pool size.

Returns

None
funcget_token(self) -> str | None

Return a usable control plane token, renewing an expiring one first.

paramself

Returns

str | None

Bearer token, or None when nothing stored can produce one.

funclogin_with_api_key(self, api_key) -> ApiToken

Exchange a control plane API key for a control plane token.

paramself
paramapi_keystr

Control plane API key.

Returns

kitaru.client.ApiToken

Token issued by the control plane.

funcdevice_login(self, open_browser=True, prompt=None, workspace_id=None) -> ApiToken

Authorize this machine and return its cached control plane token.

paramself
paramopen_browserbool
= True
parampromptCallable[[ControlPlaneDeviceAuthorization], None] | None
= None
paramworkspace_idstr | None
= None

Returns

kitaru.client.ApiToken
funcdevice_login_with_metadata(self, open_browser=True, prompt=None, workspace_id=None) -> ControlPlaneToken

Authorize this machine against the control plane.

The call blocks until a signed-in account completes authorization in a browser, or until the authorization expires.

paramself
paramopen_browserbool
= True

Whether to open the verification page.

parampromptCallable[[ControlPlaneDeviceAuthorization], None] | None
= None

Called with the authorization so the caller can show the verification URL. Defaults to logging it.

paramworkspace_idstr | None
= None

Workspace ID preselected on the verification page.

Returns

kitaru.client.control_plane.ControlPlaneToken

Control plane token and workspace selection issued for the device.

funcget_workspace(self, workspace_id, access_token) -> ControlPlaneWorkspace

Get the managed workspace selected during device authorization.

paramself
paramworkspace_iduuid.UUID

Selected workspace ID.

paramaccess_tokenstr

Control plane bearer token.

Returns

kitaru.client.control_plane.ControlPlaneWorkspace

Managed workspace connection details.

funcclose(self) -> None

Close the underlying HTTP client.

paramself

Returns

None

On this page