@zereight/mcp-gitlab 2.3.18-next.190 → 2.3.18-next.191
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/build/oauth-proxy.js +23 -7
- package/package.json +1 -1
package/build/oauth-proxy.js
CHANGED
|
@@ -630,6 +630,7 @@ class GitLabOAuthServerProvider {
|
|
|
630
630
|
return false;
|
|
631
631
|
}
|
|
632
632
|
// ---- Refresh token -----------------------------------------------------
|
|
633
|
+
/** Refresh once, preserving successful tokens while sanitizing failures and releasing rejected bodies. */
|
|
633
634
|
async exchangeRefreshToken(_client, refreshToken, scopes, resource) {
|
|
634
635
|
if (this._disableRefreshToken) {
|
|
635
636
|
// invalid_grant makes MCP clients drop stored tokens and restart the
|
|
@@ -645,14 +646,29 @@ class GitLabOAuthServerProvider {
|
|
|
645
646
|
params.set("scope", scopes.join(" "));
|
|
646
647
|
if (resource)
|
|
647
648
|
params.set("resource", resource.href);
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
649
|
+
let response;
|
|
650
|
+
try {
|
|
651
|
+
response = await fetch(`${this._gitlabBaseUrl}/oauth/token`, {
|
|
652
|
+
method: "POST",
|
|
653
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
654
|
+
body: params.toString(),
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
catch {
|
|
658
|
+
// Fetch errors may contain request URLs or credentials. Do not expose them.
|
|
659
|
+
logger.error("GitLab token refresh transport failed");
|
|
660
|
+
throw new ServerError("GitLab token refresh temporarily unavailable");
|
|
661
|
+
}
|
|
653
662
|
if (!response.ok) {
|
|
654
|
-
|
|
655
|
-
|
|
663
|
+
let body;
|
|
664
|
+
try {
|
|
665
|
+
body = await response.text();
|
|
666
|
+
}
|
|
667
|
+
catch {
|
|
668
|
+
logger.error({ status: response.status }, "GitLab token refresh response unavailable");
|
|
669
|
+
throw new ServerError(`Token refresh failed: ${response.status}`);
|
|
670
|
+
}
|
|
671
|
+
logger.error({ status: response.status }, "GitLab token refresh rejected");
|
|
656
672
|
throw tokenEndpointError("Token refresh", response.status, body);
|
|
657
673
|
}
|
|
658
674
|
const data = await response.json();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zereight/mcp-gitlab",
|
|
3
|
-
"version": "2.3.18-next.
|
|
3
|
+
"version": "2.3.18-next.191",
|
|
4
4
|
"mcpName": "io.github.zereight/gitlab-mcp",
|
|
5
5
|
"description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
|
|
6
6
|
"keywords": [
|