mcp-trellis 0.2.1 → 2.1.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 +70 -620
- package/dist/adapters/node-request.d.ts +53 -0
- package/dist/adapters/node-request.d.ts.map +1 -0
- package/dist/adapters/node-request.js +165 -0
- package/dist/adapters/node-request.js.map +1 -0
- package/dist/adapters/node.d.ts +16 -24
- package/dist/adapters/node.d.ts.map +1 -1
- package/dist/adapters/node.js +69 -88
- package/dist/adapters/node.js.map +1 -1
- package/dist/advanced.d.ts +18 -0
- package/dist/advanced.d.ts.map +1 -0
- package/dist/advanced.js +18 -0
- package/dist/advanced.js.map +1 -0
- package/dist/app-options.d.ts +132 -0
- package/dist/app-options.d.ts.map +1 -0
- package/dist/app-options.js +2 -0
- package/dist/app-options.js.map +1 -0
- package/dist/app.d.ts +2 -66
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +150 -57
- package/dist/app.js.map +1 -1
- package/dist/audit.d.ts +5 -5
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +19 -8
- package/dist/audit.js.map +1 -1
- package/dist/auth/bearer.d.ts +4 -1
- package/dist/auth/bearer.d.ts.map +1 -1
- package/dist/auth/bearer.js +25 -5
- package/dist/auth/bearer.js.map +1 -1
- package/dist/clients.d.ts.map +1 -1
- package/dist/clients.js +3 -6
- package/dist/clients.js.map +1 -1
- package/dist/deprecated.d.ts +42 -0
- package/dist/deprecated.d.ts.map +1 -0
- package/dist/deprecated.js +35 -0
- package/dist/deprecated.js.map +1 -0
- package/dist/http/body.d.ts +69 -0
- package/dist/http/body.d.ts.map +1 -0
- package/dist/http/body.js +165 -0
- package/dist/http/body.js.map +1 -0
- package/dist/http/http.d.ts +42 -0
- package/dist/http/http.d.ts.map +1 -0
- package/dist/http/http.js +100 -0
- package/dist/http/http.js.map +1 -0
- package/dist/http/origins.d.ts +37 -0
- package/dist/http/origins.d.ts.map +1 -0
- package/dist/http/origins.js +87 -0
- package/dist/http/origins.js.map +1 -0
- package/dist/mcp/dispatch.d.ts +7 -0
- package/dist/mcp/dispatch.d.ts.map +1 -0
- package/dist/mcp/dispatch.js +99 -0
- package/dist/mcp/dispatch.js.map +1 -0
- package/dist/{jsonrpc.d.ts → mcp/jsonrpc.d.ts} +10 -0
- package/dist/mcp/jsonrpc.d.ts.map +1 -0
- package/dist/mcp/jsonrpc.js +88 -0
- package/dist/mcp/jsonrpc.js.map +1 -0
- package/dist/mcp/methods.d.ts +133 -0
- package/dist/mcp/methods.d.ts.map +1 -0
- package/dist/mcp/methods.js +84 -0
- package/dist/mcp/methods.js.map +1 -0
- package/dist/mcp/protocol.d.ts +16 -0
- package/dist/mcp/protocol.d.ts.map +1 -0
- package/dist/mcp/protocol.js +22 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/registry.d.ts +58 -0
- package/dist/mcp/registry.d.ts.map +1 -0
- package/dist/mcp/registry.js +81 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/rpc-handlers.d.ts +11 -0
- package/dist/mcp/rpc-handlers.d.ts.map +1 -0
- package/dist/mcp/rpc-handlers.js +133 -0
- package/dist/mcp/rpc-handlers.js.map +1 -0
- package/dist/{tools.d.ts → mcp/tools.d.ts} +30 -2
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +166 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/{validate.d.ts → mcp/validate.d.ts} +24 -12
- package/dist/mcp/validate.d.ts.map +1 -0
- package/dist/mcp/validate.js +186 -0
- package/dist/mcp/validate.js.map +1 -0
- package/dist/oauth/audit.d.ts +20 -0
- package/dist/oauth/audit.d.ts.map +1 -0
- package/dist/oauth/audit.js +29 -0
- package/dist/oauth/audit.js.map +1 -0
- package/dist/oauth/cimd/cimd-parse.d.ts +4 -0
- package/dist/oauth/cimd/cimd-parse.d.ts.map +1 -0
- package/dist/oauth/cimd/cimd-parse.js +70 -0
- package/dist/oauth/cimd/cimd-parse.js.map +1 -0
- package/dist/oauth/cimd/cimd-ssrf.d.ts +8 -0
- package/dist/oauth/cimd/cimd-ssrf.d.ts.map +1 -0
- package/dist/oauth/cimd/cimd-ssrf.js +193 -0
- package/dist/oauth/cimd/cimd-ssrf.js.map +1 -0
- package/dist/oauth/cimd/cimd.d.ts +36 -0
- package/dist/oauth/cimd/cimd.d.ts.map +1 -0
- package/dist/oauth/cimd/cimd.js +132 -0
- package/dist/oauth/cimd/cimd.js.map +1 -0
- package/dist/oauth/cimd/types.d.ts +12 -0
- package/dist/oauth/cimd/types.d.ts.map +1 -0
- package/dist/oauth/cimd/types.js +3 -0
- package/dist/oauth/cimd/types.js.map +1 -0
- package/dist/oauth/config.d.ts +51 -0
- package/dist/oauth/config.d.ts.map +1 -0
- package/dist/oauth/config.js +108 -0
- package/dist/oauth/config.js.map +1 -0
- package/dist/oauth/constants.d.ts +15 -0
- package/dist/oauth/constants.d.ts.map +1 -1
- package/dist/oauth/constants.js +15 -0
- package/dist/oauth/constants.js.map +1 -1
- package/dist/oauth/{base64url.d.ts → crypto/base64url.d.ts} +1 -2
- package/dist/oauth/crypto/base64url.d.ts.map +1 -0
- package/dist/oauth/{base64url.js → crypto/base64url.js} +1 -5
- package/dist/oauth/crypto/base64url.js.map +1 -0
- package/dist/oauth/crypto/clientauth.d.ts +13 -0
- package/dist/oauth/crypto/clientauth.d.ts.map +1 -0
- package/dist/oauth/crypto/clientauth.js +195 -0
- package/dist/oauth/crypto/clientauth.js.map +1 -0
- package/dist/oauth/crypto/codes.d.ts +65 -0
- package/dist/oauth/crypto/codes.d.ts.map +1 -0
- package/dist/oauth/crypto/codes.js +121 -0
- package/dist/oauth/crypto/codes.js.map +1 -0
- package/dist/oauth/crypto/hkdf.d.ts +13 -0
- package/dist/oauth/crypto/hkdf.d.ts.map +1 -0
- package/dist/oauth/crypto/hkdf.js +30 -0
- package/dist/oauth/crypto/hkdf.js.map +1 -0
- package/dist/oauth/crypto/keycache.d.ts +19 -0
- package/dist/oauth/crypto/keycache.d.ts.map +1 -0
- package/dist/oauth/crypto/keycache.js +44 -0
- package/dist/oauth/crypto/keycache.js.map +1 -0
- package/dist/oauth/crypto/pkce.d.ts.map +1 -0
- package/dist/oauth/{pkce.js → crypto/pkce.js} +1 -1
- package/dist/oauth/crypto/pkce.js.map +1 -0
- package/dist/oauth/crypto/sealed.d.ts +26 -0
- package/dist/oauth/crypto/sealed.d.ts.map +1 -0
- package/dist/oauth/crypto/sealed.js +65 -0
- package/dist/oauth/crypto/sealed.js.map +1 -0
- package/dist/oauth/crypto/secrethash.d.ts +58 -0
- package/dist/oauth/crypto/secrethash.d.ts.map +1 -0
- package/dist/oauth/crypto/secrethash.js +82 -0
- package/dist/oauth/crypto/secrethash.js.map +1 -0
- package/dist/oauth/deprecated.d.ts +52 -0
- package/dist/oauth/deprecated.d.ts.map +1 -0
- package/dist/oauth/deprecated.js +49 -0
- package/dist/oauth/deprecated.js.map +1 -0
- package/dist/oauth/endpoints/authorize.d.ts +3 -0
- package/dist/oauth/endpoints/authorize.d.ts.map +1 -0
- package/dist/oauth/endpoints/authorize.js +209 -0
- package/dist/oauth/endpoints/authorize.js.map +1 -0
- package/dist/oauth/endpoints/callback.d.ts +20 -0
- package/dist/oauth/endpoints/callback.d.ts.map +1 -0
- package/dist/oauth/endpoints/callback.js +31 -0
- package/dist/oauth/endpoints/callback.js.map +1 -0
- package/dist/oauth/endpoints/consent-page.d.ts +5 -0
- package/dist/oauth/endpoints/consent-page.d.ts.map +1 -0
- package/dist/oauth/endpoints/consent-page.js +63 -0
- package/dist/oauth/endpoints/consent-page.js.map +1 -0
- package/dist/oauth/endpoints/consent.d.ts +29 -0
- package/dist/oauth/endpoints/consent.d.ts.map +1 -0
- package/dist/oauth/endpoints/consent.js +98 -0
- package/dist/oauth/endpoints/consent.js.map +1 -0
- package/dist/oauth/{metadata.d.ts → endpoints/metadata.d.ts} +14 -8
- package/dist/oauth/endpoints/metadata.d.ts.map +1 -0
- package/dist/oauth/{metadata.js → endpoints/metadata.js} +10 -4
- package/dist/oauth/endpoints/metadata.js.map +1 -0
- package/dist/oauth/endpoints/register.d.ts +10 -0
- package/dist/oauth/endpoints/register.d.ts.map +1 -0
- package/dist/oauth/endpoints/register.js +96 -0
- package/dist/oauth/endpoints/register.js.map +1 -0
- package/dist/oauth/{revoke.d.ts → endpoints/revoke.d.ts} +1 -1
- package/dist/oauth/endpoints/revoke.d.ts.map +1 -0
- package/dist/oauth/{revoke.js → endpoints/revoke.js} +11 -9
- package/dist/oauth/endpoints/revoke.js.map +1 -0
- package/dist/oauth/endpoints/token.d.ts +3 -0
- package/dist/oauth/endpoints/token.d.ts.map +1 -0
- package/dist/oauth/{token.js → endpoints/token.js} +33 -47
- package/dist/oauth/endpoints/token.js.map +1 -0
- package/dist/oauth/{wellknown.d.ts → endpoints/wellknown.d.ts} +1 -1
- package/dist/oauth/endpoints/wellknown.d.ts.map +1 -0
- package/dist/oauth/{wellknown.js → endpoints/wellknown.js} +7 -7
- package/dist/oauth/endpoints/wellknown.js.map +1 -0
- package/dist/oauth/{redirect.d.ts → policy/redirect.d.ts} +6 -1
- package/dist/oauth/policy/redirect.d.ts.map +1 -0
- package/dist/oauth/policy/redirect.js +39 -0
- package/dist/oauth/policy/redirect.js.map +1 -0
- package/dist/oauth/policy/reqbody.d.ts +18 -0
- package/dist/oauth/policy/reqbody.d.ts.map +1 -0
- package/dist/oauth/policy/reqbody.js +68 -0
- package/dist/oauth/policy/reqbody.js.map +1 -0
- package/dist/oauth/policy/resource.d.ts +37 -0
- package/dist/oauth/policy/resource.d.ts.map +1 -0
- package/dist/oauth/policy/resource.js +74 -0
- package/dist/oauth/policy/resource.js.map +1 -0
- package/dist/oauth/policy/scope.d.ts +20 -0
- package/dist/oauth/policy/scope.d.ts.map +1 -0
- package/dist/oauth/policy/scope.js +35 -0
- package/dist/oauth/policy/scope.js.map +1 -0
- package/dist/oauth/router.d.ts +12 -12
- package/dist/oauth/router.d.ts.map +1 -1
- package/dist/oauth/router.js +105 -87
- package/dist/oauth/router.js.map +1 -1
- package/dist/oauth/types.d.ts +177 -26
- package/dist/oauth/types.d.ts.map +1 -1
- package/dist/oauth/types.js +1 -27
- package/dist/oauth/types.js.map +1 -1
- package/dist/server.d.ts +14 -13
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -9
- package/dist/server.js.map +1 -1
- package/dist/util/defined.d.ts +11 -0
- package/dist/util/defined.d.ts.map +1 -0
- package/dist/util/defined.js +15 -0
- package/dist/util/defined.js.map +1 -0
- package/dist/util/json.d.ts +3 -0
- package/dist/util/json.d.ts.map +1 -0
- package/dist/util/json.js +3 -0
- package/dist/util/json.js.map +1 -0
- package/docs/ROADMAP.md +283 -0
- package/docs/compatibility.md +84 -0
- package/docs/diagrams/mcp-trellis-architecture.html +305 -0
- package/docs/guide.md +441 -0
- package/docs/reference.md +210 -0
- package/docs/security.md +112 -0
- package/docs/troubleshooting.md +19 -0
- package/package.json +24 -8
- package/dist/adapters/origins.d.ts +0 -19
- package/dist/adapters/origins.d.ts.map +0 -1
- package/dist/adapters/origins.js +0 -55
- package/dist/adapters/origins.js.map +0 -1
- package/dist/dispatch.d.ts +0 -7
- package/dist/dispatch.d.ts.map +0 -1
- package/dist/dispatch.js +0 -79
- package/dist/dispatch.js.map +0 -1
- package/dist/http.d.ts +0 -17
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -38
- package/dist/http.js.map +0 -1
- package/dist/jsonrpc.d.ts.map +0 -1
- package/dist/jsonrpc.js +0 -17
- package/dist/jsonrpc.js.map +0 -1
- package/dist/methods.d.ts +0 -61
- package/dist/methods.d.ts.map +0 -1
- package/dist/methods.js +0 -114
- package/dist/methods.js.map +0 -1
- package/dist/oauth/authorize.d.ts +0 -3
- package/dist/oauth/authorize.d.ts.map +0 -1
- package/dist/oauth/authorize.js +0 -109
- package/dist/oauth/authorize.js.map +0 -1
- package/dist/oauth/base64url.d.ts.map +0 -1
- package/dist/oauth/base64url.js.map +0 -1
- package/dist/oauth/clientauth.d.ts +0 -19
- package/dist/oauth/clientauth.d.ts.map +0 -1
- package/dist/oauth/clientauth.js +0 -76
- package/dist/oauth/clientauth.js.map +0 -1
- package/dist/oauth/codes.d.ts +0 -30
- package/dist/oauth/codes.d.ts.map +0 -1
- package/dist/oauth/codes.js +0 -93
- package/dist/oauth/codes.js.map +0 -1
- package/dist/oauth/metadata.d.ts.map +0 -1
- package/dist/oauth/metadata.js.map +0 -1
- package/dist/oauth/pkce.d.ts.map +0 -1
- package/dist/oauth/pkce.js.map +0 -1
- package/dist/oauth/redirect.d.ts.map +0 -1
- package/dist/oauth/redirect.js +0 -26
- package/dist/oauth/redirect.js.map +0 -1
- package/dist/oauth/resource.d.ts +0 -7
- package/dist/oauth/resource.d.ts.map +0 -1
- package/dist/oauth/resource.js +0 -44
- package/dist/oauth/resource.js.map +0 -1
- package/dist/oauth/revoke.d.ts.map +0 -1
- package/dist/oauth/revoke.js.map +0 -1
- package/dist/oauth/scope.d.ts +0 -11
- package/dist/oauth/scope.d.ts.map +0 -1
- package/dist/oauth/scope.js +0 -24
- package/dist/oauth/scope.js.map +0 -1
- package/dist/oauth/token.d.ts +0 -3
- package/dist/oauth/token.d.ts.map +0 -1
- package/dist/oauth/token.js.map +0 -1
- package/dist/oauth/wellknown.d.ts.map +0 -1
- package/dist/oauth/wellknown.js.map +0 -1
- package/dist/protocol.d.ts +0 -4
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -14
- package/dist/protocol.js.map +0 -1
- package/dist/registry.d.ts +0 -37
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -69
- package/dist/registry.js.map +0 -1
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -97
- package/dist/tools.js.map +0 -1
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js +0 -130
- package/dist/validate.js.map +0 -1
- /package/dist/oauth/{pkce.d.ts → crypto/pkce.d.ts} +0 -0
package/dist/oauth/router.js
CHANGED
|
@@ -1,88 +1,103 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { handleRevoke } from "./revoke.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
redirectUris = raw
|
|
24
|
-
.map((u) => String(u))
|
|
25
|
-
.filter((uri) => isAllowedRedirectUri(uri, options.redirect));
|
|
26
|
-
}
|
|
1
|
+
import { errorReason, INTERNAL_ERROR } from "../http/http.js";
|
|
2
|
+
import { safeOAuthAudit } from "./audit.js";
|
|
3
|
+
import { assertCodeSecret, assertScopeConfig, oauthError, unregisteredClientsAllowed, } from "./config.js";
|
|
4
|
+
import { DEFAULT_OAUTH_PATH, OAUTH_ERRORS } from "./constants.js";
|
|
5
|
+
import { processCodeStore } from "./crypto/codes.js";
|
|
6
|
+
import { handleAuthorize } from "./endpoints/authorize.js";
|
|
7
|
+
import { handleConsent } from "./endpoints/consent.js";
|
|
8
|
+
import { handleRegister } from "./endpoints/register.js";
|
|
9
|
+
import { handleRevoke } from "./endpoints/revoke.js";
|
|
10
|
+
import { handleToken } from "./endpoints/token.js";
|
|
11
|
+
import { handleWellKnown } from "./endpoints/wellknown.js";
|
|
12
|
+
import { DEFAULT_RESOURCE_PATH, normalizeConfiguredPath } from "./policy/resource.js";
|
|
13
|
+
/**
|
|
14
|
+
* Function-form `codeSecret` is re-validated on every call in
|
|
15
|
+
* `resolveSecrets`, since its value can vary per request; a string or array
|
|
16
|
+
* form is fixed for the life of this router, so fail fast at construction
|
|
17
|
+
* instead of at the first request.
|
|
18
|
+
*/
|
|
19
|
+
const assertRouterOptions = (options) => {
|
|
20
|
+
if (!unregisteredClientsAllowed(options) && !options.ports.clientStore) {
|
|
21
|
+
throw new Error("allowUnregisteredClients: false requires ports.clientStore " +
|
|
22
|
+
"so pre-registered clients can be resolved");
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
if (!options.ports.codeStore && !options.allowInMemoryCodeStore) {
|
|
25
|
+
throw new Error("ports.codeStore is required (shared jti store for auth-code / consent single-use). " +
|
|
26
|
+
"Pass a CodeStore, or set allowInMemoryCodeStore: true for single-process demos/tests only");
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// redirect_uri that `/authorize` would go on to reject (e.g. `clients`
|
|
34
|
-
// without `"claude"`, where `createMcpApp` sets `allowClaude: false`).
|
|
35
|
-
if (!suppliedRedirectUris && isAllowedRedirectUri(CLAUDE_CALLBACK, options.redirect)) {
|
|
36
|
-
redirectUris = [CLAUDE_CALLBACK];
|
|
28
|
+
if (typeof options.ports.codeSecret === "string") {
|
|
29
|
+
assertCodeSecret(options.ports.codeSecret);
|
|
37
30
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
if (Array.isArray(options.ports.codeSecret)) {
|
|
32
|
+
if (options.ports.codeSecret.length === 0) {
|
|
33
|
+
throw new Error("codeSecret array must not be empty — at least one key is required");
|
|
34
|
+
}
|
|
35
|
+
options.ports.codeSecret.forEach(assertCodeSecret);
|
|
42
36
|
}
|
|
43
|
-
|
|
44
|
-
client_id: newClientId(),
|
|
45
|
-
client_id_issued_at: Math.floor(Date.now() / 1000),
|
|
46
|
-
token_endpoint_auth_method: "none",
|
|
47
|
-
redirect_uris: redirectUris,
|
|
48
|
-
grant_types: [GRANT_TYPES.authorizationCode],
|
|
49
|
-
response_types: ["code"],
|
|
50
|
-
});
|
|
37
|
+
assertScopeConfig(options);
|
|
51
38
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Normalized once, not per request, so "/mcp/" and "/mcp" yield one
|
|
41
|
+
* canonical resource, and the routing table, discovery documents and the
|
|
42
|
+
* consent form action all agree on `oauthPath`.
|
|
43
|
+
*/
|
|
44
|
+
const normalizeRouterPaths = (options) => {
|
|
45
|
+
const resourcePath = normalizeConfiguredPath(options.resourcePath ?? DEFAULT_RESOURCE_PATH);
|
|
46
|
+
const oauthPath = normalizeConfiguredPath(options.oauthPath ?? DEFAULT_OAUTH_PATH);
|
|
47
|
+
if (oauthPath === resourcePath) {
|
|
48
|
+
throw new Error(`oauthPath (${oauthPath}) must not equal resourcePath — they would shadow each other`);
|
|
56
49
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
: {}),
|
|
73
|
-
[`${oauthPath}/authorize`]: (request) => handleAuthorize(request, options),
|
|
74
|
-
[`${oauthPath}/token`]: (request) => handleToken(request, options),
|
|
75
|
-
...(options.ports.revokeToken
|
|
76
|
-
? {
|
|
77
|
-
[`${oauthPath}/revoke`]: (request) => handleRevoke(request, options),
|
|
78
|
-
}
|
|
79
|
-
: {}),
|
|
50
|
+
if (resourcePath.startsWith("/.well-known")) {
|
|
51
|
+
throw new Error(`resourcePath (${resourcePath}) must not start with /.well-known — reserved for OAuth discovery documents`);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
resourcePath,
|
|
55
|
+
oauthPath,
|
|
56
|
+
prmPaths: new Set([
|
|
57
|
+
"/.well-known/oauth-protected-resource",
|
|
58
|
+
`/.well-known/oauth-protected-resource${resourcePath}`,
|
|
59
|
+
]),
|
|
60
|
+
asPaths: new Set([
|
|
61
|
+
"/.well-known/oauth-authorization-server",
|
|
62
|
+
`/.well-known/oauth-authorization-server${resourcePath}`,
|
|
63
|
+
]),
|
|
80
64
|
};
|
|
65
|
+
};
|
|
66
|
+
const buildRoutes = (options, normalizedOptions, oauthPath) => ({
|
|
67
|
+
...(unregisteredClientsAllowed(options)
|
|
68
|
+
? {
|
|
69
|
+
[`${oauthPath}/register`]: (request) => handleRegister(request, normalizedOptions),
|
|
70
|
+
}
|
|
71
|
+
: {}),
|
|
72
|
+
[`${oauthPath}/authorize`]: (request) => handleAuthorize(request, normalizedOptions),
|
|
73
|
+
[`${oauthPath}/consent`]: (request) => handleConsent(request, normalizedOptions),
|
|
74
|
+
[`${oauthPath}/token`]: (request) => handleToken(request, normalizedOptions),
|
|
75
|
+
...(options.ports.revokeToken
|
|
76
|
+
? {
|
|
77
|
+
[`${oauthPath}/revoke`]: (request) => handleRevoke(request, normalizedOptions),
|
|
78
|
+
}
|
|
79
|
+
: {}),
|
|
80
|
+
});
|
|
81
|
+
export const createOAuthRouter = (options) => {
|
|
82
|
+
assertRouterOptions(options);
|
|
83
|
+
// Resolved once; `assertRouterOptions` already required
|
|
84
|
+
// `allowInMemoryCodeStore` before the process store can be reached.
|
|
85
|
+
const codeStore = options.ports.codeStore ?? processCodeStore;
|
|
86
|
+
const ports = { ...options.ports, codeStore };
|
|
87
|
+
const { resourcePath, oauthPath, prmPaths, asPaths } = normalizeRouterPaths(options);
|
|
88
|
+
// Handlers read paths from here, never from the caller's raw options.
|
|
89
|
+
const normalizedOptions = {
|
|
90
|
+
...options,
|
|
91
|
+
resourcePath,
|
|
92
|
+
oauthPath,
|
|
93
|
+
ports,
|
|
94
|
+
};
|
|
95
|
+
const routes = buildRoutes(options, normalizedOptions, oauthPath);
|
|
81
96
|
return {
|
|
82
97
|
tryHandle: async (request) => {
|
|
83
98
|
try {
|
|
84
99
|
const path = new URL(request.url).pathname;
|
|
85
|
-
const known = await handleWellKnown(request,
|
|
100
|
+
const known = await handleWellKnown(request, normalizedOptions, {
|
|
86
101
|
prmPaths,
|
|
87
102
|
asPaths,
|
|
88
103
|
resourcePath,
|
|
@@ -93,22 +108,25 @@ export const createOAuthRouter = (options) => {
|
|
|
93
108
|
const route = routes[path];
|
|
94
109
|
return route ? await route(request) : null;
|
|
95
110
|
}
|
|
96
|
-
catch {
|
|
97
|
-
// A host port
|
|
98
|
-
//
|
|
99
|
-
//
|
|
111
|
+
catch (caught) {
|
|
112
|
+
// A host port threw, or a per-request codeSecret failed validation.
|
|
113
|
+
// Only routes this router owns get here: the caller sees a generic
|
|
114
|
+
// server_error, ports.audit gets the real reason.
|
|
115
|
+
await safeOAuthAudit(normalizedOptions, {
|
|
116
|
+
event: "server_error",
|
|
117
|
+
reason: errorReason(caught),
|
|
118
|
+
});
|
|
100
119
|
return oauthError(OAUTH_ERRORS.serverError, 500, INTERNAL_ERROR);
|
|
101
120
|
}
|
|
102
121
|
},
|
|
103
122
|
};
|
|
104
123
|
};
|
|
105
|
-
export {
|
|
106
|
-
export {
|
|
107
|
-
export {
|
|
108
|
-
|
|
109
|
-
export
|
|
110
|
-
export {
|
|
111
|
-
export {
|
|
112
|
-
export {
|
|
113
|
-
export { unregisteredClientsAllowed } from "./types.js";
|
|
124
|
+
export { isCimdClientId, resolveCimdClient, } from "./cimd/cimd.js";
|
|
125
|
+
export { DEFAULT_SCOPE, GRANT_TYPES, OAUTH_ERRORS, TOKEN_ENDPOINT_AUTH_METHODS, } from "./constants.js";
|
|
126
|
+
export { hashClientSecret, verifyClientSecret } from "./crypto/secrethash.js";
|
|
127
|
+
// Moved to `mcp-trellis/advanced`; deprecated aliases until 3.0.
|
|
128
|
+
export * from "./deprecated.js";
|
|
129
|
+
export { authorizationServerMetadata, mcpWwwAuthenticate, protectedResourceMetadata, } from "./endpoints/metadata.js";
|
|
130
|
+
export { CLAUDE_CALLBACK, isAllowedRedirectUri } from "./policy/redirect.js";
|
|
131
|
+
export { canonicalResource, DEFAULT_RESOURCE_PATH, resourcesEqual, } from "./policy/resource.js";
|
|
114
132
|
//# sourceMappingURL=router.js.map
|
package/dist/oauth/router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/oauth/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/oauth/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAkBtF;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,CAAC,OAA2B,EAAQ,EAAE;IAChE,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACvE,MAAM,IAAI,KAAK,CACb,6DAA6D;YAC3D,2CAA2C,CAC9C,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC;QAChE,MAAM,IA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WAAW,EACX,YAAY,EACZ,2BAA2B,GAE5B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,iEAAiE;AACjE,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACf,MAAM,sBAAsB,CAAC"}
|
package/dist/oauth/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { CimdCache } from "./cimd/types.js";
|
|
2
|
+
import type { TokenEndpointAuthMethod } from "./constants.js";
|
|
3
|
+
import type { CodeStore } from "./crypto/codes.js";
|
|
4
|
+
import type { RedirectAllowlistOptions } from "./policy/redirect.js";
|
|
4
5
|
export type OAuthUser = {
|
|
5
6
|
id: string;
|
|
6
7
|
};
|
|
@@ -15,15 +16,69 @@ export type RegisteredClient = {
|
|
|
15
16
|
redirectUris: string[];
|
|
16
17
|
tokenEndpointAuthMethod: TokenEndpointAuthMethod;
|
|
17
18
|
};
|
|
19
|
+
export type ConsentRequest = {
|
|
20
|
+
clientId: string;
|
|
21
|
+
registeredClient: RegisteredClient | null;
|
|
22
|
+
redirectUri: string;
|
|
23
|
+
scope: string[];
|
|
24
|
+
resource: string;
|
|
25
|
+
user: OAuthUser;
|
|
26
|
+
/** Embed this in your form's `consent_ticket` field (hidden input or POST body). */
|
|
27
|
+
ticket: string;
|
|
28
|
+
oauthPath: string;
|
|
29
|
+
};
|
|
30
|
+
export type ConsentOptions = {
|
|
31
|
+
/**
|
|
32
|
+
* Render the approval page yourself. Return any `Response` — HTML, or a
|
|
33
|
+
* redirect to your own route. Omit for the built-in hardened interstitial.
|
|
34
|
+
*
|
|
35
|
+
* If your page sets its own `Content-Security-Policy` with `form-action`,
|
|
36
|
+
* include `new URL(input.redirectUri).origin` in it — Chromium enforces
|
|
37
|
+
* `form-action` across the redirect your approval POST triggers, not just
|
|
38
|
+
* the immediate submission target, so `'self'` alone blocks the eventual
|
|
39
|
+
* redirect back to the client's own callback.
|
|
40
|
+
*/
|
|
41
|
+
render?: (input: ConsentRequest) => Response | Promise<Response>;
|
|
42
|
+
/**
|
|
43
|
+
* Client ids that skip approval. Only honored when `clientStore` actually
|
|
44
|
+
* resolves the id — a DCR or self-invented id is never trusted.
|
|
45
|
+
*/
|
|
46
|
+
preApprovedClientIds?: string[];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The payload sealed into a `client_id` this server itself issued via
|
|
50
|
+
* `/register` (see `sealed.ts`, type `"client"`). Zero storage: the id
|
|
51
|
+
* *is* the registration record, self-verifying against `codeSecret`.
|
|
52
|
+
*/
|
|
53
|
+
export type ClientAssertion = {
|
|
54
|
+
redirectUris: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Unix seconds when `/register` sealed this assertion. Informational only
|
|
57
|
+
* — not enforced as an expiry — so it can help an operator judge how old
|
|
58
|
+
* a still-valid DCR client is. Optional on read: an assertion sealed
|
|
59
|
+
* before this field existed still unseals and works.
|
|
60
|
+
*/
|
|
61
|
+
iat?: number;
|
|
62
|
+
};
|
|
18
63
|
export type ClientStore = {
|
|
19
64
|
/** Resolve a pre-registered client, or null when unknown. */
|
|
20
65
|
get: (clientId: string) => Promise<RegisteredClient | null>;
|
|
21
66
|
/**
|
|
22
|
-
* Verify a presented client secret.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
67
|
+
* Verify a presented client secret yourself. Secret storage and
|
|
68
|
+
* comparison stay entirely in your implementation — the library never
|
|
69
|
+
* sees or persists credentials. Prefer `secretHash` below when you can:
|
|
70
|
+
* a hand-rolled `stored === presented` here is a timing oracle with no
|
|
71
|
+
* warning from the library.
|
|
25
72
|
*/
|
|
26
73
|
verifySecret?: (clientId: string, presented: string) => Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Preferred over `verifySecret`: return the stored hash (from
|
|
76
|
+
* `hashClientSecret`) for `clientId`, or `null` when unknown, and the
|
|
77
|
+
* library does the comparison with the same constant-time primitive it
|
|
78
|
+
* uses everywhere else. Checked first when both are present. See
|
|
79
|
+
* `secrethash.ts`.
|
|
80
|
+
*/
|
|
81
|
+
secretHash?: (clientId: string) => Promise<string | null>;
|
|
27
82
|
};
|
|
28
83
|
export type MintedToken = {
|
|
29
84
|
accessToken: string;
|
|
@@ -47,15 +102,47 @@ export type RefreshAccessTokenInput = {
|
|
|
47
102
|
* Implementations MUST reject refresh tokens not originally issued for this resource.
|
|
48
103
|
*/
|
|
49
104
|
resource: string;
|
|
105
|
+
/**
|
|
106
|
+
* RFC 6749 §6 — optional scope reduction requested by the client.
|
|
107
|
+
* When set, the library validates against advertised `scopes` only.
|
|
108
|
+
* Implementations MUST also reject any scope outside what was originally
|
|
109
|
+
* granted to this refresh token (the library cannot see opaque RTs).
|
|
110
|
+
*/
|
|
111
|
+
scope?: string;
|
|
50
112
|
};
|
|
51
113
|
export type RevokeTokenInput = {
|
|
52
114
|
token: string;
|
|
53
115
|
clientId: string;
|
|
54
|
-
tokenTypeHint?: "access_token" | "refresh_token";
|
|
116
|
+
tokenTypeHint?: "access_token" | "refresh_token" | undefined;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* OAuth-side metrics hook, mirroring `McpPorts.audit` on the MCP side.
|
|
120
|
+
* `reason` is intentionally more specific than what the caller ever sees —
|
|
121
|
+
* `/token` and `/revoke` collapse every client-auth failure to one generic
|
|
122
|
+
* `invalid_client` (closing an enumeration oracle; see `clientauth.ts`),
|
|
123
|
+
* and a rejected `codeSecret` surfaces to the caller only as `server_error`
|
|
124
|
+
* — this port is where an operator gets the real reason back, without
|
|
125
|
+
* handing it to an unauthenticated caller.
|
|
126
|
+
*/
|
|
127
|
+
export type OAuthAuditEntry = {
|
|
128
|
+
/** Machine-stable event name, e.g. "client_auth_failed", "server_error". */
|
|
129
|
+
event: string;
|
|
130
|
+
clientId?: string | undefined;
|
|
131
|
+
reason: string;
|
|
55
132
|
};
|
|
56
133
|
export type OAuthPorts = {
|
|
57
|
-
/**
|
|
58
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Secret(s) that seal auth codes, consent tickets, and self-issued DCR
|
|
136
|
+
* client assertions (`sealed.ts`), and key `ClientStore.secretHash`.
|
|
137
|
+
*
|
|
138
|
+
* Pass a single string, or for key rotation an array: the **first** entry seals new material and hashes new client
|
|
139
|
+
* secrets; **every** entry is tried when unsealing/verifying, so material
|
|
140
|
+
* sealed under an older key keeps working until you drop it from the
|
|
141
|
+
* array. `ports.audit` sees a `"legacy_code_secret_used"` event whenever
|
|
142
|
+
* anything but the first entry was the one that actually verified,
|
|
143
|
+
* so you know when it's safe to remove.
|
|
144
|
+
*/
|
|
145
|
+
codeSecret: string | string[] | ((req: Request) => string | string[] | Promise<string | string[]>);
|
|
59
146
|
/** Resolve the logged-in user, or null → redirect to login. */
|
|
60
147
|
resolveUser: (req: Request) => Promise<OAuthUser | null>;
|
|
61
148
|
/** Where to send unauthenticated authorize requests. */
|
|
@@ -63,7 +150,7 @@ export type OAuthPorts = {
|
|
|
63
150
|
/** Mint an access token bound to the consenting user and resource audience. */
|
|
64
151
|
mintAccessToken: (input: MintAccessTokenInput) => Promise<MintedToken>;
|
|
65
152
|
/** Optional refresh_token grant. Presence advertises the grant. */
|
|
66
|
-
refreshAccessToken?: (input: RefreshAccessTokenInput) => Promise<MintedToken | null
|
|
153
|
+
refreshAccessToken?: ((input: RefreshAccessTokenInput) => Promise<MintedToken | null>) | undefined;
|
|
67
154
|
/**
|
|
68
155
|
* RFC 7009. Presence mounts `/revoke` and advertises `revocation_endpoint`.
|
|
69
156
|
* Well-formed authenticated revoke is HTTP 200 even if the token is unknown
|
|
@@ -71,11 +158,18 @@ export type OAuthPorts = {
|
|
|
71
158
|
* `refreshAccessToken` MUST consult the same store; unknown tokens and
|
|
72
159
|
* tokens not issued to `clientId` MUST no-op (not throw).
|
|
73
160
|
*/
|
|
74
|
-
revokeToken?: (input: RevokeTokenInput) => Promise<void
|
|
75
|
-
/** Shared single-use jti store for multi-instance
|
|
76
|
-
codeStore?: CodeStore;
|
|
161
|
+
revokeToken?: ((input: RevokeTokenInput) => Promise<void>) | undefined;
|
|
162
|
+
/** Shared single-use jti store for multi-instance. Required unless `allowInMemoryCodeStore`. */
|
|
163
|
+
codeStore?: CodeStore | undefined;
|
|
77
164
|
/** Pre-registered clients. Required to serve confidential clients. */
|
|
78
|
-
clientStore?: ClientStore;
|
|
165
|
+
clientStore?: ClientStore | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Opt-in metrics hook. Pass any function to see the real reason behind a
|
|
168
|
+
* collapsed `invalid_client` or a rejected `codeSecret`. Omit it and the
|
|
169
|
+
* library stays silent. Throwing never fails the request — same
|
|
170
|
+
* guarantee as `McpPorts.audit`.
|
|
171
|
+
*/
|
|
172
|
+
audit?: ((entry: OAuthAuditEntry) => void | Promise<void>) | undefined;
|
|
79
173
|
};
|
|
80
174
|
export type OAuthRouterOptions = {
|
|
81
175
|
ports: OAuthPorts;
|
|
@@ -83,6 +177,13 @@ export type OAuthRouterOptions = {
|
|
|
83
177
|
oauthPath?: string;
|
|
84
178
|
realm?: string;
|
|
85
179
|
scopes?: string[];
|
|
180
|
+
/**
|
|
181
|
+
* Scopes granted when a client omits `scope` entirely. Required when
|
|
182
|
+
* `scopes` advertises more than one — with only one advertised scope
|
|
183
|
+
* there's no escalation to prevent, so it defaults to that scope.
|
|
184
|
+
* Must be a subset of `scopes`.
|
|
185
|
+
*/
|
|
186
|
+
defaultScopes?: string[];
|
|
86
187
|
redirect?: RedirectAllowlistOptions;
|
|
87
188
|
/** Advertised in AS metadata. Defaults to `["none"]` (public clients only). */
|
|
88
189
|
tokenEndpointAuthMethods?: TokenEndpointAuthMethod[];
|
|
@@ -98,18 +199,68 @@ export type OAuthRouterOptions = {
|
|
|
98
199
|
* `hasDynamicClient`.
|
|
99
200
|
*/
|
|
100
201
|
allowUnregisteredClients?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Require every `client_id` to have gone through `clientStore` or this
|
|
204
|
+
* server's own `/register` (whose issued ids are self-verifying sealed
|
|
205
|
+
* assertions — see `sealed.ts`). Unlike `allowUnregisteredClients: false`,
|
|
206
|
+
* DCR stays mounted; a client just can't invent an id out of thin air.
|
|
207
|
+
*
|
|
208
|
+
* Default **true** since 1.0. Set **false** only when you intentionally
|
|
209
|
+
* accept arbitrary public `client_id`s (pre-CIMD connectors that invent ids).
|
|
210
|
+
*/
|
|
211
|
+
requireRegisteredClients?: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Consent policy. Policy, not a credential — sits alongside `redirect`,
|
|
214
|
+
* not under `ports`. Omit for the built-in hardened interstitial.
|
|
215
|
+
*/
|
|
216
|
+
consent?: ConsentOptions;
|
|
217
|
+
/**
|
|
218
|
+
* Max time to wait for `ports.audit` before responding anyway. Default
|
|
219
|
+
* 1000ms — same guarantee as `McpHandlerOptions.auditTimeoutMs`.
|
|
220
|
+
*/
|
|
221
|
+
auditTimeoutMs?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Allow the process-local in-memory jti Map when `ports.codeStore` is
|
|
224
|
+
* omitted. Default **false** since 2.0 — multi-instance deploys silently
|
|
225
|
+
* double-redeem auth codes without a shared store. Set true only for
|
|
226
|
+
* single-process demos and tests.
|
|
227
|
+
*/
|
|
228
|
+
allowInMemoryCodeStore?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Resolve Client ID Metadata Documents (HTTPS URL `client_id`s).
|
|
231
|
+
* Default **false** — opt in with `cimd: true`. Off until connect-pinned
|
|
232
|
+
* fetch exists; see `cimd.ts` ponytail.
|
|
233
|
+
*/
|
|
234
|
+
cimd?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* CIMD document cache (respects Cache-Control max-age, capped at 1 h).
|
|
237
|
+
* **Strongly recommended with `cimd: true`:** without it `/token` and
|
|
238
|
+
* `/revoke` re-fetch the client's document on every call, so a flaky
|
|
239
|
+
* document host fails refresh/revoke (audited as `cimd_resolve_failed`).
|
|
240
|
+
*/
|
|
241
|
+
cimdCache?: CimdCache;
|
|
242
|
+
/** Optional DNS lookup for CIMD SSRF checks — see `CimdFetchOptions.lookup`. */
|
|
243
|
+
cimdLookup?: (hostname: string) => Promise<string[]>;
|
|
101
244
|
};
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export
|
|
108
|
-
|
|
109
|
-
|
|
245
|
+
/**
|
|
246
|
+
* `OAuthRouterOptions` after `createOAuthRouter` has resolved them: paths
|
|
247
|
+
* normalized and `ports.codeStore` always present, so no endpoint handler
|
|
248
|
+
* can fall back to a store of its own. Internal — not re-exported.
|
|
249
|
+
*/
|
|
250
|
+
export type ResolvedOAuthRouterOptions = OAuthRouterOptions & {
|
|
251
|
+
resourcePath: string;
|
|
252
|
+
oauthPath: string;
|
|
253
|
+
ports: OAuthPorts & {
|
|
254
|
+
codeStore: CodeStore;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* An OAuth error's code and description without a `Response` built yet —
|
|
259
|
+
* lets a caller choose delivery: `oauthError` for a direct JSON body, or a
|
|
260
|
+
* redirect to the client's own callback (RFC 6749 §4.1.2.1).
|
|
261
|
+
*/
|
|
262
|
+
export type OAuthErrorInfo = {
|
|
110
263
|
code: string;
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
/** `grantedScope` is what the auth code carried; the port may narrow it further. */
|
|
114
|
-
export declare const tokenResponse: (minted: MintedToken, grantedScope?: string) => Response;
|
|
264
|
+
description: string;
|
|
265
|
+
};
|
|
115
266
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/oauth/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/oauth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,uBAAuB,EAAE,uBAAuB,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjE;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,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
package/dist/oauth/types.js
CHANGED
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsonResponse } from "../http.js";
|
|
3
|
-
/** Default true — see `OAuthRouterOptions.allowUnregisteredClients`. */
|
|
4
|
-
export const unregisteredClientsAllowed = (options) => options.allowUnregisteredClients !== false;
|
|
5
|
-
/** Scopes this AS advertises and is willing to grant. */
|
|
6
|
-
export const advertisedScopes = (options) => options.scopes ?? [DEFAULT_SCOPE];
|
|
7
|
-
export const resolveSecret = async (ports, req) => {
|
|
8
|
-
if (typeof ports.codeSecret === "string")
|
|
9
|
-
return ports.codeSecret;
|
|
10
|
-
return ports.codeSecret(req);
|
|
11
|
-
};
|
|
12
|
-
export const oauthError = (error, status, description) => jsonResponse(description ? { error, error_description: description } : { error }, status, undefined, { cors: false });
|
|
13
|
-
const UNREGISTERED_CLIENT_DESCRIPTION = "unknown client_id — this server only serves pre-registered clients";
|
|
14
|
-
/** Direct JSON error when this AS does not serve unknown `client_id`s. */
|
|
15
|
-
export const unregisteredClientError = (options, reject) => {
|
|
16
|
-
if (unregisteredClientsAllowed(options))
|
|
17
|
-
return null;
|
|
18
|
-
return oauthError(reject.code, reject.status, UNREGISTERED_CLIENT_DESCRIPTION);
|
|
19
|
-
};
|
|
20
|
-
/** `grantedScope` is what the auth code carried; the port may narrow it further. */
|
|
21
|
-
export const tokenResponse = (minted, grantedScope) => jsonResponse({
|
|
22
|
-
access_token: minted.accessToken,
|
|
23
|
-
token_type: minted.tokenType ?? "bearer",
|
|
24
|
-
expires_in: minted.expiresIn,
|
|
25
|
-
scope: minted.scope ?? grantedScope ?? DEFAULT_SCOPE,
|
|
26
|
-
...(minted.refreshToken ? { refresh_token: minted.refreshToken } : {}),
|
|
27
|
-
}, 200, undefined, { cors: false });
|
|
1
|
+
export {};
|
|
28
2
|
//# sourceMappingURL=types.js.map
|
package/dist/oauth/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/oauth/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/oauth/types.ts"],"names":[],"mappings":""}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export { createMcpApp, type McpApp, type McpAppOptions, type
|
|
2
|
-
/** Auth-port types used by `McpAppAuth` — annotate extracted stores/callbacks. */
|
|
3
|
-
export type { ClientStore, RegisteredClient, MintAccessTokenInput, RefreshAccessTokenInput, RevokeTokenInput, MintedToken, OAuthUser, } from "./oauth/types.js";
|
|
4
|
-
export type { CodeStore } from "./oauth/codes.js";
|
|
5
|
-
export { CLIENT_PROFILES, DEFAULT_CLIENTS, authMethodsFor, redirectUrisFor, preRegisteredClients, hasDynamicClient, type ClientName, type ClientProfile, } from "./clients.js";
|
|
6
|
-
export { createMcpHandler, type McpHandler, type McpHandlerOptions, type McpPorts, type Principal, type AuditEntry, type ServerInfo, } from "./dispatch.js";
|
|
1
|
+
export { createMcpApp, type McpApp, type McpAppAuth, type McpAppOptions, type UnifiedAuditEntry, type VerifiedToken, } from "./app.js";
|
|
7
2
|
export { consoleAudit } from "./audit.js";
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
3
|
+
export { parseBearer, rejectQueryToken, type WwwAuthenticateOptions, wwwAuthenticateHeader, } from "./auth/bearer.js";
|
|
4
|
+
export { authMethodsFor, CLIENT_PROFILES, type ClientName, type ClientProfile, DEFAULT_CLIENTS, hasDynamicClient, preRegisteredClients, redirectUrisFor, } from "./clients.js";
|
|
5
|
+
export * from "./deprecated.js";
|
|
6
|
+
export { type JsonResponseInput, type JsonResponseOptions, jsonResponse, } from "./http/http.js";
|
|
7
|
+
export { type AuditEntry, createMcpHandler, type McpHandler, type McpHandlerOptions, type McpPorts, type Principal, type ServerInfo, } from "./mcp/dispatch.js";
|
|
8
|
+
export { JSONRPC_INTERNAL_ERROR, JSONRPC_INVALID_PARAMS, JSONRPC_INVALID_REQUEST, JSONRPC_METHOD_NOT_FOUND, JSONRPC_PARSE_ERROR, JSONRPC_UNAUTHORIZED, type JsonRpcId, type JsonRpcRequest, type JsonRpcResponse, rpcError, rpcResult, } from "./mcp/jsonrpc.js";
|
|
9
|
+
export { DEFAULT_PROTOCOL_VERSION, PROTOCOL_VERSIONS } from "./mcp/protocol.js";
|
|
10
|
+
export { createToolRegistry, type RegistryOptions, type ToolDef, type ToolHandler, type ToolListEntry, type ToolRegistry, type ToolResult, } from "./mcp/registry.js";
|
|
11
|
+
export { type ApiRequest, type ApiToolOptions, apiTool, type DefineToolOptions, defineTool, type StandardSchemaV1, } from "./mcp/tools.js";
|
|
12
|
+
export type { JsonSchema } from "./mcp/validate.js";
|
|
13
|
+
export type { CodeStore } from "./oauth/crypto/codes.js";
|
|
14
|
+
/** Auth-port types used by `McpAppAuth` — annotate extracted stores/callbacks. */
|
|
15
|
+
export type { ClientStore, ConsentOptions, ConsentRequest, MintAccessTokenInput, MintedToken, OAuthUser, RefreshAccessTokenInput, RegisteredClient, RevokeTokenInput, } from "./oauth/types.js";
|
|
15
16
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CA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