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

Revert "feat: single-sig IPEX apply, offer, agree" #268

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
keria-version: ['0.2.0-dev1']
keria-version: ['0.1.3']
node-version: ['20']
env:
KERIA_IMAGE_TAG: ${{ matrix.keria-version }}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
- 7723:7723

keria:
image: ${KERIA_IMAGE:-weboftrust/keria}:${KERIA_IMAGE_TAG:-0.2.0-dev1}
image: ${KERIA_IMAGE:-weboftrust/keria}:${KERIA_IMAGE_TAG:-0.1.3}
environment:
- KERI_AGENT_CORS=1
- KERI_URL=http://keria:3902
Expand Down
112 changes: 1 addition & 111 deletions examples/integration-scripts/credentials.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
let verifierAid: Aid;
let legalEntityAid: Aid;

let applySaid: string;
let offerSaid: string;
let agreeSaid: string;

beforeAll(async () => {
[issuerClient, holderClient, verifierClient, legalEntityClient] =
await getOrCreateClients(4);
Expand Down Expand Up @@ -129,7 +125,7 @@
.rename(issuerAid.name, registryName, updatedRegistryName);

registries = await issuerClient.registries().list(issuerAid.name);
let updateRegistry: { name: string; regk: string } = registries[0];

Check warning on line 128 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and macOS-latest

'updateRegistry' is never reassigned. Use 'const' instead

Check warning on line 128 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and macOS-latest

'updateRegistry' is never reassigned. Use 'const' instead

Check warning on line 128 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and ubuntu-latest

'updateRegistry' is never reassigned. Use 'const' instead

Check warning on line 128 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and ubuntu-latest

'updateRegistry' is never reassigned. Use 'const' instead
assert.equal(registries.length, 1);
assert.equal(updateRegistry.name, updatedRegistryName);

Expand Down Expand Up @@ -247,7 +243,7 @@
datetime: dt,
});

let op = await issuerClient

Check warning on line 246 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 246 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 246 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and ubuntu-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 246 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and ubuntu-latest

'op' is never reassigned. Use 'const' instead
.ipex()
.submitGrant(issuerAid.name, grant, gsigs, gend, [
holderAid.prefix,
Expand All @@ -270,7 +266,7 @@
grantNotification.a.d!,
createTimestamp()
);
let op = await holderClient

Check warning on line 269 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 269 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 269 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and ubuntu-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 269 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and ubuntu-latest

'op' is never reassigned. Use 'const' instead
.ipex()
.submitAdmit(holderAid.name, admit, sigs, aend, [issuerAid.prefix]);
await waitOperation(holderClient, op);
Expand Down Expand Up @@ -300,107 +296,7 @@
assert(holderCredential.atc !== undefined);
});

await step('verifier IPEX apply', async () => {
const [apply, sigs, _] = await verifierClient.ipex().apply({
senderName: verifierAid.name,
schema: QVI_SCHEMA_SAID,
attributes: { LEI: '5493001KJTIIGC8Y1R17' },
recipient: holderAid.prefix,
datetime: createTimestamp(),
});

const op = await verifierClient
.ipex()
.submitApply(verifierAid.name, apply, sigs, [holderAid.prefix]);
await waitOperation(verifierClient, op);
});

await step('holder IPEX apply receive and offer', async () => {
const holderNotifications = await waitForNotifications(
holderClient,
'/exn/ipex/apply'
);

const holderApplyNote = holderNotifications[0];
assert(holderApplyNote.a.d);

const apply = await holderClient.exchanges().get(holderApplyNote.a.d);
applySaid = apply.exn.d;

let filter: { [x: string]: any } = { '-s': apply.exn.a.s };
for (const key in apply.exn.a.a) {
filter[`-a-${key}`] = apply.exn.a.a[key];
}

const matchingCreds = await holderClient.credentials().list({ filter });
expect(matchingCreds).toHaveLength(1);

await markAndRemoveNotification(holderClient, holderNotifications[0]);

const [offer, sigs, end] = await holderClient.ipex().offer({
senderName: holderAid.name,
recipient: verifierAid.prefix,
acdc: new Serder(matchingCreds[0].sad),
apply: applySaid,
datetime: createTimestamp(),
});

const op = await holderClient
.ipex()
.submitOffer(holderAid.name, offer, sigs, end, [
verifierAid.prefix,
]);
await waitOperation(holderClient, op);
});

await step('verifier receive offer and agree', async () => {
const verifierNotifications = await waitForNotifications(
verifierClient,
'/exn/ipex/offer'
);

const verifierOfferNote = verifierNotifications[0];
assert(verifierOfferNote.a.d);

const offer = await verifierClient
.exchanges()
.get(verifierOfferNote.a.d);
offerSaid = offer.exn.d;

expect(offer.exn.p).toBe(applySaid);
expect(offer.exn.e.acdc.a.LEI).toBe('5493001KJTIIGC8Y1R17');

await markAndRemoveNotification(verifierClient, verifierOfferNote);

const [agree, sigs, _] = await verifierClient.ipex().agree({
senderName: verifierAid.name,
recipient: holderAid.prefix,
offer: offerSaid,
datetime: createTimestamp(),
});

const op = await verifierClient
.ipex()
.submitAgree(verifierAid.name, agree, sigs, [holderAid.prefix]);
await waitOperation(verifierClient, op);
});

await step('holder IPEX receive agree and grant/present', async () => {
const holderNotifications = await waitForNotifications(
holderClient,
'/exn/ipex/agree'
);

const holderAgreeNote = holderNotifications[0];
assert(holderAgreeNote.a.d);

const agree = await holderClient.exchanges().get(holderAgreeNote.a.d);
agreeSaid = agree.exn.d;

expect(agree.exn.p).toBe(offerSaid);

await markAndRemoveNotification(holderClient, holderAgreeNote);

await step('holder IPEX present', async () => {
const holderCredential = await holderClient
.credentials()
.get(qviCredentialId);
Expand All @@ -414,11 +310,10 @@
acdcAttachment: holderCredential.atc,
ancAttachment: holderCredential.ancatc,
issAttachment: holderCredential.issAtc,
agree: agreeSaid,
datetime: createTimestamp(),
});

let op = await holderClient

Check warning on line 316 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 316 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 316 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and ubuntu-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 316 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and ubuntu-latest

'op' is never reassigned. Use 'const' instead
.ipex()
.submitGrant(holderAid.name, grant2, gsigs2, gend2, [
verifierAid.prefix,
Expand All @@ -433,10 +328,6 @@
);

const verifierGrantNote = verifierNotifications[0];
assert(verifierGrantNote.a.d);

const grant = await holderClient.exchanges().get(verifierGrantNote.a.d);
expect(grant.exn.p).toBe(agreeSaid);

const [admit3, sigs3, aend3] = await verifierClient
.ipex()
Expand All @@ -447,7 +338,7 @@
createTimestamp()
);

let op = await verifierClient

Check warning on line 341 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 341 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 341 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and ubuntu-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 341 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and ubuntu-latest

'op' is never reassigned. Use 'const' instead
.ipex()
.submitAdmit(verifierAid.name, admit3, sigs3, aend3, [
holderAid.prefix,
Expand All @@ -470,7 +361,6 @@
holderClient,
'/exn/ipex/admit'
);

await markAndRemoveNotification(holderClient, holderNotifications[0]);
});

Expand Down Expand Up @@ -547,7 +437,7 @@
datetime: dt,
});

let op = await holderClient

Check warning on line 440 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 440 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 440 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and ubuntu-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 440 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and ubuntu-latest

'op' is never reassigned. Use 'const' instead
.ipex()
.submitGrant(holderAid.name, grant, gsigs, gend, [
legalEntityAid.prefix,
Expand All @@ -571,7 +461,7 @@
createTimestamp()
);

let op = await legalEntityClient

Check warning on line 464 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 464 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and macOS-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 464 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18 and ubuntu-latest

'op' is never reassigned. Use 'const' instead

Check warning on line 464 in examples/integration-scripts/credentials.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 20 and ubuntu-latest

'op' is never reassigned. Use 'const' instead
.ipex()
.submitAdmit(legalEntityAid.name, admit, sigs, aend, [
holderAid.prefix,
Expand Down
6 changes: 3 additions & 3 deletions examples/integration-scripts/salty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ test('salty', async () => {
const events = client1.keyEvents();
const log = await events.get(aid['prefix']);
assert.equal(log.length, 3);
let serder = new signify.Serder(log[0].ked);
let serder = new signify.Serder(log[0]);
assert.equal(serder.pre, icp.pre);
assert.equal(serder.ked['d'], icp.ked['d']);
serder = new signify.Serder(log[1].ked);
serder = new signify.Serder(log[1]);
assert.equal(serder.pre, rot.pre);
assert.equal(serder.ked['d'], rot.ked['d']);
serder = new signify.Serder(log[2].ked);
serder = new signify.Serder(log[2]);
assert.equal(serder.pre, ixn.pre);
assert.equal(serder.ked['d'], ixn.ked['d']);

Expand Down
7 changes: 5 additions & 2 deletions examples/integration-scripts/test-setup-single-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ afterAll(async () => {

describe('test-setup-single-client', () => {
test('step1', async () => {
expect(client.agent?.pre).toEqual(
'EC60ue9GOpQGrLBlS9T0dO6JkBTbv3V05Y4O730QBBoc'
);
expect(client.controller?.pre).toEqual(
'EB3UGWwIMq7ppzcQ697ImQIuXlBG5jzh-baSx-YG3-tY'
);
Expand All @@ -30,7 +33,7 @@ describe('test-setup-single-client', () => {
switch (env.preset) {
case 'local':
expect(name1_oobi).toEqual(
`http://127.0.0.1:3902/oobi/${name1_id}/agent/${client.agent?.pre}`
`http://127.0.0.1:3902/oobi/${name1_id}/agent/EC60ue9GOpQGrLBlS9T0dO6JkBTbv3V05Y4O730QBBoc`
);
expect(oobi.oobis[0]).toEqual(
`http://127.0.0.1:5642/oobi/${name1_id}/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha`
Expand All @@ -44,7 +47,7 @@ describe('test-setup-single-client', () => {
break;
case 'docker':
expect(name1_oobi).toEqual(
`http://keria:3902/oobi/${name1_id}/agent/${client.agent?.pre}`
`http://keria:3902/oobi/${name1_id}/agent/EC60ue9GOpQGrLBlS9T0dO6JkBTbv3V05Y4O730QBBoc`
);
expect(oobi.oobis[0]).toEqual(
`http://witness-demo:5642/oobi/${name1_id}/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha`
Expand Down
18 changes: 12 additions & 6 deletions src/keri/app/aiding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,14 @@ export class Identifier {
icp: serder.ked,
sigs: sigs,
proxy: proxy,
smids: states,
rmids: rstates,
smids:
states != undefined
? states.map((state) => state.i)
: undefined,
rmids:
rstates != undefined
? rstates.map((state) => state.i)
: undefined,
};
jsondata[algo] = keeper.params();

Expand Down Expand Up @@ -278,8 +284,8 @@ export class Identifier {
jsondata[keeper.algo] = keeper.params();

const res = await this.client.fetch(
'/identifiers/' + name + '/events',
'POST',
'/identifiers/' + name + '?type=ixn',
'PUT',
jsondata
);
return new EventResult(serder, sigs, res);
Expand Down Expand Up @@ -376,8 +382,8 @@ export class Identifier {
jsondata[keeper.algo] = keeper.params();

const res = await this.client.fetch(
'/identifiers/' + name + '/events',
'POST',
'/identifiers/' + name,
'PUT',
jsondata
);
return new EventResult(serder, sigs, res);
Expand Down
Loading
Loading