Help us shape the future of Go! Take the 2026 Go Developer Survey

api

module
v0.0.0-...-b550a2e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0

README

Kaiten API

The Go backend of Kaiten. REST operations are declared with Huma on Fiber and reach the use cases through the facade in internal/kaiten. GraphQL (gqlgen) is a read-only surface: its resolvers mostly query each module's sqlc code directly rather than the use cases, and every write is a REST operation. A GraphQL request needs the scope REST requires for each resource it selects, and is refused as a whole, with the same 403 problem, when one is missing. Data lives in PostgreSQL, accessed through sqlc. Code is organised as internal/modules/<module>/<usecase>/.

Prerequisites, the local stack and the pull request checklist are in the DEVELOPMENT.md and CONTRIBUTING.md.

Human user management and provider-independent authorization are documented in users/README.md.

GET /api/authorization introspects the authenticated organization caller's current stored grants, for humans and service tokens alike. It runs after the normal authentication/JIT/grant-resolution pipeline and requires no permission, so callers can observe an empty grant set after revocation. Its explicit DTO contains only kind, userId, organizationId, externalOrganizationId, subject and scopes; credentials and token identifiers are never returned. Responses set Cache-Control: no-store. Consumers must resolve on each request and fail closed if Core rejects the caller or cannot answer. This endpoint is registered with a fixed auth-only registrar, not an empty scope requirement; it performs no domain operation and is not the human-only /me profile API.

Layout

Path Holds
cmd/server The API server. The container image builds it.
cmd/docs Prints the OpenAPI documents (see Generate).
cmd/admin-tools The operational CLI (kaiten-admin-tools): database migrations (migrate up, status, version, down-to) and the administration of organizations, users, platform tokens and service tokens. It runs as a Helm job or a one-shot compose service.
cmd/seeder Seeds a database with test data and writes development tokens.
cmd/checkapierrors Checks that every operation declares the error statuses it returns. CI runs it with go run ./cmd/checkapierrors.
cmd/schema-docs Regenerates docs/database_schema.md. It is a separate Go module.
config/ Configuration loading (below).
internal/ Modules, infrastructure and shared code.
pkg/ Shared packages outside internal/, such as scope and apierrors.
tests/ Integration tests and their fixtures.

Run from the repository root

Developer workflows use Task. Run task from the repository root; each task changes into api/ itself.

task --list

Configuration

The API is configured by environment variables, and optionally by a configuration file. No file is required: the API starts on the environment alone.

Precedence runs lowest to highest:

built-in default  ->  optional configuration file  ->  environment variable

An environment variable always wins over the same setting in a file. Commit the settings that are the same everywhere, and let each deployment's own variables carry the few that differ. Required settings are checked on the result of that merge, so a file may omit KAITEN_DATABASE_CONNECTION_STRING when the environment supplies it. A .env file in the working directory is loaded first; it never overrides a variable that is already set.

Two settings have no default and are always required. Either side may carry them:

Required setting Variable File key
Database DSN KAITEN_DATABASE_CONNECTION_STRING database.connection_string
Public listener port KAITEN_API_PORT server.port

metered.api_url and metered.token_file are also required when metered.enabled is true. A second, internal listener serves /api/platform/** on server.platform_port (KAITEN_PLATFORM_API_PORT, default 3001, which must differ from the public port). Keep it on a private network.

Discovery

With KAITEN_CONFIG_FILE unset, the API looks in KAITEN_CONFIG_DIR (the working directory by default) for a file named config with a supported extension. Discovery takes the first match in this order:

config.json   config.toml   config.yaml   config.yml

Files are never merged, so a config.json wins over a config.yaml in the same directory. Finding none is the ordinary case and is not an error. KAITEN_CONFIG_FILE names one file explicitly, and a file named there must exist, so a typo is reported. A file that is found or named but is malformed, unreadable, or contains a key that no setting claims is an error too.

Keys

Every setting is one row of the settings table in config/config.go: file key, environment variable, default, and whether it is a credential. The sections are server, database, logging, graphql, otel, retention, metered and connectors. config.example.yaml lists every key with its variable.

A value in the file is taken literally: there is no ${VARIABLE} expansion. The credential keys, database.connection_string and otel.authorization, therefore belong in the environment. The chart refuses to render a values.yaml that sets either. A literal is acceptable in a local file that is not committed.

In a container and in a cluster

The image (Containerfile) is built FROM scratch, carries no configuration file and starts in /go/bin, so discovery finds nothing there. Use environment variables alone, or mount a file and set KAITEN_CONFIG_FILE (or KAITEN_CONFIG_DIR).

The Helm chart (charts/kaiten) does this for you:

  • api.config in values.yaml is rendered into a ConfigMap, mounted under api.configMountPath, and named by KAITEN_CONFIG_FILE.
  • api.env sets plain environment variables, which override api.config.
  • Credentials come from api.secret, api.secret.existingSecret or api.extraEnv.
  • server.port and server.platform_port are set by the chart from api.service.port and api.service.platformPort. The chart refuses them in api.config.

Build

Build the API binary into api/bin/api:

task build:api

The equivalent command, from api/:

go build -o bin/api ./cmd/server

Test

Run the tests:

task test:api

The task runs go test -shuffle=on ./.... The integration tests under tests/integrations start PostgreSQL with testcontainers, so they need a running Docker daemon.

Extra go test flags pass straight through:

task test:api -- -v -run Usage
task coverage:api            # writes api/coverage.out in atomic mode

Lint, format and audit

These tasks cover both Go modules, api/ and the nested api/cmd/schema-docs:

task lint:api       # golangci-lint --fix: review the diff it leaves
task fmt:api        # gofumpt + gci
task vuln:api       # govulncheck
task deadcode:api   # unreachable functions; findings need triage

Generate

Generate the sqlc query code:

task generate:sqlc

Generate the GraphQL code:

task generate:gqlgen

Generate the OpenAPI documents from the Go source:

task generate:oas

It writes the Core document to api/openapi.yaml (git-ignored) and to app/openapi.yaml, and the Platform document to app/platform-openapi.yaml. The two files under app/ are committed. To print a document yourself, from api/:

go run cmd/docs/main.go openapi            # Core document, on stdout
go run cmd/docs/main.go platform-openapi   # Platform document, on stdout

After a change to the API contract, regenerate the console's client with pnpm run generate from app/.

Regenerate the database schema documentation (docs/database_schema.md):

task schema-docs

It runs a throwaway PostgreSQL through Dagger, so it needs Docker, and it reads KAITEN_DATABASE_USER and KAITEN_DATABASE_PASSWORD from .env.

Docs endpoint

The Core API serves its reference page at /api/docs once the server runs. It also serves the OpenAPI document at /api/openapi.yaml and /api/openapi.json.

The internal listener serves the Platform API the same way, on server.platform_port: /api/docs for the page and /api/platform-openapi.yaml or /api/platform-openapi.json for the document.

Directories

Path Synopsis
cmd
admin-tools command
Shell completion for the values this CLI's flags actually take.
Shell completion for the values this CLI's flags actually take.
checkapierrors command
Command checkapierrors verifies that every Huma endpoint declares the HTTP error statuses it can actually return.
Command checkapierrors verifies that every Huma endpoint declares the HTTP error statuses it can actually return.
docs command
seeder command
server command
Package config loads the API's configuration: an optional file -- YAML, TOML or JSON -- with environment variables over the top.
Package config loads the API's configuration: an optional file -- YAML, TOML or JSON -- with environment variables over the top.
internal
builtinconnectors
Package builtinconnectors registers the manifests of the connectors this binary ships, once, while the process is starting.
Package builtinconnectors registers the manifests of the connectors this binary ships, once, while the process is starting.
infrastructure/billing/gate
Package gate decides whether an organization may reach the commercial surface: licence prices and invoice previews now, subscriptions and invoices later.
Package gate decides whether an organization may reach the commercial surface: licence prices and invoice previews now, subscriptions and invoices later.
infrastructure/billing/money
Package money is how the billing code counts money: in a currency's minor units, never in floats.
Package money is how the billing code counts money: in a currency's minor units, never in floats.
infrastructure/billing/provider
Package provider is the boundary between billing and the payment providers that issue and collect its invoices.
Package provider is the boundary between billing and the payment providers that issue and collect its invoices.
infrastructure/billing/provider/conformance
Package conformance is the contract every provider.Adapter keeps, as a test suite any adapter runs against itself: NOOP, the fake provider, and each real provider against its own sandbox or recordings.
Package conformance is the contract every provider.Adapter keeps, as a test suite any adapter runs against itself: NOOP, the fake provider, and each real provider against its own sandbox or recordings.
infrastructure/billing/provider/fakeprovider
Package fakeprovider is an in-memory payment provider for tests: it pushes, finalizes and reports invoices like a real provider, honours idempotency keys, and lets a test inject faults and act on the provider's side (a payment, a void, a draft deleted, a line edited).
Package fakeprovider is an in-memory payment provider for tests: it pushes, finalizes and reports invoices like a real provider, honours idempotency keys, and lets a test inject faults and act on the provider's side (a payment, a void, a draft deleted, a line edited).
infrastructure/billing/provider/noop
Package noop is the provider of an organization that collects its invoices itself: nothing is pushed, invoices are issued MANUAL and handed off through the handoff queue, and a void is local.
Package noop is the provider of an organization that collects its invoices itself: nothing is pushed, invoices are issued MANUAL and handed off through the handoff queue, and a void is local.
infrastructure/billing/stripe
Package stripe is the Stripe payment provider: it pushes the invoices Kaiten composes to the organization's Stripe account, which issues, presents and collects them, and reads back what Stripe reports.
Package stripe is the Stripe payment provider: it pushes the invoices Kaiten composes to the organization's Stripe account, which issues, presents and collects them, and reads back what Stripe reports.
infrastructure/billing/stripe/stripefake
Package stripefake is an in-process Stripe for tests: an httptest server answering the endpoints the Stripe adapter calls, with Stripe's idempotency semantics, one state per account, a clock of its own and fault controls.
Package stripefake is an in-process Stripe for tests: an httptest server answering the endpoints the Stripe adapter calls, with Stripe's idempotency semantics, one state per account, a clock of its own and fault controls.
infrastructure/cdc
Package cdc turns ONE externally delivered CDC message into N independent in-process consumptions.
Package cdc turns ONE externally delivered CDC message into N independent in-process consumptions.
infrastructure/connectorhooks
Package connectorhooks is what one connector runs at the moments of its lifecycle, over and above what every connector gets (a schema check, a Vault blob and an activation row).
Package connectorhooks is what one connector runs at the moments of its lifecycle, over and above what every connector gets (a schema check, a Vault blob and an activation row).
infrastructure/database/pgtime
Package pgtime converts between time.Time and the pgtype timestamp types sqlc generates field types as.
Package pgtime converts between time.Time and the pgtype timestamp types sqlc generates field types as.
infrastructure/effectivelookup
Package effectivelookup times the reads of instance_effective_entitlement (§19.1 entitlements_effective_lookup_duration_seconds), by reader: the view is on the report path and on KbK's critical path, so its latency is watched where each reader pays it.
Package effectivelookup times the reads of instance_effective_entitlement (§19.1 entitlements_effective_lookup_duration_seconds), by reader: the view is on the report path and on KbK's critical path, so its latency is watched where each reader pays it.
infrastructure/events/webhook
Package webhook describes outbox events in the OpenAPI contract.
Package webhook describes outbox events in the OpenAPI contract.
infrastructure/http/api
Package api is Kaiten's HTTP registration layer: the list of which operations exist on which document, and the only place that list lives.
Package api is Kaiten's HTTP registration layer: the list of which operations exist on which document, and the only place that list lives.
infrastructure/http/graphql/resolver
Package resolver implements the GraphQL resolvers.
Package resolver implements the GraphQL resolvers.
infrastructure/inbox
Package inbox provides the incoming-side counterpart to internal/infrastructure/outbox: a record that a given message from a given source has already been processed, so a consumer facing at-least-once delivery (e.g.
Package inbox provides the incoming-side counterpart to internal/infrastructure/outbox: a record that a given message from a given source has already been processed, so a consumer facing at-least-once delivery (e.g.
infrastructure/pgnotify
Package pgnotify provides a minimal Postgres LISTEN/NOTIFY based fan-out mechanism for propagating in-process events -- initially, cache invalidation -- to every replica of this API, without requiring a shared external cache (Redis et al.) or the heavier Debezium+Dapr outbox/CDC pipeline this codebase already uses for cross-service domain events (see internal/infrastructure/outbox and pkg/debezium).
Package pgnotify provides a minimal Postgres LISTEN/NOTIFY based fan-out mechanism for propagating in-process events -- initially, cache invalidation -- to every replica of this API, without requiring a shared external cache (Redis et al.) or the heavier Debezium+Dapr outbox/CDC pipeline this codebase already uses for cross-service domain events (see internal/infrastructure/outbox and pkg/debezium).
infrastructure/retention
Package retention bounds the append-only outbox and inbox transport tables.
Package retention bounds the append-only outbox and inbox transport tables.
infrastructure/sweep
Package sweep is the scheduler behind every recurring database maintenance pass that runs inside the API process.
Package sweep is the scheduler behind every recurring database maintenance pass that runs inside the API process.
infrastructure/turnstile
Package turnstile verifies Cloudflare Turnstile tokens: the challenge an anonymous checkout's start passes before anything is written (V32-01, §14.8 rule 1).
Package turnstile verifies Cloudflare Turnstile tokens: the challenge an anonymous checkout's start passes before anything is written (V32-01, §14.8 rule 1).
infrastructure/uow
Package uow provides the transaction boundary every write use case runs its multi-statement work inside.
Package uow provides the transaction boundary every write use case runs its multi-statement work inside.
kaiten
Package kaiten is the application: the one place the object graph is built, and the one way to reach a use case.
Package kaiten is the application: the one place the object graph is built, and the one way to reach a use case.
modules/addons
Package addons is the add-on module: the add-on catalogue and the add-ons instances hold.
Package addons is the add-on module: the add-on catalogue and the add-ons instances hold.
modules/addons/billableaddons
Package billableaddons is the add-ons an instance holds, as billing reads them: the add-on module's implementation of billing's ports.AddonSource.
Package billableaddons is the add-ons an instance holds, as billing reads them: the add-on module's implementation of billing's ports.AddonSource.
modules/addons/catalogue
Package catalogue is what the add-on use cases share: the resource shapes, the caller and the billing gate, and reading the rows a write names.
Package catalogue is what the add-on use cases share: the resource shapes, the caller and the billing gate, and reading the rows a write names.
modules/addons/events
Package events names the events the add-on module records.
Package events names the events the add-on module records.
modules/addons/graphql
Package graphql is the add-ons module's part of the GraphQL schema (§13.14): the add-ons an instance holds, and the catalogue of add-on versions with their prices.
Package graphql is the add-ons module's part of the GraphQL schema (§13.14): the add-ons an instance holds, and the catalogue of add-on versions with their prices.
modules/audittrail/listforinstance
Package listforinstance is the audittrail module's public read port for an instance-scoped audit trail page, consumed by instances/getaudittrails (REST) and instances/graphql (GraphQL) instead of either reaching into this module's own generated db package directly.
Package listforinstance is the audittrail module's public read port for an instance-scoped audit trail page, consumed by instances/getaudittrails (REST) and instances/graphql (GraphQL) instead of either reaching into this module's own generated db package directly.
modules/audittrail/listfororganization
Package listfororganization is the audittrail module's public read port for an organization-wide audit trail page, consumed by instances/graphql (the GraphQL organizationAuditTrails field) instead of reaching into this module's own generated db package directly.
Package listfororganization is the audittrail module's public read port for an organization-wide audit trail page, consumed by instances/graphql (the GraphQL organizationAuditTrails field) instead of reaching into this module's own generated db package directly.
modules/audittrail/schema
Package schema holds the audittrail module's own plain data types, returned by its public read ports (listforinstance, listfororganization).
Package schema holds the audittrail module's own plain data types, returned by its public read ports (listforinstance, listfororganization).
modules/audittrail/subscriber
Package subscriber is the audit trail's reader of the CDC stream: every outbound domain event this deployment emitted, written back as an audit row.
Package subscriber is the audit trail's reader of the CDC stream: every outbound domain event this deployment emitted, written back as an audit row.
modules/billing
Package billing is subscriptions and the invoices they produce: what an organization's customers owe it, composed from the licence prices and the usage journal.
Package billing is subscriptions and the invoices they produce: what an organization's customers owe it, composed from the licence prices and the usage journal.
modules/billing/access
Package access is what every billing use case does first: name the caller, and keep the billing surface behind its switch.
Package access is what every billing use case does first: name the caller, and keep the billing surface behind its switch.
modules/billing/checkoutsetup
Package checkoutsetup is the provider side of an anonymous checkout (Tier 2, §12.9): the hosted setup page that saves the visitor's payment method before any customer exists, and the adoption of the provider customer that page created.
Package checkoutsetup is the provider side of an anonymous checkout (Tier 2, §12.9): the hosted setup page that saves the visitor's payment method before any customer exists, and the adoption of the provider customer that page created.
modules/billing/closing
Package closing closes subscriptions' periods into their invoices: the work of the period-close job and of close-periods.
Package closing closes subscriptions' periods into their invoices: the work of the period-close job and of close-periods.
modules/billing/completepaymentmethodsession
Package completepaymentmethodsession applies a hosted setup page the customer finished: checked with the provider server-side (the redirect is never trusted), the payment method saved becomes the one invoices are charged to, and its labels are kept.
Package completepaymentmethodsession applies a hosted setup page the customer finished: checked with the provider server-side (the redirect is never trusted), the payment method saved becomes the one invoices are charged to, and its labels are kept.
modules/billing/createpaymentmethodsession
Package createpaymentmethodsession opens a provider-hosted page where a customer saves a payment method, for its invoices to be charged automatically.
Package createpaymentmethodsession opens a provider-hosted page where a customer saves a payment method, for its invoices to be charged automatically.
modules/billing/createportalsession
Package createportalsession opens the payment provider's hosted portal for a customer: payment methods, invoices and billing details, managed there.
Package createportalsession opens the payment provider's hosted portal for a customer: payment methods, invoices and billing details, managed there.
modules/billing/detachpaymentmethod
Package detachpaymentmethod removes a customer's payment method from the payment provider, refused while a live subscription of the customer is charged automatically: switch it to SEND_INVOICE first.
Package detachpaymentmethod removes a customer's payment method from the payment provider, refused while a live subscription of the customer is charged automatically: switch it to SEND_INVOICE first.
modules/billing/getcustomerbilling
Package getcustomerbilling reads a customer's side in each payment provider: its id there and its default payment method's labels.
Package getcustomerbilling reads a customer's side in each payment provider: its id there and its default payment method's labels.
modules/billing/graphql
Package graphql is billing's part of the GraphQL schema (§13.14): an instance's subscription summary, for the console's instance lists.
Package graphql is billing's part of the GraphQL schema (§13.14): an instance's subscription summary, for the console's instance lists.
modules/billing/incomplete
Package incomplete is the INCOMPLETE subscription's life after its checkout (§9.10, V31-63): what the payment of its ACTIVATION applies, and what its expiry and its cancel drop.
Package incomplete is the INCOMPLETE subscription's life after its checkout (§9.10, V31-63): what the payment of its ACTIVATION applies, and what its expiry and its cancel drop.
modules/billing/invoiceaction
Package invoiceaction is what every action on an invoice does first: lock it the way every billing writer does, and refuse what only a payment provider may do.
Package invoiceaction is what every action on an invoice does first: lock it the way every billing writer does, and refuse what only a payment provider may do.
modules/billing/invoicelist
Package invoicelist is the invoice list both list operations share: its filters, its two orders and its cursor.
Package invoicelist is the invoice list both list operations share: its filters, its two orders and its cursor.
modules/billing/invoices
Package invoices is what every use case that writes or reads an invoice shares: its API shapes, how a composition becomes an issued invoice, and the events an invoice records.
Package invoices is what every use case that writes or reads an invoice shares: its API shapes, how a composition becomes an issued invoice, and the events an invoice records.
modules/billing/licensepreview
Package licensepreview is what a licence invoice preview reads of billing (§8.9): the add-ons it lists, the instance whose usage it rates, the voucher it applies.
Package licensepreview is what a licence invoice preview reads of billing (§8.9): the add-ons it lists, the instance whose usage it rates, the voucher it applies.
modules/billing/lifecycle
Package lifecycle is what the subscription transitions share: finding and locking a subscription, the refusals every change shares, and the moves in and out of PAST_DUE and to CANCELED.
Package lifecycle is what the subscription transitions share: finding and locking a subscription, the refusals every change shares, and the moves in and out of PAST_DUE and to CANCELED.
modules/billing/metering
Package metering turns what the usage journal says about a meter into what the rating composer rates.
Package metering turns what the usage journal says about a meter into what the rating composer rates.
modules/billing/paymentmethods
Package paymentmethods is what the payment-method use cases share: a customer's side in each provider as the API shows it, the provider that captures payment methods, and recording the labels a provider reports.
Package paymentmethods is what the payment-method use cases share: a customer's side in each provider as the API shows it, the provider that captures payment methods, and recording the labels a provider reports.
modules/billing/ports
Package ports is what the billing module needs from other modules, stated by billing and implemented by them.
Package ports is what the billing module needs from other modules, stated by billing and implemented by them.
modules/billing/providerconnector
Package providerconnector is billing's half of the connectors that configure a payment provider: the lifecycle rules every such connector keeps, whichever provider it configures.
Package providerconnector is billing's half of the connectors that configure a payment provider: the lifecycle rules every such connector keeps, whichever provider it configures.
modules/billing/providers
Package providers is how billing reaches the payment providers that issue its invoices: resolving the one an invoice or a subscription routes to, bounding each call, ensuring the provider's customer, describing an invoice to it, and mapping its failures to the API's answers.
Package providers is how billing reaches the payment providers that issue its invoices: resolving the one an invoice or a subscription routes to, bounding each call, ensuring the provider's customer, describing an invoice to it, and mapping its failures to the API's answers.
modules/billing/pushing
Package pushing pushes invoices to the payment providers that issue them.
Package pushing pushes invoices to the payment providers that issue them.
modules/billing/rating
Package rating composes the lines and totals of an invoice from the prices it bills and what their meters measured.
Package rating composes the lines and totals of an invoice from the prices it bills and what their meters measured.
modules/billing/sessioninvoices
Package sessioninvoices lists what a customer session may read of its customer's invoices (§14.4): issued ones only, newest boundary first, of the customer by id -- and of its instance, for a session bound to one.
Package sessioninvoices lists what a customer session may read of its customer's invoices (§14.4): issued ones only, newest boundary first, of the customer by id -- and of its instance, for a session bound to one.
modules/billing/settings
Package settings is an organization's billing defaults: the terms a subscription gets when it names none of its own.
Package settings is an organization's billing defaults: the terms a subscription gets when it names none of its own.
modules/billing/subscriptions
Package subscriptions is what the use cases that read or write an instance's subscription share: its API shape, its terms, and its periods.
Package subscriptions is what the use cases that read or write an instance's subscription share: its API shape, its terms, and its periods.
modules/billing/syncing
Package syncing mirrors what payment providers report about the invoices they issue: payments by any path, voids and drafts deleted in the provider, finalizations done by a human there.
Package syncing mirrors what payment providers report about the invoices they issue: payments by any path, voids and drafts deleted in the provider, finalizations done by a human there.
modules/billing/telemetry
Package telemetry is billing's metrics (§19.1) that more than one use case records, and the deployment-wide gauges the alerts of §19.2 watch.
Package telemetry is billing's metrics (§19.1) that more than one use case records, and the deployment-wide gauges the alerts of §19.2 watch.
modules/components/graphql
Package graphql is the components module's GraphQL read surface: the Query.components and Query.component root fields the schema declares, kept next to the module rather than in the shared resolver package so the generated db.Queries never leaves the module.
Package graphql is the components module's GraphQL read surface: the Query.components and Query.component root fields the schema declares, kept next to the module rather than in the shared resolver package so the generated db.Queries never leaves the module.
modules/components/releaselink
Package releaselink is the components module's public port for the release<->component linking operations the releases module needs (validating a referenced component exists, linking/unlinking it to a release, and reading back a release's components) -- consumed instead of releases reaching into this module's own generated db package directly.
Package releaselink is the components module's public port for the release<->component linking operations the releases module needs (validating a referenced component exists, linking/unlinking it to a release, and reading back a release's components) -- consumed instead of releases reaching into this module's own generated db package directly.
modules/connectors/activateconnector
Package activateconnector turns a registered connector on for one organization.
Package activateconnector turns a registered connector on for one organization.
modules/connectors/activation
Package activation is the organization-level half of a connector: whether one organization has turned it on.
Package activation is the organization-level half of a connector: whether one organization has turned it on.
modules/connectors/attio
Package attio is Kaiten's built-in CRM connector: it mirrors customers into Attio companies and instances into Attio workspaces, and writes the link back onto the Kaiten record so the console can show what is synced.
Package attio is Kaiten's built-in CRM connector: it mirrors customers into Attio companies and instances into Attio workspaces, and writes the link back onto the Kaiten record so the console can show what is synced.
modules/connectors/deactivateconnector
Package deactivateconnector turns a connector off for one organization.
Package deactivateconnector turns a connector off for one organization.
modules/connectors/getconnectorstate
Package getconnectorstate answers, in one request, everything the frontend needs to know about one connector for the current organization.
Package getconnectorstate answers, in one request, everything the frontend needs to know about one connector for the current organization.
modules/connectors/stripe
Package stripe is Kaiten's built-in billing connector: the organization's Stripe account, which issues, presents and collects the invoices Kaiten composes (invoice push).
Package stripe is Kaiten's built-in billing connector: the organization's Stripe account, which issues, presents and collects the invoices Kaiten composes (invoice push).
modules/customers/integrationsync
Package integrationsync is the customers module's public port for the generic integrations module's external-ID-driven sync flow: looking a customer up by (adapter, external ID) rather than by slug, upserting its integration record, and renaming its slug.
Package integrationsync is the customers module's public port for the generic integrations module's external-ID-driven sync flow: looking a customer up by (adapter, external ID) rather than by slug, upserting its integration record, and renaming its slug.
modules/customers/targetingfacts
Package targetingfacts is the customers module's public read port for feature-flag targeting: resolving a customer by (org, slug), and the licence/entitlement facts a targeting rule judges a customer's instance against.
Package targetingfacts is the customers module's public read port for feature-flag targeting: resolving a customer by (org, slug), and the licence/entitlement facts a targeting rule judges a customer's instance against.
modules/deploymentzones
Package deploymentzones is the deployment zone resource: one place a customer of THIS Kaiten runs a release.
Package deploymentzones is the deployment zone resource: one place a customer of THIS Kaiten runs a release.
modules/deploymentzones/dryrunlist
Package dryrunlist is the deploymentzones module's public read port for metadatafields' dry-run endpoint, which needs the (name, slug, metadata) of every deployment zone in an org to preview a metadata field's impact before it's saved.
Package dryrunlist is the deploymentzones module's public read port for metadatafields' dry-run endpoint, which needs the (name, slug, metadata) of every deployment zone in an org to preview a metadata field's impact before it's saved.
modules/deploymentzones/releaselink
Package releaselink is the deploymentzones module's public read port for the release<->deployment-zone relationships the releases module's GraphQL layer needs (which deployment zones and deployments are associated with a set of releases) -- consumed instead of releases reaching into this module's own generated db package directly.
Package releaselink is the deploymentzones module's public read port for the release<->deployment-zone relationships the releases module's GraphQL layer needs (which deployment zones and deployments are associated with a set of releases) -- consumed instead of releases reaching into this module's own generated db package directly.
modules/deploymentzones/targetingfacts
Package targetingfacts is the deploymentzones module's public read port for feature-flag targeting: resolving a deployment zone by (org, slug) for the OFREP evaluation-context enrichment flow.
Package targetingfacts is the deploymentzones module's public read port for feature-flag targeting: resolving a deployment zone by (org, slug) for the OFREP evaluation-context enrichment flow.
modules/entitlements/catalogue
Package catalogue is the entitlements module's public read port for listing every entitlement an organization has declared, with its type.
Package catalogue is the entitlements module's public read port for listing every entitlement an organization has declared, with its type.
modules/entitlements/createentitlementexception
Package createentitlementexception sets the vendor's exception on one entitlement of one instance (§13.16, V32-03 a): the last layer of the view, from startsAt to endsAt, whether or not billing is enabled.
Package createentitlementexception sets the vendor's exception on one entitlement of one instance (§13.16, V32-03 a): the last layer of the view, from startsAt to endsAt, whether or not billing is enabled.
modules/entitlements/effective
Package effective is the reference resolution of an instance's effective entitlement (§7.2, §7.3, D-53): the licence grant, then the add-ons attached, then the boosts in their window, then the instance's exception in its window (V32-03).
Package effective is the reference resolution of an instance's effective entitlement (§7.2, §7.3, D-53): the licence grant, then the add-ons attached, then the boosts in their window, then the instance's exception in its window (V32-03).
modules/entitlements/exceptions
Package exceptions is what the entitlement exception use cases share: the shape of their events and its webhook contracts (V32-03 a, §13.16).
Package exceptions is what the entitlement exception use cases share: the shape of their events and its webhook contracts (V32-03 a, §13.16).
modules/entitlements/infrastructure/dbmap
Package dbmap translates the entitlements module's sqlc row types into its schema DTOs.
Package dbmap translates the entitlements module's sqlc row types into its schema DTOs.
modules/entitlements/licenseview
Package licenseview is the entitlements module's public read port for the licenses module: resolving an entitlement by slug (to validate a license<->entitlement association's value against its declared type), and listing the entitlement groups a license's entitlements belong to.
Package licenseview is the entitlements module's public read port for the licenses module: resolving an entitlement by slug (to validate a license<->entitlement association's value against its declared type), and listing the entitlement groups a license's entitlements belong to.
modules/entitlements/listentitlementexceptions
Package listentitlementexceptions lists an instance's entitlement exceptions with their status at the read (§13.16).
Package listentitlementexceptions lists an instance's entitlement exceptions with their status at the read (§13.16).
modules/entitlements/period
Package period is the single shared implementation of periodic usage window arithmetic for NUMBER entitlements.
Package period is the single shared implementation of periodic usage window arithmetic for NUMBER entitlements.
modules/entitlements/revokeentitlementexception
Package revokeentitlementexception revokes an entitlement exception and keeps its row (§13.16): a scheduled one never starts, an active one ends at once.
Package revokeentitlementexception revokes an entitlement exception and keeps its row (§13.16): a scheduled one never starts, an active one ends at once.
modules/featureflags/evaluator
Package evaluator resolves a feature flag's variant for a given evaluation context: it walks targeting rules, evaluates each one's CEL expression via the infra CEL engine, and dispatches to the matched (or default) variant's value-resolution logic.
Package evaluator resolves a feature flag's variant for a given evaluation context: it walks targeting rules, evaluates each one's CEL expression via the infra CEL engine, and dispatches to the matched (or default) variant's value-resolution logic.
modules/featureflags/infrastructure/dbmap
Package dbmap translates between the featureflags module's sqlc row types and its schema DTOs.
Package dbmap translates between the featureflags module's sqlc row types and its schema DTOs.
modules/featureflags/schema
Package schema holds the feature-flag domain model: the request/response types the featureflags module's HTTP endpoints exchange, plus the pure (behavior-free, aside from simple accessors) data these types carry.
Package schema holds the feature-flag domain model: the request/response types the featureflags module's HTTP endpoints exchange, plus the pure (behavior-free, aside from simple accessors) data these types carry.
modules/featureflags/validator
Package validator checks a feature flag configuration is internally consistent: default and targeting variants reference variants that exist, variant values match the declared flag type, and targeting rules lint clean against the CEL engine.
Package validator checks a feature flag configuration is internally consistent: default and targeting variants reference variants that exist, variant values match the declared flag type, and targeting rules lint clean against the CEL engine.
modules/identity/createplatformtoken
Package createplatformtoken issues a platform credential -- the orgless `ksm_` token that authenticates the Platform API.
Package createplatformtoken issues a platform credential -- the orgless `ksm_` token that authenticates the Platform API.
modules/identity/events
Package events declares the identity module's outbox events.
Package events declares the identity module's outbox events.
modules/identity/getauthorization
Package getauthorization exposes only the current request's resolved identity and grants.
Package getauthorization exposes only the current request's resolved identity and grants.
modules/identity/listorganizationtokens
Package listorganizationtokens names the credentials a platform credential currently holds inside one organization.
Package listorganizationtokens names the credentials a platform credential currently holds inside one organization.
modules/identity/listplatformtokens
Package listplatformtokens reports every platform credential this deployment has ever issued.
Package listplatformtokens reports every platform credential this deployment has ever issued.
modules/identity/mintorganizationtoken
Package mintorganizationtoken issues an organization-scoped credential for the platform identity inside one named tenant.
Package mintorganizationtoken issues an organization-scoped credential for the platform identity inside one named tenant.
modules/identity/resolvetokenauthorization
Package resolvetokenauthorization fetches live machine credential grants, never JWT grants.
Package resolvetokenauthorization fetches live machine credential grants, never JWT grants.
modules/identity/revokeorganizationtoken
Package revokeorganizationtoken retires a credential the calling platform credential minted, before its parent is retired.
Package revokeorganizationtoken retires a credential the calling platform credential minted, before its parent is retired.
modules/identity/revokeplatformtoken
Package revokeplatformtoken retires a platform credential and, with it, every organization credential that credential ever issued.
Package revokeplatformtoken retires a platform credential and, with it, every organization credential that credential ever issued.
modules/identity/tokencache
Package tokencache holds the type of the identity module's credential validation cache.
Package tokencache holds the type of the identity module's credential validation cache.
modules/identity/tokenretention
Package tokenretention deletes credential rows that stopped working long ago.
Package tokenretention deletes credential rows that stopped working long ago.
modules/identity/validateplatformtoken
Package validateplatformtoken authenticates a raw `ksm_` platform credential.
Package validateplatformtoken authenticates a raw `ksm_` platform credential.
modules/instances/billableusage
Package billableusage is the usage journal as the billing module reads it: the instances module's implementation of billing's ports.UsageSource.
Package billableusage is the usage journal as the billing module reads it: the instances module's implementation of billing's ports.UsageSource.
modules/instances/dryrunlist
Package dryrunlist is the instances module's public read port for metadatafields' dry-run endpoint, which needs the (name, slug, metadata) of every instance in an org to preview a metadata field's impact before it's saved.
Package dryrunlist is the instances module's public read port for metadatafields' dry-run endpoint, which needs the (name, slug, metadata) of every instance in an org to preview a metadata field's impact before it's saved.
modules/instances/integrationsync
Package integrationsync is the instances module's public port for the generic integrations module's external-ID-driven sync flow: looking an instance up by (adapter, external ID) rather than by slug, upserting its integration record, and renaming its slug.
Package integrationsync is the instances module's public port for the generic integrations module's external-ID-driven sync flow: looking an instance up by (adapter, external ID) rather than by slug, upserting its integration record, and renaming its slug.
modules/instances/releaselink
Package releaselink is the instances module's public read port for the release<->instance relationships the releases module's GraphQL layer needs (which instances are running a set of releases) -- consumed instead of releases reaching into this module's own generated db package directly.
Package releaselink is the instances module's public read port for the release<->instance relationships the releases module's GraphQL layer needs (which instances are running a set of releases) -- consumed instead of releases reaching into this module's own generated db package directly.
modules/instances/targetingfacts
Package targetingfacts is the instances module's public read port for feature-flag targeting: resolving an instance's own registry facts by slug or by a set of IDs, for the OFREP evaluation-context enrichment flow.
Package targetingfacts is the instances module's public read port for feature-flag targeting: resolving an instance's own registry facts by slug or by a set of IDs, for the OFREP evaluation-context enrichment flow.
modules/instances/usagehistory
Package usagehistory serves the usage journal (usage_ledger) back to its readers: one pair's reports page by page, and the CSV and NDJSON exports of a pair or of a whole organization.
Package usagehistory serves the usage journal (usage_ledger) back to its readers: one pair's reports page by page, and the CSV and NDJSON exports of a pair or of a whole organization.
modules/instances/usageledger
Package usageledger keeps the usage journal (usage_ledger): its monthly partitions, and how long its rows are kept.
Package usageledger keeps the usage journal (usage_ledger): its monthly partitions, and how long its rows are kept.
modules/integrations/adapter
Package adapter holds the integrations module's adapter-name normalization, shared by getintegration and upsertintegration.
Package adapter holds the integrations module's adapter-name normalization, shared by getintegration and upsertintegration.
modules/licenses/billablecatalogue
Package billablecatalogue is the licence catalogue as the billing module reads it: the licenses module's implementation of billing's ports.CatalogueSource.
Package billablecatalogue is the licence catalogue as the billing module reads it: the licenses module's implementation of billing's ports.CatalogueSource.
modules/licenses/familydefault
Package familydefault takes a license family's default away from the versions holding it, when another version claims it.
Package familydefault takes a license family's default away from the versions holding it, when another version claims it.
modules/licenses/familyevents
Package familyevents records what happens to a license family as a whole: its first version opens it, it comes to serve another version, and its last version takes it away.
Package familyevents records what happens to a license family as a whole: its first version opens it, it comes to serve another version, and its last version takes it away.
modules/licenses/familyview
Package familyview reads the resolved view of one license family: its identity, how many versions it has, the version it currently serves and, on request, its whole history.
Package familyview reads the resolved view of one license family: its identity, how many versions it has, the version it currently serves and, on request, its whole history.
modules/licenses/infrastructure/dbmap
Package dbmap translates between the licenses module's sqlc row types and its schema DTOs.
Package dbmap translates between the licenses module's sqlc row types and its schema DTOs.
modules/licenses/lifecycletransition
Package lifecycletransition moves one license version from one lifecycle state to another.
Package lifecycletransition moves one license version from one lifecycle state to another.
modules/licenses/prices
Package prices is what the licence price use cases share: the resource shape, the rules a price must satisfy, and reading and writing it.
Package prices is what the licence price use cases share: the resource shape, the rules a price must satisfy, and reading and writing it.
modules/metadatafields/events
Package events declares the outbox event metadata published by the metadatafields module.
Package events declares the outbox event metadata published by the metadatafields module.
modules/metadatafields/graphql
Package graphql exposes the metadatafields module to GraphQL consumers.
Package graphql exposes the metadatafields module to GraphQL consumers.
modules/metadatafields/infrastructure/dbmap
Package dbmap translates the metadatafields module's sqlc row types into its schema DTOs.
Package dbmap translates the metadatafields module's sqlc row types into its schema DTOs.
modules/metadatafields/listcursor
Package listcursor holds the keyset cursor shape shared by the module's two list surfaces: GET /metadata-fields (getmetadatafields) and the GraphQL metadataFields query (graphql).
Package listcursor holds the keyset cursor shape shared by the module's two list surfaces: GET /metadata-fields (getmetadatafields) and the GraphQL metadataFields query (graphql).
modules/metadatafields/schema
Package schema exposes the public DTO of the metadatafields module — the shape returned by the REST API and embedded in outbox events.
Package schema exposes the public DTO of the metadatafields module — the shape returned by the REST API and embedded in outbox events.
modules/metadatafields/validator
Package validator implements the typed-metadata validation pipeline shared across resources.
Package validator implements the typed-metadata validation pipeline shared across resources.
modules/notifications
Package notifications is the in-app notification feed: a per-user view over the organization's audit trail, with read state, subscriptions and a live stream.
Package notifications is the in-app notification feed: a per-user view over the organization's audit trail, with read state, subscriptions and a live stream.
modules/notifications/announce
Package announce wakes every replica when a notification appears.
Package announce wakes every replica when a notification appears.
modules/notifications/catalogue
Package catalogue is the single list of events that can become a notification, and everything that differs between them.
Package catalogue is the single list of events that can become a notification, and everything that differs between them.
modules/notifications/feed
Package feed is the read model: audit trail rows, narrowed to what one user subscribes to, rendered, with their read state resolved.
Package feed is the read model: audit trail rows, narrowed to what one user subscribes to, rendered, with their read state resolved.
modules/notifications/getpreferences
Package getpreferences renders the settings matrix: every notifiable event, with this user's effective value per channel.
Package getpreferences renders the settings matrix: every notifiable event, with this user's effective value per channel.
modules/notifications/hub
Package hub holds the SSE connections this replica is serving and turns one LISTEN/NOTIFY message into the frames they should each receive.
Package hub holds the SSE connections this replica is serving and turns one LISTEN/NOTIFY message into the frames they should each receive.
modules/notifications/markread
Package markread turns notifications read, one page or all of them.
Package markread turns notifications read, one page or all of them.
modules/notifications/putpreferences
Package putpreferences stores a user's notification choices.
Package putpreferences stores a user's notification choices.
modules/notifications/schema
Package schema is the notifications wire contract.
Package schema is the notifications wire contract.
modules/notifications/stream
Package stream is the SSE transport for the notification feed.
Package stream is the SSE transport for the notification feed.
modules/organization/addmembership
Package addmembership is the organization module's public port for creating a user_on_organization row from outside the module -- e.g.
Package addmembership is the organization module's public port for creating a user_on_organization row from outside the module -- e.g.
modules/organization/ensuremembership
Package ensuremembership is the organization module's port for the membership half of provisioning: it converges on a user_on_organization row without resurrecting one that was deliberately removed, and refuses the caller when the membership it found is soft-deleted.
Package ensuremembership is the organization module's port for the membership half of provisioning: it converges on a user_on_organization row without resurrecting one that was deliberately removed, and refuses the caller when the membership it found is soft-deleted.
modules/organization/ensureorganization
Package ensureorganization converges on the organization an external identity provider describes, creating it if it is not already there.
Package ensureorganization converges on the organization an external identity provider describes, creating it if it is not already there.
modules/organization/listorganizations
Package listorganizations lists every organization in the deployment, across tenants.
Package listorganizations lists every organization in the deployment, across tenants.
modules/organization/listusermemberships
Package listusermemberships answers which organizations a user is a live member of.
Package listusermemberships answers which organizations a user is a live member of.
modules/publicsdk
Package publicsdk is the public SDK surface: the publishable keys (pk_) a vendor's web pages authenticate with, and what those keys may read -- the public catalogue, GET /api/public/catalog, and nothing else (§14, D-49).
Package publicsdk is the public SDK surface: the publishable keys (pk_) a vendor's web pages authenticate with, and what those keys may read -- the public catalogue, GET /api/public/catalog, and nothing else (§14, D-49).
modules/publicsdk/authenticatecheckoutsession
Package authenticatecheckoutsession resolves an anonymous checkout session's ksc_ for the public surface's authenticator (auth.PublicMiddleware, V32-01).
Package authenticatecheckoutsession resolves an anonymous checkout session's ksc_ for the public surface's authenticator (auth.PublicMiddleware, V32-01).
modules/publicsdk/authenticatecustomersession
Package authenticatecustomersession resolves a customer session for the public surface's authenticator (auth.PublicMiddleware).
Package authenticatecustomersession resolves a customer session for the public surface's authenticator (auth.PublicMiddleware).
modules/publicsdk/authenticatepublishablekey
Package authenticatepublishablekey resolves a publishable key for the public surface's authenticator (auth.PublishableKeyMiddleware).
Package authenticatepublishablekey resolves a publishable key for the public surface's authenticator (auth.PublishableKeyMiddleware).
modules/publicsdk/cancelsessionsubscription
Package cancelsessionsubscription is POST /public/session/billing/cancel (§14.4): the session's customer cancels the subscription of the instance the session is bound to, at the end of the period paid for.
Package cancelsessionsubscription is POST /public/session/billing/cancel (§14.4): the session's customer cancels the subscription of the instance the session is bound to, at the end of the period paid for.
modules/publicsdk/checkout
Package checkout is what the anonymous checkout use cases share (Tier 2, V32-01, §14.8): the shape of their events and its webhook contracts.
Package checkout is what the anonymous checkout use cases share (Tier 2, V32-01, §14.8): the shape of their events and its webhook contracts.
modules/publicsdk/checkoutprogress
Package checkoutprogress moves an anonymous checkout session along with the INCOMPLETE subscription its completion created (§9.12 rule 5): the billing module calls it, through its CheckoutFollower port, from the transaction that records the ACTIVATION paid and from the one that ends the subscription unpaid.
Package checkoutprogress moves an anonymous checkout session along with the INCOMPLETE subscription its completion created (§9.12 rule 5): the billing module calls it, through its CheckoutFollower port, from the transaction that records the ACTIVATION paid and from the one that ends the subscription unpaid.
modules/publicsdk/checkoutsweep
Package checkoutsweep is the work on anonymous checkout sessions no visitor's request does (§12.9, §16.2): the sync backstop's completions, of a setup the visitor finished without coming back; billing-lifecycle step (f), which completes or reaps the sessions still OPEN at their expiry; and step (h), which deletes the sessions closed longer ago than the retention.
Package checkoutsweep is the work on anonymous checkout sessions no visitor's request does (§12.9, §16.2): the sync backstop's completions, of a setup the visitor finished without coming back; billing-lifecycle step (f), which completes or reaps the sessions still OPEN at their expiry; and step (h), which deletes the sessions closed longer ago than the retention.
modules/publicsdk/completesessionpaymentmethodsession
Package completesessionpaymentmethodsession is POST /public/session/billing/payment-method-session/{sessionId}/complete (§14.4): once the customer is back from the setup page, the session is checked with the provider -- never the redirect -- and its payment method becomes the one charged, as the Core operation does (§12.5).
Package completesessionpaymentmethodsession is POST /public/session/billing/payment-method-session/{sessionId}/complete (§14.4): once the customer is back from the setup page, the session is checked with the provider -- never the redirect -- and its payment method becomes the one charged, as the Core operation does (§12.5).
modules/publicsdk/confirmcheckoutsession
Package confirmcheckoutsession is POST /public/checkout-sessions/{sessionId}/confirm (§14.8, §9.12): it completes an anonymous checkout -- the customer, the instance and the subscription, in one transaction under system:kaiten -- once nothing stands between the visitor and the plan.
Package confirmcheckoutsession is POST /public/checkout-sessions/{sessionId}/confirm (§14.8, §9.12): it completes an anonymous checkout -- the customer, the instance and the subscription, in one transaction under system:kaiten -- once nothing stands between the visitor and the plan.
modules/publicsdk/createcheckoutsession
Package createcheckoutsession is POST /public/checkout-sessions, the start of an anonymous checkout (Tier 2, V32-01, §14.8): a visitor the vendor's backend does not know yet picks a public plan on the vendor's page, passes a Turnstile challenge, and gets a session and its ksc_.
Package createcheckoutsession is POST /public/checkout-sessions, the start of an anonymous checkout (Tier 2, V32-01, §14.8): a visitor the vendor's backend does not know yet picks a public plan on the vendor's page, passes a Turnstile challenge, and gets a session and its ksc_.
modules/publicsdk/createsessioncheckout
Package createsessioncheckout is the self-serve checkout of the public SDK surface (§14.4): a vendor's customer, through a customer session bound to one of its instances, subscribes that instance to a public licence price -- with add-ons and a voucher -- in one call.
Package createsessioncheckout is the self-serve checkout of the public SDK surface (§14.4): a vendor's customer, through a customer session bound to one of its instances, subscribes that instance to a public licence price -- with add-ons and a voucher -- in one call.
modules/publicsdk/createsessionpaymentmethodsession
Package createsessionpaymentmethodsession is POST /public/session/billing/payment-method-session (§14.4): the provider-hosted page where a session's customer saves a payment method, opened as the Core operation opens it (§12.5), for the session's customer only.
Package createsessionpaymentmethodsession is POST /public/session/billing/payment-method-session (§14.4): the provider-hosted page where a session's customer saves a payment method, opened as the Core operation opens it (§12.5), for the session's customer only.
modules/publicsdk/createsessionportalsession
Package createsessionportalsession is POST /public/session/billing/portal-session (§14.4): the payment provider's customer portal, for the session's customer, opened as the Core operation opens it (§12.5).
Package createsessionportalsession is POST /public/session/billing/portal-session (§14.4): the payment provider's customer portal, for the session's customer, opened as the Core operation opens it (§12.5).
modules/publicsdk/events
Package events names the events the public SDK module records.
Package events names the events the public SDK module records.
modules/publicsdk/getcheckoutsession
Package getcheckoutsession is GET /public/checkout-sessions/{sessionId} (§14.8): an anonymous checkout session, as the ksc_ it was started with reads it -- so the page learns the outcome, up to 24 h after it closed.
Package getcheckoutsession is GET /public/checkout-sessions/{sessionId} (§14.8): an anonymous checkout session, as the ksc_ it was started with reads it -- so the page learns the outcome, up to 24 h after it closed.
modules/publicsdk/getcheckoutsessionadmin
Package getcheckoutsessionadmin is GET /checkout-sessions/{sessionId} (§13.18): one anonymous checkout as the vendor reads it.
Package getcheckoutsessionadmin is GET /checkout-sessions/{sessionId} (§13.18): one anonymous checkout as the vendor reads it.
modules/publicsdk/getpubliccatalog
Package getpubliccatalog is the public catalogue: what a vendor's pricing page renders, read with a publishable key (§14.4).
Package getpubliccatalog is the public catalogue: what a vendor's pricing page renders, read with a publishable key (§14.4).
modules/publicsdk/getsessionportal
Package getsessionportal is GET /public/session/portal (§14.4): everything the customer's portal shows, in one read -- who the customer is, the instance and its subscription, its quotas and where they come from, its add-ons and vouchers, the payment method, the next invoice, and what the portal may offer.
Package getsessionportal is GET /public/session/portal (§14.4): everything the customer's portal shows, in one read -- who the customer is, the instance and its subscription, its quotas and where they come from, its add-ons and vouchers, the payment method, the next invoice, and what the portal may offer.
modules/publicsdk/keys
Package keys is what the publishable key use cases share: the resource shape, the rules a key's label and origins must satisfy, minting the plaintext, and the dependencies.
Package keys is what the publishable key use cases share: the resource shape, the rules a key's label and origins must satisfy, minting the plaintext, and the dependencies.
modules/publicsdk/listcheckoutsessions
Package listcheckoutsessions is GET /checkout-sessions (§13.18): the organization's anonymous checkouts, newest first, for a vendor that links its buyers by reading rather than by events.
Package listcheckoutsessions is GET /checkout-sessions (§13.18): the organization's anonymous checkouts, newest first, for a vendor that links its buyers by reading rather than by events.
modules/publicsdk/listsessioninvoices
Package listsessioninvoices is GET /public/session/invoices: the invoices a customer session may read, as the session sees them.
Package listsessioninvoices is GET /public/session/invoices: the invoices a customer session may read, as the session sees them.
modules/publicsdk/reactivatesessionsubscription
Package reactivatesessionsubscription is POST /public/session/billing/reactivate (§14.4): the session's customer takes back a cancellation scheduled for the period's end, before it.
Package reactivatesessionsubscription is POST /public/session/billing/reactivate (§14.4): the session's customer takes back a cancellation scheduled for the period's end, before it.
modules/publicsdk/redeemsessionvoucher
Package redeemsessionvoucher is POST /public/session/vouchers/redeem (§11.6, V32-02): a customer redeems a code from its portal, on the instance its session is bound to, while that instance's subscription is live.
Package redeemsessionvoucher is POST /public/session/vouchers/redeem (§11.6, V32-02): a customer redeems a code from its portal, on the instance its session is bound to, while that instance's subscription is live.
modules/publicsdk/sessions
Package sessions is what the customer session use cases share.
Package sessions is what the customer session use cases share.
modules/publicsdk/setsessionaddonquantity
Package setsessionaddonquantity is PUT /public/session/addons/{addonSlug} (§14.4): the customer says how many of an add-on the session's instance holds.
Package setsessionaddonquantity is PUT /public/session/addons/{addonSlug} (§14.4): the customer says how many of an add-on the session's instance holds.
modules/publicsdk/telemetry
Package telemetry is the anonymous checkout's metrics (§19.1, V32-01): the Turnstile verifications, the sessions by the status they enter, the time from a start to its completion, and the completions that failed after a setup.
Package telemetry is the anonymous checkout's metrics (§19.1, V32-01): the Turnstile verifications, the sessions by the status they enter, the time from a start to its completion, and the completions that failed after a setup.
modules/publicsdk/validatesessionvoucher
Package validatesessionvoucher is POST /public/session/vouchers/validate (§14.4): a customer checks a code it was given before checking out with it.
Package validatesessionvoucher is POST /public/session/vouchers/validate (§14.4): a customer checks a code it was given before checking out with it.
modules/users
Package users owns JIT human identities and stored organization authorization.
Package users owns JIT human identities and stored organization authorization.
modules/users/createrole
Package createrole implements its Core user operation.
Package createrole implements its Core user operation.
modules/users/deleterole
Package deleterole implements its Core user operation.
Package deleterole implements its Core user operation.
modules/users/ensureuser
Package ensureuser converges on the user an external identity provider describes, and on their membership in the organization they are authenticating into.
Package ensureuser converges on the user an external identity provider describes, and on their membership in the organization they are authenticating into.
modules/users/getme
Package getme implements its Core user operation.
Package getme implements its Core user operation.
modules/users/getuser
Package getuser implements its Core user operation.
Package getuser implements its Core user operation.
modules/users/infrastructure/storage
Package storage owns validated, serialized users authorization writes.
Package storage owns validated, serialized users authorization writes.
modules/users/listroles
Package listroles implements its Core user operation.
Package listroles implements its Core user operation.
modules/users/listusers
Package listusers implements its Core user operation.
Package listusers implements its Core user operation.
modules/users/management
Package management implements scope-authorized human user management.
Package management implements scope-authorized human user management.
modules/users/putauthorization
Package putauthorization implements its Core user operation.
Package putauthorization implements its Core user operation.
modules/users/resolveauthorization
Package resolveauthorization resolves current human grants independently of authentication.
Package resolveauthorization resolves current human grants independently of authentication.
modules/users/resolveuser
Package resolveuser turns the external id an identity provider issued into the internal id every other user operation takes.
Package resolveuser turns the external id an identity provider issued into the internal id every other user operation takes.
modules/users/schema
Package schema defines users' stored, organization-membership authorization.
Package schema defines users' stored, organization-membership authorization.
modules/users/setuserassignments
Package setuserassignments implements its Core user operation.
Package setuserassignments implements its Core user operation.
modules/users/setuserenabled
Package setuserenabled implements its Core user operation.
Package setuserenabled implements its Core user operation.
modules/users/suggestusers
Package suggestusers lists live users whose external id starts with a prefix, so kaiten-admin-tools can complete the external-id flags its destructive commands take.
Package suggestusers lists live users whose external id starts with a prefix, so kaiten-admin-tools can complete the external-id flags its destructive commands take.
modules/users/updaterole
Package updaterole implements its Core user operation.
Package updaterole implements its Core user operation.
modules/users/updateuser
Package updateuser implements its Core user operation.
Package updateuser implements its Core user operation.
modules/vouchers
Package vouchers is the voucher module: the voucher catalogue and the vouchers instances redeem.
Package vouchers is the voucher module: the voucher catalogue and the vouchers instances redeem.
modules/vouchers/billablediscounts
Package billablediscounts is the PRICE vouchers an instance redeemed, and the PRICE parts of its COMPOSITE ones, as billing reads and consumes them: the voucher module's implementation of billing's ports.DiscountSource.
Package billablediscounts is the PRICE vouchers an instance redeemed, and the PRICE parts of its COMPOSITE ones, as billing reads and consumes them: the voucher module's implementation of billing's ports.DiscountSource.
modules/vouchers/catalogue
Package catalogue is what the voucher use cases share: the resource shapes, the caller and the billing gate, the rules a voucher must satisfy, and reading vouchers and redemptions.
Package catalogue is what the voucher use cases share: the resource shapes, the caller and the billing gate, the rules a voucher must satisfy, and reading vouchers and redemptions.
modules/vouchers/events
Package events names the events the voucher module records.
Package events names the events the voucher module records.
modules/vouchers/expiry
Package expiry is the voucher bookkeeping of the billing-lifecycle job (§11.5, §16.2 (b)): an ACTIVE voucher past its expiresAt becomes EXPIRED, with VOUCHER_EXPIRED, and an ACTIVE redemption past its window -- a boost that ran its course -- becomes EXPIRED, with INSTANCE_VOUCHER_EXPIRED.
Package expiry is the voucher bookkeeping of the billing-lifecycle job (§11.5, §16.2 (b)): an ACTIVE voucher past its expiresAt becomes EXPIRED, with VOUCHER_EXPIRED, and an ACTIVE redemption past its window -- a boost that ran its course -- becomes EXPIRED, with INSTANCE_VOUCHER_EXPIRED.
modules/vouchers/flaggrants
Package flaggrants is the vouchers module's read port for the flag evaluator (§7.4 rule 6, V32-03 c): the flag variants an instance's redemptions grant at the request's instant.
Package flaggrants is the vouchers module's read port for the flag evaluator (§7.4 rule 6, V32-03 c): the flag variants an instance's redemptions grant at the request's instant.
modules/vouchers/telemetry
Package telemetry is the vouchers module's metrics (§19.1), in the house's OpenTelemetry names: voucher_redemptions_total in the spec is kaiten.vouchers.redemptions here, exported as kaiten_vouchers_redemptions_total.
Package telemetry is the vouchers module's metrics (§19.1), in the house's OpenTelemetry names: voucher_redemptions_total in the spec is kaiten.vouchers.redemptions here, exported as kaiten_vouchers_redemptions_total.
platform/auth
Package auth turns the internal JWT a request arrives with into a principal.Principal.
Package auth turns the internal JWT a request arrives with into a principal.Principal.
platform/caller
Package caller is Kaiten's authorization vocabulary, expressed without reference to any transport.
Package caller is Kaiten's authorization vocabulary, expressed without reference to any transport.
platform/jit
Package jit provisions trusted identities after reverse-proxy authentication.
Package jit provisions trusted identities after reverse-proxy authentication.
platform/platformidentity
Package platformidentity holds the facts about system:kaiten -- the one identity that is the platform itself rather than a tenant's.
Package platformidentity holds the facts about system:kaiten -- the one identity that is the platform itself rather than a tenant's.
platform/targetorg
Package targetorg carries the organization a platform operation acts *on*, which is a different thing from the organization a request acts *as*.
Package targetorg carries the organization a platform operation acts *on*, which is a different thing from the organization a request acts *as*.
seeder
Package seeder provides a framework for seeding the database with test data.
Package seeder provides a framework for seeding the database with test data.
seeder/profiles/demo
Package demo implements the "demo" seed profile.
Package demo implements the "demo" seed profile.
seeder/profiles/dev
Package dev implements the local-development seed profile for the OSS-only local stack: the five TMNT identities on the Kaiten Sushi Shop org shell, no product data, usable straight away with the dev HS256 JWTs `seeder tokens` mints.
Package dev implements the local-development seed profile for the OSS-only local stack: the five TMNT identities on the Kaiten Sushi Shop org shell, no product data, usable straight away with the dev HS256 JWTs `seeder tokens` mints.
seeder/profiles/saas
Package saas implements the SaaS-context identity/org bootstrap: the five shared TMNT identities on Kaiten's own Dogfooding org and the (always empty) Demo Sandbox org.
Package saas implements the SaaS-context identity/org bootstrap: the five shared TMNT identities on Kaiten's own Dogfooding org and the (always empty) Demo Sandbox org.
seeder/profiles/stress-test
Package stresstest implements the high-volume stress-test seed profile.
Package stresstest implements the high-volume stress-test seed profile.
seeder/seedkit
Package seedkit holds reusable, declarative seeding helpers shared by the seeder profiles.
Package seedkit holds reusable, declarative seeding helpers shared by the seeder profiles.
shared/atomicfile
Package atomicfile atomically replaces files.
Package atomicfile atomically replaces files.
shared/integrationurl
Package integrationurl validates the optional `web_url` carried by per-entity integrations: the deep link to the record in the third-party system.
Package integrationurl validates the optional `web_url` carried by per-entity integrations: the deep link to the record in the third-party system.
shared/nullable
Package nullable publishes a response shape's absent members as JSON null (§13.15: `member|null`): present in every body, and nullable in the contract, which Huma does by itself only for pointers to primitives.
Package nullable publishes a response shape's absent members as JSON null (§13.15: `member|null`): present in every body, and nullable in the contract, which Huma does by itself only for pointers to primitives.
shared/pagination
Package pagination provides shared, generic building blocks for cursor-based (keyset/seek) pagination across this codebase's list endpoints: an opaque cursor codec (see cursor.go), a limit-clamping helper, and a generic response envelope.
Package pagination provides shared, generic building blocks for cursor-based (keyset/seek) pagination across this codebase's list endpoints: an opaque cursor codec (see cursor.go), a limit-clamping helper, and a generic response envelope.
shared/patchutil
Package patchutil provides small, pure, generic helpers for the recurring "patch/merge" shape used across the update use cases in this codebase: given a current persisted value and a partial patch (represented as a pointer, where nil conventionally means "not provided"), resolve the value that should be persisted and decide whether it actually changed.
Package patchutil provides small, pure, generic helpers for the recurring "patch/merge" shape used across the update use cases in this codebase: given a current persisted value and a partial patch (represented as a pointer, where nil conventionally means "not provided"), resolve the value that should be persisted and decide whether it actually changed.
shared/ratelimit
Package ratelimit is an in-memory token bucket per key, per replica: the API's own rate limits (§14.3), which the gateway's limiter cannot express because it is per proxy and per route, not per credential.
Package ratelimit is an in-memory token bucket per key, per replica: the API's own rate limits (§14.3), which the gateway's limiter cannot express because it is per proxy and per route, not per credential.
shared/ttlcache
Package ttlcache provides a minimal, generic, thread-safe in-memory cache with a single fixed TTL per instance and periodic background eviction of expired entries.
Package ttlcache provides a minimal, generic, thread-safe in-memory cache with a single fixed TTL per instance and periodic background eviction of expired entries.
pkg
apierrors
Package apierrors provides a unified error type for HTTP APIs, with Kinds that map to HTTP status codes.
Package apierrors provides a unified error type for HTTP APIs, with Kinds that map to HTTP status codes.
debezium
Package debezium provides types and helpers for consuming Debezium CDC events from the outbox_events table as delivered via the Dapr pub/sub pipeline.
Package debezium provides types and helpers for consuming Debezium CDC events from the outbox_events table as delivered via the Dapr pub/sub pipeline.
dogfooding
Package dogfooding holds the entitlement and entitlement-group slugs of kaiten's own metering catalogue -- the vocabulary, and nothing else.
Package dogfooding holds the entitlement and entitlement-group slugs of kaiten's own metering catalogue -- the vocabulary, and nothing else.
dogfoodingctx
Package dogfoodingctx builds the OFREP evaluation-context attributes kaiten uses for its own platform-internal flag checks -- the ones authenticated with a Dogfooding-org-scoped service token and evaluated about an arbitrary target org, rather than the org actually calling in.
Package dogfoodingctx builds the OFREP evaluation-context attributes kaiten uses for its own platform-internal flag checks -- the ones authenticated with a Dogfooding-org-scoped service token and evaluated about an arbitrary target org, rather than the org actually calling in.
externalid
Package externalid deterministically derives kaiten's internal organization/user UUIDs from external identity-provider ids (a self-hosted deployment's own IdP, local dev auth).
Package externalid deterministically derives kaiten's internal organization/user UUIDs from external identity-provider ids (a self-hosted deployment's own IdP, local dev auth).
fiberapi
Package fiberapi provides Fiber v3 HTTP glue for pkg/apierrors: RFC 9457 Problem Details error responses and a generic body-parse-and-validate helper.
Package fiberapi provides Fiber v3 HTTP glue for pkg/apierrors: RFC 9457 Problem Details error responses and a generic body-parse-and-validate helper.
secretfile
Package secretfile reads a secret (a bearer token, a signing key, a service-account JWT) from a mounted file -- the standard shape for a Kubernetes-mounted Secret volume, for every plain-text credential not read from Vault directly.
Package secretfile reads a secret (a bearer token, a signing key, a service-account JWT) from a mounted file -- the standard shape for a Kubernetes-mounted Secret volume, for every plain-text credential not read from Vault directly.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL