Skip to content

Commit

Permalink
fix credentialing field ordering and related singlesig-vlei-issuance …
Browse files Browse the repository at this point in the history
…test (#254)

* testing again vlei verification service

Signed-off-by: 2byrds <[email protected]>

* Fixes for cd '/Users/meenyleeny/VSCode/signify-ts'

Signed-off-by: 2byrds <[email protected]>

* make signedFetch generic so the caller can control contentType and data. This is a breaking change

Signed-off-by: 2byrds <[email protected]>

* CI/CD can't run the vlei verification integration test, so commenting out

Signed-off-by: 2byrds <[email protected]>

* CI/CD can't run the vlei verification integration test, so commenting out

Signed-off-by: 2byrds <[email protected]>

* formatting fixes

Signed-off-by: 2byrds <[email protected]>

* prettier formatting fixes

Signed-off-by: 2byrds <[email protected]>

* Align signedFetch with fetch api.

Signed-off-by: 2byrds <[email protected]>

* improved reliability of singlesig-vlei-issuance with retries

Signed-off-by: 2byrds <[email protected]>

* restore original package-lock.json

Signed-off-by: 2byrds <[email protected]>

* prettier formatting

Signed-off-by: 2byrds <[email protected]>

* removed unnecessary imports

Signed-off-by: 2byrds <[email protected]>

* even prettier formatting

Signed-off-by: 2byrds <[email protected]>

* fixed signedFetch documentation

Signed-off-by: 2byrds <[email protected]>

* set retry options

Signed-off-by: 2byrds <[email protected]>

* format code

Signed-off-by: 2byrds <[email protected]>

* restore asserts

Signed-off-by: 2byrds <[email protected]>

* restore asserts

Signed-off-by: 2byrds <[email protected]>

* better naming

Signed-off-by: 2byrds <[email protected]>

* restore check

Signed-off-by: 2byrds <[email protected]>

* removed unnecessary re-ordering

Signed-off-by: 2byrds <[email protected]>

* separating pr functionality

Signed-off-by: 2byrds <[email protected]>

* separating pr functionality

Signed-off-by: 2byrds <[email protected]>

---------

Signed-off-by: 2byrds <[email protected]>
  • Loading branch information
2byrds committed May 8, 2024
1 parent 651bad6 commit 2b6a2fd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
28 changes: 21 additions & 7 deletions examples/integration-scripts/singlesig-vlei-issuance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ const ECR_AUTH_RULES = Saider.saidify({
const OOR_RULES = LE_RULES;
const OOR_AUTH_RULES = LE_RULES;

const CRED_RETRY_DEFAULTS = {
maxSleep: 1000,
minSleep: 10,
maxRetries: 5,
timeout: 10000,
};

interface Aid {
name: string;
prefix: string;
Expand Down Expand Up @@ -193,8 +200,9 @@ test('singlesig-vlei-issuance', async function run() {
const cred = await getGrantedCredential(qviClient, qviCred.sad.d);
assert(cred !== undefined);
return cred;
});
}, CRED_RETRY_DEFAULTS);
}

assert.equal(qviCredHolder.sad.d, qviCred.sad.d);
assert.equal(qviCredHolder.sad.s, QVI_SCHEMA_SAID);
assert.equal(qviCredHolder.sad.i, gleifAid.prefix);
Expand Down Expand Up @@ -232,8 +240,9 @@ test('singlesig-vlei-issuance', async function run() {
const cred = await getGrantedCredential(leClient, leCred.sad.d);
assert(cred !== undefined);
return cred;
});
}, CRED_RETRY_DEFAULTS);
}

assert.equal(leCredHolder.sad.d, leCred.sad.d);
assert.equal(leCredHolder.sad.s, LE_SCHEMA_SAID);
assert.equal(leCredHolder.sad.i, qviAid.prefix);
Expand Down Expand Up @@ -273,8 +282,9 @@ test('singlesig-vlei-issuance', async function run() {
const cred = await getGrantedCredential(roleClient, ecrCred.sad.d);
assert(cred !== undefined);
return cred;
});
}, CRED_RETRY_DEFAULTS);
}

assert.equal(ecrCredHolder.sad.d, ecrCred.sad.d);
assert.equal(ecrCredHolder.sad.s, ECR_SCHEMA_SAID);
assert.equal(ecrCredHolder.sad.i, leAid.prefix);
Expand Down Expand Up @@ -320,8 +330,9 @@ test('singlesig-vlei-issuance', async function run() {
);
assert(cred !== undefined);
return cred;
});
}, CRED_RETRY_DEFAULTS);
}

assert.equal(ecrAuthCredHolder.sad.d, ecrAuthCred.sad.d);
assert.equal(ecrAuthCredHolder.sad.s, ECR_AUTH_SCHEMA_SAID);
assert.equal(ecrAuthCredHolder.sad.i, leAid.prefix);
Expand Down Expand Up @@ -363,8 +374,9 @@ test('singlesig-vlei-issuance', async function run() {
const cred = await getGrantedCredential(roleClient, ecrCred2.sad.d);
assert(cred !== undefined);
return cred;
});
}, CRED_RETRY_DEFAULTS);
}

assert.equal(ecrCredHolder2.sad.d, ecrCred2.sad.d);
assert.equal(ecrCredHolder2.sad.s, ECR_SCHEMA_SAID);
assert.equal(ecrCredHolder2.sad.i, qviAid.prefix);
Expand Down Expand Up @@ -409,8 +421,9 @@ test('singlesig-vlei-issuance', async function run() {
);
assert(cred !== undefined);
return cred;
});
}, CRED_RETRY_DEFAULTS);
}

assert.equal(oorAuthCredHolder.sad.d, oorAuthCred.sad.d);
assert.equal(oorAuthCredHolder.sad.s, OOR_AUTH_SCHEMA_SAID);
assert.equal(oorAuthCredHolder.sad.i, leAid.prefix);
Expand Down Expand Up @@ -451,8 +464,9 @@ test('singlesig-vlei-issuance', async function run() {
const cred = await getGrantedCredential(roleClient, oorCred.sad.d);
assert(cred !== undefined);
return cred;
});
}, CRED_RETRY_DEFAULTS);
}

assert.equal(oorCredHolder.sad.d, oorCred.sad.d);
assert.equal(oorCredHolder.sad.s, OOR_SCHEMA_SAID);
assert.equal(oorCredHolder.sad.i, qviAid.prefix);
Expand Down
6 changes: 5 additions & 1 deletion src/keri/app/credentialing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,13 @@ export class Credentials {
const [, acdc] = Saider.saidify({
v: versify(Ident.ACDC, undefined, Serials.JSON, 0),
d: '',
u: args.u,
i: args.i ?? hab.prefix,
...args,
ri: args.ri,
s: args.s,
a: subject,
e: args.e,
r: args.r,
});

const [, iss] = Saider.saidify({
Expand Down

0 comments on commit 2b6a2fd

Please sign in to comment.