@pithy-sh/auth 0.7.0 → 0.9.0
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 +4 -0
- package/dist/caller/certificate.d.ts +83 -0
- package/dist/caller/certificate.d.ts.map +1 -0
- package/dist/caller/certificate.js +92 -0
- package/dist/caller/request.d.ts +66 -0
- package/dist/caller/request.d.ts.map +1 -0
- package/dist/caller/request.js +71 -0
- package/dist/caller/token.d.ts +130 -0
- package/dist/caller/token.d.ts.map +1 -0
- package/dist/caller/token.js +207 -0
- package/dist/capability.d.ts +44 -1
- package/dist/capability.d.ts.map +1 -1
- package/dist/capability.js +7 -4
- package/dist/data/betterAuth.d.ts +1 -1
- package/dist/data/betterAuth.d.ts.map +1 -1
- package/dist/data/betterAuth.js +1 -1
- package/dist/data/tables.d.ts +1 -1
- package/dist/http/adminRoutes.d.ts.map +1 -1
- package/dist/http/adminRoutes.js +39 -8
- package/dist/http/credentialResign.d.ts +46 -0
- package/dist/http/credentialResign.d.ts.map +1 -0
- package/dist/http/credentialResign.js +203 -0
- package/dist/http/devLoginRoute.d.ts.map +1 -1
- package/dist/http/devLoginRoute.js +12 -5
- package/dist/http/errorCallbackUrl.d.ts.map +1 -1
- package/dist/http/errorCallbackUrl.js +15 -9
- package/dist/http/middleware.d.ts.map +1 -1
- package/dist/http/middleware.js +66 -15
- package/dist/http/providerRefusal.d.ts +8 -7
- package/dist/http/providerRefusal.d.ts.map +1 -1
- package/dist/http/providerRefusal.js +29 -32
- package/dist/http/resolve.d.ts.map +1 -1
- package/dist/http/resolve.js +18 -3
- package/dist/http/responses.d.ts +52 -0
- package/dist/http/responses.d.ts.map +1 -1
- package/dist/http/responses.js +25 -1
- package/dist/http/routes.d.ts.map +1 -1
- package/dist/http/routes.js +60 -9
- package/dist/http/schemas.d.ts +1 -1
- package/dist/http/schemas.js +1 -1
- package/dist/instance/auth.d.ts +1225 -2
- package/dist/instance/auth.d.ts.map +1 -1
- package/dist/instance/auth.js +6 -2
- package/dist/instance/jwksReencryption.d.ts +75 -0
- package/dist/instance/jwksReencryption.d.ts.map +1 -0
- package/dist/instance/jwksReencryption.js +160 -0
- package/dist/instance/providerSignInGate.d.ts +7 -6
- package/dist/instance/providerSignInGate.d.ts.map +1 -1
- package/dist/instance/providerSignInGate.js +16 -14
- package/dist/instance/providers.d.ts.map +1 -1
- package/dist/instance/providers.js +2 -1
- package/dist/instance/secrets.d.ts +168 -1
- package/dist/instance/secrets.d.ts.map +1 -1
- package/dist/instance/secrets.js +86 -3
- package/dist/instance/sessionSecrets.d.ts +45 -0
- package/dist/instance/sessionSecrets.d.ts.map +1 -0
- package/dist/instance/sessionSecrets.js +29 -0
- package/dist/migrations/0001_init.d.ts.map +1 -1
- package/dist/migrations/0003_account_issuer_nullable.d.ts +5 -0
- package/dist/migrations/0003_account_issuer_nullable.d.ts.map +1 -0
- package/dist/migrations/0003_account_issuer_nullable.js +131 -0
- package/dist/migrations/set.d.ts +2 -1
- package/dist/migrations/set.d.ts.map +1 -1
- package/dist/migrations/set.js +4 -2
- package/dist/seeds/devSession.d.ts.map +1 -1
- package/dist/seeds/devSession.js +2 -1
- package/dist/test-utils/liveApp.d.ts +5 -0
- package/dist/test-utils/liveApp.d.ts.map +1 -1
- package/dist/test-utils/liveApp.js +3 -3
- package/dist/test-utils/schemaDrift.d.ts +49 -0
- package/dist/test-utils/schemaDrift.d.ts.map +1 -0
- package/dist/test-utils/schemaDrift.js +35 -0
- package/dist/test-utils/scopedBackend.d.ts +183 -0
- package/dist/test-utils/scopedBackend.d.ts.map +1 -0
- package/dist/test-utils/scopedBackend.js +160 -0
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/docs/server-authoritative.md +182 -0
- package/package.json +14 -11
- package/src/caller/certificate.ts +133 -0
- package/src/caller/request.ts +84 -0
- package/src/caller/token.ts +276 -0
- package/src/capability.ts +65 -4
- package/src/data/betterAuth.ts +2 -1
- package/src/http/adminRoutes.ts +46 -10
- package/src/http/credentialResign.ts +268 -0
- package/src/http/devLoginRoute.ts +19 -6
- package/src/http/errorCallbackUrl.ts +21 -13
- package/src/http/middleware.ts +100 -35
- package/src/http/providerRefusal.ts +30 -32
- package/src/http/resolve.ts +27 -3
- package/src/http/responses.ts +54 -0
- package/src/http/routes.ts +97 -11
- package/src/http/schemas.ts +1 -1
- package/src/instance/auth.ts +22 -4
- package/src/instance/jwksReencryption.ts +206 -0
- package/src/instance/providerSignInGate.ts +23 -21
- package/src/instance/providers.ts +2 -1
- package/src/instance/secrets.ts +94 -1
- package/src/instance/sessionSecrets.ts +64 -0
- package/src/migrations/0001_init.ts +8 -10
- package/src/migrations/0003_account_issuer_nullable.ts +199 -0
- package/src/migrations/set.ts +3 -1
- package/src/seeds/devSession.ts +2 -1
- package/src/test-utils/liveApp.ts +8 -6
- package/src/test-utils/schemaDrift.ts +82 -0
- package/src/test-utils/scopedBackend.ts +136 -0
- package/src/version.generated.ts +1 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Pithy
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import type { D1Database } from "@cloudflare/workers-types";
|
|
4
|
+
import type { SecretsStoreEnv } from "@pithy-sh/secrets/src/env/bindings";
|
|
5
|
+
import { type SecretFixture } from "@pithy-sh/secrets/src/test-utils/secretFixtures";
|
|
6
|
+
import type { Migration } from "kysely/migration";
|
|
7
|
+
/**
|
|
8
|
+
* The fixtures a workers suite needs to put a **real** `auth()` in front of a request (#560).
|
|
9
|
+
*
|
|
10
|
+
* The scope gates in `leaderboard`, `rating` and `ledger` were each tested against a stub middleware that
|
|
11
|
+
* wrote `c.var.auth` itself, so every one of them passed while nothing real could ever open it. A suite
|
|
12
|
+
* built on this composes the actual capability through `createBackend` and signs a user in with the actual
|
|
13
|
+
* Better Auth instance, so what reaches a gate is what a deployed Worker would put there.
|
|
14
|
+
*
|
|
15
|
+
* It holds the pieces and not the composition. Which capabilities sit beside auth is the suite's own
|
|
16
|
+
* statement, and so is the probe it reads the request through.
|
|
17
|
+
*/
|
|
18
|
+
/** The session secret these suites sign with. A throwaway: it authenticates nothing anywhere. */
|
|
19
|
+
export declare const SCOPED_SESSION_SECRET = "scoped-backend-secret-please-rotate-000";
|
|
20
|
+
/** The origin the composed auth serves on, and the audience a caller token is minted for. */
|
|
21
|
+
export declare const SCOPED_ORIGIN = "http://localhost";
|
|
22
|
+
/** Auth's registry and the email link key, which every composition with `email()` resolves. */
|
|
23
|
+
export declare const SCOPED_REGISTRY: {
|
|
24
|
+
"auth-session-secret": {
|
|
25
|
+
readonly backend: "d1";
|
|
26
|
+
readonly scope: "environment";
|
|
27
|
+
readonly rotatable: true;
|
|
28
|
+
readonly valueType: "text";
|
|
29
|
+
readonly devValue: "random";
|
|
30
|
+
readonly origin: {
|
|
31
|
+
readonly kind: "minted";
|
|
32
|
+
readonly recipe: {
|
|
33
|
+
readonly kind: "random";
|
|
34
|
+
readonly bytes: 32;
|
|
35
|
+
readonly encoding: "base64url";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly rotation: {
|
|
39
|
+
readonly kind: "local";
|
|
40
|
+
};
|
|
41
|
+
readonly overlap: {
|
|
42
|
+
readonly days: 7;
|
|
43
|
+
readonly minimumDays: 7;
|
|
44
|
+
readonly reencrypt: readonly ["auth-jwks"];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
"auth-google-credentials": {
|
|
48
|
+
readonly backend: "d1";
|
|
49
|
+
readonly scope: "environment";
|
|
50
|
+
readonly rotatable: false;
|
|
51
|
+
readonly valueType: "json";
|
|
52
|
+
readonly schema: import("zod").ZodObject<{
|
|
53
|
+
clientId: import("zod").ZodString;
|
|
54
|
+
clientSecret: import("zod").ZodString;
|
|
55
|
+
}, import("zod/v4/core").$strip>;
|
|
56
|
+
readonly origin: {
|
|
57
|
+
readonly kind: "obtained";
|
|
58
|
+
readonly issuer: "google";
|
|
59
|
+
readonly documentation: "https://console.cloud.google.com/apis/credentials";
|
|
60
|
+
};
|
|
61
|
+
readonly rotation: {
|
|
62
|
+
readonly kind: "manual";
|
|
63
|
+
readonly issuer: "google";
|
|
64
|
+
readonly documentation: "https://console.cloud.google.com/apis/credentials";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
"auth-apple-credentials": {
|
|
68
|
+
readonly backend: "d1";
|
|
69
|
+
readonly scope: "environment";
|
|
70
|
+
readonly rotatable: true;
|
|
71
|
+
readonly valueType: "json";
|
|
72
|
+
readonly schema: import("zod").ZodObject<{
|
|
73
|
+
clientId: import("zod").ZodString;
|
|
74
|
+
clientSecret: import("zod").ZodString;
|
|
75
|
+
appBundleIdentifier: import("zod").ZodOptional<import("zod").ZodString>;
|
|
76
|
+
}, import("zod/v4/core").$strip>;
|
|
77
|
+
readonly origin: {
|
|
78
|
+
readonly kind: "obtained";
|
|
79
|
+
readonly issuer: "apple";
|
|
80
|
+
readonly documentation: "https://developer.apple.com/account/resources/authkeys/list";
|
|
81
|
+
};
|
|
82
|
+
readonly rotation: {
|
|
83
|
+
readonly kind: "manual";
|
|
84
|
+
readonly issuer: "apple";
|
|
85
|
+
readonly documentation: "https://developer.apple.com/account/resources/authkeys/list";
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
"auth-facebook-credentials": {
|
|
89
|
+
readonly backend: "d1";
|
|
90
|
+
readonly scope: "environment";
|
|
91
|
+
readonly rotatable: false;
|
|
92
|
+
readonly valueType: "json";
|
|
93
|
+
readonly schema: import("zod").ZodObject<{
|
|
94
|
+
clientId: import("zod").ZodString;
|
|
95
|
+
clientSecret: import("zod").ZodString;
|
|
96
|
+
}, import("zod/v4/core").$strip>;
|
|
97
|
+
readonly origin: {
|
|
98
|
+
readonly kind: "obtained";
|
|
99
|
+
readonly issuer: "facebook";
|
|
100
|
+
readonly documentation: "https://developers.facebook.com/apps/";
|
|
101
|
+
};
|
|
102
|
+
readonly rotation: {
|
|
103
|
+
readonly kind: "manual";
|
|
104
|
+
readonly issuer: "facebook";
|
|
105
|
+
readonly documentation: "https://developers.facebook.com/apps/";
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
"auth-github-credentials": {
|
|
109
|
+
readonly backend: "d1";
|
|
110
|
+
readonly scope: "environment";
|
|
111
|
+
readonly rotatable: false;
|
|
112
|
+
readonly valueType: "json";
|
|
113
|
+
readonly schema: import("zod").ZodObject<{
|
|
114
|
+
clientId: import("zod").ZodString;
|
|
115
|
+
clientSecret: import("zod").ZodString;
|
|
116
|
+
}, import("zod/v4/core").$strip>;
|
|
117
|
+
readonly origin: {
|
|
118
|
+
readonly kind: "obtained";
|
|
119
|
+
readonly issuer: "github";
|
|
120
|
+
readonly documentation: "https://github.com/settings/developers";
|
|
121
|
+
};
|
|
122
|
+
readonly rotation: {
|
|
123
|
+
readonly kind: "manual";
|
|
124
|
+
readonly issuer: "github";
|
|
125
|
+
readonly documentation: "https://github.com/settings/developers";
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
"email-link-signing-key": {
|
|
129
|
+
readonly backend: "cf-secrets-store";
|
|
130
|
+
readonly scope: "environment";
|
|
131
|
+
readonly rotatable: true;
|
|
132
|
+
readonly valueType: "text";
|
|
133
|
+
readonly devValue: "random";
|
|
134
|
+
readonly origin: {
|
|
135
|
+
readonly kind: "minted";
|
|
136
|
+
readonly recipe: {
|
|
137
|
+
readonly kind: "random";
|
|
138
|
+
readonly bytes: 32;
|
|
139
|
+
readonly encoding: "base64url";
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
readonly rotation: {
|
|
143
|
+
readonly kind: "local";
|
|
144
|
+
};
|
|
145
|
+
readonly overlap: {
|
|
146
|
+
readonly days: 90;
|
|
147
|
+
readonly minimumDays: 90;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
/** Every secret the composed backend resolves, since the shared accessor resolves the registry in one batch. */
|
|
152
|
+
export declare const SCOPED_SECRETS: SecretFixture<typeof SCOPED_REGISTRY>;
|
|
153
|
+
/** One capability's migrations, as the registry takes them, for a suite composing more than auth. */
|
|
154
|
+
export interface ExtraMigrations {
|
|
155
|
+
namespace: string;
|
|
156
|
+
order: number;
|
|
157
|
+
migrations: Record<string, Migration>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Drop every table, re-run every migration the composition needs, then seed the secrets it resolves.
|
|
161
|
+
*
|
|
162
|
+
* Every table rather than a list of them, so a suite composing a capability beside auth does not have to
|
|
163
|
+
* restate what that capability's migrations create, and a second test never meets the first one's rows.
|
|
164
|
+
*/
|
|
165
|
+
export declare function prepareScopedBackend(env: SecretsStoreEnv & {
|
|
166
|
+
DB: D1Database;
|
|
167
|
+
}, extra?: readonly ExtraMigrations[]): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* The Worker env one request runs against: the real `DB` and `SECRETS`, and stand-ins for the three
|
|
170
|
+
* bindings this composition requires and never exercises — no email is sent and the limiter always allows.
|
|
171
|
+
*/
|
|
172
|
+
export declare function scopedWorkerEnv(env: Record<string, unknown>, db?: unknown): Record<string, unknown>;
|
|
173
|
+
/**
|
|
174
|
+
* Sign a user in by OTP against the same database the composed backend reads, and return a bearer token.
|
|
175
|
+
*
|
|
176
|
+
* Directly through Better Auth rather than over HTTP: the sign-in flow is not what these suites are about,
|
|
177
|
+
* and the session row it writes is exactly the one a request presenting the token resolves.
|
|
178
|
+
*/
|
|
179
|
+
export declare function signInScoped(db: D1Database, address?: string): Promise<{
|
|
180
|
+
token: string;
|
|
181
|
+
userId: string;
|
|
182
|
+
}>;
|
|
183
|
+
//# sourceMappingURL=scopedBackend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopedBackend.d.ts","sourceRoot":"","sources":["../../src/test-utils/scopedBackend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAM5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,iDAAiD,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQlD;;;;;;;;;;GAUG;AAEH,iGAAiG;AACjG,eAAO,MAAM,qBAAqB,4CAA4C,CAAC;AAE/E,6FAA6F;AAC7F,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAEhD,+FAA+F;AAC/F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsD,CAAC;AAEnF,gHAAgH;AAChH,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,OAAO,eAAe,CAOhE,CAAC;AAEF,qGAAqG;AACrG,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,GAAG;IAAE,EAAE,EAAE,UAAU,CAAA;CAAE,EACzC,KAAK,GAAE,SAAS,eAAe,EAAO,GACrC,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,GAAE,OAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS3G;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,EAAE,EAAE,UAAU,EACd,OAAO,SAAoB,GAC1B,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA8B5C"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Pithy
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { authDatabase } from "../data/tables.js";
|
|
4
|
+
import { authSecretsRegistry } from "../instance/secrets.js";
|
|
5
|
+
import { NO_SOCIAL_PROVIDERS } from "../instance/providers.js";
|
|
6
|
+
import { makeAuth } from "../instance/auth.js";
|
|
7
|
+
import "../migrations/0001_init.js";
|
|
8
|
+
import { AUTH_MIGRATIONS } from "../migrations/set.js";
|
|
9
|
+
import { EMAIL_MIGRATION_ORDER } from "@pithy-sh/email/src/capability";
|
|
10
|
+
import { createMigrationRegistry } from "@pithy-sh/core/src/migrations/registry";
|
|
11
|
+
import { runMigrations } from "@pithy-sh/core/src/migrations/runner";
|
|
12
|
+
import { email_0001_init } from "@pithy-sh/email/src/migrations/0001_init";
|
|
13
|
+
import { seedSecrets } from "@pithy-sh/secrets/src/test-utils/secretFixtures";
|
|
14
|
+
import { emailSigningRegistry } from "@pithy-sh/email/src/crypto/signingKey";
|
|
15
|
+
//#region src/test-utils/scopedBackend.ts
|
|
16
|
+
/**
|
|
17
|
+
* The fixtures a workers suite needs to put a **real** `auth()` in front of a request (#560).
|
|
18
|
+
*
|
|
19
|
+
* The scope gates in `leaderboard`, `rating` and `ledger` were each tested against a stub middleware that
|
|
20
|
+
* wrote `c.var.auth` itself, so every one of them passed while nothing real could ever open it. A suite
|
|
21
|
+
* built on this composes the actual capability through `createBackend` and signs a user in with the actual
|
|
22
|
+
* Better Auth instance, so what reaches a gate is what a deployed Worker would put there.
|
|
23
|
+
*
|
|
24
|
+
* It holds the pieces and not the composition. Which capabilities sit beside auth is the suite's own
|
|
25
|
+
* statement, and so is the probe it reads the request through.
|
|
26
|
+
*/
|
|
27
|
+
/** The session secret these suites sign with. A throwaway: it authenticates nothing anywhere. */
|
|
28
|
+
const SCOPED_SESSION_SECRET = "scoped-backend-secret-please-rotate-000";
|
|
29
|
+
/** The origin the composed auth serves on, and the audience a caller token is minted for. */
|
|
30
|
+
const SCOPED_ORIGIN = "http://localhost";
|
|
31
|
+
/** Auth's registry and the email link key, which every composition with `email()` resolves. */
|
|
32
|
+
const SCOPED_REGISTRY = {
|
|
33
|
+
...authSecretsRegistry,
|
|
34
|
+
...emailSigningRegistry
|
|
35
|
+
};
|
|
36
|
+
/** Every secret the composed backend resolves, since the shared accessor resolves the registry in one batch. */
|
|
37
|
+
const SCOPED_SECRETS = {
|
|
38
|
+
"auth-session-secret": SCOPED_SESSION_SECRET,
|
|
39
|
+
"auth-google-credentials": {
|
|
40
|
+
clientId: "g",
|
|
41
|
+
clientSecret: "g"
|
|
42
|
+
},
|
|
43
|
+
"auth-apple-credentials": {
|
|
44
|
+
clientId: "a",
|
|
45
|
+
clientSecret: "a"
|
|
46
|
+
},
|
|
47
|
+
"auth-facebook-credentials": {
|
|
48
|
+
clientId: "f",
|
|
49
|
+
clientSecret: "f"
|
|
50
|
+
},
|
|
51
|
+
"auth-github-credentials": {
|
|
52
|
+
clientId: "h",
|
|
53
|
+
clientSecret: "h"
|
|
54
|
+
},
|
|
55
|
+
"email-link-signing-key": "dev-link-signing-key"
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Drop every table, re-run every migration the composition needs, then seed the secrets it resolves.
|
|
59
|
+
*
|
|
60
|
+
* Every table rather than a list of them, so a suite composing a capability beside auth does not have to
|
|
61
|
+
* restate what that capability's migrations create, and a second test never meets the first one's rows.
|
|
62
|
+
*/
|
|
63
|
+
async function prepareScopedBackend(env, extra = []) {
|
|
64
|
+
const tables = await env.DB.prepare("select name from sqlite_master where type = 'table' and name not like 'sqlite_%' and name not like '\\_cf\\_%' escape '\\'").all();
|
|
65
|
+
for (const { name } of tables.results) await env.DB.prepare(`drop table if exists "${name}"`).run();
|
|
66
|
+
const provider = createMigrationRegistry([
|
|
67
|
+
{
|
|
68
|
+
database: "app",
|
|
69
|
+
namespace: "auth",
|
|
70
|
+
order: 300,
|
|
71
|
+
migrations: AUTH_MIGRATIONS
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
database: "app",
|
|
75
|
+
namespace: "email",
|
|
76
|
+
order: EMAIL_MIGRATION_ORDER,
|
|
77
|
+
migrations: { "0001_init": email_0001_init }
|
|
78
|
+
},
|
|
79
|
+
...extra.map((entry) => ({
|
|
80
|
+
database: "app",
|
|
81
|
+
...entry
|
|
82
|
+
}))
|
|
83
|
+
]).app;
|
|
84
|
+
if (!provider) throw new Error("expected a migration provider for database \"app\"");
|
|
85
|
+
await runMigrations(env.DB, provider);
|
|
86
|
+
await seedSecrets(env, SCOPED_REGISTRY, SCOPED_SECRETS);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The Worker env one request runs against: the real `DB` and `SECRETS`, and stand-ins for the three
|
|
90
|
+
* bindings this composition requires and never exercises — no email is sent and the limiter always allows.
|
|
91
|
+
*/
|
|
92
|
+
function scopedWorkerEnv(env, db = env.DB) {
|
|
93
|
+
return {
|
|
94
|
+
...env,
|
|
95
|
+
DB: db,
|
|
96
|
+
ENVIRONMENT: "dev",
|
|
97
|
+
EMAIL_SUPPRESSIONS: env.DB,
|
|
98
|
+
EMAIL_SENDER: {},
|
|
99
|
+
AUTH_RATE_LIMITER: { limit: async () => ({ success: true }) }
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Sign a user in by OTP against the same database the composed backend reads, and return a bearer token.
|
|
104
|
+
*
|
|
105
|
+
* Directly through Better Auth rather than over HTTP: the sign-in flow is not what these suites are about,
|
|
106
|
+
* and the session row it writes is exactly the one a request presenting the token resolves.
|
|
107
|
+
*/
|
|
108
|
+
async function signInScoped(db, address = "player@test.com") {
|
|
109
|
+
const mailbox = [];
|
|
110
|
+
const instance = makeAuth({
|
|
111
|
+
db: authDatabase(db),
|
|
112
|
+
secret: SCOPED_SESSION_SECRET,
|
|
113
|
+
baseURL: SCOPED_ORIGIN,
|
|
114
|
+
basePath: "/auth",
|
|
115
|
+
trustedOrigins: [SCOPED_ORIGIN],
|
|
116
|
+
...NO_SOCIAL_PROVIDERS,
|
|
117
|
+
sendEmail: async (m) => {
|
|
118
|
+
mailbox.push(m.template === "otp" ? {
|
|
119
|
+
template: "otp",
|
|
120
|
+
code: m.code
|
|
121
|
+
} : { template: m.template });
|
|
122
|
+
return { delivery: "queued" };
|
|
123
|
+
},
|
|
124
|
+
sessionExpiresIn: 604800,
|
|
125
|
+
sessionUpdateAge: 86400,
|
|
126
|
+
verificationExpiresIn: 300,
|
|
127
|
+
otpLength: 6,
|
|
128
|
+
disableSignUp: false,
|
|
129
|
+
providerSignUp: {
|
|
130
|
+
google: true,
|
|
131
|
+
apple: true,
|
|
132
|
+
facebook: true,
|
|
133
|
+
github: true
|
|
134
|
+
},
|
|
135
|
+
emit: async () => {},
|
|
136
|
+
plugins: []
|
|
137
|
+
});
|
|
138
|
+
await instance.api.sendVerificationOTP({
|
|
139
|
+
body: {
|
|
140
|
+
email: address,
|
|
141
|
+
type: "sign-in"
|
|
142
|
+
},
|
|
143
|
+
headers: new Headers()
|
|
144
|
+
});
|
|
145
|
+
const otp = mailbox.find((m) => m.template === "otp");
|
|
146
|
+
if (!otp?.code) throw new Error("no OTP was mailed");
|
|
147
|
+
const signedIn = await instance.api.signInEmailOTP({
|
|
148
|
+
body: {
|
|
149
|
+
email: address,
|
|
150
|
+
otp: otp.code
|
|
151
|
+
},
|
|
152
|
+
headers: new Headers()
|
|
153
|
+
});
|
|
154
|
+
return {
|
|
155
|
+
token: signedIn.token,
|
|
156
|
+
userId: signedIn.user.id
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
export { SCOPED_ORIGIN, SCOPED_REGISTRY, SCOPED_SECRETS, SCOPED_SESSION_SECRET, prepareScopedBackend, scopedWorkerEnv, signInScoped };
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
/** This package's npm name — the join key against a release feed. */
|
|
4
4
|
export declare const PACKAGE_NAME = "@pithy-sh/auth";
|
|
5
5
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
6
|
-
export declare const PACKAGE_VERSION = "0.
|
|
6
|
+
export declare const PACKAGE_VERSION = "0.9.0";
|
|
7
7
|
//# sourceMappingURL=version.generated.d.ts.map
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
/** This package's npm name — the join key against a release feed. */
|
|
5
5
|
const PACKAGE_NAME = "@pithy-sh/auth";
|
|
6
6
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
7
|
-
const PACKAGE_VERSION = "0.
|
|
7
|
+
const PACKAGE_VERSION = "0.9.0";
|
|
8
8
|
//#endregion
|
|
9
9
|
export { PACKAGE_NAME, PACKAGE_VERSION };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Server-authoritative writes
|
|
2
|
+
|
|
3
|
+
_This copy ships in the package because `src/capability.ts` sends an adopter to it by name._
|
|
4
|
+
|
|
5
|
+
Some writes belong to your backend and never to a device. A score, a match result, a balance. `@pithy-sh/auth` decides, per request, whether the caller is your backend. This page is how.
|
|
6
|
+
|
|
7
|
+
## What a scope is
|
|
8
|
+
|
|
9
|
+
Six routes in the kit check one of four scopes on `AuthContext`:
|
|
10
|
+
|
|
11
|
+
| Scope | Capability | What it opens | Off switch |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| `leaderboard:submit` | `@pithy-sh/leaderboard` | `POST /leaderboard/:board` | `serverAuthoritative: false` |
|
|
14
|
+
| `leaderboard:admin` | `@pithy-sh/leaderboard` | hide and remove another player's entry | none |
|
|
15
|
+
| `rating:record` | `@pithy-sh/rating` | `POST /rating/games/:game/outcomes` | `serverAuthoritative: false` |
|
|
16
|
+
| `ledger:admin` | `@pithy-sh/ledger` | credit and debit another player's balance | none |
|
|
17
|
+
|
|
18
|
+
**A scope is an attestation about the caller, not a permission granted to the user.** It says *this write came from your trusted backend*. It is not a role. Tenancy roles live on `c.var.acting`, from `@pithy-sh/organization`. Management access is the control plane's, with its own credential.
|
|
19
|
+
|
|
20
|
+
Every gate fails closed. With nothing to fill the array, each one refuses every caller. `pithy doctor` names each gate in that state, per Worker, on its `scopes` line.
|
|
21
|
+
|
|
22
|
+
## The seam: `resolveScopes`
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
// apps/api/pithy.config.ts
|
|
26
|
+
auth({
|
|
27
|
+
baseURL: PUBLIC_ORIGIN,
|
|
28
|
+
resolveScopes: async (c) =>
|
|
29
|
+
(await verifyCallerRequest(c, { audience: PUBLIC_ORIGIN })).trusted ? ["leaderboard:submit", "rating:record"] : [],
|
|
30
|
+
}),
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The session middleware calls it on every authenticated request, after Better Auth resolves the session. What it returns becomes `c.var.auth.scopes`. It is handed the request context and the session, `{ userId, sessionId }`.
|
|
34
|
+
|
|
35
|
+
- **Per request, never cached.** A cached scope is a revocation that has not taken effect.
|
|
36
|
+
- **Closed on failure, never fatal.** A resolver that throws, or answers anything but a list of strings, leaves the request with no scopes. It logs at warn and the request goes on to its gate, which refuses it.
|
|
37
|
+
- **No default.** Without one the array is empty and nothing extra runs.
|
|
38
|
+
- **Never from what the request says.** Not a header like `x-scopes`, not a body field, not a query parameter. Only from what the request proves.
|
|
39
|
+
|
|
40
|
+
**The session is the player's, and the backend forwards it.** A gated write is still an authenticated request, and the route acts for the session's user. `POST /leaderboard/:board` files the score under that user and takes no player in its body. So the backend relays the player's own session on `Authorization` and adds its proof beside it. A backend that called with a session of its own would put every score under its own account. Rating outcomes, ledger credits and the admin routes name their target in the body or the path, so any session works for them.
|
|
41
|
+
|
|
42
|
+
**The proof is not bound to that session.** A caller token, a certificate or a binding says the request came from your backend. It does not say which player the backend meant. Whichever session arrives beside a valid proof is the one the write is credited to, so the backend must forward only the session of the player the write is for.
|
|
43
|
+
|
|
44
|
+
## Three ways to prove the caller
|
|
45
|
+
|
|
46
|
+
In order. Use the first one you can.
|
|
47
|
+
|
|
48
|
+
### 1. A service binding. No credential at all.
|
|
49
|
+
|
|
50
|
+
If your trusted backend is a Worker, call over a service binding. There is no public network path, so there is nothing to steal, expire or rotate. **Where you can use this, the other two are unnecessary.**
|
|
51
|
+
|
|
52
|
+
A request that arrives over a binding carries no mark of it, so the boundary is the Worker itself. Compose the gated capabilities into a Worker with no public address, and share the database by declaring the same `DB` binding. In its `wrangler.jsonc`, for each environment:
|
|
53
|
+
|
|
54
|
+
```jsonc
|
|
55
|
+
// apps/internal/wrangler.jsonc
|
|
56
|
+
"workers_dev": false,
|
|
57
|
+
"preview_urls": false,
|
|
58
|
+
// and no "routes", no "domains" in pithy.config.ts, no vars.BASE_URL
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
All three, set explicitly. `pithy deploy --env staging|prod` and `pithy doctor` read that shape as a Worker reachable only over a binding, and let it through with no origin. Leave one out and deploy refuses the Worker for having no origin, as it refuses any other.
|
|
62
|
+
|
|
63
|
+
Nothing but a binding can reach that Worker, so its resolver answers for every request it receives:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// apps/internal/pithy.config.ts — reachable only over a service binding
|
|
67
|
+
const INTERNAL_ORIGIN = "https://internal.invalid";
|
|
68
|
+
|
|
69
|
+
auth({ baseURL: INTERNAL_ORIGIN, resolveScopes: () => ["leaderboard:submit", "rating:record", "ledger:admin"] }),
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`INTERNAL_ORIGIN` is the URL the caller fetches over the binding. A binding routes by its name, never by hostname, so the host is yours to pick; `.invalid` is reserved and resolves nowhere, so nothing outside the binding can reach it by mistake. Use the same origin on both sides: `` env.INTERNAL.fetch(`${INTERNAL_ORIGIN}/leaderboard/weekly`, …) ``. The forwarded session travels on `Authorization`, so the CSRF origin check does not apply.
|
|
73
|
+
|
|
74
|
+
The caller declares `{ type: "service", name: "INTERNAL", service: "internal" }`. Give it a route later and the resolver above trusts the internet, so the two decisions stay together.
|
|
75
|
+
|
|
76
|
+
### 2. mTLS. Refused at the edge.
|
|
77
|
+
|
|
78
|
+
A client certificate is sender-constrained: a stolen token is useless without the private key. Cloudflare-managed client certificates are available on every plan. They need a proxied zone and a hostname that matches the certificate exactly. No wildcards, so not `workers.dev`.
|
|
79
|
+
|
|
80
|
+
**The zone rule is the gate.** Create a WAF custom rule on the hostname, action Block:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
(http.host eq "api.example.com" and (not cf.tls_client_auth.cert_verified or cf.tls_client_auth.cert_revoked))
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Both halves. A revoked certificate whose chain still verifies reports `cert_verified` true, so the first half alone lets it through. This is the shape of the rule Cloudflare generates for mTLS.
|
|
87
|
+
|
|
88
|
+
It runs before the Worker, so a caller without a verified, unrevoked certificate never reaches your code. Scope it to the paths only your backend calls if devices share the hostname.
|
|
89
|
+
|
|
90
|
+
**The Worker helper is defense in depth, not the gate.** `readClientCertificate` reads `request.cf.tlsClientAuth`, and `isTrustedCertificate` checks it against pins. On its own it blocks nothing. A Worker with no zone rule in front of it receives every request, certificate or not.
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import { isTrustedCertificate, readClientCertificate } from "@pithy-sh/auth/src/caller/certificate";
|
|
94
|
+
|
|
95
|
+
resolveScopes: (c) =>
|
|
96
|
+
isTrustedCertificate(readClientCertificate(c.req.raw), { fingerprintsSHA256: [GAME_SERVER_CERT] })
|
|
97
|
+
? ["leaderboard:submit"]
|
|
98
|
+
: [],
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The helper answers four states: `absent`, `unverified`, `revoked` and `verified`. Only `verified` with `certVerified === "SUCCESS"` and no revocation is trusted, and only against a fingerprint pin. Without one it trusts nothing, because every certificate your zone's CA issued would pass. An issuer pin is an extra check, never a substitute: on the Cloudflare-managed CA every certificate the zone verifies names the same issuer.
|
|
102
|
+
|
|
103
|
+
### 3. A short-lived token bound to this origin. For a backend off Cloudflare.
|
|
104
|
+
|
|
105
|
+
The option for a backend that is not a Worker, on `workers.dev` or any other host. A token signed with a shared key, minted for this Worker's origin, alive for minutes. A Worker of your own project does not need it: it calls over a service binding.
|
|
106
|
+
|
|
107
|
+
Declare the key in the project registry, so `pithy secrets` knows it:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { callerTokenRegistry } from "@pithy-sh/auth/src/caller/request";
|
|
111
|
+
|
|
112
|
+
secrets({ registry: { ...authSecretsRegistry, ...callerTokenRegistry } }),
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### The signing key
|
|
116
|
+
|
|
117
|
+
Two parties hold one value: this Worker, which verifies, and your backend, which signs. **You make it, not the kit.** Nothing in the kit hands a stored value back out, so a key the kit minted is one your backend could never learn. `pithy secrets provision` therefore does not create it.
|
|
118
|
+
|
|
119
|
+
1. Generate the value where your backend's secrets live: `openssl rand -base64 32`. That prints 44 characters of base64 text, and **the text is the key**.
|
|
120
|
+
2. Store that text in your backend's own secret manager, as it was printed.
|
|
121
|
+
3. Pipe the same value into each environment: `printf '%s' "$KEY" | pithy secrets create auth-caller-token-key --env prod`. In `dev`, write it into the dev secrets file with `pithy secrets edit`.
|
|
122
|
+
|
|
123
|
+
**Rotation is a cutover, and it is yours.** `pithy secrets update` replaces the value, and every value it writes is version `1`, so the backend signs with `kid: "1"`. A token signed with the old key is refused from the moment the Worker holds the new one. Generate the new value and change the Worker's copy and the backend's back to back. Writes between the two are refused, so the backend retries a refused write once it holds the new key. `pithy secrets rotate` does not invent a value here; it names this page.
|
|
124
|
+
|
|
125
|
+
Mint on the backend, one token per call or per few minutes, and send it on the `pithy-caller` header beside the player's session:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import { mintCallerToken } from "@pithy-sh/auth/src/caller/token";
|
|
129
|
+
|
|
130
|
+
const token = await mintCallerToken({ key: CALLER_TOKEN_KEY, kid: "1", audience: API_ORIGIN });
|
|
131
|
+
await fetch(`${API_ORIGIN}/leaderboard/weekly`, {
|
|
132
|
+
method: "POST",
|
|
133
|
+
headers: { authorization: `Bearer ${playerSession}`, "pithy-caller": token, "content-type": "application/json" },
|
|
134
|
+
body: JSON.stringify({ score }),
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### The token, for a backend that does not import the kit
|
|
139
|
+
|
|
140
|
+
`mintCallerToken` is a convenience, not a requirement. Any language can build the token. It is a compact JWS:
|
|
141
|
+
|
|
142
|
+
- **Three segments**, `header.claims.signature`, each **unpadded base64url**. Padding and the standard alphabet are refused.
|
|
143
|
+
- **The header** is `{"alg":"HS256","typ":"JWT","kid":"1"}`. `alg` must be `HS256`. `kid` is required and names the key version. `typ` is optional.
|
|
144
|
+
- **The claims** are `{"aud":"https://api.example.com","iat":1760788800,"exp":1760789100}`. `aud` is one string, the origin of the Worker the token is for, never an array and never a path. `iat` and `exp` are whole Unix seconds. `exp` is at most 900 seconds after `iat`, and `iat` at most 30 seconds in the future. `sub` is optional and grants nothing.
|
|
145
|
+
- **The signature** is HMAC-SHA-256 over the ASCII bytes of `header.claims`, as they appear in the token.
|
|
146
|
+
- **The HMAC key is the UTF-8 bytes of the stored string.** The 44 characters `openssl` printed, not the 32 bytes they decode to. A signer that base64-decodes the key first produces a token refused on its signature, every time.
|
|
147
|
+
|
|
148
|
+
In Python, with nothing but the standard library:
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
import base64, hashlib, hmac, json, time
|
|
152
|
+
|
|
153
|
+
def seg(raw: bytes) -> str:
|
|
154
|
+
return base64.urlsafe_b64encode(raw).rstrip(b"=").decode()
|
|
155
|
+
|
|
156
|
+
def caller_token(key: str, audience: str) -> str:
|
|
157
|
+
now = int(time.time())
|
|
158
|
+
header = seg(json.dumps({"alg": "HS256", "typ": "JWT", "kid": "1"}).encode())
|
|
159
|
+
claims = seg(json.dumps({"aud": audience, "iat": now, "exp": now + 300}).encode())
|
|
160
|
+
signing_input = f"{header}.{claims}"
|
|
161
|
+
signature = hmac.new(key.encode("utf-8"), signing_input.encode(), hashlib.sha256).digest()
|
|
162
|
+
return f"{signing_input}.{seg(signature)}"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### Verifying
|
|
166
|
+
|
|
167
|
+
Verify in the resolver with `verifyCallerRequest`, as in the first example. It refuses, each on its own:
|
|
168
|
+
|
|
169
|
+
- an expired token,
|
|
170
|
+
- a token minted for another origin,
|
|
171
|
+
- a token signed by a key the store does not hold,
|
|
172
|
+
- anything that is not a well-formed HS256 compact JWS.
|
|
173
|
+
|
|
174
|
+
A token lives five minutes by default and fifteen at most. A token claiming longer is refused even when everything else checks out.
|
|
175
|
+
|
|
176
|
+
**It is not sender-constrained.** A token lifted off the wire works for whoever lifted it, for the minutes it has left. The short lifetime is what bounds that. DPoP would bind it to the sender; the kit does not ship it yet.
|
|
177
|
+
|
|
178
|
+
## What not to do
|
|
179
|
+
|
|
180
|
+
**Do not compare a long-lived shared secret in a header.** It is the shape everyone reaches for, and it fails every control RFC 9700 names at once: it is not least-privilege, it is not bound to an audience, it does not expire and it is not bound to its sender. One leak is permanent until somebody notices.
|
|
181
|
+
|
|
182
|
+
**Do not mint a scope from the user.** A player's account is not a trusted backend because of who owns it. Decide from the request, every time.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pithy-sh/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsdown && tsc -p tsconfig.build.json && bun ../../tooling/build/src/stampDeclarations.ts",
|
|
30
|
-
"typecheck": "
|
|
30
|
+
"typecheck": "bun check -p tsconfig.json && bun check -p tsconfig.client.json",
|
|
31
31
|
"test": "vitest run",
|
|
32
32
|
"test:node": "vitest run --project=node",
|
|
33
33
|
"test:workers": "vitest run --project=workers",
|
|
@@ -36,25 +36,28 @@
|
|
|
36
36
|
"reset": "bun run clean && rm -rf node_modules"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@better-auth/i18n": "^1.7.
|
|
39
|
+
"@better-auth/i18n": "^1.7.11",
|
|
40
40
|
"@cloudflare/workers-types": "^5.20260729.1",
|
|
41
41
|
"@hono/zod-validator": "^0.9.0",
|
|
42
|
-
"better-auth": "^1.7.
|
|
42
|
+
"better-auth": "^1.7.11"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@pithy-sh/core": "^0.
|
|
46
|
-
"@pithy-sh/email": "^0.
|
|
47
|
-
"@pithy-sh/secrets": "^0.
|
|
48
|
-
"@pithy-sh/turnstile": "^0.
|
|
45
|
+
"@pithy-sh/core": "^0.11.0",
|
|
46
|
+
"@pithy-sh/email": "^0.5.0",
|
|
47
|
+
"@pithy-sh/secrets": "^0.5.0",
|
|
48
|
+
"@pithy-sh/turnstile": "^0.5.0",
|
|
49
49
|
"hono": "^4.13.2",
|
|
50
50
|
"kysely": "^0.29.0",
|
|
51
51
|
"zod": "^4.4.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@cloudflare/vitest-plugin": "^1.
|
|
54
|
+
"@cloudflare/vitest-plugin": "^1.4.2",
|
|
55
55
|
"@pithy-sh/cloudflare": "workspace:*",
|
|
56
56
|
"@pithy-sh/core": "workspace:*",
|
|
57
57
|
"@pithy-sh/email": "workspace:*",
|
|
58
|
+
"@pithy-sh/leaderboard": "workspace:*",
|
|
59
|
+
"@pithy-sh/ledger": "workspace:*",
|
|
60
|
+
"@pithy-sh/rating": "workspace:*",
|
|
58
61
|
"@pithy-sh/secrets": "workspace:*",
|
|
59
62
|
"@pithy-sh/tsconfig": "workspace:*",
|
|
60
63
|
"@pithy-sh/turnstile": "workspace:*",
|
|
@@ -63,11 +66,11 @@
|
|
|
63
66
|
"hono": "^4.13.2",
|
|
64
67
|
"kysely": "^0.29.0",
|
|
65
68
|
"kysely-d1": "^0.4.0",
|
|
66
|
-
"miniflare": "
|
|
69
|
+
"miniflare": "5.20261012.0-beta",
|
|
67
70
|
"tsdown": "^0.23.0",
|
|
68
71
|
"typescript": "^7.0.2",
|
|
69
72
|
"vitest": "^4.1.0",
|
|
70
|
-
"wrangler": "^4.
|
|
73
|
+
"wrangler": "^4.151.0",
|
|
71
74
|
"zod": "^4.4.0"
|
|
72
75
|
}
|
|
73
76
|
}
|