mesa-doc /mesa-pro/docs/license-issuer
docs

License issuer (MESA Pro)

Ed25519 licenses are signed here; the base @modu/contracts (and the base modu license verify CLI) is the canonical verifier. The private key never enters mesa or this repository.

Format

base64(payloadJson) + "." + base64(ed25519_signature)
  • Payload: { customer, issuedAt, expiresAt?, features?, limits? } (JSON object).
  • limits: { projects?: number, plugins?: string[] } — Pro command authorization control items. Base only verifies/passes them; Pro decides what a plugin id means.
  • Public key: 32-byte Ed25519 raw key, base64. The base verifier wraps it in an SPKI DER container.
  • The signature covers the exact payload bytes (no canonicalization step; do not re-serialize an existing license before verifying).

Issue

mesa-license issue --customer "ACME" --private-key-file ./issuer.pem \
  --expires-at 2027-12-31T23:59:59Z --features mcp,packs \
  --preset datasource.mqtt --projects 10 --out acme.license --json
  • --json prints { ok, customer, publicKey, license, out? }; text mode prints the license on stdout and the public key on stderr.
  • The private key file is read only; keep it 0600. The CLI warns when group/other bits are set.
  • --issued-at defaults to now; all timestamps are RFC3339.

Dev mode(本机开发用)

没有 license 时 mesa-mcp 走「未授权开发模式」:记忆读写(context_read/write/list)不受影响, 只有写配置类工具默认关闭。要消除提示并打开 APPLY,按下面一次性签发开发 license:

cd mesa-pro
mkdir -p .dev-license
# 1) 生成 Ed25519 私钥(0600;只用于本机;绝不入库)
node --input-type=module -e 'import {generateKeyPairSync} from "node:crypto"; import {writeFileSync} from "node:fs"; const {privateKey}=generateKeyPairSync("ed25519"); writeFileSync(".dev-license/issuer.pem", privateKey.export({format:"pem",type:"pkcs8"}), {mode:0o600})'

# 2) 签发(--json 输出里的 publicKey 记下来)
mesa-license issue --customer dev-local --private-key-file .dev-license/issuer.pem \
  --features mcp,extension,datasource,packs --preset enterprise --projects 100 \
  --expires-at 2030-12-31T23:59:59Z --out .dev-license/dev.license --json

# 3) 环境(base 校验器读 MODU_LICENSE_PUBLIC_KEY;launcher 读 MESA_LICENSE_PUBLIC_KEY)
export MESA_LICENSE_FILE="$PWD/.dev-license/dev.license"
export MODU_LICENSE_PUBLIC_KEY='<第 2 步输出的 publicKey>'
export MESA_LICENSE_PUBLIC_KEY="$MODU_LICENSE_PUBLIC_KEY"
export MESA_MCP_ALLOW_APPLY=1     # 需要写配置类工具时

# 4) 验证
modu license verify "$MESA_LICENSE_FILE" --public-key "$MODU_LICENSE_PUBLIC_KEY" --json
mesa-mcp   # stderr 应变成:mesa-mcp: license dev-local · projects=100 · plugins=*

注意:

  • 无 license 时不影响记忆(context_* 与 modu memory 都可用),只是 APPLY 工具默认关。
  • .dev-license/ 与 *.license 已在 .gitignore;开发密钥与生产签发密钥必须分开,轮换前不要复用。
  • --preset enterprise 给 plugins: ["*"]、projects: 100;要更贴近客户形态就换 starter/cockpit/datasource.*。

Verify (base CLI)

modu license verify acme.license --public-key "$(cat issuer.pub)"

The base CLI prints { ok, customer, issuedAt, expiresAt, features } and exits 0/1. A tampered payload or the wrong public key fails signature verification; an expired expiresAt fails with license 已过期.

Boundary

  • Signing is commercial and lives in mesa-pro; verification is free forever in the base.
  • Keys are operator-managed (KMS or a 0600 file); do not commit *.pem, *.key, or licenses.
  • Feature names are advisory to the base; the base only verifies the payload and expiry. Pro decides which features a customer may use.

源文件 · mesa-pro/docs/license-issuer.md