@lovable.dev/mcp-js 0.22.1 → 0.22.2-rc.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/dist/authorize-CumVyk7p.d.cts +27 -0
- package/dist/authorize-D6p4-9_D.d.ts +27 -0
- package/dist/base-DCe0kP79.d.cts +29 -0
- package/dist/base-DCe0kP79.d.ts +29 -0
- package/dist/cli/extract-manifest.cjs +116 -201
- package/dist/cli/extract-manifest.d.cts +1 -1
- package/dist/cli/extract-manifest.d.ts +1 -1
- package/dist/cli/extract-manifest.js +117 -156
- package/dist/content-D5LJAHyM.js +12 -0
- package/dist/content-NCYIGgOb.cjs +17 -0
- package/dist/context-BweeEcoA.cjs +56 -0
- package/dist/context-CIpPzN7P.js +51 -0
- package/dist/cors-CSDhBjFd.cjs +913 -0
- package/dist/cors-rWp_tbLZ.js +830 -0
- package/dist/forwarded--h4efJy-.js +43 -0
- package/dist/forwarded-Pi8Hs5Ps.cjs +48 -0
- package/dist/fs-errors-CWNzOV75.cjs +11 -0
- package/dist/fs-errors-PA2t1TIp.js +6 -0
- package/dist/index.cjs +129 -329
- package/dist/index.d.cts +26 -26
- package/dist/index.d.ts +26 -26
- package/dist/index.js +118 -177
- package/dist/{io-D4srzRKc.d.ts → io-CfSPxeBN.d.ts} +6 -4
- package/dist/io-DPYvBqET.d.cts +15 -0
- package/dist/list-tools-B4TTPEl1.d.cts +8 -0
- package/dist/list-tools-CFUX-uo-.cjs +57 -0
- package/dist/list-tools-DVJrjtmH.js +46 -0
- package/dist/list-tools-bh6-eqZM.d.ts +8 -0
- package/dist/logger-2OXtfiIW.js +141 -0
- package/dist/logger-BqPOa_E1.cjs +194 -0
- package/dist/mcp-BNcpj8o7.cjs +128 -0
- package/dist/mcp-Bx3bJHzH.js +123 -0
- package/dist/metadata-path-CAkNcfyY.js +12 -0
- package/dist/metadata-path-zd7NSNoa.cjs +17 -0
- package/dist/package-CgwD4Ywz.js +4 -0
- package/dist/package-DzstF8Ih.cjs +9 -0
- package/dist/paths-IS65L6TA.js +7 -0
- package/dist/paths-OP318a6c.cjs +18 -0
- package/dist/protocols/mcp/index.cjs +3 -750
- package/dist/protocols/mcp/index.d.cts +6 -7
- package/dist/protocols/mcp/index.d.ts +6 -7
- package/dist/protocols/mcp/index.js +2 -12
- package/dist/protocols/oauth-metadata.cjs +48 -539
- package/dist/protocols/oauth-metadata.d.cts +5 -6
- package/dist/protocols/oauth-metadata.d.ts +5 -6
- package/dist/protocols/oauth-metadata.js +52 -10
- package/dist/protocols/rest/index.cjs +5 -843
- package/dist/protocols/rest/index.d.cts +7 -10
- package/dist/protocols/rest/index.d.ts +7 -10
- package/dist/protocols/rest/index.js +3 -16
- package/dist/rest-BRshnow2.js +117 -0
- package/dist/rest-C4ZEGSIV.cjs +122 -0
- package/dist/stacks/supabase/index.cjs +76 -1318
- package/dist/stacks/supabase/index.d.cts +29 -30
- package/dist/stacks/supabase/index.d.ts +29 -30
- package/dist/stacks/supabase/index.js +73 -89
- package/dist/stacks/supabase/vite.cjs +258 -287
- package/dist/stacks/supabase/vite.d.cts +24 -24
- package/dist/stacks/supabase/vite.d.ts +24 -24
- package/dist/stacks/supabase/vite.js +252 -252
- package/dist/stacks/tanstack/index.cjs +42 -1272
- package/dist/stacks/tanstack/index.d.cts +8 -9
- package/dist/stacks/tanstack/index.d.ts +8 -9
- package/dist/stacks/tanstack/index.js +36 -41
- package/dist/stacks/tanstack/vite.cjs +223 -312
- package/dist/stacks/tanstack/vite.d.cts +80 -81
- package/dist/stacks/tanstack/vite.d.ts +80 -81
- package/dist/stacks/tanstack/vite.js +216 -282
- package/dist/types-BYdYYTjk.d.cts +321 -0
- package/dist/types-BYdYYTjk.d.ts +321 -0
- package/package.json +4 -4
- package/dist/authorize-BMeXd_Sh.d.ts +0 -25
- package/dist/base-CM-KCpp6.d.ts +0 -28
- package/dist/chunk-5HVSJCKE.js +0 -114
- package/dist/chunk-6DXGZZA4.js +0 -6
- package/dist/chunk-6QFZYYUV.js +0 -11
- package/dist/chunk-6SZOFKGH.js +0 -58
- package/dist/chunk-H37EB22A.js +0 -125
- package/dist/chunk-IFDWUM7L.js +0 -741
- package/dist/chunk-IXZIFYO6.js +0 -79
- package/dist/chunk-MA5H6PSF.js +0 -46
- package/dist/chunk-TJN33K5U.js +0 -141
- package/dist/chunk-UQK5UO6C.js +0 -26
- package/dist/chunk-XQWJN6DC.js +0 -14
- package/dist/chunk-Y3ZFPEQH.js +0 -8
- package/dist/chunk-ZQXSWTPU.js +0 -6
- package/dist/types-qqrmJ736.d.ts +0 -321
package/dist/chunk-IFDWUM7L.js
DELETED
|
@@ -1,741 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_METRICS_ENDPOINT,
|
|
3
|
-
LOG_LEVEL_ENV_VAR,
|
|
4
|
-
applyLogLevelFromEnv,
|
|
5
|
-
describeError,
|
|
6
|
-
log,
|
|
7
|
-
parseSafeUrl,
|
|
8
|
-
resolveMetricsConfig,
|
|
9
|
-
trimTrailingSlash
|
|
10
|
-
} from "./chunk-H37EB22A.js";
|
|
11
|
-
import {
|
|
12
|
-
OAUTH_PROTECTED_RESOURCE_METADATA_PATH
|
|
13
|
-
} from "./chunk-6DXGZZA4.js";
|
|
14
|
-
import {
|
|
15
|
-
version
|
|
16
|
-
} from "./chunk-ZQXSWTPU.js";
|
|
17
|
-
|
|
18
|
-
// src/core/http.ts
|
|
19
|
-
var JSON_HEADERS = { "Content-Type": "application/json" };
|
|
20
|
-
function headResponse(response) {
|
|
21
|
-
return new Response(null, { status: response.status, statusText: response.statusText, headers: response.headers });
|
|
22
|
-
}
|
|
23
|
-
function methodNotAllowed(allow) {
|
|
24
|
-
return new Response(JSON.stringify({ error: "method not allowed" }), {
|
|
25
|
-
status: 405,
|
|
26
|
-
headers: { ...JSON_HEADERS, Allow: allow }
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/auth/resource.ts
|
|
31
|
-
function resolveProtectedResource(auth, request, options) {
|
|
32
|
-
if (auth.resource)
|
|
33
|
-
return trimTrailingSlash(auth.resource);
|
|
34
|
-
const path = resolveResourcePath(options.resourcePath, request);
|
|
35
|
-
const resourceURL = new URL(path, request.url);
|
|
36
|
-
resourceURL.search = "";
|
|
37
|
-
resourceURL.hash = "";
|
|
38
|
-
return trimTrailingSlash(resourceURL.toString());
|
|
39
|
-
}
|
|
40
|
-
function assertResourcePathShape(resourcePath, label = "resourcePath") {
|
|
41
|
-
if (!resourcePath.startsWith("/") || resourcePath.startsWith("//") || resourcePath.includes("\\") || /(^|\/)\.\.(\/|$)/.test(resourcePath)) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`@lovable.dev/mcp-js: ${label} must be an absolute path beginning with "/" without ".." segments or backslashes (got ${JSON.stringify(resourcePath)})`
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function resolveResourcePath(resourcePath, request) {
|
|
48
|
-
if (resourcePath === void 0)
|
|
49
|
-
return new URL(request.url).pathname;
|
|
50
|
-
assertResourcePathShape(resourcePath);
|
|
51
|
-
return resourcePath;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// src/metrics/otlp.ts
|
|
55
|
-
var SCOPE_NAME = "@lovable.dev/mcp-js";
|
|
56
|
-
var EVENT_NAME = "mcp.tool.invocation";
|
|
57
|
-
var SEVERITY_INFO = 9;
|
|
58
|
-
function strAttr(key, value) {
|
|
59
|
-
return { key, value: { stringValue: value } };
|
|
60
|
-
}
|
|
61
|
-
function intAttr(key, value) {
|
|
62
|
-
return { key, value: { intValue: String(Math.round(value)) } };
|
|
63
|
-
}
|
|
64
|
-
function toLogRecord(rec) {
|
|
65
|
-
const attributes = [
|
|
66
|
-
strAttr("event.name", EVENT_NAME),
|
|
67
|
-
strAttr("mcp.method", rec.method),
|
|
68
|
-
strAttr("mcp.outcome", rec.outcome),
|
|
69
|
-
intAttr("mcp.duration_ms", rec.durationMs)
|
|
70
|
-
];
|
|
71
|
-
if (rec.tool !== null)
|
|
72
|
-
attributes.push(strAttr("mcp.tool", rec.tool));
|
|
73
|
-
if (rec.reqBytes !== void 0)
|
|
74
|
-
attributes.push(intAttr("mcp.request_size_bytes", rec.reqBytes));
|
|
75
|
-
if (rec.resBytes !== void 0)
|
|
76
|
-
attributes.push(intAttr("mcp.response_size_bytes", rec.resBytes));
|
|
77
|
-
attributes.push(strAttr("mcp.stack", rec.stack));
|
|
78
|
-
if (rec.endUserId !== void 0)
|
|
79
|
-
attributes.push(strAttr("mcp.end_user_id", rec.endUserId));
|
|
80
|
-
return {
|
|
81
|
-
timeUnixNano: rec.timeUnixNano,
|
|
82
|
-
observedTimeUnixNano: rec.timeUnixNano,
|
|
83
|
-
severityNumber: SEVERITY_INFO,
|
|
84
|
-
severityText: "INFO",
|
|
85
|
-
body: { stringValue: EVENT_NAME },
|
|
86
|
-
attributes
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function buildLogsPayload(records, server) {
|
|
90
|
-
return JSON.stringify({
|
|
91
|
-
resourceLogs: [
|
|
92
|
-
{
|
|
93
|
-
resource: {
|
|
94
|
-
attributes: [
|
|
95
|
-
strAttr("service.name", server.name),
|
|
96
|
-
strAttr("service.version", server.version),
|
|
97
|
-
strAttr("telemetry.sdk.name", SCOPE_NAME),
|
|
98
|
-
strAttr("telemetry.sdk.version", version),
|
|
99
|
-
strAttr("telemetry.sdk.language", "webjs")
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
scopeLogs: [
|
|
103
|
-
{
|
|
104
|
-
scope: { name: SCOPE_NAME, version },
|
|
105
|
-
logRecords: records.map(toLogRecord)
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function nowUnixNano() {
|
|
113
|
-
return `${Date.now()}000000`;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// src/metrics/impl/base.ts
|
|
117
|
-
function nowMs() {
|
|
118
|
-
return typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
119
|
-
}
|
|
120
|
-
var NOOP_RECORDER = { async emit() {
|
|
121
|
-
} };
|
|
122
|
-
function createNoopRecorder() {
|
|
123
|
-
return NOOP_RECORDER;
|
|
124
|
-
}
|
|
125
|
-
function readProcessEnv(name) {
|
|
126
|
-
try {
|
|
127
|
-
return typeof process !== "undefined" ? process.env?.[name] || void 0 : void 0;
|
|
128
|
-
} catch {
|
|
129
|
-
return void 0;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
var BaseMetricRecorder = class {
|
|
133
|
-
constructor(config, server, deps = {}) {
|
|
134
|
-
this.config = config;
|
|
135
|
-
this.server = server;
|
|
136
|
-
this.deps = deps;
|
|
137
|
-
this.doFetch = deps.fetch ?? (typeof globalThis.fetch === "function" ? globalThis.fetch.bind(globalThis) : void 0);
|
|
138
|
-
this.usesLovableEndpoint = config.endpoint === DEFAULT_METRICS_ENDPOINT;
|
|
139
|
-
const headers = {};
|
|
140
|
-
if (!this.usesLovableEndpoint) {
|
|
141
|
-
for (const [key, value] of Object.entries(config.headers)) {
|
|
142
|
-
if (key.toLowerCase() !== "content-type")
|
|
143
|
-
headers[key] = value;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
headers["content-type"] = "application/json";
|
|
147
|
-
this.baseHeaders = headers;
|
|
148
|
-
}
|
|
149
|
-
doFetch;
|
|
150
|
-
usesLovableEndpoint;
|
|
151
|
-
baseHeaders;
|
|
152
|
-
apiKey;
|
|
153
|
-
lazyLogLevelApplied = false;
|
|
154
|
-
async emit(ev) {
|
|
155
|
-
await this.applyLazyLogLevel();
|
|
156
|
-
log.info("tool.invoked", {
|
|
157
|
-
tool: ev.tool,
|
|
158
|
-
method: ev.method,
|
|
159
|
-
outcome: ev.outcome,
|
|
160
|
-
durationMs: ev.durationMs,
|
|
161
|
-
stack: this.stack,
|
|
162
|
-
...ev.errorText !== void 0 && { errorText: ev.errorText }
|
|
163
|
-
});
|
|
164
|
-
if (!this.config.enabled)
|
|
165
|
-
return;
|
|
166
|
-
if (!this.doFetch) {
|
|
167
|
-
log.warn("metrics.disabled_no_fetch", { endpoint: this.config.endpoint });
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const headers = { ...this.baseHeaders };
|
|
171
|
-
if (this.usesLovableEndpoint) {
|
|
172
|
-
const key = await this.resolveApiKey();
|
|
173
|
-
if (!key) {
|
|
174
|
-
log.warn("metrics.disabled_no_api_key", { envVar: this.config.apiKeyEnvVar, endpoint: this.config.endpoint });
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
headers.authorization = `Bearer ${key}`;
|
|
178
|
-
}
|
|
179
|
-
const body = buildLogsPayload([{ ...ev, timeUnixNano: nowUnixNano(), stack: this.stack }], this.server);
|
|
180
|
-
try {
|
|
181
|
-
const res = await this.doFetch(this.config.endpoint, { method: "POST", headers, body, keepalive: true });
|
|
182
|
-
if (!res.ok)
|
|
183
|
-
log.warn("metrics.rejected", { status: res.status, endpoint: this.config.endpoint });
|
|
184
|
-
} catch (err) {
|
|
185
|
-
log.warn("metrics.failed", { ...describeError(err), endpoint: this.config.endpoint });
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
// Cache only a successful resolution so a miss is retried on the next emit (the
|
|
189
|
-
// Cloudflare binding may not be readable on the very first attempt in an isolate).
|
|
190
|
-
async resolveApiKey() {
|
|
191
|
-
if (this.apiKey)
|
|
192
|
-
return this.apiKey;
|
|
193
|
-
this.apiKey = this.deps.getApiKey ? this.deps.getApiKey() : await this.readEnv(this.config.apiKeyEnvVar);
|
|
194
|
-
return this.apiKey;
|
|
195
|
-
}
|
|
196
|
-
async applyLazyLogLevel() {
|
|
197
|
-
if (this.lazyLogLevelApplied)
|
|
198
|
-
return;
|
|
199
|
-
this.lazyLogLevelApplied = true;
|
|
200
|
-
applyLogLevelFromEnv(await this.readEnv(LOG_LEVEL_ENV_VAR));
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// src/metrics/impl/cloudflare.ts
|
|
205
|
-
var cloudflareEnvPromise;
|
|
206
|
-
async function readCloudflareEnv(name) {
|
|
207
|
-
try {
|
|
208
|
-
const moduleSpecifier = "cloudflare:workers";
|
|
209
|
-
cloudflareEnvPromise ??= import(
|
|
210
|
-
/* @vite-ignore */
|
|
211
|
-
moduleSpecifier
|
|
212
|
-
).then((m) => m.env).catch((err) => {
|
|
213
|
-
log.debug("metrics.cloudflare_env_import_failed", describeError(err));
|
|
214
|
-
return void 0;
|
|
215
|
-
});
|
|
216
|
-
const env = await cloudflareEnvPromise;
|
|
217
|
-
const raw = env?.[name];
|
|
218
|
-
const value = typeof raw === "string" && raw ? raw : void 0;
|
|
219
|
-
log.debug("metrics.read_cloudflare_env", { name, hasEnvBinding: !!env, found: value !== void 0 });
|
|
220
|
-
return value;
|
|
221
|
-
} catch (err) {
|
|
222
|
-
log.debug("metrics.read_cloudflare_env_error", { name, ...describeError(err) });
|
|
223
|
-
return void 0;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
var TanStackMetricRecorder = class extends BaseMetricRecorder {
|
|
227
|
-
stack = "tanstack";
|
|
228
|
-
async readEnv(name) {
|
|
229
|
-
return readProcessEnv(name) ?? await readCloudflareEnv(name);
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
// src/metrics/impl/supabase.ts
|
|
234
|
-
function readDenoEnv(name) {
|
|
235
|
-
try {
|
|
236
|
-
const denoEnv = globalThis.Deno?.env;
|
|
237
|
-
const value = denoEnv?.get?.(name) || void 0;
|
|
238
|
-
log.debug("metrics.read_deno_env", { name, hasDenoEnv: !!denoEnv, found: !!value });
|
|
239
|
-
return value;
|
|
240
|
-
} catch (err) {
|
|
241
|
-
log.debug("metrics.read_deno_env_error", { name, ...describeError(err) });
|
|
242
|
-
return void 0;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
var SupabaseMetricRecorder = class extends BaseMetricRecorder {
|
|
246
|
-
stack = "supabase";
|
|
247
|
-
async readEnv(name) {
|
|
248
|
-
return readDenoEnv(name) ?? readProcessEnv(name);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
// src/metrics/recorder.ts
|
|
253
|
-
function createRecorderForRuntime(mcp, opts) {
|
|
254
|
-
const config = resolveMetricsConfig(mcp.metrics);
|
|
255
|
-
const server = { name: mcp.name, version: mcp.version };
|
|
256
|
-
if (!config.enabled)
|
|
257
|
-
return createNoopRecorder();
|
|
258
|
-
return opts.stack === "tanstack" ? new TanStackMetricRecorder(config, server) : new SupabaseMetricRecorder(config, server);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// src/core/promise.ts
|
|
262
|
-
function cachedPromise(load, label) {
|
|
263
|
-
let settled = false;
|
|
264
|
-
let value;
|
|
265
|
-
return async () => {
|
|
266
|
-
if (settled) {
|
|
267
|
-
if (label)
|
|
268
|
-
log.debug(`${label}.cache_hit`);
|
|
269
|
-
return value;
|
|
270
|
-
}
|
|
271
|
-
if (label)
|
|
272
|
-
log.debug(`${label}.load_start`);
|
|
273
|
-
try {
|
|
274
|
-
const loaded = await load();
|
|
275
|
-
settled = true;
|
|
276
|
-
value = loaded;
|
|
277
|
-
if (label)
|
|
278
|
-
log.debug(`${label}.settled`);
|
|
279
|
-
return loaded;
|
|
280
|
-
} catch (err) {
|
|
281
|
-
if (label)
|
|
282
|
-
log.debug(`${label}.load_failed`, describeError(err));
|
|
283
|
-
throw err;
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// src/auth/discovery.ts
|
|
289
|
-
var OAuthConfigurationError = class extends Error {
|
|
290
|
-
constructor(message) {
|
|
291
|
-
super(message);
|
|
292
|
-
this.name = "OAuthConfigurationError";
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
var METADATA_FETCH_TIMEOUT_MS = 5e3;
|
|
296
|
-
function issuerPath(url) {
|
|
297
|
-
const path = trimTrailingSlash(url.pathname);
|
|
298
|
-
return path === "" ? void 0 : path;
|
|
299
|
-
}
|
|
300
|
-
function pathInsertedOAuthMetadataUrls(url, path) {
|
|
301
|
-
return [
|
|
302
|
-
`${url.origin}/.well-known/oauth-authorization-server${path}`,
|
|
303
|
-
`${url.origin}/.well-known/openid-configuration${path}`
|
|
304
|
-
];
|
|
305
|
-
}
|
|
306
|
-
function oauthMetadataUrlsForIssuer(issuer) {
|
|
307
|
-
const normalizedIssuer = trimTrailingSlash(issuer);
|
|
308
|
-
const url = new URL(normalizedIssuer);
|
|
309
|
-
const path = issuerPath(url);
|
|
310
|
-
if (!path) {
|
|
311
|
-
return [
|
|
312
|
-
`${normalizedIssuer}/.well-known/oauth-authorization-server`,
|
|
313
|
-
`${normalizedIssuer}/.well-known/openid-configuration`
|
|
314
|
-
];
|
|
315
|
-
}
|
|
316
|
-
return [...pathInsertedOAuthMetadataUrls(url, path), `${normalizedIssuer}/.well-known/openid-configuration`];
|
|
317
|
-
}
|
|
318
|
-
async function fetchFirstValidOAuthServerMetadata(metadataUrls, expectedIssuer) {
|
|
319
|
-
const errors = [];
|
|
320
|
-
for (const url of metadataUrls) {
|
|
321
|
-
try {
|
|
322
|
-
return await fetchOAuthServerMetadata(url, expectedIssuer);
|
|
323
|
-
} catch (err) {
|
|
324
|
-
log.debug("oauth.discovery.attempt_failed", { url, ...describeError(err) });
|
|
325
|
-
errors.push(`${url}: ${err instanceof Error ? err.message : String(err)}`);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors });
|
|
329
|
-
throw new Error(`failed to discover OAuth server metadata (${errors.join("; ")})`);
|
|
330
|
-
}
|
|
331
|
-
async function fetchOAuthServerMetadata(url, expectedIssuer) {
|
|
332
|
-
log.debug("oauth.discovery.fetch", { url });
|
|
333
|
-
const response = await fetch(url, { signal: AbortSignal.timeout(METADATA_FETCH_TIMEOUT_MS), redirect: "manual" });
|
|
334
|
-
if (!response.ok) {
|
|
335
|
-
throw new Error(String(response.status));
|
|
336
|
-
}
|
|
337
|
-
const json = await response.json();
|
|
338
|
-
if (typeof json.issuer !== "string") {
|
|
339
|
-
throw new Error("missing issuer");
|
|
340
|
-
}
|
|
341
|
-
parseSafeUrl("discovered issuer", json.issuer);
|
|
342
|
-
if (trimTrailingSlash(json.issuer) !== expectedIssuer) {
|
|
343
|
-
log.warn("oauth.discovery.issuer_mismatch", { url, expectedIssuer, published: json.issuer });
|
|
344
|
-
throw new Error("issuer mismatch");
|
|
345
|
-
}
|
|
346
|
-
if (typeof json.jwks_uri !== "string") {
|
|
347
|
-
throw new Error("missing jwks_uri");
|
|
348
|
-
}
|
|
349
|
-
parseSafeUrl("discovered jwks_uri", json.jwks_uri);
|
|
350
|
-
return { issuer: json.issuer, jwks_uri: json.jwks_uri };
|
|
351
|
-
}
|
|
352
|
-
async function fetchIssuerOAuthServerMetadata(issuer) {
|
|
353
|
-
try {
|
|
354
|
-
return await fetchFirstValidOAuthServerMetadata(oauthMetadataUrlsForIssuer(issuer), issuer);
|
|
355
|
-
} catch (err) {
|
|
356
|
-
log.error("oauth.discovery.config_error", {
|
|
357
|
-
issuer,
|
|
358
|
-
...describeError(err),
|
|
359
|
-
outcome: "500 oauth configuration error"
|
|
360
|
-
});
|
|
361
|
-
throw new OAuthConfigurationError(
|
|
362
|
-
`OAuth issuer discovery failed: ${err instanceof Error ? err.message : String(err)}`
|
|
363
|
-
);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
function createOAuthDiscoveryResolver(auth) {
|
|
367
|
-
const configuredIssuer = trimTrailingSlash(auth.issuer);
|
|
368
|
-
const oauthServerMetadata = cachedPromise(
|
|
369
|
-
() => fetchIssuerOAuthServerMetadata(configuredIssuer),
|
|
370
|
-
"oauth.discovery.metadata"
|
|
371
|
-
);
|
|
372
|
-
return {
|
|
373
|
-
resolveIssuer: async () => configuredIssuer,
|
|
374
|
-
resolveJwksUri: async () => {
|
|
375
|
-
if (auth.jwksUri) {
|
|
376
|
-
log.debug("oauth.jwks.resolved", { jwksUri: auth.jwksUri, source: "configured" });
|
|
377
|
-
return auth.jwksUri;
|
|
378
|
-
}
|
|
379
|
-
const jwksUri = (await oauthServerMetadata()).jwks_uri;
|
|
380
|
-
log.debug("oauth.jwks.resolved", { jwksUri, source: "discovered" });
|
|
381
|
-
return jwksUri;
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
// src/auth/verifier.ts
|
|
387
|
-
import { createLocalJWKSet, decodeProtectedHeader, jwtVerify } from "jose";
|
|
388
|
-
|
|
389
|
-
// src/auth/claims.ts
|
|
390
|
-
function readString(value) {
|
|
391
|
-
return typeof value === "string" ? value : void 0;
|
|
392
|
-
}
|
|
393
|
-
function splitScopes(value) {
|
|
394
|
-
if (typeof value === "string")
|
|
395
|
-
return value.split(/\s+/).filter(Boolean);
|
|
396
|
-
return stringClaimList(value);
|
|
397
|
-
}
|
|
398
|
-
function stringClaim(claims, name) {
|
|
399
|
-
return readString(claims[name]);
|
|
400
|
-
}
|
|
401
|
-
function stringClaimList(value) {
|
|
402
|
-
if (typeof value === "string")
|
|
403
|
-
return value === "" ? [] : [value];
|
|
404
|
-
if (Array.isArray(value))
|
|
405
|
-
return value.filter((entry) => typeof entry === "string" && entry !== "");
|
|
406
|
-
return [];
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
// src/auth/verifier.ts
|
|
410
|
-
var DEFAULT_JWT_ALGORITHMS = ["RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "EdDSA"];
|
|
411
|
-
var DEFAULT_CLOCK_TOLERANCE_SECONDS = 30;
|
|
412
|
-
var DEFAULT_ACCESS_TOKEN_TYPS = ["at+jwt", "JWT"];
|
|
413
|
-
var JWKS_FETCH_TIMEOUT_MS = 5e3;
|
|
414
|
-
var OAuthTokenError = class extends Error {
|
|
415
|
-
constructor(status, oauthError, message) {
|
|
416
|
-
super(message);
|
|
417
|
-
this.status = status;
|
|
418
|
-
this.oauthError = oauthError;
|
|
419
|
-
this.name = "OAuthTokenError";
|
|
420
|
-
}
|
|
421
|
-
};
|
|
422
|
-
function resolveAcceptedAudiences(auth, resource) {
|
|
423
|
-
return auth.acceptedAudiences ?? [resource];
|
|
424
|
-
}
|
|
425
|
-
function tokenHeaderFields(token) {
|
|
426
|
-
try {
|
|
427
|
-
const header = decodeProtectedHeader(token);
|
|
428
|
-
return { jwtAlg: header.alg, jwtKid: header.kid, tokenLength: token.length };
|
|
429
|
-
} catch {
|
|
430
|
-
return { tokenLength: token.length };
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
async function fetchVerificationKeySet(jwksUri) {
|
|
434
|
-
try {
|
|
435
|
-
const response = await fetch(jwksUri, { signal: AbortSignal.timeout(JWKS_FETCH_TIMEOUT_MS), redirect: "manual" });
|
|
436
|
-
if (!response.ok)
|
|
437
|
-
throw new Error(`JWKS endpoint returned ${response.status}`);
|
|
438
|
-
const json = await response.json();
|
|
439
|
-
return createLocalJWKSet(json);
|
|
440
|
-
} catch (err) {
|
|
441
|
-
log.error("oauth.jwks.fetch_failed", { ...describeError(err), outcome: "500 oauth configuration error" });
|
|
442
|
-
throw new OAuthConfigurationError(`JWKS fetch failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
function assertAccessTokenTyp(token, allowed) {
|
|
446
|
-
let header;
|
|
447
|
-
try {
|
|
448
|
-
header = decodeProtectedHeader(token);
|
|
449
|
-
} catch (err) {
|
|
450
|
-
log.debug("oauth.verify.bad_header", { ...describeError(err), outcome: "401 invalid_token" });
|
|
451
|
-
throw new OAuthTokenError(401, "invalid_token", "Malformed JWT header");
|
|
452
|
-
}
|
|
453
|
-
const typ = header.typ;
|
|
454
|
-
if (typeof typ !== "string" || !allowed.includes(typ)) {
|
|
455
|
-
log.debug("oauth.verify.bad_typ", { jwtTyp: typ, allowed, outcome: "401 invalid_token" });
|
|
456
|
-
throw new OAuthTokenError(401, "invalid_token", "Access token typ header is not accepted");
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
async function verifyJwtClaims(token, keySet, issuer, auth) {
|
|
460
|
-
try {
|
|
461
|
-
const { payload } = await jwtVerify(token, keySet, {
|
|
462
|
-
// `issuer` is trimmed of any trailing slash; accept both forms so a token whose
|
|
463
|
-
// `iss` carries the slash the AS publishes still verifies.
|
|
464
|
-
issuer: [issuer, `${issuer}/`],
|
|
465
|
-
algorithms: auth.algorithms ? [...auth.algorithms] : DEFAULT_JWT_ALGORITHMS,
|
|
466
|
-
requiredClaims: ["sub", "exp"],
|
|
467
|
-
clockTolerance: auth.clockToleranceSeconds ?? DEFAULT_CLOCK_TOLERANCE_SECONDS
|
|
468
|
-
});
|
|
469
|
-
return payload;
|
|
470
|
-
} catch (err) {
|
|
471
|
-
log.debug("oauth.verify.rejected", { ...describeError(err), outcome: "401 invalid_token" });
|
|
472
|
-
throw err;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
function checkAcceptedAudience(claims, accepted, auth) {
|
|
476
|
-
const audPopulated = claims.aud !== void 0 && !(Array.isArray(claims.aud) && claims.aud.length === 0);
|
|
477
|
-
if (audPopulated) {
|
|
478
|
-
if (stringClaimList(claims.aud).some((audience) => accepted.includes(audience)))
|
|
479
|
-
return "aud";
|
|
480
|
-
log.debug("oauth.verify.bad_audience", { tokenAud: claims.aud, accepted, outcome: "401 invalid_token" });
|
|
481
|
-
} else if (auth.acceptResourceClaim !== false) {
|
|
482
|
-
const acceptedTrimmed = accepted.map(trimTrailingSlash);
|
|
483
|
-
if (stringClaimList(claims.resource).some((resource) => acceptedTrimmed.includes(trimTrailingSlash(resource))))
|
|
484
|
-
return "resource";
|
|
485
|
-
log.debug("oauth.verify.bad_resource", { tokenResource: claims.resource, accepted, outcome: "401 invalid_token" });
|
|
486
|
-
} else {
|
|
487
|
-
log.debug("oauth.verify.empty_audience", { accepted, outcome: "401 invalid_token" });
|
|
488
|
-
}
|
|
489
|
-
throw new OAuthTokenError(401, "invalid_token", "token audience is not accepted");
|
|
490
|
-
}
|
|
491
|
-
function assertNonEmptySubject(claims) {
|
|
492
|
-
const sub = claims["sub"];
|
|
493
|
-
if (typeof sub !== "string" || sub.trim() === "") {
|
|
494
|
-
log.debug("oauth.verify.bad_subject", { subType: typeof sub });
|
|
495
|
-
throw new OAuthTokenError(401, "invalid_token", "token subject claim must be a non-empty string");
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
function assertOAuthClientClaim(auth, clientId) {
|
|
499
|
-
if (auth.requireOAuthClientClaim !== false && !clientId) {
|
|
500
|
-
log.debug("oauth.verify.missing_client_claim", { outcome: "401 invalid_token" });
|
|
501
|
-
throw new OAuthTokenError(401, "invalid_token", "OAuth client claim is required");
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
function makeBearer(token) {
|
|
505
|
-
return Object.defineProperty({}, "token", { value: token, enumerable: false });
|
|
506
|
-
}
|
|
507
|
-
function buildMcpAuthContext(args) {
|
|
508
|
-
const { claims } = args;
|
|
509
|
-
return {
|
|
510
|
-
type: "oauth",
|
|
511
|
-
principal: {
|
|
512
|
-
claims,
|
|
513
|
-
issuer: args.issuer,
|
|
514
|
-
resource: args.resource,
|
|
515
|
-
acceptedAudiences: args.acceptedAudiences,
|
|
516
|
-
scopes: splitScopes(claims.scope),
|
|
517
|
-
sub: stringClaim(claims, "sub"),
|
|
518
|
-
email: stringClaim(claims, "email"),
|
|
519
|
-
clientId: stringClaim(claims, "client_id") ?? stringClaim(claims, "azp")
|
|
520
|
-
},
|
|
521
|
-
bearer: makeBearer(args.token)
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
|
-
function createOAuthTokenVerifier(auth, discovery) {
|
|
525
|
-
const allowedTyps = auth.accessTokenTyp ?? DEFAULT_ACCESS_TOKEN_TYPS;
|
|
526
|
-
return async (token, request, options) => {
|
|
527
|
-
const resource = resolveProtectedResource(auth, request, options);
|
|
528
|
-
const issuer = await discovery.resolveIssuer();
|
|
529
|
-
const acceptedAudiences = resolveAcceptedAudiences(auth, resource);
|
|
530
|
-
log.debug("oauth.verify.start", { issuer, acceptedAudiences, resource, ...tokenHeaderFields(token) });
|
|
531
|
-
const jwksUri = await discovery.resolveJwksUri();
|
|
532
|
-
log.debug("oauth.jwks.fetch", { jwksUri });
|
|
533
|
-
const keySet = await fetchVerificationKeySet(jwksUri);
|
|
534
|
-
assertAccessTokenTyp(token, allowedTyps);
|
|
535
|
-
const claims = await verifyJwtClaims(token, keySet, issuer, auth);
|
|
536
|
-
const audienceVia = checkAcceptedAudience(claims, acceptedAudiences, auth);
|
|
537
|
-
assertNonEmptySubject(claims);
|
|
538
|
-
const context = buildMcpAuthContext({ token, claims, issuer, resource, acceptedAudiences });
|
|
539
|
-
assertOAuthClientClaim(auth, context.principal.clientId);
|
|
540
|
-
log.info("oauth.verify.ok", {
|
|
541
|
-
sub: context.principal.sub,
|
|
542
|
-
clientId: context.principal.clientId,
|
|
543
|
-
scopes: context.principal.scopes,
|
|
544
|
-
audienceVia
|
|
545
|
-
});
|
|
546
|
-
return context;
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
// src/auth/authorize.ts
|
|
551
|
-
function quoteAuthenticateParam(value) {
|
|
552
|
-
const sanitized = value.replace(/[\u0000-\u001F\u007F]/g, "");
|
|
553
|
-
return `"${sanitized.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
554
|
-
}
|
|
555
|
-
function resolveProtectedResourceMetadataUrl(auth, request, options) {
|
|
556
|
-
if (auth.protectedResourceMetadataUrl !== void 0)
|
|
557
|
-
return auth.protectedResourceMetadataUrl;
|
|
558
|
-
const base = auth.resource ?? request.url;
|
|
559
|
-
return new URL(options.metadataPath ?? OAUTH_PROTECTED_RESOURCE_METADATA_PATH, base).toString();
|
|
560
|
-
}
|
|
561
|
-
function wwwAuthenticateHeader(auth, request, options, params = {}) {
|
|
562
|
-
const values = [
|
|
563
|
-
`realm=${quoteAuthenticateParam("mcp")}`,
|
|
564
|
-
`resource_metadata=${quoteAuthenticateParam(resolveProtectedResourceMetadataUrl(auth, request, options))}`
|
|
565
|
-
];
|
|
566
|
-
if (auth.requiredScopes && auth.requiredScopes.length > 0) {
|
|
567
|
-
values.push(`scope=${quoteAuthenticateParam(auth.requiredScopes.join(" "))}`);
|
|
568
|
-
}
|
|
569
|
-
if (params.error)
|
|
570
|
-
values.push(`error=${quoteAuthenticateParam(params.error)}`);
|
|
571
|
-
if (params.errorDescription)
|
|
572
|
-
values.push(`error_description=${quoteAuthenticateParam(params.errorDescription)}`);
|
|
573
|
-
return `Bearer ${values.join(", ")}`;
|
|
574
|
-
}
|
|
575
|
-
function challengeResponse(auth, request, options, status, oauthError, errorDescription) {
|
|
576
|
-
const headers = new Headers(JSON_HEADERS);
|
|
577
|
-
headers.set(
|
|
578
|
-
"WWW-Authenticate",
|
|
579
|
-
wwwAuthenticateHeader(auth, request, options, { error: oauthError, errorDescription })
|
|
580
|
-
);
|
|
581
|
-
headers.set("Cache-Control", "no-store");
|
|
582
|
-
return new Response(JSON.stringify({ error: status === 403 ? "forbidden" : "unauthorized" }), {
|
|
583
|
-
status,
|
|
584
|
-
headers
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
function oauthConfigurationErrorResponse() {
|
|
588
|
-
return new Response(JSON.stringify({ error: "oauth configuration error" }), {
|
|
589
|
-
status: 500,
|
|
590
|
-
headers: { ...JSON_HEADERS, "Cache-Control": "no-store" }
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
function parseBearerToken(request) {
|
|
594
|
-
const header = request.headers.get("Authorization");
|
|
595
|
-
if (!header)
|
|
596
|
-
return void 0;
|
|
597
|
-
const match = /^Bearer\s+(.+)$/i.exec(header.trim());
|
|
598
|
-
if (!match)
|
|
599
|
-
return void 0;
|
|
600
|
-
const token = match[1].trim();
|
|
601
|
-
if (token === "" || /\s/.test(token))
|
|
602
|
-
return void 0;
|
|
603
|
-
return token;
|
|
604
|
-
}
|
|
605
|
-
function getOAuthRuntime(mcp, options = {}) {
|
|
606
|
-
if (options.resourcePath !== void 0)
|
|
607
|
-
assertResourcePathShape(options.resourcePath);
|
|
608
|
-
if (options.metadataPath !== void 0)
|
|
609
|
-
assertResourcePathShape(options.metadataPath, "metadataPath");
|
|
610
|
-
const stableOptions = { resourcePath: options.resourcePath, metadataPath: options.metadataPath };
|
|
611
|
-
const auth = mcp.auth?.type === "oauth" ? mcp.auth : void 0;
|
|
612
|
-
if (!auth)
|
|
613
|
-
return { kind: "unconfigured", options: stableOptions };
|
|
614
|
-
if (options.metadataPath !== void 0 && auth.protectedResourceMetadataUrl !== void 0) {
|
|
615
|
-
throw new Error(
|
|
616
|
-
`@lovable.dev/mcp-js: the Vite plugin generates protected-resource metadata (metadataPath set), so auth.protectedResourceMetadataUrl must not also be set. Drop protectedResourceMetadataUrl, or set protectedResourceMetadataRoute: false in mcpPlugin(...) to host the document yourself.`
|
|
617
|
-
);
|
|
618
|
-
}
|
|
619
|
-
const discovery = createOAuthDiscoveryResolver(auth);
|
|
620
|
-
return {
|
|
621
|
-
kind: "configured",
|
|
622
|
-
auth,
|
|
623
|
-
discovery,
|
|
624
|
-
verify: createOAuthTokenVerifier(auth, discovery),
|
|
625
|
-
options: stableOptions
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
function assertRestResourceBinding(mcp, options = {}) {
|
|
629
|
-
const auth = mcp.auth?.type === "oauth" ? mcp.auth : void 0;
|
|
630
|
-
if (auth && auth.resource === void 0 && options.resourcePath === void 0) {
|
|
631
|
-
throw new Error(
|
|
632
|
-
`@lovable.dev/mcp-js: REST companion handlers require auth.resource or a resourcePath so principal.resource binds to the public MCP route, not the internal /.mcp/* request path`
|
|
633
|
-
);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
function missingRequiredScopes(auth, scopes) {
|
|
637
|
-
const requiredScopes = auth.requiredScopes ?? [];
|
|
638
|
-
if (requiredScopes.length === 0)
|
|
639
|
-
return [];
|
|
640
|
-
const granted = new Set(scopes);
|
|
641
|
-
return requiredScopes.filter((scope) => !granted.has(scope));
|
|
642
|
-
}
|
|
643
|
-
function assertRequiredScopes(auth, context) {
|
|
644
|
-
if (missingRequiredScopes(auth, context.principal.scopes).length > 0) {
|
|
645
|
-
throw new OAuthTokenError(403, "insufficient_scope", "Additional OAuth scope is required");
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
function createRequestAuthorizer(mcp, options = {}) {
|
|
649
|
-
const runtime = getOAuthRuntime(mcp, options);
|
|
650
|
-
return {
|
|
651
|
-
async authorize(request, recorder) {
|
|
652
|
-
if (runtime.kind === "unconfigured")
|
|
653
|
-
return { ok: true };
|
|
654
|
-
const startedAt = nowMs();
|
|
655
|
-
const token = parseBearerToken(request);
|
|
656
|
-
if (!token) {
|
|
657
|
-
log.info("auth.no_bearer_token", { outcome: "401" });
|
|
658
|
-
return { ok: false, response: challengeResponse(runtime.auth, request, runtime.options, 401) };
|
|
659
|
-
}
|
|
660
|
-
try {
|
|
661
|
-
const auth = await runtime.verify(token, request, runtime.options);
|
|
662
|
-
assertRequiredScopes(runtime.auth, auth);
|
|
663
|
-
return { ok: true, auth };
|
|
664
|
-
} catch (err) {
|
|
665
|
-
if (err instanceof OAuthConfigurationError) {
|
|
666
|
-
log.error("auth.config_error", { ...describeError(err), outcome: "500" });
|
|
667
|
-
await recorder?.emit({
|
|
668
|
-
tool: null,
|
|
669
|
-
method: "authorize",
|
|
670
|
-
outcome: "auth_config_error",
|
|
671
|
-
durationMs: nowMs() - startedAt
|
|
672
|
-
});
|
|
673
|
-
return { ok: false, response: oauthConfigurationErrorResponse() };
|
|
674
|
-
}
|
|
675
|
-
if (err instanceof OAuthTokenError) {
|
|
676
|
-
log.info("auth.token_rejected", { status: err.status, oauthError: err.oauthError });
|
|
677
|
-
return {
|
|
678
|
-
ok: false,
|
|
679
|
-
response: challengeResponse(
|
|
680
|
-
runtime.auth,
|
|
681
|
-
request,
|
|
682
|
-
runtime.options,
|
|
683
|
-
err.status,
|
|
684
|
-
err.oauthError,
|
|
685
|
-
err.message
|
|
686
|
-
)
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
log.error("auth.unexpected_error", { ...describeError(err), outcome: "401" });
|
|
690
|
-
return {
|
|
691
|
-
ok: false,
|
|
692
|
-
response: challengeResponse(
|
|
693
|
-
runtime.auth,
|
|
694
|
-
request,
|
|
695
|
-
runtime.options,
|
|
696
|
-
401,
|
|
697
|
-
"invalid_token",
|
|
698
|
-
"Invalid access token"
|
|
699
|
-
)
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
// src/core/cors.ts
|
|
707
|
-
var EXPOSE_HEADERS = "WWW-Authenticate, Mcp-Session-Id, Mcp-Protocol-Version";
|
|
708
|
-
var ALLOW_HEADERS = "Authorization, Content-Type, Mcp-Session-Id, Mcp-Protocol-Version, Last-Event-ID";
|
|
709
|
-
function withCors(response) {
|
|
710
|
-
response.headers.set("Access-Control-Allow-Origin", "*");
|
|
711
|
-
response.headers.set("Access-Control-Expose-Headers", EXPOSE_HEADERS);
|
|
712
|
-
return response;
|
|
713
|
-
}
|
|
714
|
-
function corsPreflightResponse(allowMethods) {
|
|
715
|
-
return new Response(null, {
|
|
716
|
-
status: 204,
|
|
717
|
-
headers: {
|
|
718
|
-
"Access-Control-Allow-Origin": "*",
|
|
719
|
-
"Access-Control-Allow-Methods": allowMethods,
|
|
720
|
-
"Access-Control-Allow-Headers": ALLOW_HEADERS,
|
|
721
|
-
"Access-Control-Max-Age": "86400"
|
|
722
|
-
}
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
export {
|
|
727
|
-
JSON_HEADERS,
|
|
728
|
-
headResponse,
|
|
729
|
-
methodNotAllowed,
|
|
730
|
-
nowMs,
|
|
731
|
-
createNoopRecorder,
|
|
732
|
-
createRecorderForRuntime,
|
|
733
|
-
resolveProtectedResource,
|
|
734
|
-
assertResourcePathShape,
|
|
735
|
-
oauthConfigurationErrorResponse,
|
|
736
|
-
getOAuthRuntime,
|
|
737
|
-
assertRestResourceBinding,
|
|
738
|
-
createRequestAuthorizer,
|
|
739
|
-
withCors,
|
|
740
|
-
corsPreflightResponse
|
|
741
|
-
};
|