@oxdeai/conformance 1.3.1 → 2.0.0
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/CHANGELOG.md +88 -0
- package/LICENSE +213 -0
- package/README.md +217 -5
- package/dist/evidence-metadata.json +3489 -0
- package/dist/scripts/build-evidence-metadata.d.mts +1 -0
- package/dist/scripts/build-evidence-metadata.mjs +7 -0
- package/dist/scripts/build-evidence-metadata.mjs.map +1 -0
- package/dist/scripts/extract-vectors.js +228 -22
- package/dist/scripts/extract-vectors.js.map +1 -1
- package/dist/src/evidenceScope.d.mts +68 -0
- package/dist/src/evidenceScope.mjs +127 -0
- package/dist/src/evidenceScope.mjs.map +1 -0
- package/dist/src/fixtures/conformance-engine-secret.fixture.d.ts +5 -0
- package/dist/src/fixtures/conformance-engine-secret.fixture.js +7 -0
- package/dist/src/fixtures/conformance-engine-secret.fixture.js.map +1 -0
- package/dist/src/fixtures/ed25519.test-only.fixture.d.ts +1 -1
- package/dist/src/fixtures/ed25519.test-only.fixture.js +2 -1
- package/dist/src/fixtures/ed25519.test-only.fixture.js.map +1 -1
- package/dist/src/fixtures/krl-ed25519.test-only.fixture.d.ts +13 -0
- package/dist/src/fixtures/krl-ed25519.test-only.fixture.js +19 -0
- package/dist/src/fixtures/krl-ed25519.test-only.fixture.js.map +1 -0
- package/dist/src/trustedTimeConformance.d.ts +32 -0
- package/dist/src/trustedTimeConformance.js +484 -0
- package/dist/src/trustedTimeConformance.js.map +1 -0
- package/dist/src/validate-trusted-time.d.ts +1 -0
- package/dist/src/validate-trusted-time.js +14 -0
- package/dist/src/validate-trusted-time.js.map +1 -0
- package/dist/src/validate.d.ts +1 -0
- package/dist/src/validate.js +723 -31
- package/dist/src/validate.js.map +1 -1
- package/package.json +38 -8
- package/vectors/audit-chain.json +2 -2
- package/vectors/authorization-payload.json +46 -34
- package/vectors/authorization-signature-verification.json +39 -1
- package/vectors/authorization-verification.json +54 -1
- package/vectors/clock-semantics-verification.json +136 -0
- package/vectors/delegation-chain-verification.json +366 -0
- package/vectors/delegation-parent-hash.json +54 -0
- package/vectors/delegation-signature-verification.json +317 -0
- package/vectors/delegation-verification.json +252 -0
- package/vectors/envelope-verification.json +3 -3
- package/vectors/key-lifecycle-verification.json +131 -0
- package/vectors/profile-c-state-verification.json +217 -0
- package/vectors/signed-krl-verification.json +103 -0
- package/vectors/trusted-time.json +50 -0
- package/dist/extract-vectors.js +0 -416
- package/scripts/extract-vectors.ts +0 -466
- package/src/fixtures/README.md +0 -11
- package/src/fixtures/ed25519.test-only.fixture.ts +0 -14
- package/src/validate.ts +0 -828
- package/tsconfig.json +0 -14
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.3.0",
|
|
3
|
+
"description": "Conformance vectors for DelegationV1 Ed25519 signature verification path. Mirrors authorization-signature-verification.json. Artifacts generated programmatically using test key material.",
|
|
4
|
+
"vectors": [
|
|
5
|
+
{
|
|
6
|
+
"id": "delegation-sig-001",
|
|
7
|
+
"mode": "valid",
|
|
8
|
+
"description": "correctly signed delegation - full chain + signature verification passes",
|
|
9
|
+
"expected": {
|
|
10
|
+
"status": "ok",
|
|
11
|
+
"violations": []
|
|
12
|
+
},
|
|
13
|
+
"input": {
|
|
14
|
+
"parent": {
|
|
15
|
+
"auth_id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
16
|
+
"issuer": "oxdeai.policy-engine",
|
|
17
|
+
"audience": "parent-agent",
|
|
18
|
+
"intent_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
19
|
+
"state_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
20
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
21
|
+
"decision": "ALLOW",
|
|
22
|
+
"issued_at": 1000000,
|
|
23
|
+
"expiry": 1003000,
|
|
24
|
+
"kid": "2026-01",
|
|
25
|
+
"alg": "Ed25519",
|
|
26
|
+
"signature": "r2+gZu1GsLL4HpNAwD61IUTGax1C8GDADopFLgnr2ZCIjvlLZaob6kO5qnirYpgnJf+eF2YFj3zJNpw6RoVkCg=="
|
|
27
|
+
},
|
|
28
|
+
"delegation": {
|
|
29
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-c0nf0rm4nce",
|
|
30
|
+
"issuer": "parent-agent",
|
|
31
|
+
"audience": "child-agent",
|
|
32
|
+
"parent_auth_hash": "bc25c98576d0f7f7d674e7c3485cdce0597f7091a389b75a89daf831c649b80d",
|
|
33
|
+
"delegator": "parent-agent",
|
|
34
|
+
"delegatee": "child-agent",
|
|
35
|
+
"scope": {
|
|
36
|
+
"tools": [
|
|
37
|
+
"provision_gpu"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
41
|
+
"issued_at": 1000000,
|
|
42
|
+
"expiry": 1002000,
|
|
43
|
+
"alg": "Ed25519",
|
|
44
|
+
"kid": "2026-01",
|
|
45
|
+
"signature": "OKfqOEMyQpnd0HGwN8mMZTWMM84AOZvARgqM/ttrDCluAoROJxxPqN3Bhx5nsRt7uQYgM7FrOTXRh1ApowrFAQ=="
|
|
46
|
+
},
|
|
47
|
+
"opts": {
|
|
48
|
+
"now": 1001000,
|
|
49
|
+
"requireSignatureVerification": true,
|
|
50
|
+
"trustedKeySets": {
|
|
51
|
+
"issuer": "parent-agent",
|
|
52
|
+
"version": "1",
|
|
53
|
+
"keys": [
|
|
54
|
+
{
|
|
55
|
+
"kid": "2026-01",
|
|
56
|
+
"alg": "Ed25519",
|
|
57
|
+
"public_key": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAWiMMGTYK7zzHwZXLzDpCshxAH6Lgx8gVsJaixePuY7g=\n-----END PUBLIC KEY-----"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "delegation-sig-002",
|
|
66
|
+
"mode": "tampered-signature",
|
|
67
|
+
"description": "signature bytes corrupted after signing",
|
|
68
|
+
"expected": {
|
|
69
|
+
"status": "invalid",
|
|
70
|
+
"violations": [
|
|
71
|
+
{
|
|
72
|
+
"code": "DELEGATION_SIGNATURE_INVALID",
|
|
73
|
+
"message": "signature verification failed"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"input": {
|
|
78
|
+
"parent": {
|
|
79
|
+
"auth_id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
80
|
+
"issuer": "oxdeai.policy-engine",
|
|
81
|
+
"audience": "parent-agent",
|
|
82
|
+
"intent_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
83
|
+
"state_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
84
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
85
|
+
"decision": "ALLOW",
|
|
86
|
+
"issued_at": 1000000,
|
|
87
|
+
"expiry": 1003000,
|
|
88
|
+
"kid": "2026-01",
|
|
89
|
+
"alg": "Ed25519",
|
|
90
|
+
"signature": "r2+gZu1GsLL4HpNAwD61IUTGax1C8GDADopFLgnr2ZCIjvlLZaob6kO5qnirYpgnJf+eF2YFj3zJNpw6RoVkCg=="
|
|
91
|
+
},
|
|
92
|
+
"delegation": {
|
|
93
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-c0nf0rm4nce",
|
|
94
|
+
"issuer": "parent-agent",
|
|
95
|
+
"audience": "child-agent",
|
|
96
|
+
"parent_auth_hash": "bc25c98576d0f7f7d674e7c3485cdce0597f7091a389b75a89daf831c649b80d",
|
|
97
|
+
"delegator": "parent-agent",
|
|
98
|
+
"delegatee": "child-agent",
|
|
99
|
+
"scope": {
|
|
100
|
+
"tools": [
|
|
101
|
+
"provision_gpu"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
105
|
+
"issued_at": 1000000,
|
|
106
|
+
"expiry": 1002000,
|
|
107
|
+
"alg": "Ed25519",
|
|
108
|
+
"kid": "2026-01",
|
|
109
|
+
"signature": "OKfqOEMyQpnd0HGwN8mMZTWMM84AOZvARgqM/ttrDCluAoROJxxPqN3Bhx5nsRt7uQYgM7FrOTXRh1ApowrFAAAA"
|
|
110
|
+
},
|
|
111
|
+
"opts": {
|
|
112
|
+
"now": 1001000,
|
|
113
|
+
"requireSignatureVerification": true,
|
|
114
|
+
"trustedKeySets": {
|
|
115
|
+
"issuer": "parent-agent",
|
|
116
|
+
"version": "1",
|
|
117
|
+
"keys": [
|
|
118
|
+
{
|
|
119
|
+
"kid": "2026-01",
|
|
120
|
+
"alg": "Ed25519",
|
|
121
|
+
"public_key": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAWiMMGTYK7zzHwZXLzDpCshxAH6Lgx8gVsJaixePuY7g=\n-----END PUBLIC KEY-----"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "delegation-sig-003",
|
|
130
|
+
"mode": "wrong-kid",
|
|
131
|
+
"description": "kid references a key not present in trustedKeySets",
|
|
132
|
+
"expected": {
|
|
133
|
+
"status": "invalid",
|
|
134
|
+
"violations": [
|
|
135
|
+
{
|
|
136
|
+
"code": "DELEGATION_KID_UNKNOWN",
|
|
137
|
+
"message": "kid not found for issuer/alg"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
"input": {
|
|
142
|
+
"parent": {
|
|
143
|
+
"auth_id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
144
|
+
"issuer": "oxdeai.policy-engine",
|
|
145
|
+
"audience": "parent-agent",
|
|
146
|
+
"intent_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
147
|
+
"state_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
148
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
149
|
+
"decision": "ALLOW",
|
|
150
|
+
"issued_at": 1000000,
|
|
151
|
+
"expiry": 1003000,
|
|
152
|
+
"kid": "2026-01",
|
|
153
|
+
"alg": "Ed25519",
|
|
154
|
+
"signature": "r2+gZu1GsLL4HpNAwD61IUTGax1C8GDADopFLgnr2ZCIjvlLZaob6kO5qnirYpgnJf+eF2YFj3zJNpw6RoVkCg=="
|
|
155
|
+
},
|
|
156
|
+
"delegation": {
|
|
157
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-c0nf0rm4nce",
|
|
158
|
+
"issuer": "parent-agent",
|
|
159
|
+
"audience": "child-agent",
|
|
160
|
+
"parent_auth_hash": "bc25c98576d0f7f7d674e7c3485cdce0597f7091a389b75a89daf831c649b80d",
|
|
161
|
+
"delegator": "parent-agent",
|
|
162
|
+
"delegatee": "child-agent",
|
|
163
|
+
"scope": {
|
|
164
|
+
"tools": [
|
|
165
|
+
"provision_gpu"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
169
|
+
"issued_at": 1000000,
|
|
170
|
+
"expiry": 1002000,
|
|
171
|
+
"alg": "Ed25519",
|
|
172
|
+
"kid": "unknown-kid",
|
|
173
|
+
"signature": "OKfqOEMyQpnd0HGwN8mMZTWMM84AOZvARgqM/ttrDCluAoROJxxPqN3Bhx5nsRt7uQYgM7FrOTXRh1ApowrFAQ=="
|
|
174
|
+
},
|
|
175
|
+
"opts": {
|
|
176
|
+
"now": 1001000,
|
|
177
|
+
"requireSignatureVerification": true,
|
|
178
|
+
"trustedKeySets": {
|
|
179
|
+
"issuer": "parent-agent",
|
|
180
|
+
"version": "1",
|
|
181
|
+
"keys": [
|
|
182
|
+
{
|
|
183
|
+
"kid": "2026-01",
|
|
184
|
+
"alg": "Ed25519",
|
|
185
|
+
"public_key": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAWiMMGTYK7zzHwZXLzDpCshxAH6Lgx8gVsJaixePuY7g=\n-----END PUBLIC KEY-----"
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "delegation-sig-004",
|
|
194
|
+
"mode": "tampered-field",
|
|
195
|
+
"description": "a payload field (delegatee) mutated after signing - signature covers original",
|
|
196
|
+
"expected": {
|
|
197
|
+
"status": "invalid",
|
|
198
|
+
"violations": [
|
|
199
|
+
{
|
|
200
|
+
"code": "DELEGATION_SIGNATURE_INVALID",
|
|
201
|
+
"message": "signature verification failed"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
"input": {
|
|
206
|
+
"parent": {
|
|
207
|
+
"auth_id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
208
|
+
"issuer": "oxdeai.policy-engine",
|
|
209
|
+
"audience": "parent-agent",
|
|
210
|
+
"intent_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
211
|
+
"state_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
212
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
213
|
+
"decision": "ALLOW",
|
|
214
|
+
"issued_at": 1000000,
|
|
215
|
+
"expiry": 1003000,
|
|
216
|
+
"kid": "2026-01",
|
|
217
|
+
"alg": "Ed25519",
|
|
218
|
+
"signature": "r2+gZu1GsLL4HpNAwD61IUTGax1C8GDADopFLgnr2ZCIjvlLZaob6kO5qnirYpgnJf+eF2YFj3zJNpw6RoVkCg=="
|
|
219
|
+
},
|
|
220
|
+
"delegation": {
|
|
221
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-c0nf0rm4nce",
|
|
222
|
+
"issuer": "parent-agent",
|
|
223
|
+
"audience": "child-agent",
|
|
224
|
+
"parent_auth_hash": "bc25c98576d0f7f7d674e7c3485cdce0597f7091a389b75a89daf831c649b80d",
|
|
225
|
+
"delegator": "parent-agent",
|
|
226
|
+
"delegatee": "evil-agent",
|
|
227
|
+
"scope": {
|
|
228
|
+
"tools": [
|
|
229
|
+
"provision_gpu"
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
233
|
+
"issued_at": 1000000,
|
|
234
|
+
"expiry": 1002000,
|
|
235
|
+
"alg": "Ed25519",
|
|
236
|
+
"kid": "2026-01",
|
|
237
|
+
"signature": "OKfqOEMyQpnd0HGwN8mMZTWMM84AOZvARgqM/ttrDCluAoROJxxPqN3Bhx5nsRt7uQYgM7FrOTXRh1ApowrFAQ=="
|
|
238
|
+
},
|
|
239
|
+
"opts": {
|
|
240
|
+
"now": 1001000,
|
|
241
|
+
"requireSignatureVerification": true,
|
|
242
|
+
"trustedKeySets": {
|
|
243
|
+
"issuer": "parent-agent",
|
|
244
|
+
"version": "1",
|
|
245
|
+
"keys": [
|
|
246
|
+
{
|
|
247
|
+
"kid": "2026-01",
|
|
248
|
+
"alg": "Ed25519",
|
|
249
|
+
"public_key": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAWiMMGTYK7zzHwZXLzDpCshxAH6Lgx8gVsJaixePuY7g=\n-----END PUBLIC KEY-----"
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"id": "delegation-sig-005",
|
|
258
|
+
"mode": "expired",
|
|
259
|
+
"description": "correctly signed delegation whose expiry is in the past at verification time",
|
|
260
|
+
"expected": {
|
|
261
|
+
"status": "invalid",
|
|
262
|
+
"violations": [
|
|
263
|
+
{
|
|
264
|
+
"code": "DELEGATION_EXPIRED",
|
|
265
|
+
"message": "delegation has expired"
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
"input": {
|
|
270
|
+
"parent": {
|
|
271
|
+
"auth_id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
272
|
+
"issuer": "oxdeai.policy-engine",
|
|
273
|
+
"audience": "parent-agent",
|
|
274
|
+
"intent_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
275
|
+
"state_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
276
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
277
|
+
"decision": "ALLOW",
|
|
278
|
+
"issued_at": 1000000,
|
|
279
|
+
"expiry": 1003000,
|
|
280
|
+
"kid": "2026-01",
|
|
281
|
+
"alg": "Ed25519",
|
|
282
|
+
"signature": "r2+gZu1GsLL4HpNAwD61IUTGax1C8GDADopFLgnr2ZCIjvlLZaob6kO5qnirYpgnJf+eF2YFj3zJNpw6RoVkCg=="
|
|
283
|
+
},
|
|
284
|
+
"delegation": {
|
|
285
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-exp1r3d00000",
|
|
286
|
+
"issuer": "parent-agent",
|
|
287
|
+
"audience": "child-agent",
|
|
288
|
+
"parent_auth_hash": "bc25c98576d0f7f7d674e7c3485cdce0597f7091a389b75a89daf831c649b80d",
|
|
289
|
+
"delegator": "parent-agent",
|
|
290
|
+
"delegatee": "child-agent",
|
|
291
|
+
"scope": {},
|
|
292
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
293
|
+
"issued_at": 1000000,
|
|
294
|
+
"expiry": 1000999,
|
|
295
|
+
"alg": "Ed25519",
|
|
296
|
+
"kid": "2026-01",
|
|
297
|
+
"signature": "kZVhvVrd3yqR5m1eTT/xAyMFR+PXe3ZdApv8870f2wMhNooXpzFDfuO7WYbpBJmRc/LVLrT2bP1fBFW9fv4GAw=="
|
|
298
|
+
},
|
|
299
|
+
"opts": {
|
|
300
|
+
"now": 1001000,
|
|
301
|
+
"requireSignatureVerification": true,
|
|
302
|
+
"trustedKeySets": {
|
|
303
|
+
"issuer": "parent-agent",
|
|
304
|
+
"version": "1",
|
|
305
|
+
"keys": [
|
|
306
|
+
{
|
|
307
|
+
"kid": "2026-01",
|
|
308
|
+
"alg": "Ed25519",
|
|
309
|
+
"public_key": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAWiMMGTYK7zzHwZXLzDpCshxAH6Lgx8gVsJaixePuY7g=\n-----END PUBLIC KEY-----"
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.3.0",
|
|
3
|
+
"description": "Conformance vectors for verifyDelegation() - isolated delegation artifact checks without chain resolution.",
|
|
4
|
+
"vectors": [
|
|
5
|
+
{
|
|
6
|
+
"id": "delegation-verify-001",
|
|
7
|
+
"description": "valid delegation - no signature check, correct fields, not expired",
|
|
8
|
+
"input": {
|
|
9
|
+
"delegation": {
|
|
10
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000001",
|
|
11
|
+
"issuer": "parent-agent",
|
|
12
|
+
"audience": "child-agent",
|
|
13
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
14
|
+
"delegator": "parent-agent",
|
|
15
|
+
"delegatee": "child-agent",
|
|
16
|
+
"scope": {},
|
|
17
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
18
|
+
"issued_at": 1000000,
|
|
19
|
+
"expiry": 1002000,
|
|
20
|
+
"alg": "Ed25519",
|
|
21
|
+
"kid": "2026-01",
|
|
22
|
+
"signature": "placeholder"
|
|
23
|
+
},
|
|
24
|
+
"opts": { "now": 1001000 }
|
|
25
|
+
},
|
|
26
|
+
"expected": { "status": "ok", "violations": [] }
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "delegation-verify-002",
|
|
30
|
+
"description": "expired delegation - expiry < now",
|
|
31
|
+
"input": {
|
|
32
|
+
"delegation": {
|
|
33
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000002",
|
|
34
|
+
"issuer": "parent-agent",
|
|
35
|
+
"audience": "child-agent",
|
|
36
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
37
|
+
"delegator": "parent-agent",
|
|
38
|
+
"delegatee": "child-agent",
|
|
39
|
+
"scope": {},
|
|
40
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
41
|
+
"issued_at": 1000000,
|
|
42
|
+
"expiry": 1000999,
|
|
43
|
+
"alg": "Ed25519",
|
|
44
|
+
"kid": "2026-01",
|
|
45
|
+
"signature": "placeholder"
|
|
46
|
+
},
|
|
47
|
+
"opts": { "now": 1001000 }
|
|
48
|
+
},
|
|
49
|
+
"expected": {
|
|
50
|
+
"status": "invalid",
|
|
51
|
+
"violations": [{ "code": "DELEGATION_EXPIRED", "message": "delegation has expired" }]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "delegation-verify-003",
|
|
56
|
+
"description": "expiry === now - boundary: expired (now >= expiry)",
|
|
57
|
+
"input": {
|
|
58
|
+
"delegation": {
|
|
59
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000003",
|
|
60
|
+
"issuer": "parent-agent",
|
|
61
|
+
"audience": "child-agent",
|
|
62
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
63
|
+
"delegator": "parent-agent",
|
|
64
|
+
"delegatee": "child-agent",
|
|
65
|
+
"scope": {},
|
|
66
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
67
|
+
"issued_at": 1000000,
|
|
68
|
+
"expiry": 1001000,
|
|
69
|
+
"alg": "Ed25519",
|
|
70
|
+
"kid": "2026-01",
|
|
71
|
+
"signature": "placeholder"
|
|
72
|
+
},
|
|
73
|
+
"opts": { "now": 1001000 }
|
|
74
|
+
},
|
|
75
|
+
"expected": {
|
|
76
|
+
"status": "invalid",
|
|
77
|
+
"violations": [{ "code": "DELEGATION_EXPIRED", "message": "delegation has expired" }]
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "delegation-verify-004",
|
|
82
|
+
"description": "missing required field - delegation_id empty",
|
|
83
|
+
"input": {
|
|
84
|
+
"delegation": {
|
|
85
|
+
"delegation_id": "",
|
|
86
|
+
"issuer": "parent-agent",
|
|
87
|
+
"audience": "child-agent",
|
|
88
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
89
|
+
"delegator": "parent-agent",
|
|
90
|
+
"delegatee": "child-agent",
|
|
91
|
+
"scope": {},
|
|
92
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
93
|
+
"issued_at": 1000000,
|
|
94
|
+
"expiry": 1002000,
|
|
95
|
+
"alg": "Ed25519",
|
|
96
|
+
"kid": "2026-01",
|
|
97
|
+
"signature": "placeholder"
|
|
98
|
+
},
|
|
99
|
+
"opts": { "now": 1001000 }
|
|
100
|
+
},
|
|
101
|
+
"expected": {
|
|
102
|
+
"status": "invalid",
|
|
103
|
+
"violations": [{ "code": "DELEGATION_MISSING_FIELD", "message": "delegation_id is required" }]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "delegation-verify-005",
|
|
108
|
+
"description": "scope.tools violation - child requests tool not in parent scope",
|
|
109
|
+
"input": {
|
|
110
|
+
"delegation": {
|
|
111
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000005",
|
|
112
|
+
"issuer": "parent-agent",
|
|
113
|
+
"audience": "child-agent",
|
|
114
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
115
|
+
"delegator": "parent-agent",
|
|
116
|
+
"delegatee": "child-agent",
|
|
117
|
+
"scope": { "tools": ["query_db", "provision_gpu"] },
|
|
118
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
119
|
+
"issued_at": 1000000,
|
|
120
|
+
"expiry": 1002000,
|
|
121
|
+
"alg": "Ed25519",
|
|
122
|
+
"kid": "2026-01",
|
|
123
|
+
"signature": "placeholder"
|
|
124
|
+
},
|
|
125
|
+
"opts": {
|
|
126
|
+
"now": 1001000,
|
|
127
|
+
"parentScope": { "tools": ["provision_gpu"] }
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"expected": {
|
|
131
|
+
"status": "invalid",
|
|
132
|
+
"violations": [{ "code": "DELEGATION_SCOPE_VIOLATION", "message": "scope.tools contains tools not in parent: query_db" }]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "delegation-verify-006",
|
|
137
|
+
"description": "scope.max_amount violation - child max_amount exceeds parent",
|
|
138
|
+
"input": {
|
|
139
|
+
"delegation": {
|
|
140
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000006",
|
|
141
|
+
"issuer": "parent-agent",
|
|
142
|
+
"audience": "child-agent",
|
|
143
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
144
|
+
"delegator": "parent-agent",
|
|
145
|
+
"delegatee": "child-agent",
|
|
146
|
+
"scope": { "max_amount": "500" },
|
|
147
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
148
|
+
"issued_at": 1000000,
|
|
149
|
+
"expiry": 1002000,
|
|
150
|
+
"alg": "Ed25519",
|
|
151
|
+
"kid": "2026-01",
|
|
152
|
+
"signature": "placeholder"
|
|
153
|
+
},
|
|
154
|
+
"opts": {
|
|
155
|
+
"now": 1001000,
|
|
156
|
+
"parentScope": { "max_amount": "300" }
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"expected": {
|
|
160
|
+
"status": "invalid",
|
|
161
|
+
"violations": [{ "code": "DELEGATION_SCOPE_VIOLATION", "message": "scope.max_amount 500 exceeds parent max_amount 300" }]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "delegation-verify-007",
|
|
166
|
+
"description": "delegatee mismatch - expectedDelegatee does not match delegation.delegatee",
|
|
167
|
+
"input": {
|
|
168
|
+
"delegation": {
|
|
169
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000007",
|
|
170
|
+
"issuer": "parent-agent",
|
|
171
|
+
"audience": "child-agent",
|
|
172
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
173
|
+
"delegator": "parent-agent",
|
|
174
|
+
"delegatee": "child-agent",
|
|
175
|
+
"scope": {},
|
|
176
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
177
|
+
"issued_at": 1000000,
|
|
178
|
+
"expiry": 1002000,
|
|
179
|
+
"alg": "Ed25519",
|
|
180
|
+
"kid": "2026-01",
|
|
181
|
+
"signature": "placeholder"
|
|
182
|
+
},
|
|
183
|
+
"opts": {
|
|
184
|
+
"now": 1001000,
|
|
185
|
+
"expectedDelegatee": "other-agent"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"expected": {
|
|
189
|
+
"status": "invalid",
|
|
190
|
+
"violations": [{ "code": "DELEGATION_AUDIENCE_MISMATCH", "message": "delegatee does not match expectedDelegatee" }]
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "delegation-verify-008",
|
|
195
|
+
"description": "replay - delegation_id already present in consumedDelegationIds",
|
|
196
|
+
"input": {
|
|
197
|
+
"delegation": {
|
|
198
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000008",
|
|
199
|
+
"issuer": "parent-agent",
|
|
200
|
+
"audience": "child-agent",
|
|
201
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
202
|
+
"delegator": "parent-agent",
|
|
203
|
+
"delegatee": "child-agent",
|
|
204
|
+
"scope": {},
|
|
205
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
206
|
+
"issued_at": 1000000,
|
|
207
|
+
"expiry": 1002000,
|
|
208
|
+
"alg": "Ed25519",
|
|
209
|
+
"kid": "2026-01",
|
|
210
|
+
"signature": "placeholder"
|
|
211
|
+
},
|
|
212
|
+
"opts": {
|
|
213
|
+
"now": 1001000,
|
|
214
|
+
"consumedDelegationIds": ["d1d1d1d1-0000-0000-0000-000000000008"]
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"expected": {
|
|
218
|
+
"status": "invalid",
|
|
219
|
+
"violations": [{ "code": "DELEGATION_REPLAY", "message": "delegation_id has already been consumed" }]
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "delegation-verify-009",
|
|
224
|
+
"description": "requireSignatureVerification with no trustedKeySets → DELEGATION_TRUST_MISSING",
|
|
225
|
+
"input": {
|
|
226
|
+
"delegation": {
|
|
227
|
+
"delegation_id": "d1d1d1d1-0000-0000-0000-000000000009",
|
|
228
|
+
"issuer": "parent-agent",
|
|
229
|
+
"audience": "child-agent",
|
|
230
|
+
"parent_auth_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
231
|
+
"delegator": "parent-agent",
|
|
232
|
+
"delegatee": "child-agent",
|
|
233
|
+
"scope": {},
|
|
234
|
+
"policy_id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
235
|
+
"issued_at": 1000000,
|
|
236
|
+
"expiry": 1002000,
|
|
237
|
+
"alg": "Ed25519",
|
|
238
|
+
"kid": "2026-01",
|
|
239
|
+
"signature": "placeholder"
|
|
240
|
+
},
|
|
241
|
+
"opts": {
|
|
242
|
+
"now": 1001000,
|
|
243
|
+
"requireSignatureVerification": true
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"expected": {
|
|
247
|
+
"status": "invalid",
|
|
248
|
+
"violations": [{ "code": "DELEGATION_TRUST_MISSING", "message": "trustedKeySets required for Ed25519 verification" }]
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"expected": {
|
|
8
8
|
"status": "ok",
|
|
9
9
|
"policyId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
10
|
-
"stateHash": "
|
|
11
|
-
"auditHeadHash": "
|
|
10
|
+
"stateHash": "af9020dcf23b68ca00ae29a5b1371d892763e0a49fe07866fbdba88b0b2f56a8",
|
|
11
|
+
"auditHeadHash": "ae47035e849bbc046bd17489186ad3b899edb170ad1cedcee01ad0dcdb25b409",
|
|
12
12
|
"violations": []
|
|
13
13
|
}
|
|
14
14
|
},
|
|
@@ -75,4 +75,4 @@
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
|
-
}
|
|
78
|
+
}
|