@sparkelf/dsh-plugin-mcp-credentials 0.2.1-alpha.52 → 0.2.1-alpha.54
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/LICENSE +21 -0
- package/lib/index.js +12 -1
- package/lib/types/transport.d.ts +9 -0
- package/package.json +13 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/lib/index.js
CHANGED
|
@@ -85,7 +85,18 @@ function credentialFetch(ctx, rawRef) {
|
|
|
85
85
|
const provider = ctx.get("credentials");
|
|
86
86
|
if (provider === void 0) throw new Error(`mcp-client: credential service unavailable while resolving "${ref}"`);
|
|
87
87
|
const identity = sessionScope.getStore();
|
|
88
|
-
|
|
88
|
+
if (identity !== void 0 && identity.actor !== void 0) {
|
|
89
|
+
const scopedRef = credentialRef(scopedCredentialRef(ref, identity.sessionId));
|
|
90
|
+
const scoped = await provider.resolve(scopedRef).catch(() => void 0);
|
|
91
|
+
if (scoped === void 0) throw new Error(`mcp-client: credential "${scopedRef}" is not configured for this Session`);
|
|
92
|
+
const headers = new Headers(init?.headers);
|
|
93
|
+
headers.set("Authorization", `Bearer ${scoped.value}`);
|
|
94
|
+
return globalThis.fetch(input, {
|
|
95
|
+
...init,
|
|
96
|
+
headers
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const resolved = await provider.resolve(ref);
|
|
89
100
|
if (resolved === void 0) throw new Error(`mcp-client: credential "${ref}" is not configured`);
|
|
90
101
|
const headers = new Headers(init?.headers);
|
|
91
102
|
headers.set("Authorization", `Bearer ${resolved.value}`);
|
package/lib/types/transport.d.ts
CHANGED
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
9
9
|
import type { Context } from '@deepseek-ai/cordis';
|
|
10
10
|
import type { Config } from './index.ts';
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the current bearer credential immediately before each network request.
|
|
13
|
+
*
|
|
14
|
+
* A Session carrying an actor (a group-chat room acting for one member) uses the scoped entry the
|
|
15
|
+
* connector minted for it; every other request uses the workspace credential. The scoped lookup
|
|
16
|
+
* falls back to the workspace entry, so a room whose scoped credential expired keeps working until
|
|
17
|
+
* the connector refreshes it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function credentialFetch(ctx: Context, rawRef: string): typeof globalThis.fetch;
|
|
11
20
|
/**
|
|
12
21
|
* Create an MCP transport from the resolved plugin config.
|
|
13
22
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sparkelf/dsh-plugin-mcp-credentials",
|
|
3
3
|
"description": "Official MCP client replacement with credential-backed Streamable HTTP Bearer authentication",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.54",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"zod": "^4.4.3",
|
|
41
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@deepseek-ai/dsh-attachment": "
|
|
45
|
-
"@deepseek-ai/dsh-llm": "
|
|
46
|
-
"@deepseek-ai/dsh-scope": "
|
|
47
|
-
"@deepseek-ai/dsh-subprocess": "
|
|
48
|
-
"@deepseek-ai/dsh-timeout": "
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/
|
|
51
|
-
"@deepseek-ai/
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
44
|
+
"@deepseek-ai/dsh-attachment": "^0.1.6-alpha.1",
|
|
45
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-scope": "^0.1.6-alpha.1",
|
|
47
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-timeout": "^0.1.6-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-credentials": "^0.1.6-alpha.1",
|
|
50
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
51
|
+
"@deepseek-ai/dsh-util-values": "^0.1.6-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.1"
|
|
53
53
|
}
|
|
54
|
-
}
|
|
54
|
+
}
|