@solvapay/server 1.0.8-preview.7 → 1.0.8-preview.8
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/index.cjs +15 -1
- package/dist/index.js +15 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -6489,6 +6489,19 @@ function createMcpOAuthBridge(options) {
|
|
|
6489
6489
|
oauthPaths
|
|
6490
6490
|
} = options;
|
|
6491
6491
|
const paths = resolvePaths(oauthPaths);
|
|
6492
|
+
const openidDiscoveryMiddleware = (req, res, next) => {
|
|
6493
|
+
if (req.method !== "GET" || req.path !== "/.well-known/openid-configuration") {
|
|
6494
|
+
next();
|
|
6495
|
+
return;
|
|
6496
|
+
}
|
|
6497
|
+
applyCorsHeaders(req, res);
|
|
6498
|
+
res.status(404);
|
|
6499
|
+
if (typeof res.end === "function") {
|
|
6500
|
+
res.end();
|
|
6501
|
+
} else {
|
|
6502
|
+
res.json({ error: "not_found" });
|
|
6503
|
+
}
|
|
6504
|
+
};
|
|
6492
6505
|
const protectedResourceMiddleware = (req, res, next) => {
|
|
6493
6506
|
if (req.method !== "GET" || req.path !== protectedResourcePath) {
|
|
6494
6507
|
next();
|
|
@@ -6554,7 +6567,7 @@ function createMcpOAuthBridge(options) {
|
|
|
6554
6567
|
next();
|
|
6555
6568
|
} catch {
|
|
6556
6569
|
applyCorsHeaders(req, res);
|
|
6557
|
-
res.setHeader("Access-Control-Expose-Headers", "WWW-Authenticate
|
|
6570
|
+
res.setHeader("Access-Control-Expose-Headers", "WWW-Authenticate");
|
|
6558
6571
|
setMcpChallengeHeader(res, publicBaseUrl, protectedResourcePath);
|
|
6559
6572
|
if (req.method === "POST") {
|
|
6560
6573
|
res.status(401).json(makeUnauthorizedJsonRpc(id));
|
|
@@ -6564,6 +6577,7 @@ function createMcpOAuthBridge(options) {
|
|
|
6564
6577
|
}
|
|
6565
6578
|
};
|
|
6566
6579
|
return [
|
|
6580
|
+
openidDiscoveryMiddleware,
|
|
6567
6581
|
protectedResourceMiddleware,
|
|
6568
6582
|
authorizationServerMiddleware,
|
|
6569
6583
|
registerMiddleware,
|
package/dist/index.js
CHANGED
|
@@ -2136,6 +2136,19 @@ function createMcpOAuthBridge(options) {
|
|
|
2136
2136
|
oauthPaths
|
|
2137
2137
|
} = options;
|
|
2138
2138
|
const paths = resolvePaths(oauthPaths);
|
|
2139
|
+
const openidDiscoveryMiddleware = (req, res, next) => {
|
|
2140
|
+
if (req.method !== "GET" || req.path !== "/.well-known/openid-configuration") {
|
|
2141
|
+
next();
|
|
2142
|
+
return;
|
|
2143
|
+
}
|
|
2144
|
+
applyCorsHeaders(req, res);
|
|
2145
|
+
res.status(404);
|
|
2146
|
+
if (typeof res.end === "function") {
|
|
2147
|
+
res.end();
|
|
2148
|
+
} else {
|
|
2149
|
+
res.json({ error: "not_found" });
|
|
2150
|
+
}
|
|
2151
|
+
};
|
|
2139
2152
|
const protectedResourceMiddleware = (req, res, next) => {
|
|
2140
2153
|
if (req.method !== "GET" || req.path !== protectedResourcePath) {
|
|
2141
2154
|
next();
|
|
@@ -2201,7 +2214,7 @@ function createMcpOAuthBridge(options) {
|
|
|
2201
2214
|
next();
|
|
2202
2215
|
} catch {
|
|
2203
2216
|
applyCorsHeaders(req, res);
|
|
2204
|
-
res.setHeader("Access-Control-Expose-Headers", "WWW-Authenticate
|
|
2217
|
+
res.setHeader("Access-Control-Expose-Headers", "WWW-Authenticate");
|
|
2205
2218
|
setMcpChallengeHeader(res, publicBaseUrl, protectedResourcePath);
|
|
2206
2219
|
if (req.method === "POST") {
|
|
2207
2220
|
res.status(401).json(makeUnauthorizedJsonRpc(id));
|
|
@@ -2211,6 +2224,7 @@ function createMcpOAuthBridge(options) {
|
|
|
2211
2224
|
}
|
|
2212
2225
|
};
|
|
2213
2226
|
return [
|
|
2227
|
+
openidDiscoveryMiddleware,
|
|
2214
2228
|
protectedResourceMiddleware,
|
|
2215
2229
|
authorizationServerMiddleware,
|
|
2216
2230
|
registerMiddleware,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solvapay/server",
|
|
3
|
-
"version": "1.0.8-preview.
|
|
3
|
+
"version": "1.0.8-preview.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
},
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@solvapay/core": "1.0.8-preview.
|
|
40
|
+
"@solvapay/core": "1.0.8-preview.8"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
44
44
|
"zod": "^3.25.0 || ^4.0.0",
|
|
45
|
-
"@solvapay/auth": "1.0.8-preview.
|
|
45
|
+
"@solvapay/auth": "1.0.8-preview.8"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"@modelcontextprotocol/sdk": {
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"tsx": "^4.21.0",
|
|
61
61
|
"typescript": "^5.9.3",
|
|
62
62
|
"vitest": "^4.1.2",
|
|
63
|
-
"@solvapay/auth": "1.0.8-preview.7",
|
|
64
63
|
"@solvapay/demo-services": "0.0.0",
|
|
65
|
-
"@solvapay/test-utils": "^0.0.0"
|
|
64
|
+
"@solvapay/test-utils": "^0.0.0",
|
|
65
|
+
"@solvapay/auth": "1.0.8-preview.8"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsup src/index.ts --format esm,cjs --dts --tsconfig tsconfig.build.json && tsup src/edge.ts --format esm --dts --tsconfig tsconfig.build.json",
|