Skip to content

client.license

View as Markdown

client.license — the license operations.

On AsyncKindgi every method is the same, awaited.

get(*, timeout: float | None = None) -> LicenseStatus
Signature

Where the deployment's license key stands. GET /v1/license

Whose key, which use, until when and how many days are left, and from 30 days before it expires how to get the next one, as the runtime's startup banner says it. Never the key itself. mode: development when the runtime runs with KINDGI_DEV and needs no key. The license is the deployment's: its own token (KINDGI_API_TOKEN), or a system key holding system:license (the renewal job's), reads all of it, renew with where the deployment keeps its key included. Where the deployment serves exactly one tenant, that tenant's admins read the countdown only (mode, standing, expiresAt, startsUntil, daysLeft, renewBy): never whose key it is or where it's kept. Anyone else is refused: GET /v1/identity/me/permissions says so before asking (licenseOperatorOnly, with tenant.admin). A deployment that doesn't report it answers 404.

replace(
body: LicenseKeyBody | Mapping[str, Any] | None = None,
/,
*,
timeout: float | None = None,
**fields: Any,
) -> LicenseStatus
Signature

Hand the running server a renewed license key. PUT /v1/license

What the renewal hands the deployment's running server (kindgi license renew --runtime), so it runs the new key without a restart. The server checks the key offline, as it does at a start: signed by a key it trusts, for the same licensee and use as the key it runs, and newer (a later exp, or the same exp and an iat no earlier). The same key again is taken as it is. It answers the license status with the new key. Only the deployment's own token (KINDGI_API_TOKEN), or a system key holding system:license, hands it a key; anyone else is refused (license-operator-only), and the refusal recorded, before the body is read. A deployment that doesn't take a key this way answers 404.

usage(*, since: str, timeout: float | None = None) -> LicenseUsage
Signature

How much the deployment was used since a time. GET /v1/license/usage

What a free license key's renewal carries (kindgi license renew --runtime): the runs started since since (not dry runs, replays, test runs or child runs), the distinct people who started runs or decided approvals (counted in each tenant and summed, so a person in two tenants counts twice), the projects in production when the runtime can put projects in production (PUT /v1/projects/{projectId}/production), and the runtime's version. Counts only: no content, names or ids. Only the deployment's own token (KINDGI_API_TOKEN), or a system key holding system:license, reads it; anyone else is refused (license-operator-only), and the refusal recorded, before since is read. A deployment that doesn't report it answers 404.