@vitemcp/server 1.6.2 → 1.6.3
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-Dwj2x-De.d.cts → OAuthProvider-CWBi3c3D.d.cts} +21 -11
- package/dist/{OAuthProvider-Dwj2x-De.d.ts → OAuthProvider-CWBi3c3D.d.ts} +21 -11
- package/dist/ViteMCP.cjs +2 -2
- package/dist/ViteMCP.d.cts +2 -2
- package/dist/ViteMCP.d.ts +2 -2
- package/dist/ViteMCP.js +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-3XFM6H44.js → chunk-INI5RROX.js} +88 -22
- package/dist/chunk-INI5RROX.js.map +1 -0
- package/dist/{chunk-54WICBSY.cjs → chunk-UTQ425O2.cjs} +88 -22
- package/dist/chunk-UTQ425O2.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-3XFM6H44.js.map +0 -1
- package/dist/chunk-54WICBSY.cjs.map +0 -1
|
@@ -665,19 +665,29 @@ declare class OAuthProxy {
|
|
|
665
665
|
*/
|
|
666
666
|
private issueSwappedTokensForRefresh;
|
|
667
667
|
/**
|
|
668
|
-
* Match a URI against an allow-list
|
|
669
|
-
*
|
|
668
|
+
* Match a parsed URI against an allow-list pattern, one URI component at a
|
|
669
|
+
* time: scheme, host, port, then everything from the path onwards. A `*`
|
|
670
|
+
* therefore stops where its component stops.
|
|
670
671
|
*
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* `https://clientXexampleYcom/steal`, a name an attacker can register. DCR
|
|
675
|
-
* would accept it and `handleCallback()` would later 302 a fresh
|
|
676
|
-
* authorization code to it, reopening the CWE-601 path this allow-list
|
|
677
|
-
* exists to close. `+ ^ $ ( ) [ ] { } |` widen a pattern the same way.
|
|
672
|
+
* That containment is the whole point. Matching the pattern against the raw
|
|
673
|
+
* string let a wildcard run straight through the delimiters that decide
|
|
674
|
+
* where the browser actually navigates:
|
|
678
675
|
*
|
|
679
|
-
*
|
|
680
|
-
*
|
|
676
|
+
* - `http://localhost:*` matched `http://localhost:@evil.com/cb`, where
|
|
677
|
+
* `localhost:` is userinfo and the real host is `evil.com`.
|
|
678
|
+
* - `https://*.example.com/*` matched
|
|
679
|
+
* `https://evil.com/a.example.com/cb`, because the wildcard covered
|
|
680
|
+
* `evil.com/a` — authority and path at once.
|
|
681
|
+
*
|
|
682
|
+
* Both register cleanly under the old matcher, and `handleCallback()` would
|
|
683
|
+
* then 302 a fresh authorization code to the attacker's host: the CWE-601
|
|
684
|
+
* theft path this allow-list exists to close. Comparing against `URL`'s
|
|
685
|
+
* parse makes the delimiters structural rather than incidental, so no
|
|
686
|
+
* pattern can span them however it is written.
|
|
687
|
+
*
|
|
688
|
+
* A pattern that omits the path (`http://localhost:*`, the loopback default)
|
|
689
|
+
* constrains scheme, host and port only — an ephemeral client chooses its
|
|
690
|
+
* own callback path. Write a path to pin one.
|
|
681
691
|
*/
|
|
682
692
|
private matchesPattern;
|
|
683
693
|
/**
|
|
@@ -665,19 +665,29 @@ declare class OAuthProxy {
|
|
|
665
665
|
*/
|
|
666
666
|
private issueSwappedTokensForRefresh;
|
|
667
667
|
/**
|
|
668
|
-
* Match a URI against an allow-list
|
|
669
|
-
*
|
|
668
|
+
* Match a parsed URI against an allow-list pattern, one URI component at a
|
|
669
|
+
* time: scheme, host, port, then everything from the path onwards. A `*`
|
|
670
|
+
* therefore stops where its component stops.
|
|
670
671
|
*
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* `https://clientXexampleYcom/steal`, a name an attacker can register. DCR
|
|
675
|
-
* would accept it and `handleCallback()` would later 302 a fresh
|
|
676
|
-
* authorization code to it, reopening the CWE-601 path this allow-list
|
|
677
|
-
* exists to close. `+ ^ $ ( ) [ ] { } |` widen a pattern the same way.
|
|
672
|
+
* That containment is the whole point. Matching the pattern against the raw
|
|
673
|
+
* string let a wildcard run straight through the delimiters that decide
|
|
674
|
+
* where the browser actually navigates:
|
|
678
675
|
*
|
|
679
|
-
*
|
|
680
|
-
*
|
|
676
|
+
* - `http://localhost:*` matched `http://localhost:@evil.com/cb`, where
|
|
677
|
+
* `localhost:` is userinfo and the real host is `evil.com`.
|
|
678
|
+
* - `https://*.example.com/*` matched
|
|
679
|
+
* `https://evil.com/a.example.com/cb`, because the wildcard covered
|
|
680
|
+
* `evil.com/a` — authority and path at once.
|
|
681
|
+
*
|
|
682
|
+
* Both register cleanly under the old matcher, and `handleCallback()` would
|
|
683
|
+
* then 302 a fresh authorization code to the attacker's host: the CWE-601
|
|
684
|
+
* theft path this allow-list exists to close. Comparing against `URL`'s
|
|
685
|
+
* parse makes the delimiters structural rather than incidental, so no
|
|
686
|
+
* pattern can span them however it is written.
|
|
687
|
+
*
|
|
688
|
+
* A pattern that omits the path (`http://localhost:*`, the loopback default)
|
|
689
|
+
* constrains scheme, host and port only — an ephemeral client chooses its
|
|
690
|
+
* own callback path. Write a path to pin one.
|
|
681
691
|
*/
|
|
682
692
|
private matchesPattern;
|
|
683
693
|
/**
|
package/dist/ViteMCP.cjs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkUTQ425O2cjs = require('./chunk-UTQ425O2.cjs');
|
|
16
16
|
|
|
17
17
|
// src/ViteMCP.ts
|
|
18
18
|
|
|
@@ -1352,5 +1352,5 @@ var normalizeToolResult = (result, hasOutputSchema) => {
|
|
|
1352
1352
|
|
|
1353
1353
|
|
|
1354
1354
|
|
|
1355
|
-
exports.AuthProvider =
|
|
1355
|
+
exports.AuthProvider = _chunkUTQ425O2cjs.AuthProvider; exports.AzureProvider = _chunkUTQ425O2cjs.AzureProvider; exports.DiscoveryDocumentCache = DiscoveryDocumentCache; exports.GitHubProvider = _chunkUTQ425O2cjs.GitHubProvider; exports.GoogleProvider = _chunkUTQ425O2cjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkUTQ425O2cjs.OAuthProvider; exports.OAuthProxy = _chunkUTQ425O2cjs.OAuthProxy; exports.OAuthProxyError = _chunkUTQ425O2cjs.OAuthProxyError; exports.ServerState = ServerState; exports.UnexpectedStateError = UnexpectedStateError; exports.UserError = UserError; exports.ViteMCP = ViteMCP; exports.ViteMCPError = ViteMCPError; exports.audioContent = audioContent; exports.delay = _promises3.setTimeout; exports.getAuthSession = _chunkUTQ425O2cjs.getAuthSession; exports.imageContent = imageContent; exports.jsonSchemaAdapter = jsonSchemaAdapter; exports.requireAll = _chunkUTQ425O2cjs.requireAll; exports.requireAny = _chunkUTQ425O2cjs.requireAny; exports.requireAuth = _chunkUTQ425O2cjs.requireAuth; exports.requireRole = _chunkUTQ425O2cjs.requireRole; exports.requireScopes = _chunkUTQ425O2cjs.requireScopes;
|
|
1356
1356
|
//# sourceMappingURL=ViteMCP.cjs.map
|
package/dist/ViteMCP.d.cts
CHANGED
|
@@ -4,8 +4,8 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
4
4
|
import { Hono } from 'hono';
|
|
5
5
|
import { cors } from 'hono/cors';
|
|
6
6
|
export { setTimeout as delay } from 'timers/promises';
|
|
7
|
-
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-
|
|
8
|
-
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, p as OAuthProxyError, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-
|
|
7
|
+
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-CWBi3c3D.cjs';
|
|
8
|
+
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, p as OAuthProxyError, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-CWBi3c3D.cjs';
|
|
9
9
|
|
|
10
10
|
declare class DiscoveryDocumentCache {
|
|
11
11
|
#private;
|
package/dist/ViteMCP.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
4
4
|
import { Hono } from 'hono';
|
|
5
5
|
import { cors } from 'hono/cors';
|
|
6
6
|
export { setTimeout as delay } from 'timers/promises';
|
|
7
|
-
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-
|
|
8
|
-
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, p as OAuthProxyError, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-
|
|
7
|
+
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-CWBi3c3D.js';
|
|
8
|
+
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, p as OAuthProxyError, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-CWBi3c3D.js';
|
|
9
9
|
|
|
10
10
|
declare class DiscoveryDocumentCache {
|
|
11
11
|
#private;
|
package/dist/ViteMCP.js
CHANGED
package/dist/auth/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkUTQ425O2cjs = require('../chunk-UTQ425O2.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -51,5 +51,5 @@ var _chunk54WICBSYcjs = require('../chunk-54WICBSY.cjs');
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
exports.AuthProvider =
|
|
54
|
+
exports.AuthProvider = _chunkUTQ425O2cjs.AuthProvider; exports.AzureProvider = _chunkUTQ425O2cjs.AzureProvider; exports.ConsentManager = _chunkUTQ425O2cjs.ConsentManager; exports.DEFAULT_ACCESS_TOKEN_TTL = _chunkUTQ425O2cjs.DEFAULT_ACCESS_TOKEN_TTL; exports.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH = _chunkUTQ425O2cjs.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH; exports.DEFAULT_AUTHORIZATION_CODE_TTL = _chunkUTQ425O2cjs.DEFAULT_AUTHORIZATION_CODE_TTL; exports.DEFAULT_REFRESH_TOKEN_TTL = _chunkUTQ425O2cjs.DEFAULT_REFRESH_TOKEN_TTL; exports.DEFAULT_TRANSACTION_TTL = _chunkUTQ425O2cjs.DEFAULT_TRANSACTION_TTL; exports.DiskStore = _chunkUTQ425O2cjs.DiskStore; exports.EncryptedTokenStorage = _chunkUTQ425O2cjs.EncryptedTokenStorage; exports.GitHubProvider = _chunkUTQ425O2cjs.GitHubProvider; exports.GoogleProvider = _chunkUTQ425O2cjs.GoogleProvider; exports.JWKSVerifier = _chunkUTQ425O2cjs.JWKSVerifier; exports.JWTIssuer = _chunkUTQ425O2cjs.JWTIssuer; exports.MemoryTokenStorage = _chunkUTQ425O2cjs.MemoryTokenStorage; exports.OAuthProvider = _chunkUTQ425O2cjs.OAuthProvider; exports.OAuthProxy = _chunkUTQ425O2cjs.OAuthProxy; exports.OAuthProxyError = _chunkUTQ425O2cjs.OAuthProxyError; exports.PKCEUtils = _chunkUTQ425O2cjs.PKCEUtils; exports.getAuthSession = _chunkUTQ425O2cjs.getAuthSession; exports.requireAll = _chunkUTQ425O2cjs.requireAll; exports.requireAny = _chunkUTQ425O2cjs.requireAny; exports.requireAuth = _chunkUTQ425O2cjs.requireAuth; exports.requireRole = _chunkUTQ425O2cjs.requireRole; exports.requireScopes = _chunkUTQ425O2cjs.requireScopes;
|
|
55
55
|
//# sourceMappingURL=index.cjs.map
|
package/dist/auth/index.d.cts
CHANGED
|
@@ -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-
|
|
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-
|
|
1
|
+
import { q as OAuthTransaction, C as ConsentData, T as TokenStorage, s as TokenVerifier, t as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-CWBi3c3D.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-CWBi3c3D.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Consent Management
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
1
|
+
import { q as OAuthTransaction, C as ConsentData, T as TokenStorage, s as TokenVerifier, t as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-CWBi3c3D.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-CWBi3c3D.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Consent Management
|
package/dist/auth/index.js
CHANGED
|
@@ -2318,31 +2318,54 @@ var OAuthProxy = class {
|
|
|
2318
2318
|
return response;
|
|
2319
2319
|
}
|
|
2320
2320
|
/**
|
|
2321
|
-
* Match a URI against an allow-list
|
|
2322
|
-
*
|
|
2321
|
+
* Match a parsed URI against an allow-list pattern, one URI component at a
|
|
2322
|
+
* time: scheme, host, port, then everything from the path onwards. A `*`
|
|
2323
|
+
* therefore stops where its component stops.
|
|
2323
2324
|
*
|
|
2324
|
-
*
|
|
2325
|
-
*
|
|
2326
|
-
*
|
|
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.
|
|
2325
|
+
* That containment is the whole point. Matching the pattern against the raw
|
|
2326
|
+
* string let a wildcard run straight through the delimiters that decide
|
|
2327
|
+
* where the browser actually navigates:
|
|
2331
2328
|
*
|
|
2332
|
-
*
|
|
2333
|
-
*
|
|
2329
|
+
* - `http://localhost:*` matched `http://localhost:@evil.com/cb`, where
|
|
2330
|
+
* `localhost:` is userinfo and the real host is `evil.com`.
|
|
2331
|
+
* - `https://*.example.com/*` matched
|
|
2332
|
+
* `https://evil.com/a.example.com/cb`, because the wildcard covered
|
|
2333
|
+
* `evil.com/a` — authority and path at once.
|
|
2334
|
+
*
|
|
2335
|
+
* Both register cleanly under the old matcher, and `handleCallback()` would
|
|
2336
|
+
* then 302 a fresh authorization code to the attacker's host: the CWE-601
|
|
2337
|
+
* theft path this allow-list exists to close. Comparing against `URL`'s
|
|
2338
|
+
* parse makes the delimiters structural rather than incidental, so no
|
|
2339
|
+
* pattern can span them however it is written.
|
|
2340
|
+
*
|
|
2341
|
+
* A pattern that omits the path (`http://localhost:*`, the loopback default)
|
|
2342
|
+
* constrains scheme, host and port only — an ephemeral client chooses its
|
|
2343
|
+
* own callback path. Write a path to pin one.
|
|
2334
2344
|
*/
|
|
2335
2345
|
matchesPattern(uri, pattern) {
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2338
|
-
|
|
2346
|
+
const parsed = parseUriPattern(pattern);
|
|
2347
|
+
if (!parsed) {
|
|
2348
|
+
return false;
|
|
2349
|
+
}
|
|
2350
|
+
if (uri.protocol.slice(0, -1) !== parsed.scheme) {
|
|
2351
|
+
return false;
|
|
2352
|
+
}
|
|
2353
|
+
if (parsed.authority) {
|
|
2354
|
+
if (!globComponent(parsed.authority.host).test(uri.hostname)) {
|
|
2355
|
+
return false;
|
|
2339
2356
|
}
|
|
2340
|
-
if (
|
|
2341
|
-
return
|
|
2357
|
+
if (!globComponent(parsed.authority.port).test(uri.port)) {
|
|
2358
|
+
return false;
|
|
2342
2359
|
}
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2360
|
+
} else if (uri.host !== "") {
|
|
2361
|
+
return false;
|
|
2362
|
+
}
|
|
2363
|
+
if (parsed.rest === "") {
|
|
2364
|
+
return true;
|
|
2365
|
+
}
|
|
2366
|
+
return globComponent(parsed.rest).test(
|
|
2367
|
+
`${uri.pathname}${uri.search}${uri.hash}`
|
|
2368
|
+
);
|
|
2346
2369
|
}
|
|
2347
2370
|
/**
|
|
2348
2371
|
* Parse token response that can be either JSON or URL-encoded
|
|
@@ -2566,11 +2589,15 @@ var OAuthProxy = class {
|
|
|
2566
2589
|
* theft. Do not loosen the default beyond loopback addresses.
|
|
2567
2590
|
*/
|
|
2568
2591
|
validateRedirectUri(uri) {
|
|
2592
|
+
let url;
|
|
2569
2593
|
try {
|
|
2570
|
-
new URL(uri);
|
|
2594
|
+
url = new URL(uri);
|
|
2571
2595
|
} catch {
|
|
2572
2596
|
return false;
|
|
2573
2597
|
}
|
|
2598
|
+
if (url.username !== "" || url.password !== "") {
|
|
2599
|
+
return false;
|
|
2600
|
+
}
|
|
2574
2601
|
const patterns = this.config.allowedRedirectUriPatterns;
|
|
2575
2602
|
if (Array.isArray(patterns) && patterns.length === 0) {
|
|
2576
2603
|
return false;
|
|
@@ -2580,10 +2607,49 @@ var OAuthProxy = class {
|
|
|
2580
2607
|
"http://127.0.0.1:*"
|
|
2581
2608
|
];
|
|
2582
2609
|
return effectivePatterns.some(
|
|
2583
|
-
(pattern) => this.matchesPattern(
|
|
2610
|
+
(pattern) => this.matchesPattern(url, pattern)
|
|
2584
2611
|
);
|
|
2585
2612
|
}
|
|
2586
2613
|
};
|
|
2614
|
+
var globComponent = (glob) => {
|
|
2615
|
+
const source = glob.replace(/[.*+?^${}()|[\]\\]/g, (character) => {
|
|
2616
|
+
if (character === "*") {
|
|
2617
|
+
return ".*";
|
|
2618
|
+
}
|
|
2619
|
+
if (character === "?") {
|
|
2620
|
+
return ".";
|
|
2621
|
+
}
|
|
2622
|
+
return `\\${character}`;
|
|
2623
|
+
});
|
|
2624
|
+
return new RegExp(`^${source}$`);
|
|
2625
|
+
};
|
|
2626
|
+
var parseUriPattern = (pattern) => {
|
|
2627
|
+
const schemeEnd = pattern.indexOf(":");
|
|
2628
|
+
if (schemeEnd <= 0) {
|
|
2629
|
+
return null;
|
|
2630
|
+
}
|
|
2631
|
+
const scheme = pattern.slice(0, schemeEnd).toLowerCase();
|
|
2632
|
+
const afterScheme = pattern.slice(schemeEnd + 1);
|
|
2633
|
+
if (!afterScheme.startsWith("//")) {
|
|
2634
|
+
return { authority: null, rest: afterScheme, scheme };
|
|
2635
|
+
}
|
|
2636
|
+
const hierarchical = afterScheme.slice(2);
|
|
2637
|
+
const restStart = hierarchical.search(/[#/?]/);
|
|
2638
|
+
const authority = restStart === -1 ? hierarchical : hierarchical.slice(0, restStart);
|
|
2639
|
+
if (authority.includes("@")) {
|
|
2640
|
+
return null;
|
|
2641
|
+
}
|
|
2642
|
+
const hostEnd = authority.startsWith("[") ? authority.indexOf("]") + 1 : 0;
|
|
2643
|
+
const portSeparator = authority.indexOf(":", hostEnd);
|
|
2644
|
+
return {
|
|
2645
|
+
authority: {
|
|
2646
|
+
host: (portSeparator === -1 ? authority : authority.slice(0, portSeparator)).toLowerCase(),
|
|
2647
|
+
port: portSeparator === -1 ? "" : authority.slice(portSeparator + 1)
|
|
2648
|
+
},
|
|
2649
|
+
rest: restStart === -1 ? "" : hierarchical.slice(restStart),
|
|
2650
|
+
scheme
|
|
2651
|
+
};
|
|
2652
|
+
};
|
|
2587
2653
|
var isLoopbackRedirectUri = (uri) => {
|
|
2588
2654
|
try {
|
|
2589
2655
|
const url = new URL(uri);
|
|
@@ -3217,4 +3283,4 @@ export {
|
|
|
3217
3283
|
DiskStore,
|
|
3218
3284
|
JWKSVerifier
|
|
3219
3285
|
};
|
|
3220
|
-
//# sourceMappingURL=chunk-
|
|
3286
|
+
//# sourceMappingURL=chunk-INI5RROX.js.map
|