v0.33.0¶
Release Date: 2026-11-12
A deployment can sell its plans with configuration alone: SystemAuth wires
billing from a billing section and the host's pricing spec, and
organizations choose and pay for a plan in the organization console. An
operator can put an organization on a plan by hand, and billing leaves it
there.
Billing in the organization console¶
- Billing from configuration. A
billingsection holds the Stripe secret key and the webhook signing secrets, as secret references. The host passes its pricing spec assystemauthsvc.Options.Pricing, and may passOptions.OnPlanChangefor state of its own that follows the plan (ADR-021). - Free mode. A
billingsection without a key is valid. Every organization is on the spec's default plan, the console shows the plans without a way to buy, and no webhook is served. Setting the key's secret later turns payments on. - The webhook is served on the SystemAuth host at
/billing/webhook. On PostgreSQL its locks are held in the database, so several instances can serve it. - The console's billing API, under
/console/api/v1/organizations/{org}/billing: the organization's plan, its subscription and the spec's pricing view for any member, and checkout and the customer portal for owners and admins. A person outside the organization gets404. - Return addresses fixed on the server. Checkout and the portal return
the buyer to the organization's billing page in the console. A configured
URL may name
{organization}(billing.OrganizationPlaceholder), filled with the organization the caller was authorized for. - Local test mode. With a test key, names under
localhost, such asauth.localhost, count as loopback hosts for return addresses (RFC 6761). A live key still refuses every loopback host. - The plan to enforce.
Service.OrganizationPlanandbilling.OrganizationPlanreturn the organization's plan from the spec at the moment of a check, so applications keep no copy of their own. - Price sync.
systemauthsvc.SyncPricescreates or updates Stripe's products and prices from the spec, reading only the configuration's key.
Plans set by the operator¶
- An operator's plan on the platform subscription
(ADR-022), with a
note of at most 200 characters and the time it was set. While it is set it
is the organization's plan for
OrganizationPlan, the entitlements, the authorization graph andGetPlanTier, whatever the subscription's status, and in free mode too. - Billing never writes it. Subscription events keep updating the subscription underneath, so a paid plan takes effect again when the operator's plan is cleared.
- Checkout does not sell over it. Plan checkout answers
409while it is set, and the console's billing status reportssetByOperator. - Any plan of the spec, including internal plans, which the pricing view and checkout leave out.
The host's billing command¶
billingcmd.Command adds billing to a host's Cobra CLI:
billing sync [--dry-run]creates or updates Stripe's products and prices from the spec, without starting the service.billing plan list|show|set|clearmanages operators' plans, naming an organization by its slug, its ID or its owner's email address.
Fixes¶
- In free mode every organization is on the default plan, even one with a paid subscription stored from an earlier configuration.
- Billing accepts a storage client the host passes in; the database check runs once storage is open.
- An operator's note is limited by characters, not bytes.
- Tests that made two tokens in a row no longer fail on Windows, where the clock can return the same time for both.
The release adds no breaking change.
Known issues¶
marketplace.EntitlementSourcestill grants a stored paid plan in free mode, unlikeOrganizationPlan. A deployment in free mode that once took payments should rely onOrganizationPlanuntil this is fixed. Resolved in v0.34.0 bymarketplace.WithoutPayments.- The billing page of
@plexusone/consoleships in a systemforge-web release; until then the console serves only the billing API.
Upgrading¶
Run the schema migration. It adds three nullable columns to
sf_subscriptions for the operator's plan, which every query of
subscriptions reads, with or without billing. The systemauth binary
migrates at startup by default; a host that sets Options.Migrate to false
runs systemauth migrate or Schema.Create first. No SQL migration is
needed.
To sell plans:
- Pass the pricing spec as
Options.Pricingand add abillingsection; it starts in free mode. - Add
billingcmd.Commandto the host's CLI. - Set the Stripe key's secret, then run
billing sync. - Add the Stripe webhook endpoint and set its signing secret.
See Selling plans from the console.
Planned: support requests and feedback¶
The design of support requests and feedback in every application is updated (ADR-019): SystemForge supplies the interfaces and the mail desk, and a host composes its own help desks and bot challenge. Nothing of it ships in this release.
Dependencies¶
github.com/plexusone/payforge0.1.1.github.com/plexusone/systemspec-pricingpackaging0.2.0, with internal plans.github.com/opensecurity-dev/ocsf-schema-go0.3.0, the OCSF types' new module path, replacinggithub.com/grokify/ocsf-schema-go.github.com/authzed/spicedb1.57.1,github.com/jackc/pgx/v55.13.0,github.com/mattn/go-sqlite31.14.53,github.com/spf13/pflag1.1.0,golang.org/x/crypto0.59.0,golang.org/x/oauth20.38.0 andgolang.org/x/sys0.50.0.