ovr 6.2.4 → 7.0.0-next.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 +3 -1
- package/dist/app/index.d.ts +51 -7
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +163 -28
- package/dist/auth/auth-data.d.ts +26 -0
- package/dist/auth/auth-data.d.ts.map +1 -0
- package/dist/auth/auth-data.js +42 -0
- package/dist/auth/cbor.d.ts +50 -0
- package/dist/auth/cbor.d.ts.map +1 -0
- package/dist/auth/cbor.js +200 -0
- package/dist/auth/client-source.d.ts +3 -0
- package/dist/auth/client-source.d.ts.map +1 -0
- package/dist/auth/client-source.js +3 -0
- package/dist/auth/client.d.ts +3 -0
- package/dist/auth/client.d.ts.map +1 -0
- package/dist/auth/client.js +186 -0
- package/dist/auth/configure.d.ts +28 -0
- package/dist/auth/configure.d.ts.map +1 -0
- package/dist/auth/configure.js +228 -0
- package/dist/auth/der.d.ts +6 -0
- package/dist/auth/der.d.ts.map +1 -0
- package/dist/auth/der.js +36 -0
- package/dist/auth/index.d.ts +242 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +152 -0
- package/dist/auth/issue.d.ts +36 -0
- package/dist/auth/issue.d.ts.map +1 -0
- package/dist/auth/issue.js +47 -0
- package/dist/auth/metadata.d.ts +22 -0
- package/dist/auth/metadata.d.ts.map +1 -0
- package/dist/auth/metadata.js +134 -0
- package/dist/auth/oauth.d.ts +29 -0
- package/dist/auth/oauth.d.ts.map +1 -0
- package/dist/auth/oauth.js +724 -0
- package/dist/auth/passkey.d.ts +101 -0
- package/dist/auth/passkey.d.ts.map +1 -0
- package/dist/auth/passkey.js +393 -0
- package/dist/auth/state.d.ts +49 -0
- package/dist/auth/state.d.ts.map +1 -0
- package/dist/auth/state.js +184 -0
- package/dist/auth/storage.d.ts +193 -0
- package/dist/auth/storage.d.ts.map +1 -0
- package/dist/auth/storage.js +410 -0
- package/dist/auth/token.d.ts +12 -0
- package/dist/auth/token.d.ts.map +1 -0
- package/dist/auth/token.js +39 -0
- package/dist/context/index.d.ts +86 -16
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +166 -42
- package/dist/cookie/index.d.ts +3 -0
- package/dist/cookie/index.d.ts.map +1 -1
- package/dist/cookie/index.js +1 -0
- package/dist/database/index.d.ts +262 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +807 -0
- package/dist/form/index.d.ts +699 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/index.js +901 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/dist/jsx/elements.d.ts +28 -2
- package/dist/jsx/elements.d.ts.map +1 -1
- package/dist/jsx/index.d.ts +20 -4
- package/dist/jsx/index.d.ts.map +1 -1
- package/dist/jsx/index.js +6 -65
- package/dist/limiter/index.d.ts +65 -0
- package/dist/limiter/index.d.ts.map +1 -0
- package/dist/limiter/index.js +157 -0
- package/dist/markdown/index.d.ts +61 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +1160 -0
- package/dist/markup/index.d.ts +188 -0
- package/dist/markup/index.d.ts.map +1 -0
- package/dist/markup/index.js +718 -0
- package/dist/mcp/index.d.ts +73 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +988 -0
- package/dist/middleware/index.d.ts +3 -4
- package/dist/middleware/index.d.ts.map +1 -1
- package/dist/multipart/index.d.ts +53 -7
- package/dist/multipart/index.d.ts.map +1 -1
- package/dist/multipart/index.js +332 -124
- package/dist/route/index.d.ts +226 -80
- package/dist/route/index.d.ts.map +1 -1
- package/dist/route/index.js +239 -99
- package/dist/schema/index.d.ts +307 -734
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +783 -1050
- package/dist/table/index.d.ts +132 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/index.js +188 -0
- package/dist/trie/index.js +4 -4
- package/dist/util/index.d.ts +37 -5
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +156 -41
- package/package.json +11 -4
- package/src/app/index.ts +230 -42
- package/src/auth/auth-data.ts +56 -0
- package/src/auth/cbor.ts +231 -0
- package/src/auth/client-source.ts +3 -0
- package/src/auth/client.ts +205 -0
- package/src/auth/configure.ts +279 -0
- package/src/auth/der.ts +35 -0
- package/src/auth/index.ts +387 -0
- package/src/auth/issue.ts +52 -0
- package/src/auth/metadata.ts +149 -0
- package/src/auth/oauth.ts +882 -0
- package/src/auth/passkey.ts +556 -0
- package/src/auth/state.ts +213 -0
- package/src/auth/storage.ts +572 -0
- package/src/auth/token.ts +67 -0
- package/src/context/index.ts +240 -65
- package/src/cookie/index.ts +3 -0
- package/src/database/index.ts +1193 -0
- package/src/form/index.ts +1720 -0
- package/src/index.ts +10 -3
- package/src/jsx/elements.ts +45 -25
- package/src/jsx/index.ts +24 -69
- package/src/limiter/index.ts +221 -0
- package/src/markdown/index.ts +1322 -0
- package/src/markup/index.ts +853 -0
- package/src/mcp/conformance.2025-11-25.yml +39 -0
- package/src/mcp/conformance.2026-07-28.yml +56 -0
- package/src/mcp/index.ts +1262 -0
- package/src/middleware/index.ts +5 -6
- package/src/multipart/index.ts +410 -158
- package/src/route/index.ts +559 -278
- package/src/schema/index.ts +1542 -2256
- package/src/table/index.ts +387 -0
- package/src/trie/index.ts +4 -4
- package/src/util/index.ts +163 -49
- package/dist/render/index.d.ts +0 -79
- package/dist/render/index.d.ts.map +0 -1
- package/dist/render/index.js +0 -257
- package/src/render/index.ts +0 -314
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Database } from "../database/index.js";
|
|
2
|
+
import { Field, Form, field } from "../form/index.js";
|
|
3
|
+
import { jsx } from "../jsx/index.js";
|
|
4
|
+
import { Limiter } from "../limiter/index.js";
|
|
5
|
+
import { Route } from "../route/index.js";
|
|
6
|
+
import { Header, Time, noStore } from "../util/index.js";
|
|
7
|
+
import { Issue } from "./issue.js";
|
|
8
|
+
import { Passkey } from "./passkey.js";
|
|
9
|
+
/**
|
|
10
|
+
* Construct startup-complete handlers and request-scoped UI components.
|
|
11
|
+
*
|
|
12
|
+
* @template U Users table
|
|
13
|
+
*/
|
|
14
|
+
export function configure(options, storage, state) {
|
|
15
|
+
const { users } = options;
|
|
16
|
+
const defaults = (users.options.default ?? []);
|
|
17
|
+
/**
|
|
18
|
+
* The table's form fields, other than `id` and columns with defaults,
|
|
19
|
+
* which the server sets, such as a role
|
|
20
|
+
*/
|
|
21
|
+
const shape = Object.fromEntries(Object.entries(users.shape).filter(([name, schema]) => name !== "id" && field(schema) && !defaults.includes(name)));
|
|
22
|
+
/** @returns A limit of a method's requests, shared by every instance through the database */
|
|
23
|
+
const limiter = (method, limit, interval) => new Limiter(`auth:${method}:${options.origin}`, {
|
|
24
|
+
limit,
|
|
25
|
+
interval,
|
|
26
|
+
database: options.database,
|
|
27
|
+
});
|
|
28
|
+
// fixed, they protect Auth's own storage: accounts and outstanding challenges
|
|
29
|
+
const limits = {
|
|
30
|
+
register: limiter("register", 5, 10 * Time.minute),
|
|
31
|
+
login: limiter("login", 20, Time.minute),
|
|
32
|
+
};
|
|
33
|
+
const paths = {
|
|
34
|
+
register: "/auth/register",
|
|
35
|
+
login: "/auth/login",
|
|
36
|
+
logout: "/auth/logout",
|
|
37
|
+
options: "/_passkey/options",
|
|
38
|
+
};
|
|
39
|
+
const page = options.page ?? "/login";
|
|
40
|
+
const redirect = options.redirect ?? "/";
|
|
41
|
+
const fields = new Form(shape);
|
|
42
|
+
/** @returns The first field, such as an email, or the host, naming the passkey */
|
|
43
|
+
const name = (data) => {
|
|
44
|
+
const value = fields.names[0] && Reflect.get(data, fields.names[0]);
|
|
45
|
+
return (typeof value === "string" && value.trim()
|
|
46
|
+
? value.trim()
|
|
47
|
+
: new URL(options.origin).hostname).slice(0, 256);
|
|
48
|
+
};
|
|
49
|
+
const values = (data) => {
|
|
50
|
+
// Both routes validate this application shape before selecting its transformed values.
|
|
51
|
+
return Object.fromEntries(fields.names.map((name) => [name, Reflect.get(data, name)]));
|
|
52
|
+
};
|
|
53
|
+
const back = (c, method, retry = 0) => {
|
|
54
|
+
const target = new URL(page, options.origin);
|
|
55
|
+
target.searchParams.set("_auth", method);
|
|
56
|
+
if (retry)
|
|
57
|
+
target.searchParams.set("_retry", String(retry));
|
|
58
|
+
c.redirect(target, 303);
|
|
59
|
+
};
|
|
60
|
+
const admit = async (c, method, prompt) => {
|
|
61
|
+
const admission = await limits[method].check(c, prompt ? "options" : "verify");
|
|
62
|
+
if (admission === true)
|
|
63
|
+
return true;
|
|
64
|
+
const now = Date.now();
|
|
65
|
+
const retry = Math.min(now + 3600000, Math.max(now + 1000, admission.getTime()));
|
|
66
|
+
if (!prompt) {
|
|
67
|
+
back(c, method, retry);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
Issue.limited(c, Math.ceil((retry - now) / 1000));
|
|
71
|
+
return false;
|
|
72
|
+
};
|
|
73
|
+
/** Sign the user in, and send them where they were going */
|
|
74
|
+
const enter = async (c, user) => {
|
|
75
|
+
await state(c).login(user);
|
|
76
|
+
c.redirect(state(c).resume(redirect), 303);
|
|
77
|
+
};
|
|
78
|
+
const guard = (method, prompt = false) => async (c, next) => {
|
|
79
|
+
noStore(c.res.headers);
|
|
80
|
+
try {
|
|
81
|
+
if (c.url.origin !== options.origin)
|
|
82
|
+
return c.text("Authentication failed.", 400);
|
|
83
|
+
if (c.req.headers.get(Header.name.fetch) !== "same-origin" &&
|
|
84
|
+
c.req.headers.get(Header.name.origin) !== options.origin) {
|
|
85
|
+
if (method === "logout" || prompt)
|
|
86
|
+
return c.text("Authentication failed.", 403);
|
|
87
|
+
return back(c, method);
|
|
88
|
+
}
|
|
89
|
+
// Network identity comes from the deployment, never an unauthenticated cookie or guessed proxy header.
|
|
90
|
+
if (method !== "logout" &&
|
|
91
|
+
!(prompt && method === "register") &&
|
|
92
|
+
!(await admit(c, method, prompt)))
|
|
93
|
+
return;
|
|
94
|
+
await next();
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
// a failure the client caused is answered, anything else reaches the app
|
|
98
|
+
if (!(error instanceof Issue))
|
|
99
|
+
throw error;
|
|
100
|
+
if (prompt)
|
|
101
|
+
c.text("Authentication failed. Try again.", 400);
|
|
102
|
+
else
|
|
103
|
+
back(c, method);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const register = Route.post(paths.register)
|
|
107
|
+
.fields({ ...shape, ...Passkey.shape })
|
|
108
|
+
.use(guard("register"), async (c) => {
|
|
109
|
+
// the users table's fields, only known at runtime
|
|
110
|
+
const input = (await Issue.data(c));
|
|
111
|
+
if (!input || input.issues)
|
|
112
|
+
throw new Issue("registration fields");
|
|
113
|
+
const data = values(input.data);
|
|
114
|
+
const credential = await new Passkey(c, state(c)).register(await Passkey.fields(data));
|
|
115
|
+
// only the table's fields, never protocol fields
|
|
116
|
+
await storage
|
|
117
|
+
.register(async (t, user) => {
|
|
118
|
+
await t.sql `INSERT INTO ${users} ${t.sql.values(users, { ...data, id: user })}`;
|
|
119
|
+
}, credential)
|
|
120
|
+
.catch((error) => {
|
|
121
|
+
// an account or passkey that already exists
|
|
122
|
+
if (Database.unique(error))
|
|
123
|
+
throw new Issue("account");
|
|
124
|
+
throw error;
|
|
125
|
+
});
|
|
126
|
+
await enter(c, credential.user);
|
|
127
|
+
});
|
|
128
|
+
const login = Route.post(paths.login)
|
|
129
|
+
.fields(Passkey.shape)
|
|
130
|
+
.use(guard("login"), async (c) => {
|
|
131
|
+
// Bound the body before verification.
|
|
132
|
+
if (!(await Issue.data(c)))
|
|
133
|
+
throw new Issue("login request");
|
|
134
|
+
const credential = await new Passkey(c, state(c)).login(storage.credentials);
|
|
135
|
+
await enter(c, credential.user);
|
|
136
|
+
});
|
|
137
|
+
const logout = Route.post(paths.logout).use(guard("logout"), async (c) => {
|
|
138
|
+
await state(c).logout();
|
|
139
|
+
c.redirect(page, 303);
|
|
140
|
+
});
|
|
141
|
+
const registration = Route.post(`${paths.options}/register`)
|
|
142
|
+
.fields({ ...shape, bootstrap: Field.hidden() })
|
|
143
|
+
.use(guard("register", true), async (c) => {
|
|
144
|
+
const input = await Issue.data(c);
|
|
145
|
+
if (!input)
|
|
146
|
+
throw new Issue("registration request");
|
|
147
|
+
if (input.issues) {
|
|
148
|
+
const invalid = fields.names.filter((name) => input.issues.some((issue) => issue.path[0] === name));
|
|
149
|
+
if (!invalid.length)
|
|
150
|
+
throw new Issue("registration request");
|
|
151
|
+
return c.json({ fields: invalid }, 422);
|
|
152
|
+
}
|
|
153
|
+
if (!(await admit(c, "register", true)))
|
|
154
|
+
return;
|
|
155
|
+
// The reserved bootstrap field is added to the validated application shape above.
|
|
156
|
+
const data = input.data;
|
|
157
|
+
const application = values(data);
|
|
158
|
+
await Passkey.issue(c, state(c), data.bootstrap, {
|
|
159
|
+
method: "register",
|
|
160
|
+
action: paths.register,
|
|
161
|
+
name: name(application),
|
|
162
|
+
fields: await Passkey.fields(application),
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
const assertion = Route.post(`${paths.options}/login`)
|
|
166
|
+
.fields({ bootstrap: Field.hidden() })
|
|
167
|
+
.use(guard("login", true), async (c) => {
|
|
168
|
+
const input = await Issue.data(c);
|
|
169
|
+
if (!input || input.issues)
|
|
170
|
+
throw new Issue("login request");
|
|
171
|
+
await Passkey.issue(c, state(c), input.data.bootstrap, {
|
|
172
|
+
method: "login",
|
|
173
|
+
action: paths.login,
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
const routes = [
|
|
177
|
+
register,
|
|
178
|
+
login,
|
|
179
|
+
logout,
|
|
180
|
+
registration,
|
|
181
|
+
assertion,
|
|
182
|
+
Passkey.client,
|
|
183
|
+
];
|
|
184
|
+
return {
|
|
185
|
+
routes,
|
|
186
|
+
/** Create forms in the handler before returning JSX, so ovr can set the binding cookie. */
|
|
187
|
+
forms(c, props = {}) {
|
|
188
|
+
const passkey = new Passkey(c, state(c));
|
|
189
|
+
const Register = passkey.form(register, "register", {
|
|
190
|
+
...props,
|
|
191
|
+
endpoint: registration.url(),
|
|
192
|
+
});
|
|
193
|
+
const Login = passkey.form(login, "login", {
|
|
194
|
+
...props,
|
|
195
|
+
endpoint: assertion.url(),
|
|
196
|
+
});
|
|
197
|
+
const failure = c.url.searchParams.get("_auth");
|
|
198
|
+
const retry = Number(c.url.searchParams.get("_retry"));
|
|
199
|
+
const wait = Number.isSafeInteger(retry) && retry > 0
|
|
200
|
+
? Math.min(3600, Math.max(0, Math.ceil((retry - Date.now()) / 1000)))
|
|
201
|
+
: undefined;
|
|
202
|
+
const error = (method, component) => (props) => component({
|
|
203
|
+
...props,
|
|
204
|
+
children: props.children ??
|
|
205
|
+
(failure === method
|
|
206
|
+
? wait !== undefined
|
|
207
|
+
? `Too many authentication requests. ${wait ? `Try again in ${wait} seconds.` : "Try again now."}${method === "register" ? " If you already registered, sign in." : ""}`
|
|
208
|
+
: method === "register"
|
|
209
|
+
? "Registration could not be completed. If you already registered, sign in; otherwise try again."
|
|
210
|
+
: "Authentication failed. Try again."
|
|
211
|
+
: undefined),
|
|
212
|
+
});
|
|
213
|
+
Register.Issue = error("register", Register.Issue);
|
|
214
|
+
Login.Issue = error("login", Login.Issue);
|
|
215
|
+
return {
|
|
216
|
+
Register: Object.assign(Register, {
|
|
217
|
+
Field: fields.Field,
|
|
218
|
+
Fields: fields.Fields,
|
|
219
|
+
}),
|
|
220
|
+
Login,
|
|
221
|
+
Logout: (props) => jsx(logout.Form, {
|
|
222
|
+
...props,
|
|
223
|
+
children: props.children ?? jsx("button", { children: "Log out" }),
|
|
224
|
+
}),
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Strict DER decoding for WebAuthn ES256 signatures. */
|
|
2
|
+
export declare class DER {
|
|
3
|
+
/** Convert a canonical DER ECDSA signature into Web Crypto's 64-byte format. */
|
|
4
|
+
static unwrap(der: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=der.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"der.d.ts","sourceRoot":"","sources":["../../src/auth/der.ts"],"names":[],"mappings":"AAEA,yDAAyD;AACzD,qBAAa,GAAG;IACf,gFAAgF;IAChF,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,2BA4BzC;CACD"}
|
package/dist/auth/der.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Issue } from "./issue.js";
|
|
2
|
+
/** Strict DER decoding for WebAuthn ES256 signatures. */
|
|
3
|
+
export class DER {
|
|
4
|
+
/** Convert a canonical DER ECDSA signature into Web Crypto's 64-byte format. */
|
|
5
|
+
static unwrap(der) {
|
|
6
|
+
if (der.length < 8 ||
|
|
7
|
+
der.length > 72 ||
|
|
8
|
+
der[0] !== 0x30 ||
|
|
9
|
+
der[1] !== der.length - 2)
|
|
10
|
+
throw new Issue("DER signature");
|
|
11
|
+
const raw = new Uint8Array(64);
|
|
12
|
+
let offset = 2;
|
|
13
|
+
for (let i = 0; i < 2; i++) {
|
|
14
|
+
if (der[offset++] !== 2)
|
|
15
|
+
throw new Issue("DER integer");
|
|
16
|
+
const length = der[offset++];
|
|
17
|
+
if (!length || length > 33 || offset + length > der.length)
|
|
18
|
+
throw new Issue("DER integer length");
|
|
19
|
+
let value = der.subarray(offset, offset + length);
|
|
20
|
+
offset += length;
|
|
21
|
+
if (value[0] & 128)
|
|
22
|
+
throw new Issue("DER negative integer");
|
|
23
|
+
if (value[0] === 0 && value.length > 1) {
|
|
24
|
+
if (!(value[1] & 128))
|
|
25
|
+
throw new Issue("DER integer padding");
|
|
26
|
+
value = value.subarray(1);
|
|
27
|
+
}
|
|
28
|
+
if (value.length > 32 || value.every((v) => v === 0))
|
|
29
|
+
throw new Issue("DER integer");
|
|
30
|
+
raw.set(value, (i + 1) * 32 - value.length);
|
|
31
|
+
}
|
|
32
|
+
if (offset !== der.length)
|
|
33
|
+
throw new Issue("DER signature length");
|
|
34
|
+
return raw;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { type App, agents, mount } from "../app/index.js";
|
|
2
|
+
import { type Context as ContextType } from "../context/index.js";
|
|
3
|
+
import { type Database } from "../database/index.js";
|
|
4
|
+
import type { Field, Form } from "../form/index.js";
|
|
5
|
+
import type { JSX } from "../jsx/index.js";
|
|
6
|
+
import type { Mcp } from "../mcp/index.js";
|
|
7
|
+
import type { Route } from "../route/index.js";
|
|
8
|
+
import type { Schema } from "../schema/index.js";
|
|
9
|
+
import type { Table } from "../table/index.js";
|
|
10
|
+
export declare namespace Auth {
|
|
11
|
+
/** Authentication validation issue. */
|
|
12
|
+
/** Request capabilities required while preparing the built-in UI. */
|
|
13
|
+
export type Context = Pick<ContextType, "url" | "cookie" | "res" | "multipart"> & {
|
|
14
|
+
data: (options?: {
|
|
15
|
+
payload: number;
|
|
16
|
+
}) => Promise<unknown>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Request-scoped UI pieces with application field names preserved.
|
|
20
|
+
*
|
|
21
|
+
* @template Shape Registration fields of the users table
|
|
22
|
+
*/
|
|
23
|
+
export interface Forms<Shape extends Field.Shape> {
|
|
24
|
+
Register: Route.Form<string> & {
|
|
25
|
+
Field: Form<Shape>["Field"];
|
|
26
|
+
Fields: Form<Shape>["Fields"];
|
|
27
|
+
Issue: (props: JSX.IntrinsicElements["p"]) => JSX.Element;
|
|
28
|
+
};
|
|
29
|
+
Login: Route.Form<string> & {
|
|
30
|
+
Issue: (props: JSX.IntrinsicElements["p"]) => JSX.Element;
|
|
31
|
+
};
|
|
32
|
+
Logout: Route.Form<string>;
|
|
33
|
+
}
|
|
34
|
+
/** A revocable session with a fixed lifetime, from `c.session()`. */
|
|
35
|
+
export type Session = ContextType.Session;
|
|
36
|
+
/** A users table with a text `id`, which Auth creates accounts in. */
|
|
37
|
+
export type Users = Table<string, any, any> & {
|
|
38
|
+
readonly shape: {
|
|
39
|
+
readonly id: Schema<string>;
|
|
40
|
+
readonly credential?: never;
|
|
41
|
+
readonly ceremony?: never;
|
|
42
|
+
readonly bootstrap?: never;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Columns of a users table the server sets with defaults, such as a role.
|
|
47
|
+
*
|
|
48
|
+
* @template U Users table
|
|
49
|
+
*/
|
|
50
|
+
export type Defaulted<U extends Users> = U["options"] extends {
|
|
51
|
+
readonly default: readonly (infer K)[];
|
|
52
|
+
} ? K : never;
|
|
53
|
+
/**
|
|
54
|
+
* Columns of a users table Auth cannot fill when it creates a user, other
|
|
55
|
+
* than `id`, form fields, nullable columns, and columns with defaults.
|
|
56
|
+
*
|
|
57
|
+
* @template U Users table
|
|
58
|
+
*/
|
|
59
|
+
export type Unfilled<U extends Users> = U extends Table<string, infer S, infer O> ? Exclude<Table.Key<S>, "id" | Table.Defaulted<S, O> | {
|
|
60
|
+
[K in keyof S]: S[K] extends Field.Any ? K : never;
|
|
61
|
+
}[keyof S]> : never;
|
|
62
|
+
/**
|
|
63
|
+
* Registration fields of a users table, its form fields except `id` and
|
|
64
|
+
* columns with defaults.
|
|
65
|
+
*
|
|
66
|
+
* @template U Users table
|
|
67
|
+
*/
|
|
68
|
+
export type Fields<U extends Users> = {
|
|
69
|
+
[K in keyof U["shape"] as K extends "id" | Defaulted<U> ? never : U["shape"][K] extends Field.Any ? K : never]: Extract<U["shape"][K], Field.Any>;
|
|
70
|
+
};
|
|
71
|
+
/** Auth's own endpoints, which its page cannot be */
|
|
72
|
+
type Endpoint = "/auth/register" | "/auth/login" | "/auth/logout" | "/_passkey/options/register" | "/_passkey/options/login" | "/_passkey/client.js";
|
|
73
|
+
/**
|
|
74
|
+
* A page path, a path of the app's own that is not one of Auth's endpoints.
|
|
75
|
+
*
|
|
76
|
+
* @template P Page path
|
|
77
|
+
*/
|
|
78
|
+
export type Page<P extends string> = P extends Endpoint ? "Auth's page cannot be one of its endpoints" : Route.Path<P>;
|
|
79
|
+
/**
|
|
80
|
+
* Authentication configuration; all instances share the database.
|
|
81
|
+
*
|
|
82
|
+
* @template U Users table
|
|
83
|
+
* @template P Page path
|
|
84
|
+
* @template R Redirect path
|
|
85
|
+
* @template C Consent page path
|
|
86
|
+
*/
|
|
87
|
+
export interface Options<U extends Users = Users, P extends string = string, R extends string = string, C extends string = string> {
|
|
88
|
+
/** Signing secret(s), each at least 32 UTF-8 bytes. Seal with the first; accept all during rotation. */
|
|
89
|
+
readonly secret: string | readonly [string, ...string[]];
|
|
90
|
+
/** Trusted HTTPS origin, for example `https://example.com`. */
|
|
91
|
+
readonly origin: string;
|
|
92
|
+
/**
|
|
93
|
+
* Database containing `Auth.tables`, which stores challenges, sessions,
|
|
94
|
+
* credentials, and rate limits, and the users table.
|
|
95
|
+
*/
|
|
96
|
+
readonly database: Database & Database.Tables<typeof Auth.tables> & Database.Tables<readonly [U]>;
|
|
97
|
+
/**
|
|
98
|
+
* Time in milliseconds a session lasts without being used; defaults to
|
|
99
|
+
* one week. Using it renews it, at most once a day.
|
|
100
|
+
*/
|
|
101
|
+
readonly idle?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Time in milliseconds from sign-in after which a session ends, however
|
|
104
|
+
* recently it was used; defaults to 30 days.
|
|
105
|
+
*/
|
|
106
|
+
readonly lifetime?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Users table in `database`. Its form fields, other than `id` and
|
|
109
|
+
* columns with defaults, are the registration form, and registering
|
|
110
|
+
* inserts the row in the transaction that stores the first passkey.
|
|
111
|
+
* Columns with defaults, such as a role, are set by the server, so a
|
|
112
|
+
* signup cannot choose them. Its other columns need defaults or must be nullable. The first
|
|
113
|
+
* field, such as an email, names the passkey.
|
|
114
|
+
*/
|
|
115
|
+
readonly users: U & ([Unfilled<U>] extends [never] ? unknown : `Give the users table's ${Unfilled<U>} column a default`);
|
|
116
|
+
/** Authentication page, also used for generic failure redirects. Defaults to /login. */
|
|
117
|
+
readonly page?: Page<P>;
|
|
118
|
+
/** Destination after registration or login. Defaults to /. */
|
|
119
|
+
readonly redirect?: Route.Path<R>;
|
|
120
|
+
/**
|
|
121
|
+
* Page where users approve agents, which sign in when an MCP endpoint is
|
|
122
|
+
* given this `auth`. The page calls `auth.consent(c)` for the request and
|
|
123
|
+
* its form. Defaults to /connect.
|
|
124
|
+
*/
|
|
125
|
+
readonly consent?: Route.Path<C>;
|
|
126
|
+
}
|
|
127
|
+
/** An agent's request to act for the user, shown on the consent page. */
|
|
128
|
+
export interface Consent {
|
|
129
|
+
/** The agent asking */
|
|
130
|
+
readonly client: {
|
|
131
|
+
/**
|
|
132
|
+
* Client ID, the URL of the agent's metadata document. Its origin is
|
|
133
|
+
* who publishes the agent, show it on the page.
|
|
134
|
+
*/
|
|
135
|
+
readonly id: string;
|
|
136
|
+
/** Name the agent gives itself, not verified */
|
|
137
|
+
readonly name: string;
|
|
138
|
+
};
|
|
139
|
+
/** Host the user returns to after deciding */
|
|
140
|
+
readonly redirect: string;
|
|
141
|
+
/** Form with Allow, confirmed with the user's passkey, and Deny buttons; custom `children` deny with `formaction="/oauth/deny"` */
|
|
142
|
+
readonly Form: (props: JSX.IntrinsicElements["form"]) => JSX.Element;
|
|
143
|
+
}
|
|
144
|
+
/** Stored ES256 passkey, including state updated after each login. */
|
|
145
|
+
export interface Credential {
|
|
146
|
+
id: string;
|
|
147
|
+
user: string;
|
|
148
|
+
/** SPKI-encoded P-256 public key as base64url. */
|
|
149
|
+
publicKey: string;
|
|
150
|
+
counter: number;
|
|
151
|
+
/** Whether the credential is eligible for backup; this must not change. */
|
|
152
|
+
eligible: boolean;
|
|
153
|
+
/** Current backup state, which may change. */
|
|
154
|
+
backedUp: boolean;
|
|
155
|
+
}
|
|
156
|
+
export {};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Complete passkey authentication stored in the application's Postgres database.
|
|
160
|
+
*
|
|
161
|
+
* @template U Users table, whose form fields are the registration form
|
|
162
|
+
*/
|
|
163
|
+
export declare class Auth<U extends Auth.Users = Auth.Users, P extends string = string, R extends string = string, C extends string = string> {
|
|
164
|
+
#private;
|
|
165
|
+
/**
|
|
166
|
+
* Tables Auth stores its data in, include them in the database's tables.
|
|
167
|
+
* `database.migrate` then creates them, and `database.check` checks them.
|
|
168
|
+
*/
|
|
169
|
+
static readonly tables: readonly [Table<"auth_credentials", {
|
|
170
|
+
id: Schema<string>;
|
|
171
|
+
user: Schema<string>;
|
|
172
|
+
publicKey: Schema<string>;
|
|
173
|
+
counter: Schema<number>;
|
|
174
|
+
eligible: Schema<boolean>;
|
|
175
|
+
backedUp: Schema<boolean>;
|
|
176
|
+
}, {}>, Table<"auth_sessions", {
|
|
177
|
+
id: Schema<string>;
|
|
178
|
+
user: Schema<string>;
|
|
179
|
+
expiration: Schema<number>;
|
|
180
|
+
started: Schema<number>;
|
|
181
|
+
}, {}>, Table<"auth_challenges", {
|
|
182
|
+
id: Schema<string>;
|
|
183
|
+
challenge: Schema<string>;
|
|
184
|
+
browser: Schema<string>;
|
|
185
|
+
method: Schema<"login" | "register">;
|
|
186
|
+
action: Schema<string>;
|
|
187
|
+
origin: Schema<string>;
|
|
188
|
+
expiration: Schema<number>;
|
|
189
|
+
user: Schema<string | null>;
|
|
190
|
+
fields: Schema<string | null>;
|
|
191
|
+
}, {}>, Table<"rate_limits", {
|
|
192
|
+
key: Schema<string>;
|
|
193
|
+
tokens: Schema<number>;
|
|
194
|
+
time: Schema<number>;
|
|
195
|
+
expiration: Schema<number>;
|
|
196
|
+
}, {}>, Table<"auth_tokens", {
|
|
197
|
+
id: Schema<string>;
|
|
198
|
+
kind: Schema<"access" | "code" | "refresh" | "spent">;
|
|
199
|
+
user: Schema<string>;
|
|
200
|
+
client: Schema<string>;
|
|
201
|
+
resource: Schema<string>;
|
|
202
|
+
scope: Schema<string>;
|
|
203
|
+
redirect: Schema<string | null>;
|
|
204
|
+
challenge: Schema<string | null>;
|
|
205
|
+
family: Schema<string>;
|
|
206
|
+
expiration: Schema<number>;
|
|
207
|
+
}, {}>];
|
|
208
|
+
/**
|
|
209
|
+
* Read an agent's authorization request on the consent page, with the form
|
|
210
|
+
* to allow or deny it. `null` when the request is invalid or expired.
|
|
211
|
+
*/
|
|
212
|
+
readonly consent: (c: Auth.Context) => Promise<Auth.Consent | null>;
|
|
213
|
+
/** Signs agents in for an MCP endpoint given this `auth`, internal to ovr. */
|
|
214
|
+
readonly [agents]: Mcp.Auth[typeof agents];
|
|
215
|
+
/** Prepare request-scoped UI in the handler before returning JSX. */
|
|
216
|
+
readonly forms: (c: Auth.Context, props?: {
|
|
217
|
+
nonce?: string;
|
|
218
|
+
}) => Auth.Forms<Auth.Fields<U>>;
|
|
219
|
+
/** Configure passkeys, session helpers, and automatic authentication rate limits. */
|
|
220
|
+
constructor(options: Auth.Options<U, P, R, C>);
|
|
221
|
+
/** Mounted by `app.use(auth)`, and lets every request read its session. */
|
|
222
|
+
[mount](): ReturnType<App.Service[typeof mount]>;
|
|
223
|
+
/** Establish a session for an already-authorized user with a non-blank ID of at most 1024 UTF-8 bytes. Built-in passkey handlers do this automatically. */
|
|
224
|
+
readonly login: (c: Pick<Auth.Context, "url" | "cookie" | "res">, user: string) => Promise<{
|
|
225
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
226
|
+
user: string;
|
|
227
|
+
expiration: number;
|
|
228
|
+
}>;
|
|
229
|
+
/** Revoke the current session and expire its cookie. Always await this method. */
|
|
230
|
+
readonly logout: (c: Pick<Auth.Context, "url" | "cookie" | "res">) => Promise<null>;
|
|
231
|
+
/**
|
|
232
|
+
* Disconnect one of the signed-in user's agents. Once it resolves, the
|
|
233
|
+
* agent's codes and tokens no longer work, including ones a refresh was
|
|
234
|
+
* issuing meanwhile, and connecting again needs the user's consent.
|
|
235
|
+
*
|
|
236
|
+
* @param c Request context of the signed-in user
|
|
237
|
+
* @param client Agent's client ID, from `auth_tokens`
|
|
238
|
+
* @throws When nobody is signed in
|
|
239
|
+
*/
|
|
240
|
+
readonly disconnect: (c: Pick<Auth.Context, "url" | "cookie" | "res">, client: string) => Promise<void>;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,KAAK,OAAO,IAAI,WAAW,EAAY,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,yBAAiB,IAAI,CAAC;IACrB,uCAAuC;IAEvC,qEAAqE;IACrE,MAAM,MAAM,OAAO,GAAG,IAAI,CACzB,WAAW,EACX,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,WAAW,CACtC,GAAG;QAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;IAClE;;;;OAIG;IACH,MA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