Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/submit #270

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
532d5b6
testing delegation and deployed services
2byrds May 29, 2024
50c5fd6
tested delegation endpoint
2byrds Jun 4, 2024
17037bc
successful single and multisig delegation
2byrds Jun 6, 2024
a6b77c8
fixed local test-setup run with latest keria
2byrds Jun 6, 2024
931c934
fixed salty log event ked/serder creation
2byrds Jun 8, 2024
b1db802
with keripy multiplexor parser using local=True, getting to delegatee…
2byrds Jun 11, 2024
1b86f43
small salty test fixes and updates del-multisig to notify
2byrds Jun 13, 2024
493eb6c
fixes for keripy/keria updates to exn w/ rp field
2byrds Jun 13, 2024
df700ac
del multisig w/o witnesses success
2byrds Jun 13, 2024
2cf38cf
added back witnesses for delegated multisig successful integration test
2byrds Jun 13, 2024
6ead09e
multisig-vlei-issuance successful integration test
2byrds Jun 13, 2024
badc2b4
updated digest in test per Serder changes
2byrds Jun 14, 2024
2c889ea
revert local test changes
2byrds Jun 14, 2024
619e76b
remove comments, etc
2byrds Jun 14, 2024
d6062c8
small fix depending on env
2byrds Jun 14, 2024
d8fb5b9
prettier
2byrds Jun 14, 2024
23158fa
making multisig methods available for other tests
2byrds Jun 14, 2024
aa6ca23
fix docker digest
2byrds Jun 14, 2024
eda9bad
fix docker keria health check
2byrds Jun 14, 2024
b7de398
prettier and audit fix
2byrds Jun 14, 2024
ba44f33
some test utility consolidation but a new issue should be created
2byrds Jun 14, 2024
c5968a8
prettier
2byrds Jun 14, 2024
63c473d
fix syntax
2byrds Jun 14, 2024
723c60a
prettier
2byrds Jun 16, 2024
aed163c
Fix naming
2byrds Jun 17, 2024
4bb8503
prettier
2byrds Jun 17, 2024
81edfb1
testing submit_id with unrealeased keria
2byrds Jun 19, 2024
09926eb
need to fix operation to monitor cue instead of db
2byrds Jun 21, 2024
44d9078
Merge branch 'WebOfTrust:main' into fix/test_del_rot_multisig_more
2byrds Jun 21, 2024
d3def41
updated docker-compose.yaml with entrypoint override for keria
2byrds Jun 22, 2024
fd4edef
Merge branch 'fix/test_del_rot_multisig_more' into feat/submit_id
2byrds Jun 22, 2024
1578cc6
updates to witness integration test to submit single sig and registry
2byrds Jul 1, 2024
daad177
started integration testing re-submit feature for qvi multisig vlei KEL
2byrds Jul 5, 2024
87fb71b
restored original test-setup-single-client.test
2byrds Jul 16, 2024
2778070
merged latest
2byrds Jul 16, 2024
444a6f7
restoring original keria docker-compose version string
2byrds Jul 16, 2024
139d028
simplify admitSingleSig call
2byrds Jul 16, 2024
19240dd
bump version to 0.3.0 to signal breaking change with previous 0.1.x k…
2byrds Jul 16, 2024
e884277
fixed ixn url
2byrds Jul 16, 2024
3368475
merged latest
2byrds Jul 16, 2024
545abe5
prettier
2byrds Jul 16, 2024
d467f59
fix npm audit issue with mermaid-js with override
2byrds Jul 16, 2024
114a2b1
restore eslint, etc
2byrds Jul 16, 2024
76fd97d
using constants
2byrds Jul 17, 2024
682ebcc
revert package-lock.json to original with minimal audit fixes
2byrds Jul 17, 2024
bd43e40
specify the keria version
2byrds Jul 17, 2024
8b6acf8
adding test coverage for delegation approval
2byrds Jul 17, 2024
8600ead
unit test coverage for delegation approval
2byrds Jul 17, 2024
cd5325f
prettier
2byrds Jul 17, 2024
3697243
merged latest
2byrds Jul 18, 2024
1dd5ea3
refactor temporary integration test submit
2byrds Jul 18, 2024
128651d
Merge branch 'main' into feat/submit_id
2byrds Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/witness-demo/wan.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"curls": ["tcp://witness-demo:5632/", "http://witness-demo:5642/"]
},
"iurls": []
}
}
2 changes: 1 addition & 1 deletion config/witness-demo/wes.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": []
}
}
2 changes: 1 addition & 1 deletion config/witness-demo/wil.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": []
}
}
2 changes: 1 addition & 1 deletion config/witness-demo/wit.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": []
}
}
2 changes: 1 addition & 1 deletion config/witness-demo/wub.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": []
}
}
2 changes: 1 addition & 1 deletion config/witness-demo/wyz.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": []
}
}
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ services:
depends_on:
vlei-server:
condition: service_healthy
keria:
condition: service_healthy
# keria:
# condition: service_healthy
witness-demo:
condition: service_healthy
25 changes: 24 additions & 1 deletion examples/integration-scripts/credentials.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,28 @@ test('single signature credentials', async () => {
return updateRegistry;
});

// await step('Resubmit identity to witnesses', async () => {
// const subResult = await issuerClient
// .identifiers().submit({ name: issuerAid.name });

// await waitOperation(issuerClient, await subResult.op());
// let registries = await issuerClient.registries().list(issuerAid.name);
// const registry: { name: string; regk: string } = registries[0];
// assert.equal(registries.length, 1);
// assert.equal(registry.name, registryName);

// await issuerClient
// .registries()
// .rename(issuerAid.name, registryName, updatedRegistryName);

// registries = await issuerClient.registries().list(issuerAid.name);
// let updateRegistry: { name: string; regk: string } = registries[0];
// assert.equal(registries.length, 1);
// assert.equal(updateRegistry.name, updatedRegistryName);

// return updateRegistry;
// });

await step('issuer can get schemas', async () => {
const issuerQviSchema = await issuerClient
.schemas()
Expand Down Expand Up @@ -262,6 +284,7 @@ test('single signature credentials', async () => {
recipient: issuerAid.prefix,
datetime: createTimestamp(),
});

const op = await holderClient
.ipex()
.submitAdmit(holderAid.name, admit, sigs, aend, [issuerAid.prefix]);
Expand Down Expand Up @@ -604,4 +627,4 @@ test('single signature credentials', async () => {

assert.equal(issuerCredential.status.s, '1');
});
}, 90000);
}, 900000);
1 change: 1 addition & 0 deletions examples/integration-scripts/delegation-multisig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
addEndRoleMultisig,
delegateMultisig,
startMultisigIncept,
waitAndMarkNotification,
} from './utils/multisig-utils';
import { step } from './utils/test-step';

Expand Down
27 changes: 18 additions & 9 deletions examples/integration-scripts/multisig-vlei-issuance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import signify, {
randomNonce,
Salter,
HabState,
SignifyClient,
} from 'signify-ts';
import { resolveEnvironment } from './utils/resolve-env';
import {
Expand Down Expand Up @@ -80,6 +81,8 @@ const ECR_RULES = Saider.saidify({
},
})[1];

const idQVI = 'QVI';

test('multisig-vlei-issuance', async function run() {
/**
* The abbreviations used in this script follows GLEIF vLEI
Expand Down Expand Up @@ -303,9 +306,9 @@ test('multisig-vlei-issuance', async function run() {
// Skip if a QVI AID has already been incepted.
let aidQVIbyQAR1, aidQVIbyQAR2, aidQVIbyQAR3: HabState;
try {
aidQVIbyQAR1 = await clientQAR1.identifiers().get('QVI');
aidQVIbyQAR2 = await clientQAR2.identifiers().get('QVI');
aidQVIbyQAR3 = await clientQAR3.identifiers().get('QVI');
aidQVIbyQAR1 = await clientQAR1.identifiers().get(idQVI);
aidQVIbyQAR2 = await clientQAR2.identifiers().get(idQVI);
aidQVIbyQAR3 = await clientQAR3.identifiers().get(idQVI);
} catch {
const rstates = [aidQAR1.state, aidQAR2.state, aidQAR3.state];
const states = rstates;
Expand All @@ -326,7 +329,7 @@ test('multisig-vlei-issuance', async function run() {
clientQAR1,
aidQAR1,
[aidQAR2, aidQAR3],
'QVI',
idQVI,
kargsMultisigAID,
true
);
Expand All @@ -335,15 +338,15 @@ test('multisig-vlei-issuance', async function run() {
clientQAR2,
aidQAR2,
[aidQAR1, aidQAR3],
'QVI',
idQVI,
kargsMultisigAID
);
kargsMultisigAID.mhab = aidQAR3;
const multisigAIDOp3 = await createAIDMultisig(
clientQAR3,
aidQAR3,
[aidQAR1, aidQAR2],
'QVI',
idQVI,
kargsMultisigAID
);

Expand Down Expand Up @@ -401,16 +404,18 @@ test('multisig-vlei-issuance', async function run() {

await waitAndMarkNotification(clientQAR1, '/multisig/icp');

aidQVIbyQAR1 = await clientQAR1.identifiers().get('QVI');
aidQVIbyQAR2 = await clientQAR2.identifiers().get('QVI');
aidQVIbyQAR3 = await clientQAR3.identifiers().get('QVI');
aidQVIbyQAR1 = await clientQAR1.identifiers().get(idQVI);
aidQVIbyQAR2 = await clientQAR2.identifiers().get(idQVI);
aidQVIbyQAR3 = await clientQAR3.identifiers().get(idQVI);
}
assert.equal(aidQVIbyQAR1.prefix, aidQVIbyQAR2.prefix);
assert.equal(aidQVIbyQAR1.prefix, aidQVIbyQAR3.prefix);
assert.equal(aidQVIbyQAR1.name, aidQVIbyQAR2.name);
assert.equal(aidQVIbyQAR1.name, aidQVIbyQAR3.name);
const aidQVI = aidQVIbyQAR1;

// witnessAgain(clientQAR1,idQVI,aidQVIbyQAR1.prefix,witnessIds[0],'dip');

// Add endpoint role authorization for all QARs' agents.
// Skip if they have already been authorized.
let [oobiQVIbyQAR1, oobiQVIbyQAR2, oobiQVIbyQAR3] = await Promise.all([
Expand Down Expand Up @@ -666,6 +671,8 @@ test('multisig-vlei-issuance', async function run() {
assert.equal(qviCred.sad.d, qviCredbyQAR2.sad.d);
assert.equal(qviCred.sad.d, qviCredbyQAR3.sad.d);

// witnessAgain(clientQAR1,idQVI,aidQVIbyQAR1.prefix,witnessIds[0],'dip');

// Create a multisig AID for the LE.
// Skip if a LE AID has already been incepted.
let aidLEbyLAR1, aidLEbyLAR2, aidLEbyLAR3: HabState;
Expand Down Expand Up @@ -858,6 +865,8 @@ test('multisig-vlei-issuance', async function run() {
assert.equal(qviRegistrybyQAR1[0].name, qviRegistrybyQAR3[0].name);
const qviRegistry = qviRegistrybyQAR1[0];

// witnessAgain(clientQAR1,idQVI,aidQVI.prefix,witnessIds[0],'ixn');

// QVI issues a LE vLEI credential to the LE.
// Skip if the credential has already been issued.
let leCredbyQAR1 = await getIssuedCredential(
Expand Down
4 changes: 2 additions & 2 deletions examples/integration-scripts/singlesig-vlei-issuance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const CRED_RETRY_DEFAULTS = {
maxSleep: 10000,
minSleep: 1000,
maxRetries: undefined,
timeout: 30000,
timeout: 60000,
};

function createTimestamp() {
Expand Down Expand Up @@ -473,7 +473,7 @@ test('singlesig-vlei-issuance', async function run() {

await assertOperations(gleifClient, qviClient, leClient, roleClient);
await warnNotifications(gleifClient, qviClient, leClient, roleClient);
}, 360000);
}, 3600000);

async function getOrCreateRegistry(
client: SignifyClient,
Expand Down
2 changes: 1 addition & 1 deletion examples/integration-scripts/utils/multisig-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,4 @@ export async function startMultisigIncept(
participants
);
return op1;
}
}
25 changes: 25 additions & 0 deletions examples/integration-scripts/utils/test-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,28 @@ export async function waitOperation<T = any>(

return op;
}

export async function witnessAgain(client: SignifyClient, idName: string, prefix: string, witId: string, numOobis: number, eType: string) {
// force submit again to witnesses
const subRes = await client.identifiers().submit_id(idName);

await waitOperation(client, await subRes);
const subRegId = await client.identifiers().get(idName);
assert.equal(subRegId.state.b.length, numOobis);
assert.equal(subRegId.state.b[0], witId);

const oobisWit = await client.oobis().get(idName, 'witness');
expect(oobisWit.oobis).toHaveLength(numOobis);

const oobiWit1 = oobisWit.oobis[0]
expect(oobiWit1).toContain(
`/oobi/${prefix}/witness/${witId}`
);

const oobiSubRes = await client.oobis().resolve(oobiWit1);
const oobiSub = await waitOperation(client, oobiSubRes);
expect(JSON.stringify(oobiSub['response']["b"][0])).toEqual(`\"${witId}\"`);
expect(JSON.stringify(oobiSub['response']["et"])).toEqual(`\"${eType}\"`);

return subRegId
}
105 changes: 77 additions & 28 deletions examples/integration-scripts/witness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import { strict as assert } from 'assert';
import signify from 'signify-ts';
import { resolveEnvironment } from './utils/resolve-env';
import { resolveOobi, waitOperation } from './utils/test-util';
import { resolveOobi, waitOperation, witnessAgain } from './utils/test-util';
import { step } from './utils/test-step';

const WITNESS_AID = 'BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha';
const ID1_NAME = 'aid1'
const { url, bootUrl, witnessUrls } = resolveEnvironment();

test('test witness', async () => {
Expand Down Expand Up @@ -32,39 +34,86 @@ test('test witness', async () => {
console.log('Witness OOBI resolved');

// Client 1 creates AID with 1 witness
let icpResult1 = await client1.identifiers().create('aid1', {
const icpRes = await client1.identifiers().create(ID1_NAME, {
toad: 1,
wits: [WITNESS_AID],
});
await waitOperation(client1, await icpResult1.op());
let aid1 = await client1.identifiers().get('aid1');
console.log('AID:', aid1.prefix);
assert.equal(aid1.state.b.length, 1);
assert.equal(aid1.state.b[0], WITNESS_AID);

icpResult1 = await client1.identifiers().rotate('aid1');
await waitOperation(client1, await icpResult1.op());
aid1 = await client1.identifiers().get('aid1');
assert.equal(aid1.state.b.length, 1);
assert.equal(aid1.state.b[0], WITNESS_AID);
await waitOperation(client1, await icpRes.op());
const aidIcp = await client1.identifiers().get(ID1_NAME);
console.log('AID:', aidIcp.prefix);
assert.equal(aidIcp.state.b.length, 1);
assert.equal(aidIcp.state.b[0], WITNESS_AID);

const oobisWit = await client1.oobis().get(ID1_NAME, 'witness');
expect(oobisWit.oobis).toHaveLength(1);

const oobiWit1 = oobisWit.oobis[0]
expect(oobiWit1).toContain(
`/oobi/${aidIcp.prefix}/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha`
);

const oobiResolve = await client1.oobis().resolve(oobiWit1);
const oobiResult = await waitOperation(client1, oobiResolve);
expect(JSON.stringify(oobiResult['response']["b"][0])).toEqual(`\"${WITNESS_AID}\"`);

const rotRes = await client1.identifiers().rotate(ID1_NAME);
await waitOperation(client1, await rotRes.op());
const aidRot = await client1.identifiers().get(ID1_NAME);
assert.equal(aidRot.state.b.length, 1);
assert.equal(aidRot.state.b[0], WITNESS_AID);

const ooobiRotRes = await client1.oobis().resolve(oobiWit1);
const oobiRot = await waitOperation(client1, ooobiRotRes);
expect(JSON.stringify(oobiRot['response']["b"][0])).toEqual(`\"${WITNESS_AID}\"`);

// Remove witness
icpResult1 = await client1
const rotCutRes = await client1
.identifiers()
.rotate('aid1', { cuts: [WITNESS_AID] });
await waitOperation(client1, await icpResult1.op());
aid1 = await client1.identifiers().get('aid1');
assert.equal(aid1.state.b.length, 0);
.rotate(ID1_NAME, { cuts: [WITNESS_AID] });
await waitOperation(client1, await rotCutRes.op());
const aidRemWit = await client1.identifiers().get(ID1_NAME);
assert.equal(aidRemWit.state.b.length, 0);

// Add witness again
const ooobiRotCutRes = await client1.oobis().resolve(oobiWit1);
const oobiRotCut = await waitOperation(client1, ooobiRotCutRes);
expect(JSON.stringify(oobiRotCut['response']["b"][0])).toEqual(undefined);

icpResult1 = await client1
// Add witness again
const rotAddRes = await client1
.identifiers()
.rotate('aid1', { adds: [WITNESS_AID] });

await waitOperation(client1, await icpResult1.op());
aid1 = await client1.identifiers().get('aid1');
assert.equal(aid1.state.b.length, 1);
assert.equal(aid1.state.b.length, 1);
assert.equal(aid1.state.b[0], WITNESS_AID);
}, 60000);
.rotate(ID1_NAME, { adds: [WITNESS_AID] });

await waitOperation(client1, await rotAddRes.op());
const rotAddId = await client1.identifiers().get(ID1_NAME);
assert.equal(rotAddId.state.b.length, 1);
assert.equal(rotAddId.state.b.length, 1);
assert.equal(rotAddId.state.b[0], WITNESS_AID);

const ooobiRotAddRes = await client1.oobis().resolve(oobiWit1);
const oobiRotAdd = await waitOperation(client1, ooobiRotAddRes);
expect(JSON.stringify(oobiRotAdd['response']["b"][0])).toEqual(`\"${WITNESS_AID}\"`);

// try force submit again to witnesses
const subId = await witnessAgain(client1,ID1_NAME,aidIcp.prefix,WITNESS_AID,1,'rot');

const registry = await step('Create registry', async () => {
const registryName = 'vLEI-test-registry';
const regResult = await client1
.registries()
.create({ name: subId.name, registryName: registryName });

await waitOperation(client1, await regResult.op());
let registries = await client1.registries().list(subId.name);
const registry: { name: string; regk: string } = registries[0];
assert.equal(registries.length, 1);
assert.equal(registry.name, registryName);
})

const ooobiRegRes = await client1.oobis().resolve(oobiWit1);
const oobiReg = await waitOperation(client1, ooobiRegRes);
expect(JSON.stringify(oobiReg['response']["b"][0])).toEqual(`\"${WITNESS_AID}\"`);
expect(JSON.stringify(oobiReg['response']["et"])).toEqual(`\"ixn\"`);

// force submit again to witnesses
await witnessAgain(client1,ID1_NAME,aidIcp.prefix,WITNESS_AID,1,'ixn');
}, 600000);
Loading
Loading