@decocms/runtime 1.2.7 → 1.2.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/package.json +1 -1
- package/src/bindings.ts +6 -0
- package/src/oauth.ts +0 -21
package/package.json
CHANGED
package/src/bindings.ts
CHANGED
|
@@ -108,6 +108,12 @@ export const proxyConnectionForId = (
|
|
|
108
108
|
headers ??= {};
|
|
109
109
|
headers.cookie = ctx.cookie;
|
|
110
110
|
}
|
|
111
|
+
|
|
112
|
+
if (ctx.token) {
|
|
113
|
+
headers ??= {};
|
|
114
|
+
headers["x-mesh-token"] = ctx.token;
|
|
115
|
+
}
|
|
116
|
+
|
|
111
117
|
return {
|
|
112
118
|
type: "HTTP",
|
|
113
119
|
url: new URL(`/mcp/${connectionId}`, ctx.meshUrl).href,
|
package/src/oauth.ts
CHANGED
|
@@ -70,27 +70,6 @@ interface CodePayload {
|
|
|
70
70
|
codeChallengeMethod?: string;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/**
|
|
74
|
-
* OAuth 2.0/2.1 Token Request Parameters
|
|
75
|
-
* Per RFC 6749 (OAuth 2.0) and RFC 9207 (OAuth 2.1)
|
|
76
|
-
* All parameters are strings when properly formatted
|
|
77
|
-
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3
|
|
78
|
-
*/
|
|
79
|
-
interface OAuthTokenRequestBody {
|
|
80
|
-
/** REQUIRED for authorization_code grant - The authorization code from callback */
|
|
81
|
-
code?: string;
|
|
82
|
-
/** OPTIONAL - PKCE code verifier (RFC 7636) */
|
|
83
|
-
code_verifier?: string;
|
|
84
|
-
/** REQUIRED - Grant type: "authorization_code" or "refresh_token" */
|
|
85
|
-
grant_type?: string;
|
|
86
|
-
/** REQUIRED for refresh_token grant - The refresh token */
|
|
87
|
-
refresh_token?: string;
|
|
88
|
-
/** OPTIONAL - Redirect URI used in authorization request */
|
|
89
|
-
redirect_uri?: string;
|
|
90
|
-
/** Additional provider-specific parameters */
|
|
91
|
-
[key: string]: unknown;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
73
|
const forceHttps = (url: URL) => {
|
|
95
74
|
const isLocal = url.hostname === "localhost" || url.hostname === "127.0.0.1";
|
|
96
75
|
if (!isLocal) {
|