Skip to content

Commit 2b6a2fd

Browse files
authored
fix credentialing field ordering and related singlesig-vlei-issuance test (#254)
* testing again vlei verification service Signed-off-by: 2byrds <2byrds@gmail.com> * Fixes for cd '/Users/meenyleeny/VSCode/signify-ts' Signed-off-by: 2byrds <2byrds@gmail.com> * make signedFetch generic so the caller can control contentType and data. This is a breaking change Signed-off-by: 2byrds <2byrds@gmail.com> * CI/CD can't run the vlei verification integration test, so commenting out Signed-off-by: 2byrds <2byrds@gmail.com> * CI/CD can't run the vlei verification integration test, so commenting out Signed-off-by: 2byrds <2byrds@gmail.com> * formatting fixes Signed-off-by: 2byrds <2byrds@gmail.com> * prettier formatting fixes Signed-off-by: 2byrds <2byrds@gmail.com> * Align signedFetch with fetch api. Signed-off-by: 2byrds <2byrds@gmail.com> * improved reliability of singlesig-vlei-issuance with retries Signed-off-by: 2byrds <2byrds@gmail.com> * restore original package-lock.json Signed-off-by: 2byrds <2byrds@gmail.com> * prettier formatting Signed-off-by: 2byrds <2byrds@gmail.com> * removed unnecessary imports Signed-off-by: 2byrds <2byrds@gmail.com> * even prettier formatting Signed-off-by: 2byrds <2byrds@gmail.com> * fixed signedFetch documentation Signed-off-by: 2byrds <2byrds@gmail.com> * set retry options Signed-off-by: 2byrds <2byrds@gmail.com> * format code Signed-off-by: 2byrds <2byrds@gmail.com> * restore asserts Signed-off-by: 2byrds <2byrds@gmail.com> * restore asserts Signed-off-by: 2byrds <2byrds@gmail.com> * better naming Signed-off-by: 2byrds <2byrds@gmail.com> * restore check Signed-off-by: 2byrds <2byrds@gmail.com> * removed unnecessary re-ordering Signed-off-by: 2byrds <2byrds@gmail.com> * separating pr functionality Signed-off-by: 2byrds <2byrds@gmail.com> * separating pr functionality Signed-off-by: 2byrds <2byrds@gmail.com> --------- Signed-off-by: 2byrds <2byrds@gmail.com>
1 parent 651bad6 commit 2b6a2fd

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

examples/integration-scripts/singlesig-vlei-issuance.test.ts

+21-7
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ const ECR_AUTH_RULES = Saider.saidify({
106106
const OOR_RULES = LE_RULES;
107107
const OOR_AUTH_RULES = LE_RULES;
108108

109+
const CRED_RETRY_DEFAULTS = {
110+
maxSleep: 1000,
111+
minSleep: 10,
112+
maxRetries: 5,
113+
timeout: 10000,
114+
};
115+
109116
interface Aid {
110117
name: string;
111118
prefix: string;
@@ -193,8 +200,9 @@ test('singlesig-vlei-issuance', async function run() {
193200
const cred = await getGrantedCredential(qviClient, qviCred.sad.d);
194201
assert(cred !== undefined);
195202
return cred;
196-
});
203+
}, CRED_RETRY_DEFAULTS);
197204
}
205+
198206
assert.equal(qviCredHolder.sad.d, qviCred.sad.d);
199207
assert.equal(qviCredHolder.sad.s, QVI_SCHEMA_SAID);
200208
assert.equal(qviCredHolder.sad.i, gleifAid.prefix);
@@ -232,8 +240,9 @@ test('singlesig-vlei-issuance', async function run() {
232240
const cred = await getGrantedCredential(leClient, leCred.sad.d);
233241
assert(cred !== undefined);
234242
return cred;
235-
});
243+
}, CRED_RETRY_DEFAULTS);
236244
}
245+
237246
assert.equal(leCredHolder.sad.d, leCred.sad.d);
238247
assert.equal(leCredHolder.sad.s, LE_SCHEMA_SAID);
239248
assert.equal(leCredHolder.sad.i, qviAid.prefix);
@@ -273,8 +282,9 @@ test('singlesig-vlei-issuance', async function run() {
273282
const cred = await getGrantedCredential(roleClient, ecrCred.sad.d);
274283
assert(cred !== undefined);
275284
return cred;
276-
});
285+
}, CRED_RETRY_DEFAULTS);
277286
}
287+
278288
assert.equal(ecrCredHolder.sad.d, ecrCred.sad.d);
279289
assert.equal(ecrCredHolder.sad.s, ECR_SCHEMA_SAID);
280290
assert.equal(ecrCredHolder.sad.i, leAid.prefix);
@@ -320,8 +330,9 @@ test('singlesig-vlei-issuance', async function run() {
320330
);
321331
assert(cred !== undefined);
322332
return cred;
323-
});
333+
}, CRED_RETRY_DEFAULTS);
324334
}
335+
325336
assert.equal(ecrAuthCredHolder.sad.d, ecrAuthCred.sad.d);
326337
assert.equal(ecrAuthCredHolder.sad.s, ECR_AUTH_SCHEMA_SAID);
327338
assert.equal(ecrAuthCredHolder.sad.i, leAid.prefix);
@@ -363,8 +374,9 @@ test('singlesig-vlei-issuance', async function run() {
363374
const cred = await getGrantedCredential(roleClient, ecrCred2.sad.d);
364375
assert(cred !== undefined);
365376
return cred;
366-
});
377+
}, CRED_RETRY_DEFAULTS);
367378
}
379+
368380
assert.equal(ecrCredHolder2.sad.d, ecrCred2.sad.d);
369381
assert.equal(ecrCredHolder2.sad.s, ECR_SCHEMA_SAID);
370382
assert.equal(ecrCredHolder2.sad.i, qviAid.prefix);
@@ -409,8 +421,9 @@ test('singlesig-vlei-issuance', async function run() {
409421
);
410422
assert(cred !== undefined);
411423
return cred;
412-
});
424+
}, CRED_RETRY_DEFAULTS);
413425
}
426+
414427
assert.equal(oorAuthCredHolder.sad.d, oorAuthCred.sad.d);
415428
assert.equal(oorAuthCredHolder.sad.s, OOR_AUTH_SCHEMA_SAID);
416429
assert.equal(oorAuthCredHolder.sad.i, leAid.prefix);
@@ -451,8 +464,9 @@ test('singlesig-vlei-issuance', async function run() {
451464
const cred = await getGrantedCredential(roleClient, oorCred.sad.d);
452465
assert(cred !== undefined);
453466
return cred;
454-
});
467+
}, CRED_RETRY_DEFAULTS);
455468
}
469+
456470
assert.equal(oorCredHolder.sad.d, oorCred.sad.d);
457471
assert.equal(oorCredHolder.sad.s, OOR_SCHEMA_SAID);
458472
assert.equal(oorCredHolder.sad.i, qviAid.prefix);

src/keri/app/credentialing.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,13 @@ export class Credentials {
211211
const [, acdc] = Saider.saidify({
212212
v: versify(Ident.ACDC, undefined, Serials.JSON, 0),
213213
d: '',
214+
u: args.u,
214215
i: args.i ?? hab.prefix,
215-
...args,
216+
ri: args.ri,
217+
s: args.s,
216218
a: subject,
219+
e: args.e,
220+
r: args.r,
217221
});
218222

219223
const [, iss] = Saider.saidify({

0 commit comments

Comments
 (0)