Skip to content

Commit

Permalink
Merge branch 'develop' into feat/DTIS-1378-handle-credential-revocati…
Browse files Browse the repository at this point in the history
…ons-of-credential-that-arent-accepted-yet-in-IPEX
  • Loading branch information
Sotatek-BaoHoanga committed Nov 11, 2024
2 parents 1895d25 + fe10d10 commit f579952
Show file tree
Hide file tree
Showing 85 changed files with 2,040 additions and 684 deletions.
9 changes: 7 additions & 2 deletions services/credential-server/src/modules/signify/signifyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Operation,
Saider,
Serder,
State,
} from "signify-ts";
import { waitAndGetDoneOp } from "./utils";
import { config } from "../../config";
Expand Down Expand Up @@ -74,15 +75,19 @@ export class SignifyApi {

async resolveOobi(url: string): Promise<any> {
const alias = new URL(url).searchParams.get("name") ?? uuidv4();
const operation = await waitAndGetDoneOp(
const operation = (await waitAndGetDoneOp(
this.signifyClient,
await this.signifyClient.oobis().resolve(url, alias),
this.opTimeout,
this.opRetryInterval
);
)) as Operation & { response: State };
if (!operation.done) {
throw new Error(SignifyApi.FAILED_TO_RESOLVE_OOBI);
}
if (operation.response && operation.response.i) {
const connectionId = operation.response.i;
await this.signifyClient.contacts().update(connectionId, { alias });
}
return operation;
}

Expand Down
13 changes: 13 additions & 0 deletions src/core/__fixtures__/agent/keriaNotificationFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const grantForIssuanceExnMessage = {
a: {
m: "",
i: "EE-gjeEni5eCdpFlBtG7s4wkv7LJ0JmWplCS4DNQwW2G",
gid: "gid",
},
e: {
acdc: {
Expand Down Expand Up @@ -351,6 +352,17 @@ const credentialState = {
et: "iss",
};

const notificationIpexOfferProp = {
i: "string",
dt: "string",
r: false,
a: {
r: NotificationRoute.ExnIpexOffer,
d: "string",
m: "",
},
};

export {
credentialMetadataMock,
grantForIssuanceExnMessage,
Expand All @@ -368,4 +380,5 @@ export {
notificationIpexAgreeProp,
notificationIpexApplyProp,
credentialState,
notificationIpexOfferProp,
};
66 changes: 35 additions & 31 deletions src/core/__fixtures__/agent/multSigFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,48 +440,52 @@ const multisigExnIpexGrantEnd =
"-LA35AACAA-e-exn-FABEPIKswKD9AiVxIqU4QLn14qpNuiAfgVGzoK-HVU0znjC0AAAAAAAAAAAAAAAAAAAAAAAEPIKswKD9AiVxIqU4QLn14qpNuiAfgVGzoK-HVU0znjC-AABAABTAefC5IBObzL5ZteOa6me6iLQXV1v1rTcsBOrJDfk6uwRfR1nxm2DKWxehRMHEdq6YlqxysCdWfVBIvd4t3gH";

const resolvedOobiOpResponse = {
name: "oobi.ABi0yV6LhFudjaGT4wkCNpVChyHOSFii_idAIAEhyfot",
metadata: {
oobi: "http://keria:3902/oobi/EH_rgokxkQE886aZf7ZRBgqN2y6aALPAmUvI5haK4yr7/agent/EFv5qAoixFv0WwsekWSqS5ypXQUl2f_N4j8GGURs3QUT",
},
done: true,
error: null,
response: {
vn: [1, 0],
i: "EH_rgokxkQE886aZf7ZRBgqN2y6aALPAmUvI5haK4yr7",
s: "0",
p: "",
d: "EH_rgokxkQE886aZf7ZRBgqN2y6aALPAmUvI5haK4yr7",
f: "0",
dt: "2024-08-09T11:04:09.343208+00:00",
et: "icp",
kt: "1",
k: ["DLt2-jru3tSgE9Ui2dSRCYy5BJjWsyGXsX7klF_ecylO"],
nt: "1",
n: ["EIxuzxaSiS6HHdff1M8vzkRlJSFK4YwpD813PPmnBZSe"],
bt: "3",
b: [
"BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha",
"BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM",
"BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX",
],
c: [],
ee: {
op: {
name: "oobi.ABi0yV6LhFudjaGT4wkCNpVChyHOSFii_idAIAEhyfot",
metadata: {
oobi: "http://keria:3902/oobi/EH_rgokxkQE886aZf7ZRBgqN2y6aALPAmUvI5haK4yr7/agent/EFv5qAoixFv0WwsekWSqS5ypXQUl2f_N4j8GGURs3QUT",
},
done: true,
error: null,
response: {
vn: [1, 0],
i: "EH_rgokxkQE886aZf7ZRBgqN2y6aALPAmUvI5haK4yr7",
s: "0",
p: "",
d: "EH_rgokxkQE886aZf7ZRBgqN2y6aALPAmUvI5haK4yr7",
br: [],
ba: [],
f: "0",
dt: "2024-08-09T11:04:09.343208+00:00",
et: "icp",
kt: "1",
k: ["DLt2-jru3tSgE9Ui2dSRCYy5BJjWsyGXsX7klF_ecylO"],
nt: "1",
n: ["EIxuzxaSiS6HHdff1M8vzkRlJSFK4YwpD813PPmnBZSe"],
bt: "3",
b: [
"BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha",
"BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM",
"BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX",
],
c: [],
ee: {
s: "0",
d: "EH_rgokxkQE886aZf7ZRBgqN2y6aALPAmUvI5haK4yr7",
br: [],
ba: [],
},
di: "",
},
di: "",
},
alias: "alias",
connection: {},
};

const initiatorConnectionShortDetails = {
id: "ENsj-3icUgAutHtrUHYnUPnP8RiafT5tOdVIZarFHuyP",
label: "f4732f8a-1967-454a-8865-2bbf2377c26e",
oobi: "http://127.0.0.1:3902/oobi/ENsj-3icUgAutHtrUHYnUPnP8RiafT5tOdVIZarFHuyP/agent/EF_dfLFGvUh9kMsV2LIJQtrkuXWG_-wxWzC_XjCWjlkQ",
status: ConnectionStatus.CONFIRMED,
connectionDate: new Date().toISOString(),
createdAtUTC: new Date().toISOString(),
};

const notificationMultisigExnRotation = {
Expand Down
8 changes: 5 additions & 3 deletions src/core/agent/agent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ enum MiscRecordId {
KERIA_NOTIFICATION_MARKER = "keria-notification-marker",
APP_IDENTIFIER_VIEW_TYPE = "app-identifier-view-type",
APP_CRED_VIEW_TYPE = "app-cred-view-type",
APP_IDENTIFIER_SELECTED_FILTER = "app-identifier-selected-filter",
APP_CRED_SELECTED_FILTER = "app-cred-selected-filter",
KERIA_CONNECT_URL = "keria-connect-url",
KERIA_BOOT_URL = "keria-boot-url",
APP_IDENTIFIER_FAVOURITE_INDEX = "identifier-favourite-index",
Expand All @@ -40,7 +42,7 @@ enum MiscRecordId {
interface ConnectionShortDetails {
id: string;
label: string;
connectionDate: string;
createdAtUTC: string;
logo?: string;
status: ConnectionStatus;
oobi?: string;
Expand All @@ -62,7 +64,7 @@ interface JSONArray extends Array<JSONValue> {}

type JSONValue = string | number | boolean | JSONObject | JSONArray;

type IpexMessage = {
type ExnMessage = {
exn: {
v: string;
t: string;
Expand Down Expand Up @@ -214,7 +216,7 @@ export type {
IdentifierResult,
AgentUrls,
BranAndMnemonic,
IpexMessage,
ExnMessage,
NotificationRpy,
AuthorizationRequestExn,
OperationCallback,
Expand Down
Loading

0 comments on commit f579952

Please sign in to comment.