@vitemcp/server 1.6.1 → 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.
@@ -1,5 +1,5 @@
1
- import { q as OAuthTransaction, C as ConsentData, T as TokenStorage, s as TokenVerifier, t as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-CoIruClQ.cjs';
2
- export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, u as ClientIdMetadataOptions, E as CustomClaimsPassthroughConfig, F as DCRClientMetadata, H as DCRRequest, I as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, v as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, w as DEFAULT_AUTHORIZATION_CODE_TTL, x as DEFAULT_REFRESH_TOKEN_TTL, y as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, J as OAuthError, d as OAuthProvider, K as OAuthProviderConfig, a as OAuthProxy, L as OAuthProxyConfig, p as OAuthProxyError, O as OAuthSession, M as ProxyDCRClient, R as RefreshRequest, S as SessionAuth, N as TokenMapping, Q as TokenRequest, U as TokenResponse, V as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-CoIruClQ.cjs';
1
+ import { q as OAuthTransaction, C as ConsentData, T as TokenStorage, s as TokenVerifier, t as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-Dwj2x-De.cjs';
2
+ export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, u as ClientIdMetadataOptions, E as CustomClaimsPassthroughConfig, F as DCRClientMetadata, H as DCRRequest, I as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, v as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, w as DEFAULT_AUTHORIZATION_CODE_TTL, x as DEFAULT_REFRESH_TOKEN_TTL, y as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, J as OAuthError, d as OAuthProvider, K as OAuthProviderConfig, a as OAuthProxy, L as OAuthProxyConfig, p as OAuthProxyError, O as OAuthSession, M as ProxyDCRClient, R as RefreshRequest, S as SessionAuth, N as TokenMapping, Q as TokenRequest, U as TokenResponse, V as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-Dwj2x-De.cjs';
3
3
 
4
4
  /**
5
5
  * Consent Management
@@ -1,5 +1,5 @@
1
- import { q as OAuthTransaction, C as ConsentData, T as TokenStorage, s as TokenVerifier, t as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-CoIruClQ.js';
2
- export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, u as ClientIdMetadataOptions, E as CustomClaimsPassthroughConfig, F as DCRClientMetadata, H as DCRRequest, I as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, v as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, w as DEFAULT_AUTHORIZATION_CODE_TTL, x as DEFAULT_REFRESH_TOKEN_TTL, y as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, J as OAuthError, d as OAuthProvider, K as OAuthProviderConfig, a as OAuthProxy, L as OAuthProxyConfig, p as OAuthProxyError, O as OAuthSession, M as ProxyDCRClient, R as RefreshRequest, S as SessionAuth, N as TokenMapping, Q as TokenRequest, U as TokenResponse, V as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-CoIruClQ.js';
1
+ import { q as OAuthTransaction, C as ConsentData, T as TokenStorage, s as TokenVerifier, t as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-Dwj2x-De.js';
2
+ export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, u as ClientIdMetadataOptions, E as CustomClaimsPassthroughConfig, F as DCRClientMetadata, H as DCRRequest, I as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, v as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, w as DEFAULT_AUTHORIZATION_CODE_TTL, x as DEFAULT_REFRESH_TOKEN_TTL, y as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, J as OAuthError, d as OAuthProvider, K as OAuthProviderConfig, a as OAuthProxy, L as OAuthProxyConfig, p as OAuthProxyError, O as OAuthSession, M as ProxyDCRClient, R as RefreshRequest, S as SessionAuth, N as TokenMapping, Q as TokenRequest, U as TokenResponse, V as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-Dwj2x-De.js';
3
3
 
4
4
  /**
5
5
  * Consent Management
@@ -24,7 +24,7 @@ import {
24
24
  requireAuth,
25
25
  requireRole,
26
26
  requireScopes
27
- } from "../chunk-XZBHP34C.js";
27
+ } from "../chunk-3XFM6H44.js";
28
28
  export {
29
29
  AuthProvider,
30
30
  AzureProvider,
@@ -2318,13 +2318,31 @@ var OAuthProxy = class {
2318
2318
  return response;
2319
2319
  }
2320
2320
  /**
2321
- * Match URI against pattern (supports wildcards)
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 regex = new RegExp(
2325
- "^" + pattern.replace(/\*/g, ".*").replace(/\?/g, ".") + "$"
2326
- );
2327
- return regex.test(uri);
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), "utf-8");
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-XZBHP34C.js.map
3220
+ //# sourceMappingURL=chunk-3XFM6H44.js.map