@substrat-run/vertical-auth 0.25.3 → 0.26.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.
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * The `AuthProvider` contract — the ONLY thing a vertical's app depends on for identity.
3
3
  *
4
- * The application codes to this interface and does not care WHICH auth is behind it: Better
5
- * Auth running in a per-tenant Durable Object (`identity-do.ts`), an OIDC issuer (`oidc.ts`),
6
- * or a test mock all satisfy it. Swapping the implementation never touches the app.
4
+ * The application codes to this interface: OIDC bearer verification, the browser
5
+ * relying-party flow, or a test mock all satisfy it. Swapping the implementation never touches the app.
7
6
  *
8
7
  * - `handle` — the credential/session endpoints (`/api/auth/*`): sign-up, login, logout,
9
8
  * callbacks. The worker forwards the raw request; the provider owns what's behind it.
@@ -12,7 +11,7 @@
12
11
  * per-scope concern (the identity directory), not the provider's job.
13
12
  */
14
13
  export interface AuthSubject {
15
- /** The provider's stable subject id — a Better Auth user id, an OIDC `sub`, … */
14
+ /** The provider's stable subject id — an OIDC `sub` */
16
15
  sub: string;
17
16
  email: string | null;
18
17
  name: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACjD;AAED,wGAAwG;AACxG,MAAM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AAE,cAAc,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAChG"}
@@ -3,7 +3,7 @@
3
3
  * its sites (each site IS a scope), so it can list and switch between them CP-lessly. Kept as
4
4
  * plain functions over a minimal SQLite `exec` seam rather than methods on the IdentityDO, so
5
5
  * the logic is unit-testable against a plain SQLite without standing up a Durable Object (the
6
- * DO module pulls in Better Auth, which the workers test pool cannot load). The IdentityDO's
6
+ * DO module imports cloudflare:workers, which a Node test pool cannot load). The IdentityDO's
7
7
  * `recordSite`/`listSites`/`resolveSiteScope` delegate here.
8
8
  */
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  * its sites (each site IS a scope), so it can list and switch between them CP-lessly. Kept as
4
4
  * plain functions over a minimal SQLite `exec` seam rather than methods on the IdentityDO, so
5
5
  * the logic is unit-testable against a plain SQLite without standing up a Durable Object (the
6
- * DO module pulls in Better Auth, which the workers test pool cannot load). The IdentityDO's
6
+ * DO module imports cloudflare:workers, which a Node test pool cannot load). The IdentityDO's
7
7
  * `recordSite`/`listSites`/`resolveSiteScope` delegate here.
8
8
  */
9
9
  /** The `site` table (+ slug index), folded into the IdentityDO's schema statements. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@substrat-run/vertical-auth",
3
- "version": "0.25.3",
4
- "description": "Pluggable auth for Substrat verticals — the AuthProvider contract, an OIDC provider (Supabase/Auth0/AuthHero/Keycloak), a full relying-party login flow, and a per-tenant identity Durable Object (Better Auth + sub→principal directory). Workers-targeted; the vertical worker bundles it.",
3
+ "version": "0.26.1",
4
+ "description": "OIDC authentication for Substrat verticals — token verification, a full relying-party login flow, and a per-tenant identity directory Durable Object. Workers-targeted; the vertical worker bundles it.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
7
7
  "type": "git",
@@ -49,13 +49,11 @@
49
49
  "dist"
50
50
  ],
51
51
  "dependencies": {
52
- "better-auth": "^1.7.1",
53
- "drizzle-orm": "^0.45.2",
54
52
  "jose": "^6.2.3",
55
- "@substrat-run/contracts": "^0.154.0",
53
+ "@substrat-run/contracts": "^0.156.0",
54
+ "@substrat-run/kernel": "^0.156.0",
56
55
  "@substrat-run/oidc-rp": "^0.13.0",
57
- "@substrat-run/psl": "^0.2.5",
58
- "@substrat-run/kernel": "^0.154.0"
56
+ "@substrat-run/psl": "^0.2.5"
59
57
  },
60
58
  "peerDependencies": {
61
59
  "hono": "^4.13.13"
@@ -64,7 +62,9 @@
64
62
  "@cloudflare/workers-types": "^4.20250109.0",
65
63
  "@types/better-sqlite3": "^9.6.0",
66
64
  "better-sqlite3": "^13.0.3",
65
+ "esbuild": "^0.28.2",
67
66
  "hono": "^4.13.13",
67
+ "miniflare": "^4.20260310.0",
68
68
  "typescript": "^7.0.0",
69
69
  "vitest": "^5.0.5"
70
70
  },