@stigmer/enterprise 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,13 +46,13 @@ docker run -d -p 7234:7234 -p 7235:7235 -v stigmer-data:/data \
46
46
  ghcr.io/stigmer/stigmer-server-ee:latest
47
47
  ```
48
48
 
49
- The image reads the variables in the table above, and everything the open-source image reads. A key it cannot verify stops the container with exit code 1 and one `boot failed:` line saying why. An image only trusts the signing keys compiled into its release, and none is compiled in yet: until a release carries the production key, every image refuses every key, and runs as open source without one. A licensed server refuses to start without Postgres or without sign-in (`STIGMER_OIDC_ISSUER`). One whose license may hold more than one organization also refuses to start with no sandbox driver that isolates a session (`SANDBOX_PROVISIONER_TYPE` set to `docker`, `agent-sandbox` or `substrate`), because every organization's agents would share one runner, unless `STIGMER_SHARED_RUNNER_ACROSS_ORGANIZATIONS=accepted` says the operator accepts that; the example above sets neither, so add one of them, or use a license with `maxOrgs: 1`.
49
+ The image reads the variables in the table above, and everything the open-source image reads. A key it cannot verify stops the container with exit code 1 and one `boot failed:` line saying why. An image only trusts the signing keys compiled into its release (`src/license/trusted-keys.ts`): from 0.1.1, Stigmer's own issuer's key, `license-signing:v1`, so a license Stigmer issues verifies, and any other key is refused. With no key the image runs as open source. A licensed server refuses to start without Postgres or without sign-in (`STIGMER_OIDC_ISSUER`). One whose license may hold more than one organization also refuses to start with no sandbox driver that isolates a session (`SANDBOX_PROVISIONER_TYPE` set to `docker`, `agent-sandbox` or `substrate`), because every organization's agents would share one runner, unless `STIGMER_SHARED_RUNNER_ACROSS_ORGANIZATIONS=accepted` says the operator accepts that; the example above sets neither, so add one of them, or use a license with `maxOrgs: 1`.
50
50
 
51
51
  On Kubernetes, the repository's Helm chart runs this image: a license Secret named in `enterprise.license.existingSecret` switches the chart's server to it, with the settings above as chart values and an outbound network fence on by default (`deploy/helm/stigmer/README.md`, "Stigmer Enterprise").
52
52
 
53
53
  Its labels say what it holds: `org.opencontainers.image.title` is `stigmer-server-ee`, and `org.opencontainers.image.licenses` is `LicenseRef-Stigmer-Enterprise AND Apache-2.0`, this package under `LICENSE` (which sits beside `main.js` in `/app`) and the open-source server under the Apache License 2.0.
54
54
 
55
- Tags: `vX.Y.Z` for each release; `latest` moves only to a stable release, after the pushed image has passed its smoke on native runners of both architectures. Local build and smoke: `make smoke-ee-image`, which bundles the tree (`make bundle-ee-slim`) and runs `scripts/smoke-image.mjs`: the labels, the open-source server's own image smoke with no key, and two keys it cannot verify refused.
55
+ Tags: `vX.Y.Z` for each release; `latest` moves only to a stable release, after the pushed image has passed its smoke on native runners of both architectures. Local build and smoke: `make smoke-ee-image`, which bundles the tree (`make bundle-ee-slim`) and runs `scripts/smoke-image.mjs`: the labels, the open-source server's own image smoke with no key, and two keys it cannot verify refused; with a license from Stigmer's issuer in `STIGMER_EE_SMOKE_LICENSE_KEY`, also a licensed boot reading edition `enterprise`, and that license with one claim changed refused. Each release runs it with a license (`--require-license`) before `latest` moves.
56
56
 
57
57
  ## Using it as a library
58
58
 
@@ -23,9 +23,13 @@
23
23
  * kid compiled twice is refused too: the second entry would replace the
24
24
  * first, and a rotation that reused a kid would drop a trusted key.
25
25
  *
26
- * The ring is empty until the production issuer's key is compiled in, so
27
- * every license key is refused as `unknown-key` until then. Tests pass a
28
- * ring of their own to the verifier and never touch this one.
26
+ * The ring holds the production issuer's key: Stigmer Cloud's Transit key
27
+ * `license-signing`, whose kid is the key's name and version. A rotation
28
+ * adds the next version beside it. A rebuilt vault starts its versions at
29
+ * 1 again, so it signs under a new key name and never reuses a kid; the
30
+ * twice-listed refusal above turns a reused one into a failed build. Tests
31
+ * pass a ring of their own to the verifier and never touch this one, except
32
+ * the case that pins this ring's exact contents.
29
33
  */
30
34
  /** One compiled key: its `kid` and its raw Ed25519 public key in base64. */
31
35
  export type CompiledLicenseKey = readonly [keyId: string, publicKeyBase64: string];
@@ -1 +1 @@
1
- {"version":3,"file":"trusted-keys.d.ts","sourceRoot":"","sources":["../../src/license/trusted-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;AAOnF,8DAA8D;AAC9D,wBAAgB,kBAAkB,IAAI,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAEpE;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,GACzC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAejC"}
1
+ {"version":3,"file":"trusted-keys.d.ts","sourceRoot":"","sources":["../../src/license/trusted-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;AAUnF,8DAA8D;AAC9D,wBAAgB,kBAAkB,IAAI,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAEpE;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,GACzC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAejC"}
@@ -23,13 +23,20 @@
23
23
  * kid compiled twice is refused too: the second entry would replace the
24
24
  * first, and a rotation that reused a kid would drop a trusted key.
25
25
  *
26
- * The ring is empty until the production issuer's key is compiled in, so
27
- * every license key is refused as `unknown-key` until then. Tests pass a
28
- * ring of their own to the verifier and never touch this one.
26
+ * The ring holds the production issuer's key: Stigmer Cloud's Transit key
27
+ * `license-signing`, whose kid is the key's name and version. A rotation
28
+ * adds the next version beside it. A rebuilt vault starts its versions at
29
+ * 1 again, so it signs under a new key name and never reuses a kid; the
30
+ * twice-listed refusal above turns a reused one into a failed build. Tests
31
+ * pass a ring of their own to the verifier and never touch this one, except
32
+ * the case that pins this ring's exact contents.
29
33
  */
30
34
  /** The raw length of an Ed25519 public key. */
31
35
  const ED25519_PUBLIC_KEY_BYTES = 32;
32
- const COMPILED_LICENSE_KEYS = Object.freeze([]);
36
+ const COMPILED_LICENSE_KEYS = Object.freeze([
37
+ // Stigmer Cloud production's license-signing key, first signed 2026-11-06.
38
+ Object.freeze(["license-signing:v1", "2eKKaLG5hUNtnf0BU9GPFqXJ1GFHbQVnHZGusyLcg/4="]),
39
+ ]);
33
40
  /** The ring this build trusts, built afresh on every call. */
34
41
  export function trustedLicenseKeys() {
35
42
  return licenseKeyRing(COMPILED_LICENSE_KEYS);
@@ -1 +1 @@
1
- {"version":3,"file":"trusted-keys.js","sourceRoot":"","sources":["../../src/license/trusted-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,+CAA+C;AAC/C,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEpC,MAAM,qBAAqB,GAAsC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEnF,8DAA8D;AAC9D,MAAM,UAAU,kBAAkB;IAChC,OAAO,cAAc,CAAC,qBAAqB,CAAC,CAAC;AAC/C,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,cAAc,CAC5B,OAA0C;IAE1C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC3C,KAAK,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,OAAO,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,mBAAmB,CAAC,CAAC;QACzE,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;QACnD,IA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,GAAG,CAAC,MAAM,KAAK,wBAAwB,EAAE,CAAC;YAC1F,MAAM,IAAI,KAAK,CACb,6BAA6B,KAAK,sCAAsC,wBAAwB,0BAA0B,CAC3H,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigmer/enterprise",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Stigmer Enterprise: many organizations, federation with the platforms whose tokens it trusts, teams and invitations, on the open-source Stigmer server, turned on by a license key.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -53,9 +53,9 @@
53
53
  "@bufbuild/protobuf": "2.12.0",
54
54
  "@bufbuild/protovalidate": "^1.1.1",
55
55
  "@connectrpc/connect": "^2.0.0",
56
- "@stigmer/apis": "0.1.0",
57
- "@stigmer/outbound": "0.1.0",
58
- "@stigmer/server": "0.1.0",
56
+ "@stigmer/apis": "0.1.1",
57
+ "@stigmer/outbound": "0.1.1",
58
+ "@stigmer/server": "0.1.1",
59
59
  "pg": "8.23.0"
60
60
  },
61
61
  "devDependencies": {
@@ -3,8 +3,10 @@
3
3
  *
4
4
  * - every read is a fresh ring: a key added to one copy, or a byte
5
5
  * changed in one copy's key, never reaches the next read. Proved on a
6
- * ring of a test key, because the compiled ring is empty until the
7
- * production issuer's key is compiled in;
6
+ * ring of a test key, whose private half the test holds;
7
+ * - the compiled ring is exactly the production issuer's keys written
8
+ * below, so adding, dropping or editing a trusted key is a deliberate
9
+ * change in two places;
8
10
  * - every compiled key decodes, and the decoding refuses a key that is
9
11
  * not canonical base64 of 32 bytes, and a kid listed twice, so a
10
12
  * mangled or repeated paste fails here rather than at a customer's
@@ -53,6 +55,14 @@ describe("licenseKeyRing", () => {
53
55
  });
54
56
 
55
57
  describe("trustedLicenseKeys", () => {
58
+ it("trusts exactly the production issuer's keys", () => {
59
+ const ring = trustedLicenseKeys();
60
+ expect([...ring.keys()]).toEqual(["license-signing:v1"]);
61
+ expect(Buffer.from(ring.get("license-signing:v1") ?? new Uint8Array()).toString("base64")).toBe(
62
+ "2eKKaLG5hUNtnf0BU9GPFqXJ1GFHbQVnHZGusyLcg/4=",
63
+ );
64
+ });
65
+
56
66
  it("decodes every compiled key to 32 bytes and hands each caller its own ring", () => {
57
67
  const ring = trustedLicenseKeys();
58
68
  for (const [kid, raw] of ring) {
@@ -23,9 +23,13 @@
23
23
  * kid compiled twice is refused too: the second entry would replace the
24
24
  * first, and a rotation that reused a kid would drop a trusted key.
25
25
  *
26
- * The ring is empty until the production issuer's key is compiled in, so
27
- * every license key is refused as `unknown-key` until then. Tests pass a
28
- * ring of their own to the verifier and never touch this one.
26
+ * The ring holds the production issuer's key: Stigmer Cloud's Transit key
27
+ * `license-signing`, whose kid is the key's name and version. A rotation
28
+ * adds the next version beside it. A rebuilt vault starts its versions at
29
+ * 1 again, so it signs under a new key name and never reuses a kid; the
30
+ * twice-listed refusal above turns a reused one into a failed build. Tests
31
+ * pass a ring of their own to the verifier and never touch this one, except
32
+ * the case that pins this ring's exact contents.
29
33
  */
30
34
 
31
35
  /** One compiled key: its `kid` and its raw Ed25519 public key in base64. */
@@ -34,7 +38,10 @@ export type CompiledLicenseKey = readonly [keyId: string, publicKeyBase64: strin
34
38
  /** The raw length of an Ed25519 public key. */
35
39
  const ED25519_PUBLIC_KEY_BYTES = 32;
36
40
 
37
- const COMPILED_LICENSE_KEYS: ReadonlyArray<CompiledLicenseKey> = Object.freeze([]);
41
+ const COMPILED_LICENSE_KEYS: ReadonlyArray<CompiledLicenseKey> = Object.freeze([
42
+ // Stigmer Cloud production's license-signing key, first signed 2026-11-06.
43
+ Object.freeze(["license-signing:v1", "2eKKaLG5hUNtnf0BU9GPFqXJ1GFHbQVnHZGusyLcg/4="] as const),
44
+ ]);
38
45
 
39
46
  /** The ring this build trusts, built afresh on every call. */
40
47
  export function trustedLicenseKeys(): ReadonlyMap<string, Uint8Array> {