Skip to content

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 billing section holds the Stripe secret key and the webhook signing secrets, as secret references. The host passes its pricing spec as systemauthsvc.Options.Pricing, and may pass Options.OnPlanChange for state of its own that follows the plan (ADR-021).
  • Free mode. A billing section 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 gets 404.
  • 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 as auth.localhost, count as loopback hosts for return addresses (RFC 6761). A live key still refuses every loopback host.
  • The plan to enforce. Service.OrganizationPlan and billing.OrganizationPlan return the organization's plan from the spec at the moment of a check, so applications keep no copy of their own.
  • Price sync. systemauthsvc.SyncPrices creates 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 and GetPlanTier, 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 409 while it is set, and the console's billing status reports setByOperator.
  • 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|clear manages 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.EntitlementSource still grants a stored paid plan in free mode, unlike OrganizationPlan. A deployment in free mode that once took payments should rely on OrganizationPlan until this is fixed. Resolved in v0.34.0 by marketplace.WithoutPayments.
  • The billing page of @plexusone/console ships 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:

  1. Pass the pricing spec as Options.Pricing and add a billing section; it starts in free mode.
  2. Add billingcmd.Command to the host's CLI.
  3. Set the Stripe key's secret, then run billing sync.
  4. 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/payforge 0.1.1.
  • github.com/plexusone/systemspec-pricingpackaging 0.2.0, with internal plans.
  • github.com/opensecurity-dev/ocsf-schema-go 0.3.0, the OCSF types' new module path, replacing github.com/grokify/ocsf-schema-go.
  • github.com/authzed/spicedb 1.57.1, github.com/jackc/pgx/v5 5.13.0, github.com/mattn/go-sqlite3 1.14.53, github.com/spf13/pflag 1.1.0, golang.org/x/crypto 0.59.0, golang.org/x/oauth2 0.38.0 and golang.org/x/sys 0.50.0.