@kya-os/mcp-i-core 1.3.10 → 1.3.11
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/.claude/settings.local.json +9 -0
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test$colon$coverage.log +3419 -3072
- package/.turbo/turbo-test.log +1805 -1680
- package/coverage/coverage-final.json +60 -0
- package/dist/identity/idp-token-resolver.d.ts +17 -1
- package/dist/identity/idp-token-resolver.d.ts.map +1 -1
- package/dist/identity/idp-token-resolver.js +34 -6
- package/dist/identity/idp-token-resolver.js.map +1 -1
- package/dist/identity/idp-token-storage.interface.d.ts +38 -7
- package/dist/identity/idp-token-storage.interface.d.ts.map +1 -1
- package/dist/identity/idp-token-storage.interface.js +2 -0
- package/dist/identity/idp-token-storage.interface.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/tool-context-builder.d.ts +18 -1
- package/dist/services/tool-context-builder.d.ts.map +1 -1
- package/dist/services/tool-context-builder.js +63 -10
- package/dist/services/tool-context-builder.js.map +1 -1
- package/dist/services/tool-protection.service.d.ts +1 -1
- package/dist/services/tool-protection.service.d.ts.map +1 -1
- package/dist/services/tool-protection.service.js +17 -10
- package/dist/services/tool-protection.service.js.map +1 -1
- package/dist/utils/did-helpers.d.ts +33 -0
- package/dist/utils/did-helpers.d.ts.map +1 -1
- package/dist/utils/did-helpers.js +53 -0
- package/dist/utils/did-helpers.js.map +1 -1
- package/package.json +1 -1
- package/src/delegation/__tests__/vc-issuer.test.ts +1 -1
- package/src/identity/idp-token-resolver.ts +41 -7
- package/src/identity/idp-token-storage.interface.ts +42 -7
- package/src/index.ts +6 -2
- package/src/services/tool-context-builder.ts +75 -10
- package/src/services/tool-protection.service.ts +51 -32
- package/src/utils/__tests__/did-helpers.test.ts +55 -0
- package/src/utils/did-helpers.ts +60 -0
- package/dist/__tests__/utils/mock-providers.d.ts +0 -104
- package/dist/__tests__/utils/mock-providers.d.ts.map +0 -1
- package/dist/__tests__/utils/mock-providers.js +0 -293
- package/dist/__tests__/utils/mock-providers.js.map +0 -1
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,585 +1,826 @@
|
|
|
1
1
|
|
|
2
|
-
> @kya-os/mcp-i-core@1.3.
|
|
2
|
+
> @kya-os/mcp-i-core@1.3.11 test /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
RUN v4.0.
|
|
6
|
+
RUN v4.0.14 /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
|
|
7
7
|
|
|
8
|
-
stderr | src/services/__tests__/
|
|
9
|
-
[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
18
|
-
at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
|
|
19
|
-
at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
|
|
20
|
-
|
|
21
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
|
|
22
|
-
[CryptoService] Invalid Ed25519 JWK format
|
|
23
|
-
|
|
24
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
|
|
25
|
-
[CryptoService] Invalid Ed25519 JWK format
|
|
26
|
-
|
|
27
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
|
|
28
|
-
[CryptoService] Invalid Ed25519 JWK format
|
|
29
|
-
|
|
30
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
|
|
31
|
-
[CryptoService] Invalid Ed25519 JWK format
|
|
32
|
-
|
|
33
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
|
|
34
|
-
[CryptoService] Invalid Ed25519 JWK format
|
|
35
|
-
|
|
36
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
|
|
37
|
-
[CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token '', "" is not valid JSON
|
|
38
|
-
at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
|
|
39
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
40
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
|
|
41
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
42
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
43
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
44
|
-
at new Promise (<anonymous>)
|
|
45
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
46
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
47
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
48
|
-
|
|
49
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
|
|
50
|
-
[CryptoService] Unsupported algorithm: RS256, expected EdDSA
|
|
51
|
-
|
|
52
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
|
|
53
|
-
[CryptoService] Unsupported algorithm: HS256, expected EdDSA
|
|
54
|
-
|
|
55
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
|
|
56
|
-
[CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
|
|
57
|
-
at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
|
|
58
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
59
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
|
|
60
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
61
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
62
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
63
|
-
at new Promise (<anonymous>)
|
|
64
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
65
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
66
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
67
|
-
|
|
68
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
|
|
69
|
-
[CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
|
|
70
|
-
at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
|
|
71
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
72
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
|
|
73
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
74
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
75
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
76
|
-
at new Promise (<anonymous>)
|
|
77
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
78
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
79
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
80
|
-
|
|
81
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
|
|
82
|
-
[CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
|
|
83
|
-
at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
|
|
84
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
85
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
|
|
86
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
87
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
88
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
89
|
-
at new Promise (<anonymous>)
|
|
90
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
91
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
92
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
93
|
-
|
|
94
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
|
|
95
|
-
[CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
|
|
96
|
-
at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
|
|
97
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
98
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
|
|
99
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
100
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
101
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
102
|
-
at new Promise (<anonymous>)
|
|
103
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
104
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
105
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
106
|
-
|
|
107
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
|
|
108
|
-
[CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
|
|
109
|
-
at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
|
|
110
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
111
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
|
|
112
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
113
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
114
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
115
|
-
at new Promise (<anonymous>)
|
|
116
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
117
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
118
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
119
|
-
|
|
120
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
|
|
121
|
-
[CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
|
|
122
|
-
at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
|
|
123
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
124
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
|
|
125
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
126
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
127
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
128
|
-
at new Promise (<anonymous>)
|
|
129
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
130
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
131
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
132
|
-
|
|
133
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
|
|
134
|
-
[CryptoService] Key ID mismatch
|
|
135
|
-
|
|
136
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
|
|
137
|
-
[CryptoService] Unsupported algorithm: EdDSA, expected RS256
|
|
138
|
-
|
|
139
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
|
|
140
|
-
[CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
|
|
141
|
-
at CryptoService.jwkToBase64PublicKey (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
|
|
142
|
-
at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
|
|
143
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
|
|
144
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
145
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
146
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
147
|
-
at new Promise (<anonymous>)
|
|
148
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
149
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
150
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
151
|
-
|
|
152
|
-
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
|
|
153
|
-
[CryptoService] Ed25519 verification error: Error: Crypto error
|
|
154
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
|
|
155
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
156
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
157
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
158
|
-
at new Promise (<anonymous>)
|
|
159
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
160
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
161
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
162
|
-
at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
|
|
163
|
-
at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
|
|
164
|
-
|
|
165
|
-
✓ src/services/__tests__/crypto.service.test.ts (34 tests) 19ms
|
|
166
|
-
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use X-API-Key header for new endpoint
|
|
167
|
-
[ToolProtectionService] Config loaded from API {
|
|
168
|
-
source: 'api',
|
|
169
|
-
toolCount: 0,
|
|
170
|
-
protectedTools: [],
|
|
171
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
172
|
-
projectId: 'test-project-123',
|
|
173
|
-
cacheTtlMs: 300000,
|
|
174
|
-
cacheExpiresAt: '2025-11-26T15:41:45.310Z'
|
|
8
|
+
stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
|
|
9
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
10
|
+
correlationId: '77c7a20f-05ce-4415-838f-5f53cb90aa44',
|
|
11
|
+
status: 200,
|
|
12
|
+
statusText: '',
|
|
13
|
+
headers: { 'content-type': 'application/json' },
|
|
14
|
+
responseTextLength: 100,
|
|
15
|
+
responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
|
|
16
|
+
fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
|
|
175
17
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
18
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
19
|
+
correlationId: '77c7a20f-05ce-4415-838f-5f53cb90aa44',
|
|
20
|
+
status: 200,
|
|
21
|
+
responseDataType: 'object',
|
|
22
|
+
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
23
|
+
responseData: '{\n' +
|
|
24
|
+
' "success": true,\n' +
|
|
25
|
+
' "accepted": 1,\n' +
|
|
26
|
+
' "rejected": 0,\n' +
|
|
27
|
+
' "outcomes": {\n' +
|
|
28
|
+
' "success": 1,\n' +
|
|
29
|
+
' "failed": 0,\n' +
|
|
30
|
+
' "blocked": 0,\n' +
|
|
31
|
+
' "error": 0\n' +
|
|
32
|
+
' }\n' +
|
|
33
|
+
'}'
|
|
186
34
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
35
|
+
[AccessControl] Raw response received: {
|
|
36
|
+
"success": true,
|
|
37
|
+
"accepted": 1,
|
|
38
|
+
"rejected": 0,
|
|
39
|
+
"outcomes": {
|
|
40
|
+
"success": 1,
|
|
41
|
+
"failed": 0,
|
|
42
|
+
"blocked": 0,
|
|
43
|
+
"error": 0
|
|
44
|
+
}
|
|
197
45
|
}
|
|
198
46
|
|
|
199
|
-
|
|
200
|
-
[
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
47
|
+
stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
|
|
48
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
49
|
+
correlationId: '1747205d-098b-4520-acc2-6cd9890190f3',
|
|
50
|
+
status: 200,
|
|
51
|
+
statusText: '',
|
|
52
|
+
headers: { 'content-type': 'application/json' },
|
|
53
|
+
responseTextLength: 200,
|
|
54
|
+
responseTextPreview: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}',
|
|
55
|
+
fullResponseText: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}'
|
|
208
56
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
57
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
58
|
+
correlationId: '1747205d-098b-4520-acc2-6cd9890190f3',
|
|
59
|
+
status: 200,
|
|
60
|
+
responseDataType: 'object',
|
|
61
|
+
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
62
|
+
responseData: '{\n' +
|
|
63
|
+
' "success": true,\n' +
|
|
64
|
+
' "accepted": 0,\n' +
|
|
65
|
+
' "rejected": 1,\n' +
|
|
66
|
+
' "outcomes": {\n' +
|
|
67
|
+
' "success": 0,\n' +
|
|
68
|
+
' "failed": 1,\n' +
|
|
69
|
+
' "blocked": 0,\n' +
|
|
70
|
+
' "error": 0\n' +
|
|
71
|
+
' },\n' +
|
|
72
|
+
' "errors": [\n' +
|
|
73
|
+
' {\n' +
|
|
74
|
+
' "proof_index": 0,\n' +
|
|
75
|
+
' "error": {\n' +
|
|
76
|
+
' "code": "invalid_signature",\n' +
|
|
77
|
+
' "message": "Invalid JWS signature"\n' +
|
|
78
|
+
' }\n' +
|
|
79
|
+
' }\n' +
|
|
80
|
+
' ]\n' +
|
|
81
|
+
'}'
|
|
219
82
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
83
|
+
[AccessControl] Raw response received: {
|
|
84
|
+
"success": true,
|
|
85
|
+
"accepted": 0,
|
|
86
|
+
"rejected": 1,
|
|
87
|
+
"outcomes": {
|
|
88
|
+
"success": 0,
|
|
89
|
+
"failed": 1,
|
|
90
|
+
"blocked": 0,
|
|
91
|
+
"error": 0
|
|
92
|
+
},
|
|
93
|
+
"errors": [
|
|
94
|
+
{
|
|
95
|
+
"proof_index": 0,
|
|
96
|
+
"error": {
|
|
97
|
+
"code": "invalid_signature",
|
|
98
|
+
"message": "Invalid JWS signature"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
230
102
|
}
|
|
231
103
|
|
|
232
|
-
|
|
233
|
-
[
|
|
234
|
-
source: 'api',
|
|
235
|
-
toolCount: 2,
|
|
236
|
-
protectedTools: [ 'checkout' ],
|
|
237
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
238
|
-
projectId: 'test-project-123',
|
|
239
|
-
cacheTtlMs: 300000,
|
|
240
|
-
cacheExpiresAt: '2025-11-26T15:41:45.316Z'
|
|
241
|
-
}
|
|
104
|
+
stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
|
|
105
|
+
[CryptoService] Key ID mismatch
|
|
242
106
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
toolCount: 2,
|
|
247
|
-
protectedTools: [ 'checkout' ],
|
|
248
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
249
|
-
projectId: 'test-project-123',
|
|
250
|
-
cacheTtlMs: 300000,
|
|
251
|
-
cacheExpiresAt: '2025-11-26T15:41:45.312Z'
|
|
252
|
-
}
|
|
107
|
+
✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 118ms
|
|
108
|
+
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
|
|
109
|
+
[StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
|
|
253
110
|
|
|
254
|
-
|
|
255
|
-
[
|
|
256
|
-
source: 'api',
|
|
257
|
-
toolCount: 2,
|
|
258
|
-
protectedTools: [ 'protected_tool' ],
|
|
259
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
260
|
-
projectId: 'test-project-123',
|
|
261
|
-
cacheTtlMs: 300000,
|
|
262
|
-
cacheExpiresAt: '2025-11-26T15:41:45.316Z'
|
|
263
|
-
}
|
|
111
|
+
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
|
|
112
|
+
[StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/storage.service.ts'
|
|
264
113
|
|
|
265
|
-
|
|
266
|
-
[
|
|
267
|
-
source: 'api',
|
|
268
|
-
toolCount: 2,
|
|
269
|
-
protectedTools: [ 'read_repos', 'send_email' ],
|
|
270
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
271
|
-
projectId: 'test-project-123',
|
|
272
|
-
cacheTtlMs: 300000,
|
|
273
|
-
cacheExpiresAt: '2025-11-26T15:41:45.317Z'
|
|
274
|
-
}
|
|
114
|
+
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
|
|
115
|
+
[StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
|
|
275
116
|
|
|
276
|
-
|
|
277
|
-
[
|
|
278
|
-
source: 'api',
|
|
279
|
-
toolCount: 2,
|
|
280
|
-
protectedTools: [ 'checkout' ],
|
|
281
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
282
|
-
projectId: 'none',
|
|
283
|
-
cacheTtlMs: 300000,
|
|
284
|
-
cacheExpiresAt: '2025-11-26T15:41:45.317Z'
|
|
285
|
-
}
|
|
117
|
+
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
|
|
118
|
+
[StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/storage.service.ts'
|
|
286
119
|
|
|
287
|
-
|
|
288
|
-
[
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
120
|
+
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
|
|
121
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
122
|
+
correlationId: 'deae9b94-fc2a-44bb-8c86-7b453c0151f7',
|
|
123
|
+
status: 200,
|
|
124
|
+
statusText: '',
|
|
125
|
+
headers: { 'content-type': 'application/json' },
|
|
126
|
+
responseTextLength: 100,
|
|
127
|
+
responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
|
|
128
|
+
fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
|
|
296
129
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
130
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
131
|
+
correlationId: 'deae9b94-fc2a-44bb-8c86-7b453c0151f7',
|
|
132
|
+
status: 200,
|
|
133
|
+
responseDataType: 'object',
|
|
134
|
+
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
135
|
+
responseData: '{\n' +
|
|
136
|
+
' "success": true,\n' +
|
|
137
|
+
' "accepted": 1,\n' +
|
|
138
|
+
' "rejected": 0,\n' +
|
|
139
|
+
' "outcomes": {\n' +
|
|
140
|
+
' "success": 1,\n' +
|
|
141
|
+
' "failed": 0,\n' +
|
|
142
|
+
' "blocked": 0,\n' +
|
|
143
|
+
' "error": 0\n' +
|
|
144
|
+
' }\n' +
|
|
145
|
+
'}'
|
|
307
146
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
147
|
+
[AccessControl] Raw response received: {
|
|
148
|
+
"success": true,
|
|
149
|
+
"accepted": 1,
|
|
150
|
+
"rejected": 0,
|
|
151
|
+
"outcomes": {
|
|
152
|
+
"success": 1,
|
|
153
|
+
"failed": 0,
|
|
154
|
+
"blocked": 0,
|
|
155
|
+
"error": 0
|
|
156
|
+
}
|
|
318
157
|
}
|
|
319
158
|
|
|
320
|
-
|
|
321
|
-
[
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
159
|
+
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
|
|
160
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
161
|
+
correlationId: 'c2bd8538-dc0b-4694-9e4d-dd3d07df2bac',
|
|
162
|
+
status: 400,
|
|
163
|
+
statusText: '',
|
|
164
|
+
headers: { 'content-type': 'application/json' },
|
|
165
|
+
responseTextLength: 209,
|
|
166
|
+
responseTextPreview: '{"success":false,"error":{"code":"all_proofs_rejected","message":"All proofs rejected","details":{"rejected":1,"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid signature"}}]}}}',
|
|
167
|
+
fullResponseText: '{"success":false,"error":{"code":"all_proofs_rejected","message":"All proofs rejected","details":{"rejected":1,"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid signature"}}]}}}'
|
|
329
168
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
169
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
170
|
+
correlationId: 'c2bd8538-dc0b-4694-9e4d-dd3d07df2bac',
|
|
171
|
+
status: 400,
|
|
172
|
+
responseDataType: 'object',
|
|
173
|
+
responseDataKeys: [ 'success', 'error' ],
|
|
174
|
+
responseData: '{\n' +
|
|
175
|
+
' "success": false,\n' +
|
|
176
|
+
' "error": {\n' +
|
|
177
|
+
' "code": "all_proofs_rejected",\n' +
|
|
178
|
+
' "message": "All proofs rejected",\n' +
|
|
179
|
+
' "details": {\n' +
|
|
180
|
+
' "rejected": 1,\n' +
|
|
181
|
+
' "errors": [\n' +
|
|
182
|
+
' {\n' +
|
|
183
|
+
' "proof_index": 0,\n' +
|
|
184
|
+
' "error": {\n' +
|
|
185
|
+
' "code": "invalid_signature",\n' +
|
|
186
|
+
' "message": "Invalid signature"\n' +
|
|
187
|
+
' }\n' +
|
|
188
|
+
' }\n' +
|
|
189
|
+
' ]\n' +
|
|
190
|
+
' }\n' +
|
|
191
|
+
' }\n' +
|
|
192
|
+
'}'
|
|
340
193
|
}
|
|
341
194
|
|
|
342
|
-
|
|
343
|
-
[
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
cacheTtlMs: 300000,
|
|
352
|
-
|
|
353
|
-
cacheExpiresAt: '2025-11-26T15:41:45.318Z'
|
|
354
|
-
stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
|
|
355
|
-
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
|
|
356
|
-
|
|
195
|
+
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
|
|
196
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
197
|
+
correlationId: 'aec40584-7681-44c4-ba5f-846b20e3b703',
|
|
198
|
+
status: 200,
|
|
199
|
+
statusText: '',
|
|
200
|
+
headers: { 'content-type': 'application/json' },
|
|
201
|
+
responseTextLength: 206,
|
|
202
|
+
responseTextPreview: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.158Z"}}',
|
|
203
|
+
fullResponseText: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.158Z"}}'
|
|
357
204
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
205
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
206
|
+
correlationId: 'aec40584-7681-44c4-ba5f-846b20e3b703',
|
|
207
|
+
status: 200,
|
|
208
|
+
responseDataType: 'object',
|
|
209
|
+
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
210
|
+
responseData: '{\n' +
|
|
211
|
+
' "success": true,\n' +
|
|
212
|
+
' "data": {\n' +
|
|
213
|
+
' "success": true,\n' +
|
|
214
|
+
' "accepted": 1,\n' +
|
|
215
|
+
' "rejected": 0,\n' +
|
|
216
|
+
' "outcomes": {\n' +
|
|
217
|
+
' "success": 1,\n' +
|
|
218
|
+
' "failed": 0,\n' +
|
|
219
|
+
' "blocked": 0,\n' +
|
|
220
|
+
' "error": 0\n' +
|
|
221
|
+
' }\n' +
|
|
222
|
+
' },\n' +
|
|
223
|
+
' "metadata": {\n' +
|
|
224
|
+
' "requestId": "test-request-id",\n' +
|
|
225
|
+
' "timestamp": "2025-12-04T01:04:13.158Z"\n' +
|
|
226
|
+
' }\n' +
|
|
227
|
+
'}'
|
|
368
228
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
229
|
+
[AccessControl] Raw response received: {
|
|
230
|
+
"success": true,
|
|
231
|
+
"data": {
|
|
232
|
+
"success": true,
|
|
233
|
+
"accepted": 1,
|
|
234
|
+
"rejected": 0,
|
|
235
|
+
"outcomes": {
|
|
236
|
+
"success": 1,
|
|
237
|
+
"failed": 0,
|
|
238
|
+
"blocked": 0,
|
|
239
|
+
"error": 0
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"metadata": {
|
|
243
|
+
"requestId": "test-request-id",
|
|
244
|
+
"timestamp": "2025-12-04T01:04:13.158Z"
|
|
245
|
+
}
|
|
379
246
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
[
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
247
|
+
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
248
|
+
correlationId: 'aec40584-7681-44c4-ba5f-846b20e3b703',
|
|
249
|
+
dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
250
|
+
hasAccepted: true,
|
|
251
|
+
hasRejected: true,
|
|
252
|
+
hasOutcomes: true,
|
|
253
|
+
hasErrors: false,
|
|
254
|
+
acceptedType: 'number',
|
|
255
|
+
acceptedValue: 1,
|
|
256
|
+
rejectedType: 'number',
|
|
257
|
+
rejectedValue: 0,
|
|
258
|
+
outcomesType: 'object',
|
|
259
|
+
outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
|
|
260
|
+
errorsType: 'undefined',
|
|
261
|
+
errorsIsArray: false,
|
|
262
|
+
fullData: '{\n' +
|
|
263
|
+
' "success": true,\n' +
|
|
264
|
+
' "accepted": 1,\n' +
|
|
265
|
+
' "rejected": 0,\n' +
|
|
266
|
+
' "outcomes": {\n' +
|
|
267
|
+
' "success": 1,\n' +
|
|
268
|
+
' "failed": 0,\n' +
|
|
269
|
+
' "blocked": 0,\n' +
|
|
270
|
+
' "error": 0\n' +
|
|
271
|
+
' }\n' +
|
|
272
|
+
'}'
|
|
390
273
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
[
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
274
|
+
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
275
|
+
correlationId: 'aec40584-7681-44c4-ba5f-846b20e3b703',
|
|
276
|
+
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
277
|
+
hasSuccess: true,
|
|
278
|
+
successValue: true,
|
|
279
|
+
hasAccepted: true,
|
|
280
|
+
acceptedValue: 1,
|
|
281
|
+
hasRejected: true,
|
|
282
|
+
rejectedValue: 0,
|
|
283
|
+
hasOutcomes: true,
|
|
284
|
+
outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
|
|
285
|
+
fullDataWithSuccess: '{\n' +
|
|
286
|
+
' "success": true,\n' +
|
|
287
|
+
' "accepted": 1,\n' +
|
|
288
|
+
' "rejected": 0,\n' +
|
|
289
|
+
' "outcomes": {\n' +
|
|
290
|
+
' "success": 1,\n' +
|
|
291
|
+
' "failed": 0,\n' +
|
|
292
|
+
' "blocked": 0,\n' +
|
|
293
|
+
' "error": 0\n' +
|
|
294
|
+
' }\n' +
|
|
295
|
+
'}'
|
|
401
296
|
}
|
|
402
297
|
|
|
403
|
-
|
|
404
|
-
[
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
298
|
+
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
|
|
299
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
300
|
+
correlationId: '23f9725f-3ae1-4507-a0b4-9000c503f539',
|
|
301
|
+
status: 200,
|
|
302
|
+
statusText: '',
|
|
303
|
+
headers: { 'content-type': 'application/json' },
|
|
304
|
+
responseTextLength: 42,
|
|
305
|
+
responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
|
|
306
|
+
fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
|
|
307
|
+
}
|
|
308
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
309
|
+
correlationId: '23f9725f-3ae1-4507-a0b4-9000c503f539',
|
|
310
|
+
status: 200,
|
|
311
|
+
responseDataType: 'object',
|
|
312
|
+
responseDataKeys: [ 'success', 'accepted', 'rejected' ],
|
|
313
|
+
responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
|
|
314
|
+
}
|
|
315
|
+
[AccessControl] Raw response received: {
|
|
316
|
+
"success": true,
|
|
317
|
+
"accepted": 1,
|
|
318
|
+
"rejected": 0
|
|
319
|
+
}
|
|
419
320
|
|
|
420
|
-
|
|
421
|
-
[
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
321
|
+
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
|
|
322
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
323
|
+
correlationId: '3d3e7ec6-3d12-4ffb-94db-8f1fd1eacb83',
|
|
324
|
+
status: 200,
|
|
325
|
+
statusText: '',
|
|
326
|
+
headers: { 'content-type': 'application/json' },
|
|
327
|
+
responseTextLength: 100,
|
|
328
|
+
responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
|
|
329
|
+
fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
|
|
330
|
+
}
|
|
331
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
332
|
+
correlationId: '3d3e7ec6-3d12-4ffb-94db-8f1fd1eacb83',
|
|
333
|
+
status: 200,
|
|
334
|
+
responseDataType: 'object',
|
|
335
|
+
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
336
|
+
responseData: '{\n' +
|
|
337
|
+
' "success": true,\n' +
|
|
338
|
+
' "accepted": 1,\n' +
|
|
339
|
+
' "rejected": 0,\n' +
|
|
340
|
+
' "outcomes": {\n' +
|
|
341
|
+
' "success": 1,\n' +
|
|
342
|
+
' "failed": 0,\n' +
|
|
343
|
+
' "blocked": 0,\n' +
|
|
344
|
+
' "error": 0\n' +
|
|
345
|
+
' }\n' +
|
|
346
|
+
'}'
|
|
347
|
+
}
|
|
348
|
+
[AccessControl] Raw response received: {
|
|
349
|
+
"success": true,
|
|
350
|
+
"accepted": 1,
|
|
351
|
+
"rejected": 0,
|
|
352
|
+
"outcomes": {
|
|
353
|
+
"success": 1,
|
|
354
|
+
"failed": 0,
|
|
355
|
+
"blocked": 0,
|
|
356
|
+
"error": 0
|
|
357
|
+
}
|
|
433
358
|
}
|
|
434
359
|
|
|
435
|
-
|
|
360
|
+
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
|
|
361
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
362
|
+
correlationId: 'c2f50d50-cdd9-487b-aca9-8655b5525cfb',
|
|
363
|
+
status: 200,
|
|
364
|
+
statusText: '',
|
|
365
|
+
headers: { 'content-type': 'application/json' },
|
|
366
|
+
responseTextLength: 56,
|
|
367
|
+
responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
|
|
368
|
+
fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
|
|
369
|
+
}
|
|
370
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
371
|
+
correlationId: 'c2f50d50-cdd9-487b-aca9-8655b5525cfb',
|
|
372
|
+
status: 200,
|
|
373
|
+
responseDataType: 'object',
|
|
374
|
+
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
375
|
+
responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
|
|
376
|
+
}
|
|
377
|
+
[AccessControl] Raw response received: {
|
|
378
|
+
"success": true,
|
|
379
|
+
"accepted": 1,
|
|
380
|
+
"rejected": 0,
|
|
381
|
+
"outcomes": {}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
|
|
385
|
+
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
386
|
+
correlationId: 'acc96611-1fba-48e8-a631-9e57dbf31366',
|
|
387
|
+
status: 200,
|
|
388
|
+
statusText: '',
|
|
389
|
+
headers: { 'content-type': 'application/json' },
|
|
390
|
+
responseTextLength: 52,
|
|
391
|
+
responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
|
|
392
|
+
fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
|
|
393
|
+
}
|
|
394
|
+
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
395
|
+
correlationId: 'acc96611-1fba-48e8-a631-9e57dbf31366',
|
|
396
|
+
status: 200,
|
|
397
|
+
responseDataType: 'object',
|
|
398
|
+
responseDataKeys: [ 'success', 'data' ],
|
|
399
|
+
responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
|
|
400
|
+
}
|
|
401
|
+
[AccessControl] Raw response received: {
|
|
402
|
+
"success": true,
|
|
403
|
+
"data": {
|
|
404
|
+
"message": "Invalid format"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
408
|
+
correlationId: 'acc96611-1fba-48e8-a631-9e57dbf31366',
|
|
409
|
+
dataKeys: [ 'message' ],
|
|
410
|
+
hasAccepted: false,
|
|
411
|
+
hasRejected: false,
|
|
412
|
+
hasOutcomes: false,
|
|
413
|
+
hasErrors: false,
|
|
414
|
+
acceptedType: 'undefined',
|
|
415
|
+
acceptedValue: undefined,
|
|
416
|
+
rejectedType: 'undefined',
|
|
417
|
+
rejectedValue: undefined,
|
|
418
|
+
outcomesType: 'undefined',
|
|
419
|
+
outcomesValue: undefined,
|
|
420
|
+
errorsType: 'undefined',
|
|
421
|
+
errorsIsArray: false,
|
|
422
|
+
fullData: '{\n "message": "Invalid format"\n}'
|
|
423
|
+
}
|
|
424
|
+
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
425
|
+
correlationId: 'acc96611-1fba-48e8-a631-9e57dbf31366',
|
|
426
|
+
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
|
|
427
|
+
hasSuccess: true,
|
|
428
|
+
successValue: true,
|
|
429
|
+
hasAccepted: true,
|
|
430
|
+
acceptedValue: undefined,
|
|
431
|
+
hasRejected: true,
|
|
432
|
+
rejectedValue: undefined,
|
|
433
|
+
hasOutcomes: false,
|
|
434
|
+
outcomesValue: undefined,
|
|
435
|
+
fullDataWithSuccess: '{\n "success": true\n}'
|
|
436
|
+
}
|
|
437
|
+
[AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
|
|
438
|
+
correlationId: 'acc96611-1fba-48e8-a631-9e57dbf31366',
|
|
439
|
+
hasAccepted: true,
|
|
440
|
+
acceptedType: 'undefined',
|
|
441
|
+
acceptedValue: undefined,
|
|
442
|
+
hasRejected: true,
|
|
443
|
+
rejectedType: 'undefined',
|
|
444
|
+
rejectedValue: undefined,
|
|
445
|
+
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
|
|
446
|
+
fullDataWithSuccess: '{\n "success": true\n}',
|
|
447
|
+
dataToValidateKeys: [ 'message' ],
|
|
448
|
+
fullDataToValidate: '{\n "message": "Invalid format"\n}',
|
|
449
|
+
originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
✓ src/services/__tests__/storage.service.test.ts (17 tests) 60ms
|
|
453
|
+
✓ src/services/__tests__/access-control.service.test.ts (23 tests) 35ms
|
|
454
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should fetch from project-scoped /config endpoint when projectId is available
|
|
436
455
|
[ToolProtectionService] Config loaded from API {
|
|
437
456
|
source: 'api',
|
|
438
|
-
toolCount:
|
|
439
|
-
protectedTools: [ '
|
|
457
|
+
toolCount: 2,
|
|
458
|
+
protectedTools: [ 'checkout' ],
|
|
440
459
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
441
|
-
projectId: '
|
|
460
|
+
projectId: 'test-project-123',
|
|
442
461
|
cacheTtlMs: 300000,
|
|
443
|
-
cacheExpiresAt: '2025-
|
|
444
|
-
}
|
|
445
|
-
[ToolProtectionService] API fetch successful, config cached {
|
|
446
|
-
source: 'cache-write',
|
|
447
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
448
|
-
cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
|
|
449
|
-
toolCount: 1,
|
|
450
|
-
tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
|
|
451
|
-
ttlMs: 300000,
|
|
452
|
-
ttlMinutes: 5,
|
|
453
|
-
expiresAt: '2025-11-26T15:41:45.321Z',
|
|
454
|
-
expiresIn: '300s'
|
|
462
|
+
cacheExpiresAt: '2025-12-04T01:09:13.325Z'
|
|
455
463
|
}
|
|
456
464
|
|
|
457
|
-
stdout | src/__tests__/services/
|
|
465
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should handle new endpoint format with toolProtections object
|
|
458
466
|
[ToolProtectionService] Config loaded from API {
|
|
459
467
|
source: 'api',
|
|
460
|
-
toolCount:
|
|
461
|
-
protectedTools: [ '
|
|
468
|
+
toolCount: 2,
|
|
469
|
+
protectedTools: [ 'protected_tool' ],
|
|
462
470
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
463
471
|
projectId: 'test-project-123',
|
|
464
472
|
cacheTtlMs: 300000,
|
|
465
|
-
cacheExpiresAt: '2025-
|
|
473
|
+
cacheExpiresAt: '2025-12-04T01:09:13.327Z'
|
|
466
474
|
}
|
|
467
475
|
|
|
468
|
-
stdout | src/__tests__/services/
|
|
476
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should parse oauthProvider from new endpoint format (Phase 2)
|
|
469
477
|
[ToolProtectionService] Config loaded from API {
|
|
470
478
|
source: 'api',
|
|
471
|
-
toolCount:
|
|
472
|
-
protectedTools: [],
|
|
479
|
+
toolCount: 2,
|
|
480
|
+
protectedTools: [ 'read_repos', 'send_email' ],
|
|
473
481
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
474
482
|
projectId: 'test-project-123',
|
|
475
|
-
cacheTtlMs:
|
|
476
|
-
cacheExpiresAt: '2025-
|
|
483
|
+
cacheTtlMs: 300000,
|
|
484
|
+
cacheExpiresAt: '2025-12-04T01:09:13.327Z'
|
|
477
485
|
}
|
|
478
486
|
|
|
479
|
-
|
|
480
|
-
[ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
|
|
481
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
|
|
487
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should preserve oauthProvider through cache operations
|
|
482
488
|
[ToolProtectionService] Config loaded from API {
|
|
483
489
|
source: 'api',
|
|
484
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
485
|
-
error: 'ECONNREFUSED',
|
|
486
|
-
cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
|
|
487
490
|
toolCount: 1,
|
|
488
|
-
protectedTools: [ '
|
|
491
|
+
protectedTools: [ 'read_repos' ],
|
|
489
492
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
490
|
-
projectId: '
|
|
493
|
+
projectId: 'test-project-123',
|
|
491
494
|
cacheTtlMs: 300000,
|
|
495
|
+
cacheExpiresAt: '2025-12-04T01:09:13.327Z'
|
|
492
496
|
}
|
|
493
|
-
cacheExpiresAt: '2025-11-26T15:41:45.324Z'
|
|
494
497
|
|
|
495
|
-
|
|
496
|
-
stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
|
|
497
|
-
|
|
498
|
-
[ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
|
|
499
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
|
|
498
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should fetch from agent-scoped endpoint when projectId is not available
|
|
500
499
|
[ToolProtectionService] Config loaded from API {
|
|
501
500
|
source: 'api',
|
|
502
|
-
toolCount:
|
|
503
|
-
protectedTools: [],
|
|
501
|
+
toolCount: 2,
|
|
502
|
+
protectedTools: [ 'checkout' ],
|
|
504
503
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
505
504
|
projectId: 'none',
|
|
506
505
|
cacheTtlMs: 300000,
|
|
507
|
-
cacheExpiresAt: '2025-
|
|
508
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
509
|
-
error: 'Network error',
|
|
510
|
-
cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
|
|
511
|
-
}
|
|
512
|
-
|
|
506
|
+
cacheExpiresAt: '2025-12-04T01:09:13.328Z'
|
|
513
507
|
}
|
|
514
508
|
|
|
515
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig >
|
|
509
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools array
|
|
516
510
|
[ToolProtectionService] Config loaded from API {
|
|
517
511
|
source: 'api',
|
|
518
|
-
toolCount:
|
|
519
|
-
protectedTools: [],
|
|
512
|
+
toolCount: 2,
|
|
513
|
+
protectedTools: [ 'tool1' ],
|
|
520
514
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
521
515
|
projectId: 'none',
|
|
522
|
-
cacheTtlMs:
|
|
523
|
-
cacheExpiresAt: '2025-
|
|
516
|
+
cacheTtlMs: 300000,
|
|
517
|
+
cacheExpiresAt: '2025-12-04T01:09:13.328Z'
|
|
524
518
|
}
|
|
525
519
|
|
|
526
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig >
|
|
520
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should parse oauthProvider from old endpoint format (tools array)
|
|
527
521
|
[ToolProtectionService] Config loaded from API {
|
|
528
522
|
source: 'api',
|
|
529
|
-
toolCount:
|
|
530
|
-
protectedTools: [],
|
|
523
|
+
toolCount: 2,
|
|
524
|
+
protectedTools: [ 'read_repos', 'send_email' ],
|
|
531
525
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
532
526
|
projectId: 'none',
|
|
533
527
|
cacheTtlMs: 300000,
|
|
534
|
-
cacheExpiresAt: '2025-
|
|
528
|
+
cacheExpiresAt: '2025-12-04T01:09:13.328Z'
|
|
535
529
|
}
|
|
536
530
|
|
|
537
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig >
|
|
531
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools object
|
|
538
532
|
[ToolProtectionService] Config loaded from API {
|
|
539
533
|
source: 'api',
|
|
540
|
-
toolCount:
|
|
534
|
+
toolCount: 2,
|
|
541
535
|
protectedTools: [ 'tool1' ],
|
|
542
536
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
543
537
|
projectId: 'none',
|
|
544
538
|
cacheTtlMs: 300000,
|
|
545
|
-
cacheExpiresAt: '2025-
|
|
539
|
+
cacheExpiresAt: '2025-12-04T01:09:13.328Z'
|
|
546
540
|
}
|
|
547
541
|
|
|
548
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig >
|
|
542
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should parse oauthProvider from old endpoint format (tools object)
|
|
549
543
|
[ToolProtectionService] Config loaded from API {
|
|
550
544
|
source: 'api',
|
|
551
545
|
toolCount: 2,
|
|
552
|
-
protectedTools: [ '
|
|
546
|
+
protectedTools: [ 'read_repos', 'send_email' ],
|
|
553
547
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
554
548
|
projectId: 'none',
|
|
555
549
|
cacheTtlMs: 300000,
|
|
556
|
-
cacheExpiresAt: '2025-
|
|
550
|
+
cacheExpiresAt: '2025-12-04T01:09:13.328Z'
|
|
557
551
|
}
|
|
558
552
|
|
|
559
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService >
|
|
560
|
-
[ToolProtectionService]
|
|
561
|
-
source: 'api',
|
|
562
|
-
|
|
563
|
-
protectedTools: [],
|
|
553
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
|
|
554
|
+
[ToolProtectionService] Cache miss, fetching from API {
|
|
555
|
+
source: 'api-fetch-start',
|
|
556
|
+
cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
|
|
564
557
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
565
558
|
projectId: 'none',
|
|
566
|
-
|
|
567
|
-
|
|
559
|
+
apiUrl: 'https://kya.vouched.id',
|
|
560
|
+
endpoint: '/api/v1/bouncer/config?agent_did=did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
|
|
561
|
+
}
|
|
562
|
+
[ToolProtectionService] Fetching from API: https://kya.vouched.id/api/v1/bouncer/config?agent_did=did%3Akey%3Az6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK {
|
|
563
|
+
method: 'config?agent_did (legacy)',
|
|
564
|
+
projectId: 'none',
|
|
565
|
+
apiKeyPresent: true,
|
|
566
|
+
apiKeyLength: 18,
|
|
567
|
+
apiKeyMasked: 'test-api...'
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
-
stdout | src/__tests__/services/tool-protection.
|
|
570
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fetching from /config endpoint with embedded tools > should fetch from /config endpoint and extract toolProtection.tools
|
|
571
571
|
[ToolProtectionService] Config loaded from API {
|
|
572
572
|
source: 'api',
|
|
573
|
-
toolCount:
|
|
574
|
-
protectedTools: [ '
|
|
573
|
+
toolCount: 2,
|
|
574
|
+
protectedTools: [ 'checkout' ],
|
|
575
575
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
576
|
-
projectId: '
|
|
576
|
+
projectId: 'test-project-123',
|
|
577
577
|
cacheTtlMs: 300000,
|
|
578
|
-
cacheExpiresAt: '2025-
|
|
578
|
+
cacheExpiresAt: '2025-12-04T01:09:13.327Z'
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService >
|
|
582
|
-
[ToolProtectionService]
|
|
581
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
|
|
582
|
+
[ToolProtectionService] API response received {
|
|
583
|
+
source: 'api-fetch-complete',
|
|
584
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
585
|
+
projectId: 'none',
|
|
586
|
+
responseKeys: [ 'success', 'data', 'metadata' ],
|
|
587
|
+
dataKeys: [ 'tools' ],
|
|
588
|
+
rawConfig: null,
|
|
589
|
+
rawConfigToolProtection: null,
|
|
590
|
+
rawToolProtections: null,
|
|
591
|
+
rawTools: [
|
|
592
|
+
{ name: 'valid_tool', requiresDelegation: true },
|
|
593
|
+
{ requiresDelegation: false }
|
|
594
|
+
],
|
|
595
|
+
responseMetadata: {}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
|
|
599
|
+
[ToolProtectionService] Config loaded from API {
|
|
600
|
+
source: 'api',
|
|
601
|
+
toolCount: 1,
|
|
602
|
+
protectedTools: [ 'valid_tool' ],
|
|
603
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
604
|
+
projectId: 'none',
|
|
605
|
+
cacheTtlMs: 300000,
|
|
606
|
+
cacheExpiresAt: '2025-12-04T01:09:13.329Z'
|
|
607
|
+
}
|
|
608
|
+
[ToolProtectionService] API fetch successful, config cached {
|
|
609
|
+
source: 'cache-write',
|
|
610
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
611
|
+
cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
|
|
612
|
+
toolCount: 1,
|
|
613
|
+
tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
|
|
614
|
+
ttlMs: 300000,
|
|
615
|
+
ttlMinutes: 5,
|
|
616
|
+
expiresAt: '2025-12-04T01:09:13.329Z',
|
|
617
|
+
expiresIn: '300s'
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fetching from /config endpoint with embedded tools > should use projectId-based /config endpoint when projectId is set
|
|
621
|
+
[ToolProtectionService] Config loaded from API {
|
|
622
|
+
source: 'api',
|
|
623
|
+
toolCount: 1,
|
|
624
|
+
protectedTools: [ 'greet' ],
|
|
625
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
626
|
+
projectId: 'my-project-id',
|
|
627
|
+
cacheTtlMs: 300000,
|
|
628
|
+
cacheExpiresAt: '2025-12-04T01:09:13.330Z'
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fetching from /config endpoint with embedded tools > should handle empty tools object from merged config
|
|
632
|
+
[ToolProtectionService] Config loaded from API {
|
|
633
|
+
source: 'api',
|
|
634
|
+
toolCount: 0,
|
|
635
|
+
protectedTools: [],
|
|
636
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
637
|
+
projectId: 'test-project-123',
|
|
638
|
+
cacheTtlMs: 300000,
|
|
639
|
+
cacheExpiresAt: '2025-12-04T01:09:13.331Z'
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should correctly identify protected tool from merged config
|
|
643
|
+
[ToolProtectionService] Config loaded from API {
|
|
644
|
+
source: 'api',
|
|
645
|
+
toolCount: 2,
|
|
646
|
+
protectedTools: [ 'checkout' ],
|
|
647
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
648
|
+
projectId: 'test-project-123',
|
|
649
|
+
cacheTtlMs: 300000,
|
|
650
|
+
cacheExpiresAt: '2025-12-04T01:09:13.331Z'
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should correctly identify protected tool from merged config
|
|
654
|
+
[ToolProtectionService] Protection check {
|
|
655
|
+
tool: 'checkout',
|
|
656
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
657
|
+
found: true,
|
|
658
|
+
isWildcard: false,
|
|
659
|
+
requiresDelegation: true,
|
|
660
|
+
availableTools: [ 'checkout', 'greet' ]
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should return null for unknown tool
|
|
664
|
+
[ToolProtectionService] Config loaded from API {
|
|
665
|
+
source: 'api',
|
|
666
|
+
toolCount: 1,
|
|
667
|
+
protectedTools: [],
|
|
668
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
669
|
+
projectId: 'test-project-123',
|
|
670
|
+
cacheTtlMs: 300000,
|
|
671
|
+
cacheExpiresAt: '2025-12-04T01:09:13.331Z'
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should return null for unknown tool
|
|
675
|
+
[ToolProtectionService] Protection check {
|
|
676
|
+
tool: 'unknown-tool',
|
|
677
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
678
|
+
found: false,
|
|
679
|
+
isWildcard: true,
|
|
680
|
+
requiresDelegation: false,
|
|
681
|
+
availableTools: [ 'greet' ]
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
|
|
685
|
+
[ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
|
|
686
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
687
|
+
error: 'ECONNREFUSED',
|
|
688
|
+
cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
stderr | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fallback behavior with merged config > should use fallback config when network error occurs
|
|
692
|
+
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
|
|
693
|
+
|
|
694
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
|
|
695
|
+
[ToolProtectionService] Config loaded from API {
|
|
696
|
+
source: 'api',
|
|
697
|
+
toolCount: 1,
|
|
698
|
+
protectedTools: [ 'tool1' ],
|
|
699
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
700
|
+
projectId: 'none',
|
|
701
|
+
cacheTtlMs: 300000,
|
|
702
|
+
cacheExpiresAt: '2025-12-04T01:09:13.332Z'
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
|
|
706
|
+
[ToolProtectionService] Config loaded from API {
|
|
707
|
+
source: 'api',
|
|
708
|
+
toolCount: 0,
|
|
709
|
+
protectedTools: [],
|
|
710
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
711
|
+
projectId: 'none',
|
|
712
|
+
cacheTtlMs: 300000,
|
|
713
|
+
cacheExpiresAt: '2025-12-04T01:09:13.332Z'
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
|
|
717
|
+
[ToolProtectionService] Config loaded from API {
|
|
718
|
+
source: 'api',
|
|
719
|
+
toolCount: 0,
|
|
720
|
+
protectedTools: [],
|
|
721
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
722
|
+
projectId: 'none',
|
|
723
|
+
cacheTtlMs: 600000,
|
|
724
|
+
cacheExpiresAt: '2025-12-04T01:14:13.332Z'
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fallback behavior with merged config > should handle API returning config without tools field
|
|
728
|
+
[ToolProtectionService] Config loaded from API {
|
|
729
|
+
source: 'api',
|
|
730
|
+
toolCount: 1,
|
|
731
|
+
protectedTools: [ 'greet' ],
|
|
732
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
733
|
+
projectId: 'test-project-123',
|
|
734
|
+
cacheTtlMs: 300000,
|
|
735
|
+
cacheExpiresAt: '2025-12-04T01:09:13.332Z'
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Caching with merged config > should cache tool protections extracted from merged config
|
|
739
|
+
[ToolProtectionService] Config loaded from API {
|
|
740
|
+
source: 'api',
|
|
741
|
+
toolCount: 1,
|
|
742
|
+
protectedTools: [ 'greet' ],
|
|
743
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
744
|
+
projectId: 'test-project-123',
|
|
745
|
+
cacheTtlMs: 300000,
|
|
746
|
+
cacheExpiresAt: '2025-12-04T01:09:13.332Z'
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Caching with merged config > should respect cache TTL for merged config
|
|
750
|
+
[ToolProtectionService] Config loaded from API {
|
|
751
|
+
source: 'api',
|
|
752
|
+
toolCount: 1,
|
|
753
|
+
protectedTools: [ 'greet' ],
|
|
754
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
755
|
+
projectId: 'test-project-123',
|
|
756
|
+
cacheTtlMs: 100,
|
|
757
|
+
cacheExpiresAt: '2025-12-04T01:04:13.433Z'
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle empty toolProtections object
|
|
761
|
+
[ToolProtectionService] Config loaded from API {
|
|
762
|
+
source: 'api',
|
|
763
|
+
toolCount: 0,
|
|
764
|
+
protectedTools: [],
|
|
765
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
766
|
+
projectId: 'none',
|
|
767
|
+
cacheTtlMs: 300000,
|
|
768
|
+
cacheExpiresAt: '2025-12-04T01:09:13.333Z'
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle null requiredScopes
|
|
772
|
+
[ToolProtectionService] Config loaded from API {
|
|
773
|
+
source: 'api',
|
|
774
|
+
toolCount: 1,
|
|
775
|
+
protectedTools: [ 'tool1' ],
|
|
776
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
777
|
+
projectId: 'none',
|
|
778
|
+
cacheTtlMs: 300000,
|
|
779
|
+
cacheExpiresAt: '2025-12-04T01:09:13.334Z'
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle mixed camelCase and snake_case in response
|
|
783
|
+
stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
|
|
784
|
+
[ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
|
|
785
|
+
[ToolProtectionService] Config loaded from API {
|
|
786
|
+
source: 'api',
|
|
787
|
+
toolCount: 2,
|
|
788
|
+
protectedTools: [ 'tool1' ],
|
|
789
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
790
|
+
error: 'Network error',
|
|
791
|
+
cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
|
|
792
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
projectId: 'none',
|
|
796
|
+
cacheTtlMs: 300000,
|
|
797
|
+
cacheExpiresAt: '2025-12-04T01:09:13.334Z'
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool has no protection
|
|
801
|
+
[ToolProtectionService] Config loaded from API {
|
|
802
|
+
source: 'api',
|
|
803
|
+
toolCount: 1,
|
|
804
|
+
protectedTools: [],
|
|
805
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
806
|
+
projectId: 'none',
|
|
807
|
+
cacheTtlMs: 300000,
|
|
808
|
+
cacheExpiresAt: '2025-12-04T01:09:13.334Z'
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
|
|
812
|
+
[ToolProtectionService] Config loaded from API {
|
|
813
|
+
source: 'api',
|
|
814
|
+
toolCount: 1,
|
|
815
|
+
protectedTools: [ 'other_tool' ],
|
|
816
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
817
|
+
projectId: 'none',
|
|
818
|
+
cacheTtlMs: 300000,
|
|
819
|
+
cacheExpiresAt: '2025-12-04T01:09:13.334Z'
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
|
|
823
|
+
[ToolProtectionService] Protection check {
|
|
583
824
|
tool: 'unknown_tool',
|
|
584
825
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
585
826
|
found: false,
|
|
@@ -596,7 +837,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
|
|
|
596
837
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
597
838
|
projectId: 'none',
|
|
598
839
|
cacheTtlMs: 300000,
|
|
599
|
-
cacheExpiresAt: '2025-
|
|
840
|
+
cacheExpiresAt: '2025-12-04T01:09:13.334Z'
|
|
600
841
|
}
|
|
601
842
|
|
|
602
843
|
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
|
|
@@ -617,7 +858,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
|
|
|
617
858
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
618
859
|
projectId: 'none',
|
|
619
860
|
cacheTtlMs: 300000,
|
|
620
|
-
cacheExpiresAt: '2025-
|
|
861
|
+
cacheExpiresAt: '2025-12-04T01:09:13.334Z'
|
|
621
862
|
}
|
|
622
863
|
|
|
623
864
|
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
|
|
@@ -638,7 +879,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
|
|
|
638
879
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
639
880
|
projectId: 'none',
|
|
640
881
|
cacheTtlMs: 300000,
|
|
641
|
-
cacheExpiresAt: '2025-
|
|
882
|
+
cacheExpiresAt: '2025-12-04T01:09:13.335Z'
|
|
642
883
|
}
|
|
643
884
|
|
|
644
885
|
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
|
|
@@ -651,6 +892,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
|
|
|
651
892
|
availableTools: [ 'protected_tool' ]
|
|
652
893
|
}
|
|
653
894
|
|
|
895
|
+
✓ src/delegation/__tests__/utils.test.ts (28 tests) 3ms
|
|
654
896
|
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
|
|
655
897
|
[ToolProtectionService] Config loaded from API {
|
|
656
898
|
source: 'api',
|
|
@@ -659,7 +901,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
|
|
|
659
901
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
660
902
|
projectId: 'none',
|
|
661
903
|
cacheTtlMs: 300000,
|
|
662
|
-
cacheExpiresAt: '2025-
|
|
904
|
+
cacheExpiresAt: '2025-12-04T01:09:13.335Z'
|
|
663
905
|
}
|
|
664
906
|
|
|
665
907
|
stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
|
|
@@ -670,104 +912,227 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
|
|
|
670
912
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
671
913
|
projectId: 'none',
|
|
672
914
|
cacheTtlMs: 300000,
|
|
673
|
-
cacheExpiresAt: '2025-
|
|
915
|
+
cacheExpiresAt: '2025-12-04T01:09:13.335Z'
|
|
674
916
|
}
|
|
675
917
|
|
|
676
|
-
✓ src/__tests__/services/tool-protection.service.test.ts (49 tests)
|
|
677
|
-
|
|
678
|
-
[
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
918
|
+
✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 15ms
|
|
919
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use X-API-Key header for new endpoint
|
|
920
|
+
[ToolProtectionService] Config loaded from API {
|
|
921
|
+
stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
|
|
922
|
+
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
|
|
923
|
+
source: 'api',
|
|
924
|
+
|
|
925
|
+
stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
|
|
926
|
+
toolCount: 0,
|
|
927
|
+
protectedTools: [],
|
|
928
|
+
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
|
|
929
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
930
|
+
|
|
931
|
+
projectId: 'test-project-123',
|
|
932
|
+
cacheTtlMs: 300000,
|
|
933
|
+
cacheExpiresAt: '2025-12-04T01:09:13.336Z'
|
|
686
934
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
' "success": 1,\n' +
|
|
698
|
-
' "failed": 0,\n' +
|
|
699
|
-
' "blocked": 0,\n' +
|
|
700
|
-
' "error": 0\n' +
|
|
701
|
-
' }\n' +
|
|
702
|
-
'}'
|
|
935
|
+
|
|
936
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use Authorization Bearer header for old endpoint
|
|
937
|
+
[ToolProtectionService] Config loaded from API {
|
|
938
|
+
source: 'api',
|
|
939
|
+
toolCount: 0,
|
|
940
|
+
protectedTools: [],
|
|
941
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
942
|
+
projectId: 'none',
|
|
943
|
+
cacheTtlMs: 300000,
|
|
944
|
+
cacheExpiresAt: '2025-12-04T01:09:13.356Z'
|
|
703
945
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
946
|
+
|
|
947
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use project-scoped /config endpoint when projectId is available
|
|
948
|
+
[ToolProtectionService] Config loaded from API {
|
|
949
|
+
source: 'api',
|
|
950
|
+
toolCount: 0,
|
|
951
|
+
protectedTools: [],
|
|
952
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
953
|
+
projectId: 'test-project-123',
|
|
954
|
+
cacheTtlMs: 300000,
|
|
955
|
+
cacheExpiresAt: '2025-12-04T01:09:13.367Z'
|
|
714
956
|
}
|
|
715
957
|
|
|
716
|
-
|
|
717
|
-
[
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
958
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use agent-scoped endpoint when projectId is not available
|
|
959
|
+
[ToolProtectionService] Config loaded from API {
|
|
960
|
+
source: 'api',
|
|
961
|
+
toolCount: 0,
|
|
962
|
+
protectedTools: [],
|
|
963
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
964
|
+
projectId: 'none',
|
|
965
|
+
cacheTtlMs: 300000,
|
|
966
|
+
cacheExpiresAt: '2025-12-04T01:09:13.367Z'
|
|
725
967
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
' "details": {\n' +
|
|
737
|
-
' "rejected": 1,\n' +
|
|
738
|
-
' "errors": [\n' +
|
|
739
|
-
' {\n' +
|
|
740
|
-
' "proof_index": 0,\n' +
|
|
741
|
-
' "error": {\n' +
|
|
742
|
-
' "code": "invalid_signature",\n' +
|
|
743
|
-
' "message": "Invalid signature"\n' +
|
|
744
|
-
' }\n' +
|
|
745
|
-
' }\n' +
|
|
746
|
-
' ]\n' +
|
|
747
|
-
' }\n' +
|
|
748
|
-
' }\n' +
|
|
749
|
-
'}'
|
|
968
|
+
|
|
969
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode projectId in URL
|
|
970
|
+
[ToolProtectionService] Config loaded from API {
|
|
971
|
+
source: 'api',
|
|
972
|
+
toolCount: 0,
|
|
973
|
+
protectedTools: [],
|
|
974
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
975
|
+
projectId: 'project/with/special-chars',
|
|
976
|
+
cacheTtlMs: 300000,
|
|
977
|
+
cacheExpiresAt: '2025-12-04T01:09:13.368Z'
|
|
750
978
|
}
|
|
751
979
|
|
|
752
|
-
|
|
980
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode agent DID in URL
|
|
981
|
+
[ToolProtectionService] Config loaded from API {
|
|
982
|
+
source: 'api',
|
|
983
|
+
toolCount: 0,
|
|
984
|
+
protectedTools: [],
|
|
985
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
986
|
+
projectId: 'none',
|
|
987
|
+
cacheTtlMs: 300000,
|
|
988
|
+
cacheExpiresAt: '2025-12-04T01:09:13.368Z'
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle new endpoint format (toolProtections object)
|
|
992
|
+
[ToolProtectionService] Config loaded from API {
|
|
993
|
+
source: 'api',
|
|
994
|
+
toolCount: 2,
|
|
995
|
+
protectedTools: [ 'checkout' ],
|
|
996
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
997
|
+
projectId: 'test-project-123',
|
|
998
|
+
cacheTtlMs: 300000,
|
|
999
|
+
cacheExpiresAt: '2025-12-04T01:09:13.368Z'
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
|
|
1003
|
+
[ToolProtectionService] Config loaded from API {
|
|
1004
|
+
source: 'api',
|
|
1005
|
+
toolCount: 2,
|
|
1006
|
+
protectedTools: [ 'checkout' ],
|
|
1007
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1008
|
+
projectId: 'none',
|
|
1009
|
+
cacheTtlMs: 300000,
|
|
1010
|
+
cacheExpiresAt: '2025-12-04T01:09:13.368Z'
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
|
|
1014
|
+
[ToolProtectionService] Config loaded from API {
|
|
1015
|
+
source: 'api',
|
|
1016
|
+
toolCount: 2,
|
|
1017
|
+
protectedTools: [ 'checkout' ],
|
|
1018
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1019
|
+
projectId: 'none',
|
|
1020
|
+
cacheTtlMs: 300000,
|
|
1021
|
+
cacheExpiresAt: '2025-12-04T01:09:13.369Z'
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
|
|
1025
|
+
[ToolProtectionService] Config loaded from API {
|
|
1026
|
+
source: 'api',
|
|
1027
|
+
toolCount: 1,
|
|
1028
|
+
protectedTools: [ 'tool1' ],
|
|
1029
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1030
|
+
projectId: 'test-project-123',
|
|
1031
|
+
cacheTtlMs: 300000,
|
|
1032
|
+
cacheExpiresAt: '2025-12-04T01:09:13.369Z'
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
|
|
1036
|
+
[ToolProtectionService] Config loaded from API {
|
|
1037
|
+
source: 'api',
|
|
1038
|
+
toolCount: 1,
|
|
1039
|
+
protectedTools: [ 'tool1' ],
|
|
1040
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1041
|
+
projectId: 'test-project-123',
|
|
1042
|
+
cacheTtlMs: 300000,
|
|
1043
|
+
cacheExpiresAt: '2025-12-04T01:09:13.369Z'
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
|
|
1047
|
+
[ToolProtectionService] Config loaded from API {
|
|
1048
|
+
source: 'api',
|
|
1049
|
+
toolCount: 1,
|
|
1050
|
+
protectedTools: [ 'tool1' ],
|
|
1051
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1052
|
+
projectId: 'test-project-123',
|
|
1053
|
+
cacheTtlMs: 300000,
|
|
1054
|
+
cacheExpiresAt: '2025-12-04T01:09:13.369Z'
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
|
|
1058
|
+
[ToolProtectionService] Config loaded from API {
|
|
1059
|
+
source: 'api',
|
|
1060
|
+
toolCount: 1,
|
|
1061
|
+
protectedTools: [ 'tool1' ],
|
|
1062
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1063
|
+
projectId: 'test-project-123',
|
|
1064
|
+
cacheTtlMs: 300000,
|
|
1065
|
+
cacheExpiresAt: '2025-12-04T01:09:13.371Z'
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
|
|
1069
|
+
[ToolProtectionService] Config loaded from API {
|
|
1070
|
+
source: 'api',
|
|
1071
|
+
toolCount: 0,
|
|
1072
|
+
protectedTools: [],
|
|
1073
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1074
|
+
projectId: 'test-project-123',
|
|
1075
|
+
cacheTtlMs: 1000,
|
|
1076
|
+
cacheExpiresAt: '2025-12-04T01:04:14.371Z'
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
✓ src/__tests__/runtime/base.test.ts (55 tests) 64ms
|
|
1080
|
+
stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
|
|
1081
|
+
[ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
|
|
1082
|
+
at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
|
|
1083
|
+
at processTicksAndRejections (node:internal/process/task_queues:103:5)
|
|
1084
|
+
at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
|
|
1085
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
|
|
1086
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
|
|
1087
|
+
|
|
1088
|
+
stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
|
|
1089
|
+
[ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
|
|
1090
|
+
at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
|
|
1091
|
+
at processTicksAndRejections (node:internal/process/task_queues:103:5)
|
|
1092
|
+
at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
|
|
1093
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
|
|
1094
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
|
|
1095
|
+
|
|
1096
|
+
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with success field in data
|
|
1097
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Caching with merged config > should respect cache TTL for merged config
|
|
753
1098
|
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
754
|
-
|
|
1099
|
+
[ToolProtectionService] Config loaded from API {
|
|
1100
|
+
source: 'api',
|
|
1101
|
+
correlationId: 'e81d10fc-4a5c-419f-b96f-442734a20e6e',
|
|
1102
|
+
toolCount: 1,
|
|
755
1103
|
status: 200,
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
1104
|
+
protectedTools: [ 'greet' ],
|
|
1105
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1106
|
+
projectId: 'test-project-123',
|
|
1107
|
+
statusText: undefined,
|
|
1108
|
+
headers: {},
|
|
1109
|
+
cacheTtlMs: 100,
|
|
1110
|
+
cacheExpiresAt: '2025-12-04T01:04:13.584Z'
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
responseTextLength: 191,
|
|
1114
|
+
stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Backward compatibility - /tool-protections response format > should still handle legacy /tool-protections response format if encountered
|
|
1115
|
+
[ToolProtectionService] Config loaded from API {
|
|
1116
|
+
responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.369Z"}}',
|
|
1117
|
+
source: 'api',
|
|
1118
|
+
toolCount: 1,
|
|
1119
|
+
protectedTools: [ 'greet' ],
|
|
1120
|
+
fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.369Z"}}'
|
|
1121
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1122
|
+
}
|
|
1123
|
+
projectId: 'test-project-123',
|
|
1124
|
+
cacheTtlMs: 300000,
|
|
1125
|
+
cacheExpiresAt: '2025-12-04T01:09:13.485Z'
|
|
761
1126
|
}
|
|
1127
|
+
|
|
762
1128
|
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
763
|
-
correlationId: '
|
|
1129
|
+
correlationId: 'e81d10fc-4a5c-419f-b96f-442734a20e6e',
|
|
764
1130
|
status: 200,
|
|
765
1131
|
responseDataType: 'object',
|
|
766
1132
|
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
767
1133
|
responseData: '{\n' +
|
|
768
1134
|
' "success": true,\n' +
|
|
769
1135
|
' "data": {\n' +
|
|
770
|
-
' "success": true,\n' +
|
|
771
1136
|
' "accepted": 1,\n' +
|
|
772
1137
|
' "rejected": 0,\n' +
|
|
773
1138
|
' "outcomes": {\n' +
|
|
@@ -779,14 +1144,13 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
|
|
|
779
1144
|
' },\n' +
|
|
780
1145
|
' "metadata": {\n' +
|
|
781
1146
|
' "requestId": "test-request-id",\n' +
|
|
782
|
-
' "timestamp": "2025-
|
|
1147
|
+
' "timestamp": "2025-12-04T01:04:13.369Z"\n' +
|
|
783
1148
|
' }\n' +
|
|
784
1149
|
'}'
|
|
785
1150
|
}
|
|
786
1151
|
[AccessControl] Raw response received: {
|
|
787
1152
|
"success": true,
|
|
788
1153
|
"data": {
|
|
789
|
-
"success": true,
|
|
790
1154
|
"accepted": 1,
|
|
791
1155
|
"rejected": 0,
|
|
792
1156
|
"outcomes": {
|
|
@@ -798,12 +1162,12 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
|
|
|
798
1162
|
},
|
|
799
1163
|
"metadata": {
|
|
800
1164
|
"requestId": "test-request-id",
|
|
801
|
-
"timestamp": "2025-
|
|
1165
|
+
"timestamp": "2025-12-04T01:04:13.369Z"
|
|
802
1166
|
}
|
|
803
1167
|
}
|
|
804
1168
|
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
805
|
-
correlationId: '
|
|
806
|
-
dataKeys: [ '
|
|
1169
|
+
correlationId: 'e81d10fc-4a5c-419f-b96f-442734a20e6e',
|
|
1170
|
+
dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
|
|
807
1171
|
hasAccepted: true,
|
|
808
1172
|
hasRejected: true,
|
|
809
1173
|
hasOutcomes: true,
|
|
@@ -817,7 +1181,6 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
|
|
|
817
1181
|
errorsType: 'undefined',
|
|
818
1182
|
errorsIsArray: false,
|
|
819
1183
|
fullData: '{\n' +
|
|
820
|
-
' "success": true,\n' +
|
|
821
1184
|
' "accepted": 1,\n' +
|
|
822
1185
|
' "rejected": 0,\n' +
|
|
823
1186
|
' "outcomes": {\n' +
|
|
@@ -829,7 +1192,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
|
|
|
829
1192
|
'}'
|
|
830
1193
|
}
|
|
831
1194
|
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
832
|
-
correlationId: '
|
|
1195
|
+
correlationId: 'e81d10fc-4a5c-419f-b96f-442734a20e6e',
|
|
833
1196
|
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
834
1197
|
hasSuccess: true,
|
|
835
1198
|
successValue: true,
|
|
@@ -852,305 +1215,48 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
|
|
|
852
1215
|
'}'
|
|
853
1216
|
}
|
|
854
1217
|
|
|
855
|
-
stderr | src/services/__tests__/access-control.
|
|
856
|
-
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
857
|
-
correlationId: 'd77a977b-42ca-4926-a1a3-8e633c5c215c',
|
|
858
|
-
status: 200,
|
|
859
|
-
statusText: '',
|
|
860
|
-
headers: { 'content-type': 'application/json' },
|
|
861
|
-
responseTextLength: 42,
|
|
862
|
-
responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
|
|
863
|
-
fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
|
|
864
|
-
}
|
|
865
|
-
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
866
|
-
correlationId: 'd77a977b-42ca-4926-a1a3-8e633c5c215c',
|
|
867
|
-
status: 200,
|
|
868
|
-
responseDataType: 'object',
|
|
869
|
-
responseDataKeys: [ 'success', 'accepted', 'rejected' ],
|
|
870
|
-
responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
|
|
871
|
-
}
|
|
872
|
-
[AccessControl] Raw response received: {
|
|
873
|
-
"success": true,
|
|
874
|
-
"accepted": 1,
|
|
875
|
-
"rejected": 0
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
|
|
1218
|
+
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with errors array
|
|
879
1219
|
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
880
|
-
correlationId: '
|
|
1220
|
+
correlationId: 'fd709747-f82f-46b1-860e-25f3dff00f62',
|
|
881
1221
|
status: 200,
|
|
882
|
-
statusText:
|
|
883
|
-
headers: {
|
|
884
|
-
responseTextLength:
|
|
885
|
-
responseTextPreview: '{"success":true,"accepted":
|
|
886
|
-
fullResponseText: '{"success":true,"accepted":
|
|
1222
|
+
statusText: undefined,
|
|
1223
|
+
headers: {},
|
|
1224
|
+
responseTextLength: 333,
|
|
1225
|
+
responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.436Z"}}',
|
|
1226
|
+
fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.436Z"}}'
|
|
887
1227
|
}
|
|
888
1228
|
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
889
|
-
correlationId: '
|
|
1229
|
+
correlationId: 'fd709747-f82f-46b1-860e-25f3dff00f62',
|
|
890
1230
|
status: 200,
|
|
891
1231
|
responseDataType: 'object',
|
|
892
|
-
responseDataKeys: [ 'success', '
|
|
1232
|
+
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
893
1233
|
responseData: '{\n' +
|
|
894
1234
|
' "success": true,\n' +
|
|
895
|
-
' "
|
|
896
|
-
'
|
|
897
|
-
'
|
|
898
|
-
' "
|
|
899
|
-
'
|
|
900
|
-
'
|
|
901
|
-
'
|
|
902
|
-
'
|
|
903
|
-
'}'
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
"
|
|
911
|
-
"
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
status: 200,
|
|
921
|
-
statusText: '',
|
|
922
|
-
headers: { 'content-type': 'application/json' },
|
|
923
|
-
responseTextLength: 56,
|
|
924
|
-
responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
|
|
925
|
-
fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
|
|
926
|
-
}
|
|
927
|
-
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
928
|
-
correlationId: '9e9878e9-938f-4bd4-b940-aa4cd8626ac8',
|
|
929
|
-
status: 200,
|
|
930
|
-
responseDataType: 'object',
|
|
931
|
-
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
932
|
-
responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
|
|
933
|
-
}
|
|
934
|
-
[AccessControl] Raw response received: {
|
|
935
|
-
"success": true,
|
|
936
|
-
"accepted": 1,
|
|
937
|
-
"rejected": 0,
|
|
938
|
-
"outcomes": {}
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
|
|
942
|
-
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
943
|
-
correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
|
|
944
|
-
status: 200,
|
|
945
|
-
statusText: '',
|
|
946
|
-
headers: { 'content-type': 'application/json' },
|
|
947
|
-
responseTextLength: 52,
|
|
948
|
-
responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
|
|
949
|
-
fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
|
|
950
|
-
}
|
|
951
|
-
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
952
|
-
correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
|
|
953
|
-
status: 200,
|
|
954
|
-
responseDataType: 'object',
|
|
955
|
-
responseDataKeys: [ 'success', 'data' ],
|
|
956
|
-
responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
|
|
957
|
-
}
|
|
958
|
-
[AccessControl] Raw response received: {
|
|
959
|
-
"success": true,
|
|
960
|
-
"data": {
|
|
961
|
-
"message": "Invalid format"
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
965
|
-
correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
|
|
966
|
-
dataKeys: [ 'message' ],
|
|
967
|
-
hasAccepted: false,
|
|
968
|
-
hasRejected: false,
|
|
969
|
-
hasOutcomes: false,
|
|
970
|
-
hasErrors: false,
|
|
971
|
-
acceptedType: 'undefined',
|
|
972
|
-
acceptedValue: undefined,
|
|
973
|
-
rejectedType: 'undefined',
|
|
974
|
-
rejectedValue: undefined,
|
|
975
|
-
outcomesType: 'undefined',
|
|
976
|
-
outcomesValue: undefined,
|
|
977
|
-
errorsType: 'undefined',
|
|
978
|
-
errorsIsArray: false,
|
|
979
|
-
fullData: '{\n "message": "Invalid format"\n}'
|
|
980
|
-
}
|
|
981
|
-
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
982
|
-
correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
|
|
983
|
-
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
|
|
984
|
-
hasSuccess: true,
|
|
985
|
-
successValue: true,
|
|
986
|
-
hasAccepted: true,
|
|
987
|
-
acceptedValue: undefined,
|
|
988
|
-
hasRejected: true,
|
|
989
|
-
rejectedValue: undefined,
|
|
990
|
-
hasOutcomes: false,
|
|
991
|
-
outcomesValue: undefined,
|
|
992
|
-
fullDataWithSuccess: '{\n "success": true\n}'
|
|
993
|
-
}
|
|
994
|
-
[AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
|
|
995
|
-
correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
|
|
996
|
-
hasAccepted: true,
|
|
997
|
-
acceptedType: 'undefined',
|
|
998
|
-
acceptedValue: undefined,
|
|
999
|
-
hasRejected: true,
|
|
1000
|
-
rejectedType: 'undefined',
|
|
1001
|
-
rejectedValue: undefined,
|
|
1002
|
-
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
|
|
1003
|
-
fullDataWithSuccess: '{\n "success": true\n}',
|
|
1004
|
-
dataToValidateKeys: [ 'message' ],
|
|
1005
|
-
fullDataToValidate: '{\n "message": "Invalid format"\n}',
|
|
1006
|
-
originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
|
|
1010
|
-
[StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
|
|
1011
|
-
|
|
1012
|
-
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with success field in data
|
|
1013
|
-
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
1014
|
-
correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
|
|
1015
|
-
status: 200,
|
|
1016
|
-
statusText: undefined,
|
|
1017
|
-
headers: {},
|
|
1018
|
-
responseTextLength: 191,
|
|
1019
|
-
responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.364Z"}}',
|
|
1020
|
-
fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.364Z"}}'
|
|
1021
|
-
}
|
|
1022
|
-
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1023
|
-
correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
|
|
1024
|
-
status: 200,
|
|
1025
|
-
responseDataType: 'object',
|
|
1026
|
-
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
1027
|
-
responseData: '{\n' +
|
|
1028
|
-
' "success": true,\n' +
|
|
1029
|
-
' "data": {\n' +
|
|
1030
|
-
' "accepted": 1,\n' +
|
|
1031
|
-
' "rejected": 0,\n' +
|
|
1032
|
-
' "outcomes": {\n' +
|
|
1033
|
-
' "success": 1,\n' +
|
|
1034
|
-
' "failed": 0,\n' +
|
|
1035
|
-
' "blocked": 0,\n' +
|
|
1036
|
-
' "error": 0\n' +
|
|
1037
|
-
' }\n' +
|
|
1038
|
-
' },\n' +
|
|
1039
|
-
' "metadata": {\n' +
|
|
1040
|
-
' "requestId": "test-request-id",\n' +
|
|
1041
|
-
' "timestamp": "2025-11-26T15:36:45.364Z"\n' +
|
|
1042
|
-
' }\n' +
|
|
1043
|
-
'}'
|
|
1044
|
-
}
|
|
1045
|
-
[AccessControl] Raw response received: {
|
|
1046
|
-
"success": true,
|
|
1047
|
-
"data": {
|
|
1048
|
-
"accepted": 1,
|
|
1049
|
-
"rejected": 0,
|
|
1050
|
-
"outcomes": {
|
|
1051
|
-
"success": 1,
|
|
1052
|
-
"failed": 0,
|
|
1053
|
-
"blocked": 0,
|
|
1054
|
-
"error": 0
|
|
1055
|
-
}
|
|
1056
|
-
},
|
|
1057
|
-
"metadata": {
|
|
1058
|
-
"requestId": "test-request-id",
|
|
1059
|
-
"timestamp": "2025-11-26T15:36:45.364Z"
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
1063
|
-
correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
|
|
1064
|
-
dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
|
|
1065
|
-
hasAccepted: true,
|
|
1066
|
-
hasRejected: true,
|
|
1067
|
-
hasOutcomes: true,
|
|
1068
|
-
hasErrors: false,
|
|
1069
|
-
acceptedType: 'number',
|
|
1070
|
-
acceptedValue: 1,
|
|
1071
|
-
rejectedType: 'number',
|
|
1072
|
-
rejectedValue: 0,
|
|
1073
|
-
outcomesType: 'object',
|
|
1074
|
-
outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
|
|
1075
|
-
errorsType: 'undefined',
|
|
1076
|
-
errorsIsArray: false,
|
|
1077
|
-
fullData: '{\n' +
|
|
1078
|
-
' "accepted": 1,\n' +
|
|
1079
|
-
' "rejected": 0,\n' +
|
|
1080
|
-
' "outcomes": {\n' +
|
|
1081
|
-
' "success": 1,\n' +
|
|
1082
|
-
' "failed": 0,\n' +
|
|
1083
|
-
' "blocked": 0,\n' +
|
|
1084
|
-
' "error": 0\n' +
|
|
1085
|
-
' }\n' +
|
|
1086
|
-
'}'
|
|
1087
|
-
}
|
|
1088
|
-
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
1089
|
-
correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
|
|
1090
|
-
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
1091
|
-
hasSuccess: true,
|
|
1092
|
-
successValue: true,
|
|
1093
|
-
hasAccepted: true,
|
|
1094
|
-
acceptedValue: 1,
|
|
1095
|
-
hasRejected: true,
|
|
1096
|
-
rejectedValue: 0,
|
|
1097
|
-
hasOutcomes: true,
|
|
1098
|
-
outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
|
|
1099
|
-
fullDataWithSuccess: '{\n' +
|
|
1100
|
-
' "success": true,\n' +
|
|
1101
|
-
' "accepted": 1,\n' +
|
|
1102
|
-
' "rejected": 0,\n' +
|
|
1103
|
-
' "outcomes": {\n' +
|
|
1104
|
-
' "success": 1,\n' +
|
|
1105
|
-
' "failed": 0,\n' +
|
|
1106
|
-
' "blocked": 0,\n' +
|
|
1107
|
-
' "error": 0\n' +
|
|
1108
|
-
' }\n' +
|
|
1109
|
-
'}'
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with errors array
|
|
1113
|
-
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
1114
|
-
correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
|
|
1115
|
-
status: 200,
|
|
1116
|
-
statusText: undefined,
|
|
1117
|
-
headers: {},
|
|
1118
|
-
responseTextLength: 333,
|
|
1119
|
-
responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.376Z"}}',
|
|
1120
|
-
fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.376Z"}}'
|
|
1121
|
-
}
|
|
1122
|
-
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1123
|
-
correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
|
|
1124
|
-
status: 200,
|
|
1125
|
-
responseDataType: 'object',
|
|
1126
|
-
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
1127
|
-
responseData: '{\n' +
|
|
1128
|
-
' "success": true,\n' +
|
|
1129
|
-
' "data": {\n' +
|
|
1130
|
-
' "accepted": 0,\n' +
|
|
1131
|
-
' "rejected": 1,\n' +
|
|
1132
|
-
' "outcomes": {\n' +
|
|
1133
|
-
' "success": 0,\n' +
|
|
1134
|
-
' "failed": 1,\n' +
|
|
1135
|
-
' "blocked": 0,\n' +
|
|
1136
|
-
' "error": 0\n' +
|
|
1137
|
-
' },\n' +
|
|
1138
|
-
' "errors": [\n' +
|
|
1139
|
-
' {\n' +
|
|
1140
|
-
' "proof_index": 0,\n' +
|
|
1141
|
-
' "error": {\n' +
|
|
1142
|
-
' "code": "validation_error",\n' +
|
|
1143
|
-
' "message": "Proof validation failed",\n' +
|
|
1144
|
-
' "details": {\n' +
|
|
1145
|
-
' "reason": "invalid_signature"\n' +
|
|
1146
|
-
' }\n' +
|
|
1147
|
-
' }\n' +
|
|
1148
|
-
' }\n' +
|
|
1149
|
-
' ]\n' +
|
|
1150
|
-
' },\n' +
|
|
1151
|
-
' "metadata": {\n' +
|
|
1152
|
-
' "requestId": "test-request-id",\n' +
|
|
1153
|
-
' "timestamp": "2025-11-26T15:36:45.376Z"\n' +
|
|
1235
|
+
' "data": {\n' +
|
|
1236
|
+
' "accepted": 0,\n' +
|
|
1237
|
+
' "rejected": 1,\n' +
|
|
1238
|
+
' "outcomes": {\n' +
|
|
1239
|
+
' "success": 0,\n' +
|
|
1240
|
+
' "failed": 1,\n' +
|
|
1241
|
+
' "blocked": 0,\n' +
|
|
1242
|
+
' "error": 0\n' +
|
|
1243
|
+
' },\n' +
|
|
1244
|
+
' "errors": [\n' +
|
|
1245
|
+
' {\n' +
|
|
1246
|
+
' "proof_index": 0,\n' +
|
|
1247
|
+
' "error": {\n' +
|
|
1248
|
+
' "code": "validation_error",\n' +
|
|
1249
|
+
' "message": "Proof validation failed",\n' +
|
|
1250
|
+
' "details": {\n' +
|
|
1251
|
+
' "reason": "invalid_signature"\n' +
|
|
1252
|
+
' }\n' +
|
|
1253
|
+
' }\n' +
|
|
1254
|
+
' }\n' +
|
|
1255
|
+
' ]\n' +
|
|
1256
|
+
' },\n' +
|
|
1257
|
+
' "metadata": {\n' +
|
|
1258
|
+
' "requestId": "test-request-id",\n' +
|
|
1259
|
+
' "timestamp": "2025-12-04T01:04:13.436Z"\n' +
|
|
1154
1260
|
' }\n' +
|
|
1155
1261
|
'}'
|
|
1156
1262
|
}
|
|
@@ -1180,11 +1286,11 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1180
1286
|
},
|
|
1181
1287
|
"metadata": {
|
|
1182
1288
|
"requestId": "test-request-id",
|
|
1183
|
-
"timestamp": "2025-
|
|
1289
|
+
"timestamp": "2025-12-04T01:04:13.436Z"
|
|
1184
1290
|
}
|
|
1185
1291
|
}
|
|
1186
1292
|
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
1187
|
-
correlationId: '
|
|
1293
|
+
correlationId: 'fd709747-f82f-46b1-860e-25f3dff00f62',
|
|
1188
1294
|
dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1189
1295
|
hasAccepted: true,
|
|
1190
1296
|
hasRejected: true,
|
|
@@ -1222,7 +1328,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1222
1328
|
'}'
|
|
1223
1329
|
}
|
|
1224
1330
|
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
1225
|
-
correlationId: '
|
|
1331
|
+
correlationId: 'fd709747-f82f-46b1-860e-25f3dff00f62',
|
|
1226
1332
|
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1227
1333
|
hasSuccess: true,
|
|
1228
1334
|
successValue: true,
|
|
@@ -1259,16 +1365,16 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1259
1365
|
|
|
1260
1366
|
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response without outcomes (optional field)
|
|
1261
1367
|
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
1262
|
-
correlationId: '
|
|
1368
|
+
correlationId: 'd9e8a43f-4427-4b5f-a380-9928b2f6c919',
|
|
1263
1369
|
status: 200,
|
|
1264
1370
|
statusText: undefined,
|
|
1265
1371
|
headers: {},
|
|
1266
1372
|
responseTextLength: 133,
|
|
1267
|
-
responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-
|
|
1268
|
-
fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-
|
|
1373
|
+
responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.436Z"}}',
|
|
1374
|
+
fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.436Z"}}'
|
|
1269
1375
|
}
|
|
1270
1376
|
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1271
|
-
correlationId: '
|
|
1377
|
+
correlationId: 'd9e8a43f-4427-4b5f-a380-9928b2f6c919',
|
|
1272
1378
|
status: 200,
|
|
1273
1379
|
responseDataType: 'object',
|
|
1274
1380
|
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
@@ -1280,7 +1386,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1280
1386
|
' },\n' +
|
|
1281
1387
|
' "metadata": {\n' +
|
|
1282
1388
|
' "requestId": "test-request-id",\n' +
|
|
1283
|
-
' "timestamp": "2025-
|
|
1389
|
+
' "timestamp": "2025-12-04T01:04:13.436Z"\n' +
|
|
1284
1390
|
' }\n' +
|
|
1285
1391
|
'}'
|
|
1286
1392
|
}
|
|
@@ -1292,11 +1398,11 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1292
1398
|
},
|
|
1293
1399
|
"metadata": {
|
|
1294
1400
|
"requestId": "test-request-id",
|
|
1295
|
-
"timestamp": "2025-
|
|
1401
|
+
"timestamp": "2025-12-04T01:04:13.436Z"
|
|
1296
1402
|
}
|
|
1297
1403
|
}
|
|
1298
1404
|
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
1299
|
-
correlationId: '
|
|
1405
|
+
correlationId: 'd9e8a43f-4427-4b5f-a380-9928b2f6c919',
|
|
1300
1406
|
dataKeys: [ 'accepted', 'rejected' ],
|
|
1301
1407
|
hasAccepted: true,
|
|
1302
1408
|
hasRejected: true,
|
|
@@ -1313,7 +1419,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1313
1419
|
fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
|
|
1314
1420
|
}
|
|
1315
1421
|
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
1316
|
-
correlationId: '
|
|
1422
|
+
correlationId: 'd9e8a43f-4427-4b5f-a380-9928b2f6c919',
|
|
1317
1423
|
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
|
|
1318
1424
|
hasSuccess: true,
|
|
1319
1425
|
successValue: true,
|
|
@@ -1326,28 +1432,18 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1326
1432
|
fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
|
|
1327
1433
|
}
|
|
1328
1434
|
|
|
1329
|
-
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
|
|
1330
|
-
[StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/storage.service.ts'
|
|
1331
|
-
|
|
1332
|
-
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
|
|
1333
|
-
[StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
|
|
1334
|
-
|
|
1335
|
-
stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
|
|
1336
|
-
[StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/storage.service.ts'
|
|
1337
|
-
|
|
1338
|
-
✓ src/services/__tests__/access-control.service.test.ts (23 tests) 34ms
|
|
1339
1435
|
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should throw validation error if data object missing success field
|
|
1340
1436
|
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
1341
|
-
correlationId: '
|
|
1437
|
+
correlationId: 'c3aabc29-772c-4036-9609-6cc8c3f5c09b',
|
|
1342
1438
|
status: 200,
|
|
1343
1439
|
statusText: undefined,
|
|
1344
1440
|
headers: {},
|
|
1345
1441
|
responseTextLength: 191,
|
|
1346
|
-
responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-
|
|
1347
|
-
fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-
|
|
1442
|
+
responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.437Z"}}',
|
|
1443
|
+
fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:04:13.437Z"}}'
|
|
1348
1444
|
}
|
|
1349
1445
|
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1350
|
-
correlationId: '
|
|
1446
|
+
correlationId: 'c3aabc29-772c-4036-9609-6cc8c3f5c09b',
|
|
1351
1447
|
status: 200,
|
|
1352
1448
|
responseDataType: 'object',
|
|
1353
1449
|
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
@@ -1365,7 +1461,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1365
1461
|
' },\n' +
|
|
1366
1462
|
' "metadata": {\n' +
|
|
1367
1463
|
' "requestId": "test-request-id",\n' +
|
|
1368
|
-
' "timestamp": "2025-
|
|
1464
|
+
' "timestamp": "2025-12-04T01:04:13.437Z"\n' +
|
|
1369
1465
|
' }\n' +
|
|
1370
1466
|
'}'
|
|
1371
1467
|
}
|
|
@@ -1383,11 +1479,11 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1383
1479
|
},
|
|
1384
1480
|
"metadata": {
|
|
1385
1481
|
"requestId": "test-request-id",
|
|
1386
|
-
"timestamp": "2025-
|
|
1482
|
+
"timestamp": "2025-12-04T01:04:13.437Z"
|
|
1387
1483
|
}
|
|
1388
1484
|
}
|
|
1389
1485
|
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
1390
|
-
correlationId: '
|
|
1486
|
+
correlationId: 'c3aabc29-772c-4036-9609-6cc8c3f5c09b',
|
|
1391
1487
|
dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
|
|
1392
1488
|
hasAccepted: true,
|
|
1393
1489
|
hasRejected: true,
|
|
@@ -1413,7 +1509,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1413
1509
|
'}'
|
|
1414
1510
|
}
|
|
1415
1511
|
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
1416
|
-
correlationId: '
|
|
1512
|
+
correlationId: 'c3aabc29-772c-4036-9609-6cc8c3f5c09b',
|
|
1417
1513
|
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
1418
1514
|
hasSuccess: true,
|
|
1419
1515
|
successValue: true,
|
|
@@ -1438,7 +1534,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1438
1534
|
|
|
1439
1535
|
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should correctly extract data from wrapped response after JSON deep clone
|
|
1440
1536
|
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
1441
|
-
correlationId: '
|
|
1537
|
+
correlationId: '5adca573-666b-4ae3-bc6b-ff799385e578',
|
|
1442
1538
|
status: 200,
|
|
1443
1539
|
statusText: undefined,
|
|
1444
1540
|
headers: {},
|
|
@@ -1447,7 +1543,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1447
1543
|
fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}'
|
|
1448
1544
|
}
|
|
1449
1545
|
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1450
|
-
correlationId: '
|
|
1546
|
+
correlationId: '5adca573-666b-4ae3-bc6b-ff799385e578',
|
|
1451
1547
|
status: 200,
|
|
1452
1548
|
responseDataType: 'object',
|
|
1453
1549
|
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
@@ -1483,7 +1579,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1483
1579
|
}
|
|
1484
1580
|
}
|
|
1485
1581
|
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
1486
|
-
correlationId: '
|
|
1582
|
+
correlationId: '5adca573-666b-4ae3-bc6b-ff799385e578',
|
|
1487
1583
|
dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1488
1584
|
hasAccepted: true,
|
|
1489
1585
|
hasRejected: true,
|
|
@@ -1507,7 +1603,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1507
1603
|
'}'
|
|
1508
1604
|
}
|
|
1509
1605
|
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
1510
|
-
correlationId: '
|
|
1606
|
+
correlationId: '5adca573-666b-4ae3-bc6b-ff799385e578',
|
|
1511
1607
|
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1512
1608
|
hasSuccess: true,
|
|
1513
1609
|
successValue: true,
|
|
@@ -1530,16 +1626,16 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1530
1626
|
|
|
1531
1627
|
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response where data fields are numeric values (not undefined)
|
|
1532
1628
|
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
1533
|
-
correlationId: '
|
|
1629
|
+
correlationId: 'cdd19aee-28fe-4c90-bcd5-6707560cbcf2',
|
|
1534
1630
|
status: 200,
|
|
1535
1631
|
statusText: undefined,
|
|
1536
1632
|
headers: {},
|
|
1537
1633
|
responseTextLength: 151,
|
|
1538
|
-
responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-
|
|
1539
|
-
fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-
|
|
1634
|
+
responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:04:13.439Z"}}',
|
|
1635
|
+
fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:04:13.439Z"}}'
|
|
1540
1636
|
}
|
|
1541
1637
|
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1542
|
-
correlationId: '
|
|
1638
|
+
correlationId: 'cdd19aee-28fe-4c90-bcd5-6707560cbcf2',
|
|
1543
1639
|
status: 200,
|
|
1544
1640
|
responseDataType: 'object',
|
|
1545
1641
|
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
@@ -1553,7 +1649,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1553
1649
|
' },\n' +
|
|
1554
1650
|
' "metadata": {\n' +
|
|
1555
1651
|
' "requestId": "test-id",\n' +
|
|
1556
|
-
' "timestamp": "2025-
|
|
1652
|
+
' "timestamp": "2025-12-04T01:04:13.439Z"\n' +
|
|
1557
1653
|
' }\n' +
|
|
1558
1654
|
'}'
|
|
1559
1655
|
}
|
|
@@ -1567,11 +1663,11 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1567
1663
|
},
|
|
1568
1664
|
"metadata": {
|
|
1569
1665
|
"requestId": "test-id",
|
|
1570
|
-
"timestamp": "2025-
|
|
1666
|
+
"timestamp": "2025-12-04T01:04:13.439Z"
|
|
1571
1667
|
}
|
|
1572
1668
|
}
|
|
1573
1669
|
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
1574
|
-
correlationId: '
|
|
1670
|
+
correlationId: 'cdd19aee-28fe-4c90-bcd5-6707560cbcf2',
|
|
1575
1671
|
dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1576
1672
|
hasAccepted: true,
|
|
1577
1673
|
hasRejected: true,
|
|
@@ -1588,7 +1684,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1588
1684
|
fullData: '{\n "accepted": 0,\n "rejected": 0,\n "outcomes": {},\n "errors": []\n}'
|
|
1589
1685
|
}
|
|
1590
1686
|
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
1591
|
-
correlationId: '
|
|
1687
|
+
correlationId: 'cdd19aee-28fe-4c90-bcd5-6707560cbcf2',
|
|
1592
1688
|
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1593
1689
|
hasSuccess: true,
|
|
1594
1690
|
successValue: true,
|
|
@@ -1609,16 +1705,16 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1609
1705
|
|
|
1610
1706
|
stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response with nested outcomes object
|
|
1611
1707
|
[AccessControl] 🔍 RAW API RESPONSE (before parsing): {
|
|
1612
|
-
correlationId: '
|
|
1708
|
+
correlationId: '7454c6a3-85c3-41e6-944f-e69811fabbce',
|
|
1613
1709
|
status: 200,
|
|
1614
1710
|
statusText: undefined,
|
|
1615
1711
|
headers: {},
|
|
1616
1712
|
responseTextLength: 278,
|
|
1617
|
-
responseTextPreview: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-
|
|
1618
|
-
fullResponseText: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-
|
|
1713
|
+
responseTextPreview: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:04:13.439Z"}}',
|
|
1714
|
+
fullResponseText: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:04:13.439Z"}}'
|
|
1619
1715
|
}
|
|
1620
1716
|
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1621
|
-
correlationId: '
|
|
1717
|
+
correlationId: '7454c6a3-85c3-41e6-944f-e69811fabbce',
|
|
1622
1718
|
status: 200,
|
|
1623
1719
|
responseDataType: 'object',
|
|
1624
1720
|
responseDataKeys: [ 'success', 'data', 'metadata' ],
|
|
@@ -1645,301 +1741,659 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
|
|
|
1645
1741
|
' },\n' +
|
|
1646
1742
|
' "metadata": {\n' +
|
|
1647
1743
|
' "requestId": "test-id",\n' +
|
|
1648
|
-
' "timestamp": "2025-
|
|
1744
|
+
' "timestamp": "2025-12-04T01:04:13.439Z"\n' +
|
|
1649
1745
|
' }\n' +
|
|
1650
1746
|
'}'
|
|
1651
1747
|
}
|
|
1652
|
-
[AccessControl] Raw response received: {
|
|
1653
|
-
"success": true,
|
|
1654
|
-
"data": {
|
|
1655
|
-
"accepted": 3,
|
|
1656
|
-
"rejected": 2,
|
|
1657
|
-
"outcomes": {
|
|
1658
|
-
"success": 1,
|
|
1659
|
-
"failed": 1,
|
|
1660
|
-
"blocked": 1,
|
|
1661
|
-
"error": 2
|
|
1662
|
-
},
|
|
1663
|
-
"errors": [
|
|
1664
|
-
{
|
|
1665
|
-
"proof_index": 0,
|
|
1666
|
-
"error": {
|
|
1667
|
-
"code": "validation_error",
|
|
1668
|
-
"message": "Invalid signature"
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
]
|
|
1672
|
-
},
|
|
1673
|
-
"metadata": {
|
|
1674
|
-
"requestId": "test-id",
|
|
1675
|
-
"timestamp": "2025-
|
|
1676
|
-
}
|
|
1748
|
+
[AccessControl] Raw response received: {
|
|
1749
|
+
"success": true,
|
|
1750
|
+
"data": {
|
|
1751
|
+
"accepted": 3,
|
|
1752
|
+
"rejected": 2,
|
|
1753
|
+
"outcomes": {
|
|
1754
|
+
"success": 1,
|
|
1755
|
+
"failed": 1,
|
|
1756
|
+
"blocked": 1,
|
|
1757
|
+
"error": 2
|
|
1758
|
+
},
|
|
1759
|
+
"errors": [
|
|
1760
|
+
{
|
|
1761
|
+
"proof_index": 0,
|
|
1762
|
+
"error": {
|
|
1763
|
+
"code": "validation_error",
|
|
1764
|
+
"message": "Invalid signature"
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
]
|
|
1768
|
+
},
|
|
1769
|
+
"metadata": {
|
|
1770
|
+
"requestId": "test-id",
|
|
1771
|
+
"timestamp": "2025-12-04T01:04:13.439Z"
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
[AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
|
|
1775
|
+
correlationId: '7454c6a3-85c3-41e6-944f-e69811fabbce',
|
|
1776
|
+
dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1777
|
+
hasAccepted: true,
|
|
1778
|
+
hasRejected: true,
|
|
1779
|
+
hasOutcomes: true,
|
|
1780
|
+
hasErrors: true,
|
|
1781
|
+
acceptedType: 'number',
|
|
1782
|
+
acceptedValue: 3,
|
|
1783
|
+
rejectedType: 'number',
|
|
1784
|
+
rejectedValue: 2,
|
|
1785
|
+
outcomesType: 'object',
|
|
1786
|
+
outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
|
|
1787
|
+
errorsType: 'object',
|
|
1788
|
+
errorsIsArray: true,
|
|
1789
|
+
fullData: '{\n' +
|
|
1790
|
+
' "accepted": 3,\n' +
|
|
1791
|
+
' "rejected": 2,\n' +
|
|
1792
|
+
' "outcomes": {\n' +
|
|
1793
|
+
' "success": 1,\n' +
|
|
1794
|
+
' "failed": 1,\n' +
|
|
1795
|
+
' "blocked": 1,\n' +
|
|
1796
|
+
' "error": 2\n' +
|
|
1797
|
+
' },\n' +
|
|
1798
|
+
' "errors": [\n' +
|
|
1799
|
+
' {\n' +
|
|
1800
|
+
' "proof_index": 0,\n' +
|
|
1801
|
+
' "error": {\n' +
|
|
1802
|
+
' "code": "validation_error",\n' +
|
|
1803
|
+
' "message": "Invalid signature"\n' +
|
|
1804
|
+
' }\n' +
|
|
1805
|
+
' }\n' +
|
|
1806
|
+
' ]\n' +
|
|
1807
|
+
'}'
|
|
1808
|
+
}
|
|
1809
|
+
[AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
|
|
1810
|
+
correlationId: '7454c6a3-85c3-41e6-944f-e69811fabbce',
|
|
1811
|
+
dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1812
|
+
hasSuccess: true,
|
|
1813
|
+
successValue: true,
|
|
1814
|
+
hasAccepted: true,
|
|
1815
|
+
acceptedValue: 3,
|
|
1816
|
+
hasRejected: true,
|
|
1817
|
+
rejectedValue: 2,
|
|
1818
|
+
hasOutcomes: true,
|
|
1819
|
+
outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
|
|
1820
|
+
fullDataWithSuccess: '{\n' +
|
|
1821
|
+
' "success": true,\n' +
|
|
1822
|
+
' "accepted": 3,\n' +
|
|
1823
|
+
' "rejected": 2,\n' +
|
|
1824
|
+
' "outcomes": {\n' +
|
|
1825
|
+
' "success": 1,\n' +
|
|
1826
|
+
' "failed": 1,\n' +
|
|
1827
|
+
' "blocked": 1,\n' +
|
|
1828
|
+
' "error": 2\n' +
|
|
1829
|
+
' },\n' +
|
|
1830
|
+
' "errors": [\n' +
|
|
1831
|
+
' {\n' +
|
|
1832
|
+
' "proof_index": 0,\n' +
|
|
1833
|
+
' "error": {\n' +
|
|
1834
|
+
' "code": "validation_error",\n' +
|
|
1835
|
+
' "message": "Invalid signature"\n' +
|
|
1836
|
+
' }\n' +
|
|
1837
|
+
' }\n' +
|
|
1838
|
+
' ]\n' +
|
|
1839
|
+
'}'
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
✓ src/__tests__/services/tool-protection-merged-config.test.ts (11 tests) 161ms
|
|
1843
|
+
✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 162ms
|
|
1844
|
+
✓ src/services/__tests__/access-control.proof-response-validation.test.ts (12 tests) 71ms
|
|
1845
|
+
✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 102ms
|
|
1846
|
+
✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 21ms
|
|
1847
|
+
✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 13ms
|
|
1848
|
+
stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
|
|
1849
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
|
|
1850
|
+
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
|
|
1851
|
+
|
|
1852
|
+
[ToolProtectionService] Config loaded from API {
|
|
1853
|
+
source: 'api',
|
|
1854
|
+
stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
|
|
1855
|
+
toolCount: 1,
|
|
1856
|
+
[ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
|
|
1857
|
+
protectedTools: [],
|
|
1858
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1859
|
+
error: 'Network error',
|
|
1860
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1861
|
+
projectId: 'test-project',
|
|
1862
|
+
cacheKey: 'config:tool-protections:test-project'
|
|
1863
|
+
cacheTtlMs: 300000,
|
|
1864
|
+
}
|
|
1865
|
+
cacheExpiresAt: '2025-12-04T01:09:13.661Z'
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
|
|
1870
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
|
|
1871
|
+
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
|
|
1872
|
+
[ToolProtectionService] Config loaded from API {
|
|
1873
|
+
|
|
1874
|
+
source: 'api',
|
|
1875
|
+
toolCount: 1,
|
|
1876
|
+
protectedTools: [ 'checkout' ],
|
|
1877
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1878
|
+
projectId: 'test-project',
|
|
1879
|
+
cacheTtlMs: 300000,
|
|
1880
|
+
cacheExpiresAt: '2025-12-04T01:09:13.662Z'
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
|
|
1884
|
+
[ToolProtectionService] Protection check {
|
|
1885
|
+
tool: 'checkout',
|
|
1886
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1887
|
+
found: true,
|
|
1888
|
+
isWildcard: false,
|
|
1889
|
+
requiresDelegation: true,
|
|
1890
|
+
availableTools: [ 'checkout' ]
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield merged config
|
|
1894
|
+
[ToolProtectionService] Config loaded from API {
|
|
1895
|
+
source: 'api',
|
|
1896
|
+
toolCount: 1,
|
|
1897
|
+
protectedTools: [ 'protected_tool' ],
|
|
1898
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1899
|
+
projectId: 'test-project',
|
|
1900
|
+
cacheTtlMs: 300000,
|
|
1901
|
+
cacheExpiresAt: '2025-12-04T01:09:13.662Z'
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
|
|
1905
|
+
[ToolProtectionService] Config loaded from API {
|
|
1906
|
+
source: 'api',
|
|
1907
|
+
toolCount: 1,
|
|
1908
|
+
protectedTools: [ 'tool1' ],
|
|
1909
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1910
|
+
projectId: 'test-project',
|
|
1911
|
+
cacheTtlMs: 300000,
|
|
1912
|
+
cacheExpiresAt: '2025-12-04T01:09:13.663Z'
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
|
|
1916
|
+
[ToolProtectionService] Config loaded from API {
|
|
1917
|
+
source: 'api',
|
|
1918
|
+
toolCount: 1,
|
|
1919
|
+
protectedTools: [ 'tool1' ],
|
|
1920
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1921
|
+
projectId: 'test-project',
|
|
1922
|
+
cacheTtlMs: 300000,
|
|
1923
|
+
cacheExpiresAt: '2025-12-04T01:09:13.674Z'
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
|
|
1927
|
+
[ToolProtectionService] Config loaded from API {
|
|
1928
|
+
source: 'api',
|
|
1929
|
+
toolCount: 1,
|
|
1930
|
+
protectedTools: [ 'tool1' ],
|
|
1931
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1932
|
+
projectId: 'test-project',
|
|
1933
|
+
cacheTtlMs: 300000,
|
|
1934
|
+
cacheExpiresAt: '2025-12-04T01:09:13.675Z'
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
|
|
1938
|
+
[ToolProtectionService] Config loaded from API {
|
|
1939
|
+
source: 'api',
|
|
1940
|
+
toolCount: 1,
|
|
1941
|
+
protectedTools: [ 'tool1' ],
|
|
1942
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1943
|
+
projectId: 'test-project',
|
|
1944
|
+
cacheTtlMs: 300000,
|
|
1945
|
+
cacheExpiresAt: '2025-12-04T01:09:13.675Z'
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Real-world e-commerce scenario > should handle complete e-commerce flow with tool protection
|
|
1949
|
+
[ToolProtectionService] Config loaded from API {
|
|
1950
|
+
source: 'api',
|
|
1951
|
+
toolCount: 3,
|
|
1952
|
+
protectedTools: [ 'add_to_cart', 'checkout' ],
|
|
1953
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1954
|
+
projectId: 'test-project',
|
|
1955
|
+
cacheTtlMs: 300000,
|
|
1956
|
+
cacheExpiresAt: '2025-12-04T01:09:13.675Z'
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Real-world e-commerce scenario > should handle complete e-commerce flow with tool protection
|
|
1960
|
+
[ToolProtectionService] Protection check {
|
|
1961
|
+
tool: 'add_to_cart',
|
|
1962
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1963
|
+
found: true,
|
|
1964
|
+
isWildcard: false,
|
|
1965
|
+
requiresDelegation: true,
|
|
1966
|
+
availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Concurrent operations > should handle concurrent cache operations
|
|
1970
|
+
[ToolProtectionService] Config loaded from API {
|
|
1971
|
+
source: 'api',
|
|
1972
|
+
toolCount: 1,
|
|
1973
|
+
protectedTools: [ 'tool1' ],
|
|
1974
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1975
|
+
projectId: 'test-project',
|
|
1976
|
+
cacheTtlMs: 300000,
|
|
1977
|
+
cacheExpiresAt: '2025-12-04T01:09:13.676Z'
|
|
1978
|
+
}
|
|
1979
|
+
[ToolProtectionService] Config loaded from API {
|
|
1980
|
+
source: 'api',
|
|
1981
|
+
toolCount: 1,
|
|
1982
|
+
protectedTools: [ 'tool1' ],
|
|
1983
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1984
|
+
projectId: 'test-project',
|
|
1985
|
+
cacheTtlMs: 300000,
|
|
1986
|
+
cacheExpiresAt: '2025-12-04T01:09:13.676Z'
|
|
1987
|
+
}
|
|
1988
|
+
[ToolProtectionService] Config loaded from API {
|
|
1989
|
+
source: 'api',
|
|
1990
|
+
toolCount: 1,
|
|
1991
|
+
protectedTools: [ 'tool1' ],
|
|
1992
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
1993
|
+
projectId: 'test-project',
|
|
1994
|
+
cacheTtlMs: 300000,
|
|
1995
|
+
cacheExpiresAt: '2025-12-04T01:09:13.676Z'
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
✓ src/__tests__/integration/full-flow.test.ts (21 tests) 111ms
|
|
1999
|
+
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Phase 1 tools (no oauthProvider) > should work with Phase 1 tools that don't specify oauthProvider
|
|
2000
|
+
[ToolProtectionService] Config loaded from API {
|
|
2001
|
+
source: 'api',
|
|
2002
|
+
toolCount: 1,
|
|
2003
|
+
protectedTools: [ 'phase1_tool' ],
|
|
2004
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2005
|
+
projectId: 'none',
|
|
2006
|
+
cacheTtlMs: 300000,
|
|
2007
|
+
cacheExpiresAt: '2025-12-04T01:09:13.842Z'
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools array)
|
|
2011
|
+
[ToolProtectionService] Config loaded from API {
|
|
2012
|
+
source: 'api',
|
|
2013
|
+
toolCount: 1,
|
|
2014
|
+
protectedTools: [ 'old_tool' ],
|
|
2015
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2016
|
+
projectId: 'none',
|
|
2017
|
+
cacheTtlMs: 300000,
|
|
2018
|
+
cacheExpiresAt: '2025-12-04T01:09:13.847Z'
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools object)
|
|
2022
|
+
[ToolProtectionService] Config loaded from API {
|
|
2023
|
+
source: 'api',
|
|
2024
|
+
toolCount: 1,
|
|
2025
|
+
protectedTools: [ 'old_tool' ],
|
|
2026
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2027
|
+
projectId: 'none',
|
|
2028
|
+
cacheTtlMs: 300000,
|
|
2029
|
+
cacheExpiresAt: '2025-12-04T01:09:13.848Z'
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > snake_case field names > should still support snake_case field names
|
|
2033
|
+
[ToolProtectionService] Config loaded from API {
|
|
2034
|
+
source: 'api',
|
|
2035
|
+
toolCount: 1,
|
|
2036
|
+
protectedTools: [ 'tool_with_snake_case' ],
|
|
2037
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2038
|
+
projectId: 'test-project-123',
|
|
2039
|
+
cacheTtlMs: 300000,
|
|
2040
|
+
cacheExpiresAt: '2025-12-04T01:09:13.848Z'
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Mixed Phase 1 and Phase 2 tools > should handle mix of Phase 1 and Phase 2 tools in same project
|
|
2044
|
+
[ToolProtectionService] Config loaded from API {
|
|
2045
|
+
source: 'api',
|
|
2046
|
+
stderr | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > No Regressions > Phase 1 OAuth flow > should still work with Phase 1 OAuth flow (no oauthProvider)
|
|
2047
|
+
[ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
|
|
2048
|
+
toolCount: 2,
|
|
2049
|
+
protectedTools: [ 'phase1_tool', 'phase2_tool' ],
|
|
2050
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2051
|
+
|
|
2052
|
+
projectId: 'test-project-123',
|
|
2053
|
+
cacheTtlMs: 300000,
|
|
2054
|
+
cacheExpiresAt: '2025-12-04T01:09:13.850Z'
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 9ms
|
|
2058
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
|
|
2059
|
+
[CryptoService] Ed25519 verification error: Error: Verification failed
|
|
2060
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
|
|
2061
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2062
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2063
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2064
|
+
at new Promise (<anonymous>)
|
|
2065
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2066
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2067
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2068
|
+
at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
|
|
2069
|
+
at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
|
|
2070
|
+
|
|
2071
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
|
|
2072
|
+
[CryptoService] Invalid Ed25519 JWK format
|
|
2073
|
+
|
|
2074
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
|
|
2075
|
+
[CryptoService] Invalid Ed25519 JWK format
|
|
2076
|
+
|
|
2077
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
|
|
2078
|
+
[CryptoService] Invalid Ed25519 JWK format
|
|
2079
|
+
|
|
2080
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
|
|
2081
|
+
[CryptoService] Invalid Ed25519 JWK format
|
|
2082
|
+
|
|
2083
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
|
|
2084
|
+
[CryptoService] Invalid Ed25519 JWK format
|
|
2085
|
+
|
|
2086
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
|
|
2087
|
+
✓ src/__tests__/providers/memory.test.ts (34 tests) 39ms
|
|
2088
|
+
[CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token '', "" is not valid JSON
|
|
2089
|
+
at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
|
|
2090
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
2091
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
|
|
2092
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2093
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2094
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2095
|
+
at new Promise (<anonymous>)
|
|
2096
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2097
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2098
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2099
|
+
|
|
2100
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
|
|
2101
|
+
[CryptoService] Unsupported algorithm: RS256, expected EdDSA
|
|
2102
|
+
|
|
2103
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
|
|
2104
|
+
[CryptoService] Unsupported algorithm: HS256, expected EdDSA
|
|
2105
|
+
|
|
2106
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
|
|
2107
|
+
[CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
|
|
2108
|
+
at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
|
|
2109
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
2110
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
|
|
2111
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2112
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2113
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2114
|
+
at new Promise (<anonymous>)
|
|
2115
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2116
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2117
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2118
|
+
|
|
2119
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
|
|
2120
|
+
[CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
|
|
2121
|
+
at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
|
|
2122
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
2123
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
|
|
2124
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2125
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2126
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2127
|
+
at new Promise (<anonymous>)
|
|
2128
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2129
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2130
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2131
|
+
|
|
2132
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
|
|
2133
|
+
[CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
|
|
2134
|
+
at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
|
|
2135
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
2136
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
|
|
2137
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2138
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2139
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2140
|
+
at new Promise (<anonymous>)
|
|
2141
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2142
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2143
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2144
|
+
|
|
2145
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
|
|
2146
|
+
[CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
|
|
2147
|
+
at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
|
|
2148
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
2149
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
|
|
2150
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2151
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2152
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2153
|
+
at new Promise (<anonymous>)
|
|
2154
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2155
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2156
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2157
|
+
|
|
2158
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
|
|
2159
|
+
[CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
|
|
2160
|
+
at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
|
|
2161
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
2162
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
|
|
2163
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2164
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2165
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2166
|
+
at new Promise (<anonymous>)
|
|
2167
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2168
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2169
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2170
|
+
|
|
2171
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
|
|
2172
|
+
[CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
|
|
2173
|
+
at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
|
|
2174
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
|
|
2175
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
|
|
2176
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2177
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2178
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2179
|
+
at new Promise (<anonymous>)
|
|
2180
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2181
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2182
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2183
|
+
|
|
2184
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
|
|
2185
|
+
[CryptoService] Key ID mismatch
|
|
2186
|
+
|
|
2187
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
|
|
2188
|
+
[CryptoService] Unsupported algorithm: EdDSA, expected RS256
|
|
2189
|
+
|
|
2190
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
|
|
2191
|
+
[CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
|
|
2192
|
+
at CryptoService.jwkToBase64PublicKey (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
|
|
2193
|
+
at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
|
|
2194
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
|
|
2195
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2196
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2197
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2198
|
+
at new Promise (<anonymous>)
|
|
2199
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2200
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2201
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2202
|
+
|
|
2203
|
+
stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
|
|
2204
|
+
[CryptoService] Ed25519 verification error: Error: Crypto error
|
|
2205
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
|
|
2206
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2207
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2208
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2209
|
+
at new Promise (<anonymous>)
|
|
2210
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2211
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2212
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2213
|
+
at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
|
|
2214
|
+
at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
|
|
2215
|
+
|
|
2216
|
+
✓ src/services/__tests__/crypto.service.test.ts (34 tests) 52ms
|
|
2217
|
+
✓ src/__tests__/providers/base.test.ts (14 tests) 70ms
|
|
2218
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
|
|
2219
|
+
[ToolProtectionService] Config loaded from API {
|
|
2220
|
+
source: 'api',
|
|
2221
|
+
toolCount: 0,
|
|
2222
|
+
protectedTools: [],
|
|
2223
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2224
|
+
projectId: 'test-project-123',
|
|
2225
|
+
cacheTtlMs: 1000,
|
|
2226
|
+
cacheExpiresAt: '2025-12-04T01:04:15.473Z'
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
|
|
2230
|
+
[ToolProtectionService] Config loaded from API {
|
|
2231
|
+
source: 'api',
|
|
2232
|
+
toolCount: 4,
|
|
2233
|
+
protectedTools: [ 'add_to_cart', 'checkout' ],
|
|
2234
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2235
|
+
projectId: 'test-project-123',
|
|
2236
|
+
cacheTtlMs: 300000,
|
|
2237
|
+
cacheExpiresAt: '2025-12-04T01:09:14.474Z'
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
|
|
2241
|
+
[ToolProtectionService] Config loaded from API {
|
|
2242
|
+
source: 'api',
|
|
2243
|
+
toolCount: 1,
|
|
2244
|
+
protectedTools: [ 'tool1' ],
|
|
2245
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2246
|
+
projectId: 'test-project-123',
|
|
2247
|
+
cacheTtlMs: 300000,
|
|
2248
|
+
cacheExpiresAt: '2025-12-04T01:09:14.474Z'
|
|
2249
|
+
}
|
|
2250
|
+
[ToolProtectionService] Config loaded from API {
|
|
2251
|
+
source: 'api',
|
|
2252
|
+
toolCount: 1,
|
|
2253
|
+
protectedTools: [ 'tool1' ],
|
|
2254
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2255
|
+
projectId: 'test-project-123',
|
|
2256
|
+
cacheTtlMs: 300000,
|
|
2257
|
+
cacheExpiresAt: '2025-12-04T01:09:14.474Z'
|
|
1677
2258
|
}
|
|
1678
|
-
[
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
acceptedValue: 3,
|
|
1687
|
-
rejectedType: 'number',
|
|
1688
|
-
rejectedValue: 2,
|
|
1689
|
-
outcomesType: 'object',
|
|
1690
|
-
outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
|
|
1691
|
-
errorsType: 'object',
|
|
1692
|
-
errorsIsArray: true,
|
|
1693
|
-
fullData: '{\n' +
|
|
1694
|
-
' "accepted": 3,\n' +
|
|
1695
|
-
' "rejected": 2,\n' +
|
|
1696
|
-
' "outcomes": {\n' +
|
|
1697
|
-
' "success": 1,\n' +
|
|
1698
|
-
' "failed": 1,\n' +
|
|
1699
|
-
' "blocked": 1,\n' +
|
|
1700
|
-
' "error": 2\n' +
|
|
1701
|
-
' },\n' +
|
|
1702
|
-
' "errors": [\n' +
|
|
1703
|
-
' {\n' +
|
|
1704
|
-
' "proof_index": 0,\n' +
|
|
1705
|
-
' "error": {\n' +
|
|
1706
|
-
' "code": "validation_error",\n' +
|
|
1707
|
-
' "message": "Invalid signature"\n' +
|
|
1708
|
-
' }\n' +
|
|
1709
|
-
' }\n' +
|
|
1710
|
-
' ]\n' +
|
|
1711
|
-
'}'
|
|
2259
|
+
[ToolProtectionService] Config loaded from API {
|
|
2260
|
+
source: 'api',
|
|
2261
|
+
toolCount: 1,
|
|
2262
|
+
protectedTools: [ 'tool1' ],
|
|
2263
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2264
|
+
projectId: 'test-project-123',
|
|
2265
|
+
cacheTtlMs: 300000,
|
|
2266
|
+
cacheExpiresAt: '2025-12-04T01:09:14.474Z'
|
|
1712
2267
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
hasAccepted: true,
|
|
1719
|
-
acceptedValue: 3,
|
|
1720
|
-
hasRejected: true,
|
|
1721
|
-
rejectedValue: 2,
|
|
1722
|
-
hasOutcomes: true,
|
|
1723
|
-
outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
|
|
1724
|
-
fullDataWithSuccess: '{\n' +
|
|
1725
|
-
' "success": true,\n' +
|
|
1726
|
-
' "accepted": 3,\n' +
|
|
1727
|
-
' "rejected": 2,\n' +
|
|
1728
|
-
' "outcomes": {\n' +
|
|
1729
|
-
' "success": 1,\n' +
|
|
1730
|
-
' "failed": 1,\n' +
|
|
1731
|
-
' "blocked": 1,\n' +
|
|
1732
|
-
' "error": 2\n' +
|
|
1733
|
-
' },\n' +
|
|
1734
|
-
' "errors": [\n' +
|
|
1735
|
-
' {\n' +
|
|
1736
|
-
' "proof_index": 0,\n' +
|
|
1737
|
-
' "error": {\n' +
|
|
1738
|
-
' "code": "validation_error",\n' +
|
|
1739
|
-
' "message": "Invalid signature"\n' +
|
|
1740
|
-
' }\n' +
|
|
1741
|
-
' }\n' +
|
|
1742
|
-
' ]\n' +
|
|
1743
|
-
'}'
|
|
2268
|
+
|
|
2269
|
+
stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
|
|
2270
|
+
[ToolProtectionService] API fetch failed, using fallback config {
|
|
2271
|
+
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2272
|
+
error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
|
|
1744
2273
|
}
|
|
1745
2274
|
|
|
1746
|
-
✓ src/services/
|
|
1747
|
-
|
|
2275
|
+
✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1140ms
|
|
2276
|
+
✓ should respect cache TTL 1103ms
|
|
2277
|
+
✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 99ms
|
|
1748
2278
|
stderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
|
|
1749
2279
|
[CryptoService] Ed25519 verification error: Error: Crypto error
|
|
1750
|
-
|
|
1751
|
-
at
|
|
1752
|
-
at file:///Users/
|
|
1753
|
-
at file:///Users/
|
|
2280
|
+
✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 7ms
|
|
2281
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
|
|
2282
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2283
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2284
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
1754
2285
|
at new Promise (<anonymous>)
|
|
1755
|
-
at runWithTimeout (file:///Users/
|
|
1756
|
-
at
|
|
1757
|
-
at
|
|
1758
|
-
at
|
|
1759
|
-
at
|
|
2286
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2287
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2288
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2289
|
+
at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
|
|
2290
|
+
at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
|
|
2291
|
+
|
|
2292
|
+
✓ src/__tests__/services/oauth-service-pkce.test.ts (18 tests) 14ms
|
|
2293
|
+
✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 16ms
|
|
2294
|
+
✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 210ms
|
|
2295
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
|
|
2296
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zjbbPxe6AE2HLR3QRM_E0z4u_aWhgGpQ3","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254825,"timestampFormatted":"2025-12-04T01:04:14.825Z"}
|
|
1760
2297
|
|
|
1761
|
-
|
|
1762
|
-
[
|
|
1763
|
-
correlationId: '5be6f8ae-ee53-4b5f-a627-da78df1494fb',
|
|
1764
|
-
status: 200,
|
|
1765
|
-
statusText: '',
|
|
1766
|
-
headers: { 'content-type': 'application/json' },
|
|
1767
|
-
responseTextLength: 100,
|
|
1768
|
-
responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
|
|
1769
|
-
fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
|
|
1770
|
-
}
|
|
1771
|
-
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1772
|
-
correlationId: '5be6f8ae-ee53-4b5f-a627-da78df1494fb',
|
|
1773
|
-
status: 200,
|
|
1774
|
-
responseDataType: 'object',
|
|
1775
|
-
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
|
|
1776
|
-
responseData: '{\n' +
|
|
1777
|
-
' "success": true,\n' +
|
|
1778
|
-
' "accepted": 1,\n' +
|
|
1779
|
-
' "rejected": 0,\n' +
|
|
1780
|
-
' "outcomes": {\n' +
|
|
1781
|
-
' "success": 1,\n' +
|
|
1782
|
-
' "failed": 0,\n' +
|
|
1783
|
-
' "blocked": 0,\n' +
|
|
1784
|
-
' "error": 0\n' +
|
|
1785
|
-
' }\n' +
|
|
1786
|
-
'}'
|
|
1787
|
-
}
|
|
1788
|
-
[AccessControl] Raw response received: {
|
|
1789
|
-
"success": true,
|
|
1790
|
-
"accepted": 1,
|
|
1791
|
-
"rejected": 0,
|
|
1792
|
-
"outcomes": {
|
|
1793
|
-
"success": 1,
|
|
1794
|
-
"failed": 0,
|
|
1795
|
-
"blocked": 0,
|
|
1796
|
-
"error": 0
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
2298
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
|
|
2299
|
+
[AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"ba91f41cf17c12fcd070b5cfd89b06e3","timestamp":1764810254825},"timestamp":1764810254825,"timestampFormatted":"2025-12-04T01:04:14.825Z"}
|
|
1799
2300
|
|
|
1800
|
-
|
|
1801
|
-
[
|
|
1802
|
-
correlationId: '1ceb40b1-e915-4474-97ee-d103432d8f85',
|
|
1803
|
-
status: 200,
|
|
1804
|
-
statusText: '',
|
|
1805
|
-
headers: { 'content-type': 'application/json' },
|
|
1806
|
-
responseTextLength: 200,
|
|
1807
|
-
responseTextPreview: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}',
|
|
1808
|
-
fullResponseText: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}'
|
|
1809
|
-
}
|
|
1810
|
-
[AccessControl] 🔍 PARSED RESPONSE DATA: {
|
|
1811
|
-
correlationId: '1ceb40b1-e915-4474-97ee-d103432d8f85',
|
|
1812
|
-
status: 200,
|
|
1813
|
-
responseDataType: 'object',
|
|
1814
|
-
responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
|
|
1815
|
-
responseData: '{\n' +
|
|
1816
|
-
' "success": true,\n' +
|
|
1817
|
-
' "accepted": 0,\n' +
|
|
1818
|
-
' "rejected": 1,\n' +
|
|
1819
|
-
' "outcomes": {\n' +
|
|
1820
|
-
' "success": 0,\n' +
|
|
1821
|
-
' "failed": 1,\n' +
|
|
1822
|
-
' "blocked": 0,\n' +
|
|
1823
|
-
' "error": 0\n' +
|
|
1824
|
-
' },\n' +
|
|
1825
|
-
' "errors": [\n' +
|
|
1826
|
-
' {\n' +
|
|
1827
|
-
' "proof_index": 0,\n' +
|
|
1828
|
-
' "error": {\n' +
|
|
1829
|
-
' "code": "invalid_signature",\n' +
|
|
1830
|
-
' "message": "Invalid JWS signature"\n' +
|
|
1831
|
-
' }\n' +
|
|
1832
|
-
' }\n' +
|
|
1833
|
-
' ]\n' +
|
|
1834
|
-
'}'
|
|
1835
|
-
}
|
|
1836
|
-
[AccessControl] Raw response received: {
|
|
1837
|
-
"success": true,
|
|
1838
|
-
"accepted": 0,
|
|
1839
|
-
"rejected": 1,
|
|
1840
|
-
"outcomes": {
|
|
1841
|
-
"success": 0,
|
|
1842
|
-
"failed": 1,
|
|
1843
|
-
"blocked": 0,
|
|
1844
|
-
"error": 0
|
|
1845
|
-
},
|
|
1846
|
-
"errors": [
|
|
1847
|
-
{
|
|
1848
|
-
"proof_index": 0,
|
|
1849
|
-
"error": {
|
|
1850
|
-
"code": "invalid_signature",
|
|
1851
|
-
"message": "Invalid JWS signature"
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
]
|
|
1855
|
-
}
|
|
2301
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
|
|
2302
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z4Ep3_6GMiNGMjkYK-_EFcb-GaTHIXCyR","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254847,"timestampFormatted":"2025-12-04T01:04:14.847Z"}
|
|
1856
2303
|
|
|
1857
|
-
|
|
1858
|
-
[
|
|
2304
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
|
|
2305
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z_qssUyj-sPIMt5zoPGba1dHDGP6MgsQG","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254848,"timestampFormatted":"2025-12-04T01:04:14.848Z"}
|
|
2306
|
+
|
|
2307
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
|
|
2308
|
+
[AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:z_qssUyj-sPIMt5zoPGba1dHDGP6MgsQG","newDid":"did:key:zYJVTLOR2WCfN5FapeKI7uJi-SAUL-BFT","timestamp":1764810254848},"timestamp":1764810254848,"timestampFormatted":"2025-12-04T01:04:14.848Z"}
|
|
2309
|
+
|
|
2310
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
|
|
2311
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z0p0-xYtFCTSYO9PMFoSTRT6Uj1nGDBwI","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254849,"timestampFormatted":"2025-12-04T01:04:14.849Z"}
|
|
2312
|
+
|
|
2313
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
|
|
2314
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zQfJPS5aQrf_f6YY2uFf6loa4S7YM1Jyb","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254850,"timestampFormatted":"2025-12-04T01:04:14.850Z"}
|
|
1859
2315
|
|
|
1860
|
-
|
|
1861
|
-
|
|
2316
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
|
|
2317
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zRzncwCTe9ETyyWDPdbvxs5Q3OmQA7-cF","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254850,"timestampFormatted":"2025-12-04T01:04:14.850Z"}
|
|
2318
|
+
|
|
2319
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
|
|
2320
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zETFV_zv_9XzsdurOI7285XtCZ5P_zYTE","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254850,"timestampFormatted":"2025-12-04T01:04:14.850Z"}
|
|
2321
|
+
|
|
2322
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
|
|
2323
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zK32d_cVxugLUy6F0GgHDRakMJD0uwDbo","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254851,"timestampFormatted":"2025-12-04T01:04:14.851Z"}
|
|
2324
|
+
|
|
2325
|
+
stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
|
|
2326
|
+
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z6joWc15AsX4mYbNqt_WdJLJfLfRH2yN8","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810254851,"timestampFormatted":"2025-12-04T01:04:14.851Z"}
|
|
2327
|
+
|
|
2328
|
+
✓ src/__tests__/integration.test.ts (9 tests) 49ms
|
|
1862
2329
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
|
|
1863
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
|
|
1864
|
-
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
1865
|
-
tool: 'protectedTool',
|
|
1866
|
-
requiredScopes: [ 'files:write' ],
|
|
1867
2330
|
[MCP-I] Checking tool protection: {
|
|
1868
2331
|
tool: 'unprotectedTool',
|
|
1869
|
-
|
|
1870
|
-
resumeToken: 'resume_gxa3v_mig63sgc',
|
|
2332
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
|
|
1871
2333
|
agentDid: 'did:key:zmock123...',
|
|
1872
2334
|
hasDelegation: false
|
|
1873
2335
|
}
|
|
1874
2336
|
|
|
1875
2337
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
|
|
1876
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gxa3v_mig63sgc'
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
|
|
1880
2338
|
[MCP-I] Tool protection check passed (no delegation required) {
|
|
1881
2339
|
tool: 'unprotectedTool',
|
|
1882
|
-
[MCP-I] ❌ Delegation verification FAILED {
|
|
1883
2340
|
agentDid: 'did:key:zmock123...',
|
|
2341
|
+
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
1884
2342
|
reason: 'Tool not configured to require delegation'
|
|
1885
2343
|
}
|
|
1886
|
-
|
|
1887
2344
|
tool: 'protectedTool',
|
|
2345
|
+
requiredScopes: [ 'files:write' ],
|
|
2346
|
+
|
|
1888
2347
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
|
|
1889
|
-
[MCP-I] Checking tool protection: {
|
|
1890
2348
|
agentDid: 'did:key:zmock123...',
|
|
2349
|
+
[MCP-I] Checking tool protection: {
|
|
1891
2350
|
tool: 'protectedTool',
|
|
1892
2351
|
agentDid: 'did:key:zmock123...',
|
|
1893
2352
|
hasDelegation: false
|
|
1894
|
-
reason: 'Delegation token expired',
|
|
1895
2353
|
}
|
|
2354
|
+
resumeToken: 'resume_t9ybq8_miqqgjrp',
|
|
1896
2355
|
|
|
1897
|
-
errorCode: undefined,
|
|
1898
2356
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
|
|
1899
|
-
errorMessage: undefined,
|
|
1900
2357
|
[MCP-I] Checking tool protection: {
|
|
1901
2358
|
tool: 'protectedTool',
|
|
1902
2359
|
agentDid: 'did:key:zmock123...',
|
|
1903
2360
|
hasDelegation: true
|
|
1904
|
-
requiredScopes: [ 'files:write' ]
|
|
1905
|
-
}
|
|
1906
2361
|
}
|
|
2362
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_t9ybq8_miqqgjrp'
|
|
1907
2363
|
|
|
2364
|
+
}
|
|
1908
2365
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
|
|
1909
2366
|
[MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
|
|
1910
2367
|
tool: 'protectedTool',
|
|
1911
2368
|
agentDid: 'did:key:zmock123...',
|
|
1912
2369
|
hasDelegationToken: true,
|
|
1913
|
-
|
|
1914
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
|
|
1915
2370
|
hasConsentProof: false,
|
|
1916
|
-
[MCP-I] ❌ Delegation verification FAILED {
|
|
1917
2371
|
requiredScopes: [ 'files:write' ]
|
|
2372
|
+
|
|
2373
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
|
|
2374
|
+
[MCP-I] ❌ Delegation verification FAILED {
|
|
1918
2375
|
}
|
|
1919
2376
|
|
|
1920
2377
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
|
|
1921
2378
|
[MCP-I] ✅ Delegation verification SUCCEEDED {
|
|
1922
2379
|
tool: 'protectedTool',
|
|
1923
|
-
tool: 'protectedTool',
|
|
1924
|
-
agentDid: 'did:key:zmock123...',
|
|
1925
2380
|
agentDid: 'did:key:zmock123...',
|
|
1926
|
-
|
|
2381
|
+
tool: 'protectedTool',
|
|
1927
2382
|
delegationId: 'test-delegation-id',
|
|
1928
2383
|
credentialScopes: [ 'files:write' ],
|
|
1929
|
-
errorCode: undefined,
|
|
1930
2384
|
requiredScopes: [ 'files:write' ]
|
|
1931
2385
|
}
|
|
1932
|
-
errorMessage: undefined,
|
|
1933
|
-
requiredScopes: [ 'files:write' ]
|
|
1934
2386
|
|
|
2387
|
+
agentDid: 'did:key:zmock123...',
|
|
1935
2388
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
|
|
1936
2389
|
[MCP-I] Checking tool protection: {
|
|
1937
2390
|
tool: 'protectedTool',
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2391
|
+
reason: 'Delegation token expired',
|
|
2392
|
+
agentDid: 'did:key:zmock123...',
|
|
1941
2393
|
hasDelegation: true
|
|
1942
2394
|
}
|
|
2395
|
+
errorCode: undefined,
|
|
2396
|
+
errorMessage: undefined,
|
|
1943
2397
|
|
|
1944
2398
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
|
|
1945
2399
|
[MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
|
|
@@ -1949,25 +2403,35 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
|
|
|
1949
2403
|
hasConsentProof: true,
|
|
1950
2404
|
requiredScopes: [ 'files:write' ]
|
|
1951
2405
|
}
|
|
2406
|
+
requiredScopes: [ 'files:write' ]
|
|
1952
2407
|
|
|
2408
|
+
}
|
|
1953
2409
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
|
|
1954
2410
|
[MCP-I] ✅ Delegation verification SUCCEEDED {
|
|
2411
|
+
|
|
1955
2412
|
tool: 'protectedTool',
|
|
1956
2413
|
agentDid: 'did:key:zmock123...',
|
|
2414
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
|
|
1957
2415
|
delegationId: 'test-delegation-id',
|
|
2416
|
+
[MCP-I] ❌ Delegation verification FAILED {
|
|
1958
2417
|
credentialScopes: [ 'files:write' ],
|
|
2418
|
+
tool: 'protectedTool',
|
|
1959
2419
|
requiredScopes: [ 'files:write' ]
|
|
2420
|
+
agentDid: 'did:key:zmock123...',
|
|
1960
2421
|
}
|
|
2422
|
+
reason: 'Insufficient scopes',
|
|
1961
2423
|
|
|
1962
2424
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
|
|
1963
2425
|
[MCP-I] Checking tool protection: {
|
|
1964
2426
|
tool: 'protectedTool',
|
|
2427
|
+
errorCode: undefined,
|
|
1965
2428
|
agentDid: 'did:key:zmock123...',
|
|
1966
2429
|
hasDelegation: true
|
|
1967
2430
|
}
|
|
1968
2431
|
|
|
1969
2432
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
|
|
1970
2433
|
[MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
|
|
2434
|
+
errorMessage: undefined,
|
|
1971
2435
|
tool: 'protectedTool',
|
|
1972
2436
|
agentDid: 'did:key:zmock123...',
|
|
1973
2437
|
hasDelegationToken: true,
|
|
@@ -1978,85 +2442,87 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
|
|
|
1978
2442
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
|
|
1979
2443
|
[MCP-I] Checking tool protection: {
|
|
1980
2444
|
tool: 'protectedTool',
|
|
2445
|
+
requiredScopes: [ 'files:write' ]
|
|
1981
2446
|
agentDid: 'did:key:zmock123...',
|
|
1982
2447
|
hasDelegation: true
|
|
1983
2448
|
}
|
|
2449
|
+
}
|
|
1984
2450
|
|
|
1985
2451
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
|
|
1986
2452
|
[MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
|
|
1987
2453
|
tool: 'protectedTool',
|
|
1988
2454
|
agentDid: 'did:key:zmock123...',
|
|
2455
|
+
|
|
2456
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
|
|
1989
2457
|
hasDelegationToken: true,
|
|
2458
|
+
[MCP-I] ❌ Delegation verification error (API failure) {
|
|
1990
2459
|
hasConsentProof: false,
|
|
2460
|
+
tool: 'protectedTool',
|
|
1991
2461
|
requiredScopes: [ 'files:write' ]
|
|
1992
2462
|
}
|
|
1993
2463
|
|
|
1994
|
-
✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 31ms
|
|
1995
2464
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
|
|
1996
2465
|
[MCP-I] Checking tool protection: {
|
|
2466
|
+
agentDid: 'did:key:zmock123...',
|
|
2467
|
+
errorCode: 'network_error',
|
|
2468
|
+
errorMessage: 'API unavailable',
|
|
2469
|
+
errorDetails: {}
|
|
1997
2470
|
tool: 'protectedTool',
|
|
1998
2471
|
agentDid: 'did:key:zmock123...',
|
|
1999
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
|
|
2000
2472
|
hasDelegation: true
|
|
2001
2473
|
}
|
|
2002
2474
|
|
|
2003
2475
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
|
|
2004
|
-
[MCP-I] ❌ Delegation verification error (API failure) {
|
|
2005
2476
|
[MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
|
|
2006
2477
|
tool: 'protectedTool',
|
|
2007
|
-
|
|
2008
|
-
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
|
|
2009
2481
|
agentDid: 'did:key:zmock123...',
|
|
2010
2482
|
hasDelegationToken: true,
|
|
2011
2483
|
hasConsentProof: false,
|
|
2012
|
-
errorCode: 'network_error',
|
|
2013
2484
|
requiredScopes: [ 'files:write' ]
|
|
2485
|
+
[MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
|
|
2014
2486
|
}
|
|
2015
|
-
errorMessage: 'API unavailable',
|
|
2016
2487
|
|
|
2017
|
-
errorDetails: {}
|
|
2018
2488
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
|
|
2019
2489
|
[MCP-I] Checking tool protection: {
|
|
2020
2490
|
tool: 'protectedTool',
|
|
2491
|
+
tool: 'protectedTool',
|
|
2492
|
+
agentDid: 'did:key:zmock123...',
|
|
2021
2493
|
agentDid: 'did:key:zmock123...',
|
|
2022
2494
|
hasDelegation: true
|
|
2023
2495
|
}
|
|
2024
2496
|
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
|
|
2028
|
-
[MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
|
|
2029
|
-
tool: 'protectedTool',
|
|
2030
|
-
agentDid: 'did:key:zmock123...',
|
|
2031
2497
|
hasDelegationToken: true,
|
|
2032
2498
|
hasConsentProof: false
|
|
2033
2499
|
}
|
|
2034
2500
|
|
|
2035
2501
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
|
|
2036
|
-
[MCP-I] Checking tool protection: {
|
|
2037
2502
|
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
|
|
2503
|
+
[MCP-I] Checking tool protection: {
|
|
2504
|
+
[MCP-I] 🔒 SECURITY: User identifier validation FAILED {
|
|
2505
|
+
tool: 'protectedTool',
|
|
2038
2506
|
tool: 'protectedTool',
|
|
2039
2507
|
agentDid: 'did:key:zmock123...',
|
|
2040
|
-
|
|
2508
|
+
agentDid: 'did:key:zmock123...',
|
|
2509
|
+
delegationUserIdentifier: 'did:key:zUserB987654...',
|
|
2041
2510
|
hasDelegation: true
|
|
2511
|
+
sessionUserDid: 'did:key:zUserA123456...',
|
|
2042
2512
|
}
|
|
2043
|
-
tool: 'protectedTool',
|
|
2044
2513
|
|
|
2045
|
-
agentDid: 'did:key:zmock123...',
|
|
2046
|
-
delegationUserIdentifier: 'did:key:zUserB987654...',
|
|
2047
2514
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
|
|
2048
2515
|
[MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
|
|
2049
|
-
tool: 'protectedTool',
|
|
2050
|
-
sessionUserDid: 'did:key:zUserA123456...',
|
|
2051
2516
|
sessionId: 'session123...',
|
|
2052
|
-
|
|
2053
|
-
severity: 'high'
|
|
2517
|
+
tool: 'protectedTool',
|
|
2054
2518
|
agentDid: 'did:key:zmock123...',
|
|
2055
|
-
}
|
|
2056
2519
|
hasDelegationToken: true,
|
|
2057
|
-
|
|
2058
2520
|
hasConsentProof: false,
|
|
2059
2521
|
requiredScopes: [ 'files:write' ]
|
|
2522
|
+
reason: 'user_identifier_mismatch',
|
|
2523
|
+
severity: 'high'
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2060
2526
|
}
|
|
2061
2527
|
|
|
2062
2528
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
|
|
@@ -2127,73 +2593,63 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
|
|
|
2127
2593
|
tool: 'protectedTool',
|
|
2128
2594
|
agentDid: 'did:key:zmock123...',
|
|
2129
2595
|
hasDelegationToken: true,
|
|
2130
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
|
|
2131
2596
|
hasConsentProof: false,
|
|
2132
2597
|
requiredScopes: [ 'files:write' ]
|
|
2133
2598
|
}
|
|
2134
|
-
[MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
|
|
2135
2599
|
|
|
2136
2600
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
|
|
2137
|
-
tool: 'protectedTool',
|
|
2138
|
-
agentDid: 'did:key:zmock123...',
|
|
2139
|
-
delegationUserIdentifier: 'did:key:zUserA123456...',
|
|
2140
2601
|
[MCP-I] ✅ Delegation verification SUCCEEDED {
|
|
2141
2602
|
tool: 'protectedTool',
|
|
2603
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
|
|
2142
2604
|
agentDid: 'did:key:zmock123...',
|
|
2605
|
+
[MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
|
|
2143
2606
|
delegationId: 'test-delegation-id',
|
|
2144
2607
|
credentialScopes: [ 'files:write' ],
|
|
2145
|
-
|
|
2608
|
+
tool: 'protectedTool',
|
|
2146
2609
|
requiredScopes: [ 'files:write' ]
|
|
2610
|
+
agentDid: 'did:key:zmock123...',
|
|
2147
2611
|
}
|
|
2148
2612
|
|
|
2149
2613
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
|
|
2150
2614
|
[MCP-I] Checking tool protection: {
|
|
2151
|
-
|
|
2152
|
-
|
|
2615
|
+
delegationUserIdentifier: 'did:key:zUserA123456...',
|
|
2153
2616
|
tool: 'unprotectedTool',
|
|
2617
|
+
sessionId: 'session123...'
|
|
2154
2618
|
agentDid: 'did:key:zmock123...',
|
|
2155
2619
|
hasDelegation: false
|
|
2156
2620
|
}
|
|
2621
|
+
}
|
|
2157
2622
|
|
|
2158
2623
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
|
|
2159
2624
|
[MCP-I] Tool protection check passed (no delegation required) {
|
|
2160
2625
|
tool: 'unprotectedTool',
|
|
2161
2626
|
agentDid: 'did:key:zmock123...',
|
|
2162
2627
|
reason: 'Tool not configured to require delegation'
|
|
2628
|
+
|
|
2163
2629
|
}
|
|
2164
2630
|
|
|
2165
2631
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
|
|
2166
2632
|
[MCP-I] Checking tool protection: {
|
|
2167
2633
|
tool: 'protectedTool',
|
|
2168
2634
|
agentDid: 'did:key:zmock123...',
|
|
2635
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
|
|
2169
2636
|
hasDelegation: false
|
|
2637
|
+
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2170
2638
|
}
|
|
2171
2639
|
|
|
2172
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
|
|
2173
2640
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
|
|
2641
|
+
tool: 'protectedTool',
|
|
2174
2642
|
[MCP-I] Checking tool protection: {
|
|
2175
2643
|
tool: 'protectedTool',
|
|
2644
|
+
requiredScopes: [ 'files:write' ],
|
|
2176
2645
|
agentDid: 'did:key:zmock123...',
|
|
2177
2646
|
hasDelegation: false
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2181
|
-
tool: 'protectedTool',
|
|
2182
|
-
requiredScopes: [ 'files:write' ],
|
|
2183
2647
|
agentDid: 'did:key:zmock123...',
|
|
2184
|
-
resumeToken: '
|
|
2185
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8nc_mig63sgv'
|
|
2648
|
+
resumeToken: 'resume_t9ycf7_miqqgjry',
|
|
2186
2649
|
}
|
|
2187
2650
|
|
|
2188
|
-
|
|
2189
|
-
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2190
|
-
tool: 'protectedTool',
|
|
2191
|
-
requiredScopes: [ 'files:write' ],
|
|
2192
|
-
agentDid: 'did:key:zmock123...',
|
|
2193
|
-
resumeToken: 'resume_gx8nc_mig63sgv',
|
|
2194
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8nc_mig63sgv'
|
|
2651
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_t9ycf7_miqqgjry'
|
|
2195
2652
|
}
|
|
2196
|
-
|
|
2197
2653
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
|
|
2198
2654
|
[MCP-I] Checking tool protection: {
|
|
2199
2655
|
tool: 'protectedTool',
|
|
@@ -2201,73 +2657,65 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
|
|
|
2201
2657
|
hasDelegation: false
|
|
2202
2658
|
}
|
|
2203
2659
|
|
|
2204
|
-
|
|
2660
|
+
|
|
2661
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
|
|
2205
2662
|
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2206
2663
|
tool: 'protectedTool',
|
|
2207
|
-
requiredScopes: [ 'files:write'
|
|
2664
|
+
requiredScopes: [ 'files:write' ],
|
|
2208
2665
|
agentDid: 'did:key:zmock123...',
|
|
2209
|
-
resumeToken: '
|
|
2210
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite
|
|
2666
|
+
resumeToken: 'resume_t9ycg2_miqqgjry',
|
|
2667
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_t9ycg2_miqqgjry'
|
|
2211
2668
|
}
|
|
2212
2669
|
|
|
2213
2670
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
|
|
2214
2671
|
[MCP-I] Checking tool protection: {
|
|
2672
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
|
|
2215
2673
|
tool: 'protectedTool',
|
|
2216
2674
|
agentDid: 'did:key:zmock123...',
|
|
2217
2675
|
hasDelegation: false
|
|
2218
2676
|
}
|
|
2219
|
-
|
|
2220
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
|
|
2221
2677
|
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2222
2678
|
tool: 'protectedTool',
|
|
2223
|
-
requiredScopes: [ 'files:write' ],
|
|
2679
|
+
requiredScopes: [ 'files:write', 'files:read' ],
|
|
2224
2680
|
agentDid: 'did:key:zmock123...',
|
|
2225
|
-
resumeToken: 'resume_gx8mh_mig63sgw',
|
|
2226
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8mh_mig63sgw'
|
|
2227
|
-
}
|
|
2228
2681
|
|
|
2229
2682
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
|
|
2230
2683
|
[MCP-I] Checking tool protection: {
|
|
2231
2684
|
tool: 'protectedTool',
|
|
2685
|
+
resumeToken: 'resume_t9ycg2_miqqgjry',
|
|
2686
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_t9ycg2_miqqgjry'
|
|
2232
2687
|
agentDid: 'did:key:zmock123...',
|
|
2233
2688
|
hasDelegation: false
|
|
2234
2689
|
}
|
|
2235
|
-
|
|
2236
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
|
|
2237
|
-
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2238
|
-
tool: 'protectedTool',
|
|
2239
|
-
requiredScopes: [ 'files:write' ],
|
|
2240
|
-
agentDid: 'did:key:zmock123...',
|
|
2241
|
-
resumeToken: 'resume_gx8mh_mig63sgw',
|
|
2242
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8mh_mig63sgw'
|
|
2243
2690
|
}
|
|
2244
2691
|
|
|
2692
|
+
|
|
2245
2693
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
|
|
2246
2694
|
[MCP-I] Checking tool protection: {
|
|
2247
2695
|
tool: 'protectedTool',
|
|
2248
2696
|
agentDid: 'did:key:zmock123...',
|
|
2697
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
|
|
2249
2698
|
hasDelegation: false
|
|
2250
|
-
}
|
|
2251
|
-
|
|
2252
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
|
|
2253
2699
|
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2254
2700
|
tool: 'protectedTool',
|
|
2255
|
-
requiredScopes: [ 'files:write' ],
|
|
2256
|
-
agentDid: 'did:key:zmock123...',
|
|
2257
|
-
resumeToken: 'resume_fpsylu_mig63sgw',
|
|
2258
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_fpsylu_mig63sgw'
|
|
2259
2701
|
}
|
|
2702
|
+
requiredScopes: [ 'files:write' ],
|
|
2260
2703
|
|
|
2261
2704
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
|
|
2262
2705
|
[MCP-I] Checking tool protection: {
|
|
2706
|
+
agentDid: 'did:key:zmock123...',
|
|
2263
2707
|
tool: 'testTool',
|
|
2708
|
+
resumeToken: 'resume_t9ycg2_miqqgjry',
|
|
2264
2709
|
agentDid: 'did:key:zmock123...',
|
|
2265
2710
|
hasDelegation: false
|
|
2711
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_t9ycg2_miqqgjry'
|
|
2266
2712
|
}
|
|
2267
2713
|
|
|
2268
2714
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
|
|
2269
2715
|
[MCP-I] Tool protection check passed (no delegation required) {
|
|
2716
|
+
}
|
|
2270
2717
|
tool: 'testTool',
|
|
2718
|
+
|
|
2271
2719
|
agentDid: 'did:key:zmock123...',
|
|
2272
2720
|
reason: 'Tool not configured to require delegation'
|
|
2273
2721
|
}
|
|
@@ -2276,17 +2724,30 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
|
|
|
2276
2724
|
[MCP-I] Checking tool protection: {
|
|
2277
2725
|
tool: 'protectedTool',
|
|
2278
2726
|
agentDid: 'did:key:zmock123...',
|
|
2727
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
|
|
2728
|
+
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2279
2729
|
hasDelegation: false
|
|
2280
2730
|
}
|
|
2731
|
+
tool: 'protectedTool',
|
|
2732
|
+
requiredScopes: [ 'files:write' ],
|
|
2733
|
+
agentDid: 'did:key:zmock123...',
|
|
2281
2734
|
|
|
2735
|
+
resumeToken: 'resume_t9ycg2_miqqgjry',
|
|
2282
2736
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
|
|
2737
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_t9ycg2_miqqgjry'
|
|
2283
2738
|
[MCP-I] Checking tool protection: {
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
|
|
2284
2742
|
tool: 'testTool',
|
|
2285
2743
|
agentDid: 'did:key:zmock123...',
|
|
2286
2744
|
hasDelegation: false
|
|
2745
|
+
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2287
2746
|
}
|
|
2288
2747
|
|
|
2748
|
+
tool: 'protectedTool',
|
|
2289
2749
|
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
|
|
2750
|
+
requiredScopes: [ 'files:write' ],
|
|
2290
2751
|
[MCP-I] Tool protection check passed (no delegation required) {
|
|
2291
2752
|
tool: 'testTool',
|
|
2292
2753
|
agentDid: 'did:key:zmock123...',
|
|
@@ -2297,277 +2758,100 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
|
|
|
2297
2758
|
[MCP-I] Checking tool protection: {
|
|
2298
2759
|
tool: 'testTool',
|
|
2299
2760
|
agentDid: 'did:key:zmock123...',
|
|
2300
|
-
hasDelegation: false
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
|
|
2304
|
-
[MCP-I] Checking tool protection: {
|
|
2305
|
-
tool: 'protectedTool',
|
|
2306
|
-
agentDid: 'did:key:zmock123...',
|
|
2307
|
-
hasDelegation: false
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
|
|
2311
|
-
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2312
|
-
tool: 'protectedTool',
|
|
2313
|
-
requiredScopes: [],
|
|
2314
|
-
agentDid: 'did:key:zmock123...',
|
|
2315
|
-
resumeToken: 'resume_gx7z8_mig63sh2',
|
|
2316
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_gx7z8_mig63sh2'
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
|
|
2320
|
-
[MCP-I] Checking tool protection: {
|
|
2321
|
-
tool: 'protectedTool',
|
|
2322
|
-
agentDid: 'did:key:zmock123...',
|
|
2323
|
-
hasDelegation: false
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
|
|
2327
|
-
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2328
|
-
tool: 'protectedTool',
|
|
2329
|
-
requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
|
|
2330
|
-
agentDid: 'did:key:zmock123...',
|
|
2331
|
-
resumeToken: 'resume_gx7yd_mig63sh3',
|
|
2332
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_gx7yd_mig63sh3'
|
|
2333
|
-
}
|
|
2334
|
-
|
|
2335
|
-
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
|
|
2336
|
-
[MCP-I] Checking tool protection: {
|
|
2337
|
-
tool: 'protectedTool',
|
|
2338
|
-
agentDid: 'did:key:zmock123...',
|
|
2339
|
-
hasDelegation: false
|
|
2340
|
-
}
|
|
2341
|
-
|
|
2342
|
-
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
|
|
2343
|
-
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2344
|
-
tool: 'protectedTool',
|
|
2345
|
-
requiredScopes: [ 'files:write' ],
|
|
2346
|
-
agentDid: 'did:key:zmock123...',
|
|
2347
|
-
resumeToken: 'resume_cl4sgd_mig63sh3',
|
|
2348
|
-
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_cl4sgd_mig63sh3'
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
|
|
2352
|
-
[MCP-I] Checking tool protection: {
|
|
2353
|
-
tool: 'errorTool',
|
|
2354
2761
|
agentDid: 'did:key:zmock123...',
|
|
2355
2762
|
hasDelegation: false
|
|
2763
|
+
resumeToken: 'resume_pkfiar_miqqgjrz',
|
|
2356
2764
|
}
|
|
2357
|
-
|
|
2358
|
-
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
|
|
2359
|
-
[MCP-I] Tool protection check passed (no delegation required) {
|
|
2360
|
-
tool: 'errorTool',
|
|
2361
|
-
agentDid: 'did:key:zmock123...',
|
|
2362
|
-
reason: 'Tool not configured to require delegation'
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 63ms
|
|
2366
|
-
stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
|
|
2367
|
-
[ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
|
|
2368
|
-
at Object.resolveDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
|
|
2369
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
2370
|
-
at ProofVerifier.fetchPublicKeyFromDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
|
|
2371
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
|
|
2372
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
|
|
2373
|
-
|
|
2374
|
-
stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
|
|
2375
|
-
[ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
|
|
2376
|
-
at Object.resolveDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
|
|
2377
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
2378
|
-
at ProofVerifier.fetchPublicKeyFromDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
|
|
2379
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
|
|
2380
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
|
|
2381
|
-
|
|
2382
|
-
✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 46ms
|
|
2383
|
-
✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 154ms
|
|
2384
|
-
✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 134ms
|
|
2385
|
-
✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 317ms
|
|
2386
|
-
✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 324ms
|
|
2387
|
-
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
|
|
2388
|
-
[ToolProtectionService] Config loaded from API {
|
|
2389
|
-
source: 'api',
|
|
2390
|
-
toolCount: 1,
|
|
2391
|
-
protectedTools: [],
|
|
2392
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2393
|
-
stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
|
|
2394
|
-
projectId: 'test-project',
|
|
2395
|
-
cacheTtlMs: 300000,
|
|
2396
|
-
cacheExpiresAt: '2025-11-26T15:41:45.684Z'
|
|
2397
|
-
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
|
|
2398
|
-
}
|
|
2399
|
-
|
|
2400
|
-
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
|
|
2401
|
-
[ToolProtectionService] Config loaded from API {
|
|
2402
|
-
source: 'api',
|
|
2403
|
-
toolCount: 1,
|
|
2404
|
-
protectedTools: [ 'checkout' ],
|
|
2405
|
-
|
|
2406
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2407
|
-
stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
|
|
2408
|
-
projectId: 'test-project',
|
|
2409
|
-
cacheTtlMs: 300000,
|
|
2410
|
-
cacheExpiresAt: '2025-11-26T15:41:45.685Z'
|
|
2411
|
-
}
|
|
2412
|
-
[ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
|
|
2413
|
-
|
|
2414
|
-
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
|
|
2415
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2416
|
-
error: 'Network error',
|
|
2417
|
-
[ToolProtectionService] Protection check {
|
|
2418
|
-
tool: 'checkout',
|
|
2419
|
-
cacheKey: 'config:tool-protections:test-project'
|
|
2420
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2421
|
-
found: true,
|
|
2422
|
-
isWildcard: false,
|
|
2423
|
-
requiresDelegation: true,
|
|
2424
|
-
availableTools: [ 'checkout' ]
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield
|
|
2428
|
-
}
|
|
2429
|
-
[ToolProtectionService] Config loaded from API {
|
|
2430
|
-
source: 'api',
|
|
2431
|
-
|
|
2432
|
-
stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
|
|
2433
|
-
[ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
|
|
2434
|
-
toolCount: 1,
|
|
2435
|
-
protectedTools: [ 'protected_tool' ],
|
|
2436
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2437
|
-
projectId: 'test-project',
|
|
2438
|
-
cacheTtlMs: 300000,
|
|
2439
|
-
|
|
2440
|
-
cacheExpiresAt: '2025-11-26T15:41:45.686Z'
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
|
|
2444
|
-
[ToolProtectionService] Config loaded from API {
|
|
2445
|
-
source: 'api',
|
|
2446
|
-
toolCount: 1,
|
|
2447
|
-
protectedTools: [ 'tool1' ],
|
|
2448
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2449
|
-
projectId: 'test-project',
|
|
2450
|
-
cacheTtlMs: 300000,
|
|
2451
|
-
cacheExpiresAt: '2025-11-26T15:41:45.687Z'
|
|
2765
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_pkfiar_miqqgjrz'
|
|
2452
2766
|
}
|
|
2453
2767
|
|
|
2454
|
-
|
|
2455
|
-
[
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2768
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
|
|
2769
|
+
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2770
|
+
tool: 'protectedTool',
|
|
2771
|
+
requiredScopes: [],
|
|
2772
|
+
agentDid: 'did:key:zmock123...',
|
|
2773
|
+
|
|
2774
|
+
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
|
|
2775
|
+
resumeToken: 'resume_t9yczv_miqqgjs0',
|
|
2776
|
+
[MCP-I] Checking tool protection: {
|
|
2777
|
+
tool: 'protectedTool',
|
|
2778
|
+
agentDid: 'did:key:zmock123...',
|
|
2779
|
+
hasDelegation: false
|
|
2463
2780
|
}
|
|
2464
2781
|
|
|
2465
|
-
|
|
2466
|
-
[ToolProtectionService] Config loaded from API {
|
|
2467
|
-
source: 'api',
|
|
2468
|
-
toolCount: 1,
|
|
2469
|
-
protectedTools: [ 'tool1' ],
|
|
2470
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2471
|
-
projectId: 'test-project',
|
|
2472
|
-
cacheTtlMs: 300000,
|
|
2473
|
-
cacheExpiresAt: '2025-11-26T15:41:45.689Z'
|
|
2782
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_t9yczv_miqqgjs0'
|
|
2474
2783
|
}
|
|
2475
2784
|
|
|
2476
|
-
stdout | src/__tests__/
|
|
2477
|
-
[
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
projectId: 'test-project',
|
|
2483
|
-
cacheTtlMs: 300000,
|
|
2484
|
-
cacheExpiresAt: '2025-11-26T15:41:45.689Z'
|
|
2785
|
+
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
|
|
2786
|
+
[MCP-I] Checking tool protection: {
|
|
2787
|
+
tool: 'protectedTool',
|
|
2788
|
+
agentDid: 'did:key:zmock123...',
|
|
2789
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
|
|
2790
|
+
hasDelegation: false
|
|
2485
2791
|
}
|
|
2486
2792
|
|
|
2487
|
-
stdout | src/__tests__/
|
|
2488
|
-
[
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2793
|
+
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
|
|
2794
|
+
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2795
|
+
[MCP-I] Checking tool protection: {
|
|
2796
|
+
tool: 'protectedTool',
|
|
2797
|
+
agentDid: 'did:key:zmock123...',
|
|
2798
|
+
tool: 'protectedTool',
|
|
2799
|
+
requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
|
|
2800
|
+
agentDid: 'did:key:zmock123...',
|
|
2801
|
+
resumeToken: 'resume_t9yczv_miqqgjs0',
|
|
2802
|
+
hasDelegation: false
|
|
2803
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_t9yczv_miqqgjs0'
|
|
2496
2804
|
}
|
|
2497
2805
|
|
|
2498
|
-
stdout | src/__tests__/
|
|
2499
|
-
[ToolProtectionService] Protection check {
|
|
2500
|
-
tool: 'add_to_cart',
|
|
2501
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2502
|
-
found: true,
|
|
2503
|
-
isWildcard: false,
|
|
2504
|
-
requiresDelegation: true,
|
|
2505
|
-
availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
|
|
2806
|
+
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
|
|
2506
2807
|
}
|
|
2808
|
+
[MCP-I] Checking tool protection: {
|
|
2507
2809
|
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2514
|
-
projectId: 'test-project',
|
|
2515
|
-
cacheTtlMs: 300000,
|
|
2516
|
-
cacheExpiresAt: '2025-11-26T15:41:45.690Z'
|
|
2810
|
+
tool: 'errorTool',
|
|
2811
|
+
agentDid: 'did:key:zmock123...',
|
|
2812
|
+
hasDelegation: false
|
|
2813
|
+
stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
|
|
2814
|
+
[MCP-I] BLOCKED: Tool requires delegation but none provided {
|
|
2517
2815
|
}
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2816
|
+
|
|
2817
|
+
stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
|
|
2818
|
+
tool: 'protectedTool',
|
|
2819
|
+
[MCP-I] Tool protection check passed (no delegation required) {
|
|
2820
|
+
requiredScopes: [ 'files:write' ],
|
|
2821
|
+
agentDid: 'did:key:zmock123...',
|
|
2822
|
+
tool: 'errorTool',
|
|
2823
|
+
agentDid: 'did:key:zmock123...',
|
|
2824
|
+
resumeToken: 'resume_sp3okj_miqqgjs0',
|
|
2825
|
+
reason: 'Tool not configured to require delegation'
|
|
2526
2826
|
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
toolCount: 1,
|
|
2530
|
-
protectedTools: [ 'tool1' ],
|
|
2531
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2532
|
-
projectId: 'test-project',
|
|
2533
|
-
cacheTtlMs: 300000,
|
|
2534
|
-
cacheExpiresAt: '2025-11-26T15:41:45.690Z'
|
|
2827
|
+
consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_sp3okj_miqqgjs0'
|
|
2828
|
+
|
|
2535
2829
|
}
|
|
2536
2830
|
|
|
2537
|
-
✓ src/__tests__/
|
|
2538
|
-
stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully
|
|
2539
|
-
[UserDidManager] Storage.get failed
|
|
2540
|
-
at /Users/
|
|
2541
|
-
at file:///Users/
|
|
2542
|
-
at file:///Users/
|
|
2543
|
-
at file:///Users/
|
|
2544
|
-
at new Promise (<anonymous>)
|
|
2545
|
-
at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
|
|
2546
|
-
at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
|
|
2547
|
-
at processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
2548
|
-
at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
|
|
2549
|
-
at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
|
|
2550
|
-
|
|
2551
|
-
stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.set errors gracefully
|
|
2552
|
-
[UserDidManager] Storage.set failed, continuing with cached DID: Error: Storage error
|
|
2553
|
-
at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:196:67
|
|
2554
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
|
|
2555
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
|
|
2556
|
-
at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
|
|
2831
|
+
✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 78ms
|
|
2832
|
+
stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully (Phase 5)
|
|
2833
|
+
[UserDidManager] Storage.get failed: Error: Storage error
|
|
2834
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:67
|
|
2835
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
2836
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
2837
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2557
2838
|
at new Promise (<anonymous>)
|
|
2558
|
-
at runWithTimeout (file:///Users/
|
|
2559
|
-
at
|
|
2560
|
-
at
|
|
2561
|
-
at
|
|
2562
|
-
at
|
|
2839
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
2840
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
2841
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
2842
|
+
at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
|
|
2843
|
+
at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
|
|
2563
2844
|
|
|
2564
2845
|
stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
|
|
2565
2846
|
[UserDidManager] Storage.delete failed, continuing: Error: Storage error
|
|
2566
|
-
at /Users/
|
|
2567
|
-
at processTicksAndRejections (node:internal/process/task_queues:
|
|
2568
|
-
at file:///Users/
|
|
2847
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:225:70
|
|
2848
|
+
at processTicksAndRejections (node:internal/process/task_queues:103:5)
|
|
2849
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
|
|
2569
2850
|
|
|
2570
2851
|
✓ src/__tests__/identity/user-did-manager.test.ts (17 tests) 8ms
|
|
2852
|
+
✓ src/config/__tests__/merged-config.spec.ts (6 tests) 5ms
|
|
2853
|
+
✓ src/delegation/__tests__/did-key-resolver.test.ts (28 tests) 6ms
|
|
2854
|
+
✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 8ms
|
|
2571
2855
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from camelCase field
|
|
2572
2856
|
[ToolProtectionService] Config loaded from API {
|
|
2573
2857
|
source: 'api',
|
|
@@ -2576,7 +2860,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2576
2860
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2577
2861
|
projectId: 'test-project-123',
|
|
2578
2862
|
cacheTtlMs: 300000,
|
|
2579
|
-
cacheExpiresAt: '2025-
|
|
2863
|
+
cacheExpiresAt: '2025-12-04T01:09:15.032Z'
|
|
2580
2864
|
}
|
|
2581
2865
|
|
|
2582
2866
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from snake_case field
|
|
@@ -2587,7 +2871,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2587
2871
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2588
2872
|
projectId: 'test-project-123',
|
|
2589
2873
|
cacheTtlMs: 300000,
|
|
2590
|
-
cacheExpiresAt: '2025-
|
|
2874
|
+
cacheExpiresAt: '2025-12-04T01:09:15.033Z'
|
|
2591
2875
|
}
|
|
2592
2876
|
|
|
2593
2877
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should prefer camelCase over snake_case when both present
|
|
@@ -2598,7 +2882,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2598
2882
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2599
2883
|
projectId: 'test-project-123',
|
|
2600
2884
|
cacheTtlMs: 300000,
|
|
2601
|
-
cacheExpiresAt: '2025-
|
|
2885
|
+
cacheExpiresAt: '2025-12-04T01:09:15.034Z'
|
|
2602
2886
|
}
|
|
2603
2887
|
|
|
2604
2888
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should handle missing oauthProvider field (backward compatible)
|
|
@@ -2609,7 +2893,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2609
2893
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2610
2894
|
projectId: 'test-project-123',
|
|
2611
2895
|
cacheTtlMs: 300000,
|
|
2612
|
-
cacheExpiresAt: '2025-
|
|
2896
|
+
cacheExpiresAt: '2025-12-04T01:09:15.034Z'
|
|
2613
2897
|
}
|
|
2614
2898
|
|
|
2615
2899
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with camelCase
|
|
@@ -2620,7 +2904,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2620
2904
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2621
2905
|
projectId: 'none',
|
|
2622
2906
|
cacheTtlMs: 300000,
|
|
2623
|
-
cacheExpiresAt: '2025-
|
|
2907
|
+
cacheExpiresAt: '2025-12-04T01:09:15.035Z'
|
|
2624
2908
|
}
|
|
2625
2909
|
|
|
2626
2910
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with snake_case
|
|
@@ -2631,7 +2915,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2631
2915
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2632
2916
|
projectId: 'none',
|
|
2633
2917
|
cacheTtlMs: 300000,
|
|
2634
|
-
cacheExpiresAt: '2025-
|
|
2918
|
+
cacheExpiresAt: '2025-12-04T01:09:15.036Z'
|
|
2635
2919
|
}
|
|
2636
2920
|
|
|
2637
2921
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should prefer camelCase over snake_case in array format
|
|
@@ -2642,7 +2926,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2642
2926
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2643
2927
|
projectId: 'none',
|
|
2644
2928
|
cacheTtlMs: 300000,
|
|
2645
|
-
cacheExpiresAt: '2025-
|
|
2929
|
+
cacheExpiresAt: '2025-12-04T01:09:15.036Z'
|
|
2646
2930
|
}
|
|
2647
2931
|
|
|
2648
2932
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with camelCase
|
|
@@ -2653,7 +2937,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2653
2937
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2654
2938
|
projectId: 'none',
|
|
2655
2939
|
cacheTtlMs: 300000,
|
|
2656
|
-
cacheExpiresAt: '2025-
|
|
2940
|
+
cacheExpiresAt: '2025-12-04T01:09:15.036Z'
|
|
2657
2941
|
}
|
|
2658
2942
|
|
|
2659
2943
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with snake_case
|
|
@@ -2664,7 +2948,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2664
2948
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2665
2949
|
projectId: 'none',
|
|
2666
2950
|
cacheTtlMs: 300000,
|
|
2667
|
-
cacheExpiresAt: '2025-
|
|
2951
|
+
cacheExpiresAt: '2025-12-04T01:09:15.036Z'
|
|
2668
2952
|
}
|
|
2669
2953
|
|
|
2670
2954
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should prefer camelCase over snake_case in object format
|
|
@@ -2675,7 +2959,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2675
2959
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2676
2960
|
projectId: 'none',
|
|
2677
2961
|
cacheTtlMs: 300000,
|
|
2678
|
-
cacheExpiresAt: '2025-
|
|
2962
|
+
cacheExpiresAt: '2025-12-04T01:09:15.036Z'
|
|
2679
2963
|
}
|
|
2680
2964
|
|
|
2681
2965
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
|
|
@@ -2686,7 +2970,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2686
2970
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2687
2971
|
projectId: 'test-project-123',
|
|
2688
2972
|
cacheTtlMs: 300000,
|
|
2689
|
-
cacheExpiresAt: '2025-
|
|
2973
|
+
cacheExpiresAt: '2025-12-04T01:09:15.037Z'
|
|
2690
2974
|
}
|
|
2691
2975
|
|
|
2692
2976
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should include oauthProvider in returned ToolProtection objects when present
|
|
@@ -2697,7 +2981,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2697
2981
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2698
2982
|
projectId: 'test-project-123',
|
|
2699
2983
|
cacheTtlMs: 300000,
|
|
2700
|
-
cacheExpiresAt: '2025-
|
|
2984
|
+
cacheExpiresAt: '2025-12-04T01:09:15.037Z'
|
|
2701
2985
|
}
|
|
2702
2986
|
|
|
2703
2987
|
stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
|
|
@@ -2708,23 +2992,10 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
|
|
|
2708
2992
|
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2709
2993
|
projectId: 'test-project-123',
|
|
2710
2994
|
cacheTtlMs: 300000,
|
|
2711
|
-
cacheExpiresAt: '2025-
|
|
2995
|
+
cacheExpiresAt: '2025-12-04T01:09:15.037Z'
|
|
2712
2996
|
}
|
|
2713
2997
|
|
|
2714
2998
|
✓ src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 7ms
|
|
2715
|
-
✓ src/__tests__/services/oauth-service-pkce.test.ts (18 tests) 9ms
|
|
2716
|
-
✓ src/__tests__/providers/memory.test.ts (34 tests) 13ms
|
|
2717
|
-
✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 25ms
|
|
2718
|
-
stderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should fall back to configuredProvider for ambiguous scopes
|
|
2719
|
-
[ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
|
|
2720
|
-
✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 9ms
|
|
2721
|
-
stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
|
|
2722
|
-
[ProviderResolver] Inferred provider "github" from scopes
|
|
2723
|
-
|
|
2724
|
-
stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
|
|
2725
|
-
[ProviderResolver] Inferred provider "google" from scopes
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
2999
|
stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
|
|
2729
3000
|
[ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
|
|
2730
3001
|
|
|
@@ -2733,10 +3004,10 @@ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderR
|
|
|
2733
3004
|
|
|
2734
3005
|
stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
|
|
2735
3006
|
[ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
|
|
2736
|
-
|
|
2737
3007
|
stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify gmail → google mapping works
|
|
2738
3008
|
[ProviderResolver] Inferred provider "google" from scopes
|
|
2739
3009
|
|
|
3010
|
+
|
|
2740
3011
|
stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify calendar → google mapping works
|
|
2741
3012
|
[ProviderResolver] Inferred provider "google" from scopes
|
|
2742
3013
|
|
|
@@ -2755,155 +3026,74 @@ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderR
|
|
|
2755
3026
|
stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Provider name case sensitivity > should handle provider names case-insensitively in inference
|
|
2756
3027
|
[ProviderResolver] Inferred provider "github" from scopes
|
|
2757
3028
|
|
|
2758
|
-
stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should use configuredProvider when tool has no oauthProvider
|
|
2759
3029
|
stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Multiple scopes with same provider > should handle multiple scopes from same provider
|
|
2760
|
-
|
|
3030
|
+
stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should use configuredProvider when tool has no oauthProvider
|
|
2761
3031
|
[ProviderResolver] Inferred provider "github" from scopes
|
|
2762
3032
|
|
|
3033
|
+
[ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
|
|
2763
3034
|
|
|
2764
3035
|
stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should prefer scope-inferred provider over configuredProvider
|
|
2765
3036
|
[ProviderResolver] Inferred provider "google" from scopes
|
|
2766
3037
|
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
cacheExpiresAt: '2025-11-26T15:41:45.870Z'
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools array)
|
|
2779
|
-
[ToolProtectionService] Config loaded from API {
|
|
2780
|
-
source: 'api',
|
|
2781
|
-
toolCount: 1,
|
|
2782
|
-
protectedTools: [ 'old_tool' ],
|
|
2783
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2784
|
-
projectId: 'none',
|
|
2785
|
-
cacheTtlMs: 300000,
|
|
2786
|
-
cacheExpiresAt: '2025-11-26T15:41:45.881Z'
|
|
2787
|
-
}
|
|
2788
|
-
|
|
2789
|
-
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools object)
|
|
2790
|
-
[ToolProtectionService] Config loaded from API {
|
|
2791
|
-
source: 'api',
|
|
2792
|
-
toolCount: 1,
|
|
2793
|
-
protectedTools: [ 'old_tool' ],
|
|
2794
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2795
|
-
projectId: 'none',
|
|
2796
|
-
cacheTtlMs: 300000,
|
|
2797
|
-
cacheExpiresAt: '2025-11-26T15:41:45.882Z'
|
|
2798
|
-
}
|
|
2799
|
-
|
|
2800
|
-
stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > snake_case field names > should still support snake_case field names
|
|
2801
|
-
[ToolProtectionService] Config loaded from API {
|
|
2802
|
-
source: 'api',
|
|
2803
|
-
toolCount: 1,
|
|
2804
|
-
protectedTools: [ 'tool_with_snake_case' ],
|
|
2805
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2806
|
-
projectId: 'test-project-123',
|
|
2807
|
-
cacheTtlMs: 300000,
|
|
2808
|
-
cacheExpiresAt: '2025-11-26T15:41:45.882Z'
|
|
2809
|
-
}
|
|
3038
|
+
✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (25 tests | 1 skipped) 8ms
|
|
3039
|
+
✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 19ms
|
|
3040
|
+
✓ src/utils/__tests__/did-helpers.test.ts (16 tests) 3ms
|
|
3041
|
+
✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 6ms
|
|
3042
|
+
✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 5ms
|
|
3043
|
+
✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 2ms
|
|
3044
|
+
stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
|
|
3045
|
+
[ProviderResolver] Inferred provider "github" from scopes
|
|
2810
3046
|
|
|
2811
|
-
stdout | src/__tests__/
|
|
2812
|
-
[
|
|
2813
|
-
source: 'api',
|
|
2814
|
-
toolCount: 2,
|
|
2815
|
-
protectedTools: [ 'phase1_tool', 'phase2_tool' ],
|
|
2816
|
-
stderr | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > No Regressions > Phase 1 OAuth flow > should still work with Phase 1 OAuth flow (no oauthProvider)
|
|
2817
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2818
|
-
projectId: 'test-project-123',
|
|
2819
|
-
cacheTtlMs: 300000,
|
|
2820
|
-
cacheExpiresAt: '2025-11-26T15:41:45.885Z'
|
|
2821
|
-
}
|
|
3047
|
+
stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
|
|
3048
|
+
[ProviderResolver] Inferred provider "google" from scopes
|
|
2822
3049
|
|
|
3050
|
+
stderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should fall back to configuredProvider for ambiguous scopes
|
|
2823
3051
|
[ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
|
|
2824
3052
|
|
|
2825
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
|
|
2826
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z-fcn5k3v2ZvYK9dlIxU8n4lMqIWAYMTh","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405871,"timestampFormatted":"2025-11-26T15:36:45.871Z"}
|
|
2827
|
-
|
|
2828
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
|
|
2829
|
-
[AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"70fae80e7f85d8d7c07f785a68990d26","timestamp":1764171405871},"timestamp":1764171405871,"timestampFormatted":"2025-11-26T15:36:45.871Z"}
|
|
2830
|
-
|
|
2831
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
|
|
2832
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zT_7RaA0bLnzRdBKcRy8wSQhZQWOqdu6M","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405883,"timestampFormatted":"2025-11-26T15:36:45.883Z"}
|
|
2833
|
-
|
|
2834
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
|
|
2835
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zTh6D4u2wJj_Y3a4AyHIqU89X7UCKWfoF","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405883,"timestampFormatted":"2025-11-26T15:36:45.883Z"}
|
|
2836
|
-
|
|
2837
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
|
|
2838
|
-
[AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zTh6D4u2wJj_Y3a4AyHIqU89X7UCKWfoF","newDid":"did:key:zmjuGQxXVJTkNFmfA7biSllCtFAK3U22B","timestamp":1764171405883},"timestamp":1764171405883,"timestampFormatted":"2025-11-26T15:36:45.883Z"}
|
|
2839
|
-
|
|
2840
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
|
|
2841
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zt1EwInIPdYDy3nYd-H-vnDVXRVC8Ngnz","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405887,"timestampFormatted":"2025-11-26T15:36:45.887Z"}
|
|
2842
|
-
|
|
2843
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
|
|
2844
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zd-MgrCaVXirdlYFY4OUm5ClzQZAdOchd","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405888,"timestampFormatted":"2025-11-26T15:36:45.888Z"}
|
|
2845
|
-
|
|
2846
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
|
|
2847
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zmtiafOUYJHiKNWjqtCy4IRCk3iieeEpb","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405888,"timestampFormatted":"2025-11-26T15:36:45.888Z"}
|
|
2848
|
-
|
|
2849
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
|
|
2850
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zmglnfmMGPMSRQ2b7Vr0t-PoMXPG0Ltbg","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405888,"timestampFormatted":"2025-11-26T15:36:45.888Z"}
|
|
2851
|
-
|
|
2852
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
|
|
2853
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zs1TeqYecLeqs89TtiOTV2kVTDeu1wdzZ","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405889,"timestampFormatted":"2025-11-26T15:36:45.889Z"}
|
|
2854
|
-
|
|
2855
|
-
✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (25 tests | 1 skipped) 12ms
|
|
2856
|
-
✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 6ms
|
|
2857
|
-
✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 14ms
|
|
2858
|
-
stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
|
|
2859
|
-
[AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z-4za6CQd91VdYGlXbvvTWpL8r9av_GhE","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405889,"timestampFormatted":"2025-11-26T15:36:45.889Z"}
|
|
2860
|
-
|
|
2861
|
-
✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 17ms
|
|
2862
3053
|
✓ src/services/__tests__/provider-resolver.test.ts (8 tests) 6ms
|
|
2863
|
-
✓ src/__tests__/
|
|
2864
|
-
✓ src/__tests__/
|
|
2865
|
-
✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 7ms
|
|
3054
|
+
✓ src/delegation/__tests__/bitstring.test.ts (30 tests) 4ms
|
|
3055
|
+
✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 3ms
|
|
2866
3056
|
stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
|
|
2867
3057
|
[RemoteConfig] API returned 404: Not Found
|
|
2868
3058
|
|
|
2869
3059
|
stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
|
|
2870
3060
|
[RemoteConfig] Failed to fetch config: Error: Network error
|
|
2871
|
-
at /Users/
|
|
2872
|
-
at file:///Users/
|
|
2873
|
-
at file:///Users/
|
|
2874
|
-
at file:///Users/
|
|
3061
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
|
|
3062
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
3063
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
3064
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2875
3065
|
at new Promise (<anonymous>)
|
|
2876
|
-
at runWithTimeout (file:///Users/
|
|
2877
|
-
at
|
|
2878
|
-
at
|
|
2879
|
-
at
|
|
2880
|
-
at
|
|
3066
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
3067
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
3068
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
3069
|
+
at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
|
|
3070
|
+
at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
|
|
2881
3071
|
|
|
2882
3072
|
stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
|
|
2883
3073
|
[RemoteConfig] Neither projectId nor agentDid provided
|
|
2884
3074
|
|
|
2885
3075
|
stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
|
|
2886
3076
|
[RemoteConfig] Cache read failed: Error: Cache error
|
|
2887
|
-
at /Users/
|
|
2888
|
-
at file:///Users/
|
|
2889
|
-
at file:///Users/
|
|
2890
|
-
at file:///Users/
|
|
3077
|
+
at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
|
|
3078
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
|
|
3079
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
|
|
3080
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
|
|
2891
3081
|
at new Promise (<anonymous>)
|
|
2892
|
-
at runWithTimeout (file:///Users/
|
|
2893
|
-
at
|
|
2894
|
-
at
|
|
2895
|
-
at
|
|
2896
|
-
at
|
|
2897
|
-
|
|
2898
|
-
✓ src/config/__tests__/remote-config.spec.ts (9 tests)
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
✓ src/delegation/__tests__/
|
|
2903
|
-
✓ src/services/__tests__/
|
|
3082
|
+
at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
|
|
3083
|
+
at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
|
|
3084
|
+
at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
|
|
3085
|
+
at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
|
|
3086
|
+
at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
|
|
3087
|
+
|
|
3088
|
+
✓ src/config/__tests__/remote-config.spec.ts (9 tests) 10ms
|
|
3089
|
+
stderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
|
|
3090
|
+
[ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
|
|
3091
|
+
|
|
3092
|
+
✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 25ms
|
|
3093
|
+
✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 5ms
|
|
3094
|
+
✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 5ms
|
|
3095
|
+
✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 18ms
|
|
2904
3096
|
✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 3ms
|
|
2905
|
-
✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 4ms
|
|
2906
|
-
✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 4ms
|
|
2907
3097
|
stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
|
|
2908
3098
|
[ToolProtectionService] clearAndRefresh starting {
|
|
2909
3099
|
cacheKey: 'config:tool-protections:test-project-123',
|
|
@@ -2923,8 +3113,8 @@ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAn
|
|
|
2923
3113
|
}
|
|
2924
3114
|
|
|
2925
3115
|
stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add cache-busting query param when bypassCDNCache is true
|
|
2926
|
-
[ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/
|
|
2927
|
-
method: 'projects/{projectId}/
|
|
3116
|
+
[ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/config?_t=1764810255702 {
|
|
3117
|
+
method: 'projects/{projectId}/config (merged)',
|
|
2928
3118
|
projectId: 'test-project-123',
|
|
2929
3119
|
apiKeyPresent: true,
|
|
2930
3120
|
apiKeyLength: 12,
|
|
@@ -2932,8 +3122,8 @@ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAn
|
|
|
2932
3122
|
}
|
|
2933
3123
|
|
|
2934
3124
|
stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add Cache-Control headers when bypassCDNCache is true
|
|
2935
|
-
[ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/
|
|
2936
|
-
method: 'projects/{projectId}/
|
|
3125
|
+
[ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/config?_t=1764810255702 {
|
|
3126
|
+
method: 'projects/{projectId}/config (merged)',
|
|
2937
3127
|
projectId: 'test-project-123',
|
|
2938
3128
|
apiKeyPresent: true,
|
|
2939
3129
|
apiKeyLength: 12,
|
|
@@ -2941,8 +3131,8 @@ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAn
|
|
|
2941
3131
|
}
|
|
2942
3132
|
|
|
2943
3133
|
stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should NOT add cache-busting when bypassCDNCache is false/undefined
|
|
2944
|
-
[ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/
|
|
2945
|
-
method: 'projects/{projectId}/
|
|
3134
|
+
[ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/config {
|
|
3135
|
+
method: 'projects/{projectId}/config (merged)',
|
|
2946
3136
|
projectId: 'test-project-123',
|
|
2947
3137
|
apiKeyPresent: true,
|
|
2948
3138
|
apiKeyLength: 12,
|
|
@@ -2967,78 +3157,13 @@ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAn
|
|
|
2967
3157
|
source: 'api'
|
|
2968
3158
|
}
|
|
2969
3159
|
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
✓ src/__tests__/services/cache-busting.test.ts (5 tests) 5ms
|
|
2974
|
-
✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 4ms
|
|
2975
|
-
✓ src/utils/__tests__/did-helpers.test.ts (11 tests) 3ms
|
|
2976
|
-
✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 1ms
|
|
2977
|
-
✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 4ms
|
|
2978
|
-
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
|
|
2979
|
-
[ToolProtectionService] Config loaded from API {
|
|
2980
|
-
source: 'api',
|
|
2981
|
-
toolCount: 0,
|
|
2982
|
-
protectedTools: [],
|
|
2983
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2984
|
-
projectId: 'test-project-123',
|
|
2985
|
-
cacheTtlMs: 1000,
|
|
2986
|
-
cacheExpiresAt: '2025-11-26T15:36:47.421Z'
|
|
2987
|
-
}
|
|
2988
|
-
|
|
2989
|
-
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
|
|
2990
|
-
[ToolProtectionService] Config loaded from API {
|
|
2991
|
-
source: 'api',
|
|
2992
|
-
toolCount: 4,
|
|
2993
|
-
protectedTools: [ 'add_to_cart', 'checkout' ],
|
|
2994
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
2995
|
-
projectId: 'test-project-123',
|
|
2996
|
-
cacheTtlMs: 300000,
|
|
2997
|
-
cacheExpiresAt: '2025-11-26T15:41:46.421Z'
|
|
2998
|
-
}
|
|
2999
|
-
|
|
3000
|
-
stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
|
|
3001
|
-
[ToolProtectionService] API fetch failed, using fallback config {
|
|
3002
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
3003
|
-
error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
|
|
3004
|
-
}
|
|
3005
|
-
|
|
3006
|
-
stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
|
|
3007
|
-
[ToolProtectionService] Config loaded from API {
|
|
3008
|
-
source: 'api',
|
|
3009
|
-
toolCount: 1,
|
|
3010
|
-
protectedTools: [ 'tool1' ],
|
|
3011
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
3012
|
-
projectId: 'test-project-123',
|
|
3013
|
-
cacheTtlMs: 300000,
|
|
3014
|
-
cacheExpiresAt: '2025-11-26T15:41:46.422Z'
|
|
3015
|
-
}
|
|
3016
|
-
[ToolProtectionService] Config loaded from API {
|
|
3017
|
-
source: 'api',
|
|
3018
|
-
toolCount: 1,
|
|
3019
|
-
protectedTools: [ 'tool1' ],
|
|
3020
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
3021
|
-
projectId: 'test-project-123',
|
|
3022
|
-
cacheTtlMs: 300000,
|
|
3023
|
-
cacheExpiresAt: '2025-11-26T15:41:46.422Z'
|
|
3024
|
-
}
|
|
3025
|
-
[ToolProtectionService] Config loaded from API {
|
|
3026
|
-
source: 'api',
|
|
3027
|
-
toolCount: 1,
|
|
3028
|
-
protectedTools: [ 'tool1' ],
|
|
3029
|
-
agentDid: 'did:key:z6MkhaXgBZDv...',
|
|
3030
|
-
projectId: 'test-project-123',
|
|
3031
|
-
cacheTtlMs: 300000,
|
|
3032
|
-
cacheExpiresAt: '2025-11-26T15:41:46.422Z'
|
|
3033
|
-
}
|
|
3034
|
-
|
|
3035
|
-
✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1113ms
|
|
3036
|
-
✓ should respect cache TTL 1102ms
|
|
3160
|
+
✓ src/__tests__/services/cache-busting.test.ts (5 tests) 6ms
|
|
3161
|
+
✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 3ms
|
|
3037
3162
|
↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
|
|
3038
|
-
✓ src/__tests__/index.test.ts (4 tests)
|
|
3163
|
+
✓ src/__tests__/index.test.ts (4 tests) 3ms
|
|
3039
3164
|
|
|
3040
|
-
Test Files
|
|
3041
|
-
Tests
|
|
3042
|
-
Start at
|
|
3043
|
-
Duration
|
|
3165
|
+
Test Files 48 passed | 1 skipped (49)
|
|
3166
|
+
Tests 955 passed | 16 skipped (971)
|
|
3167
|
+
Start at 19:04:10
|
|
3168
|
+
Duration 5.41s (transform 6.92s, setup 0ms, import 15.31s, tests 2.88s, environment 3ms)
|
|
3044
3169
|
|