Skip to content

Commit

Permalink
Revert "feat: single-sig IPEX apply, offer, agree" (#268)
Browse files Browse the repository at this point in the history
* Revert "feat: single-sig IPEX apply, offer, agree (#234)"

This reverts commit 140ecd7.

* build: lock to 0.1.3 KERIA tag for now
  • Loading branch information
iFergal authored Jul 16, 2024
1 parent 140ecd7 commit e7aaf3c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 703 deletions.
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 holderAid: Aid;
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 @@ -300,107 +296,7 @@ test('single signature credentials', async () => {
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,7 +310,6 @@ test('single signature credentials', async () => {
acdcAttachment: holderCredential.atc,
ancAttachment: holderCredential.ancatc,
issAttachment: holderCredential.issAtc,
agree: agreeSaid,
datetime: createTimestamp(),
});

Expand All @@ -433,10 +328,6 @@ test('single signature credentials', async () => {
);

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 Down Expand Up @@ -470,7 +361,6 @@ test('single signature credentials', async () => {
holderClient,
'/exn/ipex/admit'
);

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

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

0 comments on commit e7aaf3c

Please sign in to comment.