@vitemcp/server 1.6.0 → 1.6.2
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/{OAuthProvider-CoIruClQ.d.cts → OAuthProvider-Dwj2x-De.d.cts} +13 -1
- package/dist/{OAuthProvider-CoIruClQ.d.ts → OAuthProvider-Dwj2x-De.d.ts} +13 -1
- package/dist/ViteMCP.cjs +27 -10
- package/dist/ViteMCP.cjs.map +1 -1
- package/dist/ViteMCP.d.cts +2 -2
- package/dist/ViteMCP.d.ts +2 -2
- package/dist/ViteMCP.js +24 -7
- package/dist/ViteMCP.js.map +1 -1
- package/dist/auth/index.cjs +2 -2
- package/dist/auth/index.d.cts +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-XZBHP34C.js → chunk-3XFM6H44.js} +29 -8
- package/dist/chunk-3XFM6H44.js.map +1 -0
- package/dist/{chunk-XC4BVJQZ.cjs → chunk-54WICBSY.cjs} +29 -8
- package/dist/chunk-54WICBSY.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-XC4BVJQZ.cjs.map +0 -1
- package/dist/chunk-XZBHP34C.js.map +0 -1
|
@@ -2318,13 +2318,31 @@ var OAuthProxy = class {
|
|
|
2318
2318
|
return response;
|
|
2319
2319
|
}
|
|
2320
2320
|
/**
|
|
2321
|
-
* Match URI against
|
|
2321
|
+
* Match a URI against an allow-list glob: `*` spans any run of characters,
|
|
2322
|
+
* `?` exactly one, and everything else is literal.
|
|
2323
|
+
*
|
|
2324
|
+
* "Everything else is literal" is the security-relevant half. Left unescaped,
|
|
2325
|
+
* a `.` reaches the RegExp as "any character", so the pattern an operator
|
|
2326
|
+
* wrote for one host — `https://client.example.com/*` — also admits
|
|
2327
|
+
* `https://clientXexampleYcom/steal`, a name an attacker can register. DCR
|
|
2328
|
+
* would accept it and `handleCallback()` would later 302 a fresh
|
|
2329
|
+
* authorization code to it, reopening the CWE-601 path this allow-list
|
|
2330
|
+
* exists to close. `+ ^ $ ( ) [ ] { } |` widen a pattern the same way.
|
|
2331
|
+
*
|
|
2332
|
+
* Escaping and wildcard expansion happen in one pass, so a backslash this
|
|
2333
|
+
* inserts can never be re-read as the metacharacter of a later pass.
|
|
2322
2334
|
*/
|
|
2323
2335
|
matchesPattern(uri, pattern) {
|
|
2324
|
-
const
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2336
|
+
const source = pattern.replace(/[.*+?^${}()|[\]\\]/g, (character) => {
|
|
2337
|
+
if (character === "*") {
|
|
2338
|
+
return ".*";
|
|
2339
|
+
}
|
|
2340
|
+
if (character === "?") {
|
|
2341
|
+
return ".";
|
|
2342
|
+
}
|
|
2343
|
+
return `\\${character}`;
|
|
2344
|
+
});
|
|
2345
|
+
return new RegExp(`^${source}$`).test(uri);
|
|
2328
2346
|
}
|
|
2329
2347
|
/**
|
|
2330
2348
|
* Parse token response that can be either JSON or URL-encoded
|
|
@@ -2958,7 +2976,10 @@ var DiskStore = class {
|
|
|
2958
2976
|
value
|
|
2959
2977
|
};
|
|
2960
2978
|
try {
|
|
2961
|
-
await writeFile(filePath, JSON.stringify(entry, null, 2),
|
|
2979
|
+
await writeFile(filePath, JSON.stringify(entry, null, 2), {
|
|
2980
|
+
encoding: "utf-8",
|
|
2981
|
+
mode: 384
|
|
2982
|
+
});
|
|
2962
2983
|
} catch (error) {
|
|
2963
2984
|
console.error(`Failed to save key ${key}:`, error);
|
|
2964
2985
|
throw error;
|
|
@@ -3017,7 +3038,7 @@ var DiskStore = class {
|
|
|
3017
3038
|
}
|
|
3018
3039
|
} catch (error) {
|
|
3019
3040
|
if (error.code === "ENOENT") {
|
|
3020
|
-
await mkdir(this.directory, { recursive: true });
|
|
3041
|
+
await mkdir(this.directory, { mode: 448, recursive: true });
|
|
3021
3042
|
} else {
|
|
3022
3043
|
throw error;
|
|
3023
3044
|
}
|
|
@@ -3196,4 +3217,4 @@ export {
|
|
|
3196
3217
|
DiskStore,
|
|
3197
3218
|
JWKSVerifier
|
|
3198
3219
|
};
|
|
3199
|
-
//# sourceMappingURL=chunk-
|
|
3220
|
+
//# sourceMappingURL=chunk-3XFM6H44.js.map
|