From 365beac4212b1122000f95b3776676da3ad9992a Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 2 Dec 2024 17:00:34 -0800 Subject: [PATCH] Remove use of verification from credential details Signed-off-by: Gavin Jaeger-Freeborn --- .../credentialDetail/CredentialDetail.vue | 103 +----------------- .../api/v3/credential-verify.service.ts | 8 -- src/store/modules/credential-detail.ts | 28 ----- 3 files changed, 2 insertions(+), 137 deletions(-) diff --git a/src/components/entity/credentialDetail/CredentialDetail.vue b/src/components/entity/credentialDetail/CredentialDetail.vue index e12738e..14c6242 100644 --- a/src/components/entity/credentialDetail/CredentialDetail.vue +++ b/src/components/entity/credentialDetail/CredentialDetail.vue @@ -14,17 +14,11 @@

- {{ - mdiShieldCheckOutline - }} {{ `${credentialTypeDescription} credential` }} verified claims + > claims

-

- {{ `Cryptographically verified ${now}` }} -

Issued: {{ issuedDate | formatDate }} • Effective: {{ effectiveDate | formatDate }} @@ -87,60 +81,6 @@ - - - - - -

Claims proven

- - -
-
{{ rawData }}
-
- - - -
- - -
- - - - - -

Proof Details

-
- -
-
{{ proofRaw }}
-
-
-
-
-
@@ -175,8 +115,6 @@ interface Data { "selectedTopic", "selectedTopicFullCredentialSet", "getSelectedCredential", - "getPresentationId", - "getPresentationEX", "loading", ]), }, @@ -184,8 +122,6 @@ interface Data { ...mapActions([ "fetchSelectedCredential", "setLoading", - "fetchPresId", - "fetchPresEx", "fetchFormattedIdentifiedTopic", ]), }, @@ -195,13 +131,9 @@ export default class CredentialDetail extends Vue { selectedTopicFullCredentialSet!: Array; getSelectedCredential!: ICredentialFormatted | undefined; loading!: boolean; - getPresentationId!: string; - getPresentationEX!: ICredentialProof; sourceId!: string; isExpired = isExpired; fetchSelectedCredential!: (id: string) => Promise; - fetchPresId!: (id: string) => Promise; - fetchPresEx!: (params: { id: string; presId: string }) => Promise; fetchFormattedIdentifiedTopic!: ({ sourceId, type, @@ -302,27 +234,7 @@ export default class CredentialDetail extends Vue { if (replaced) { base += "has been replaced."; } - return base + " It can no longer be verified"; - } - - get proofRaw(): string | undefined { - const rawVals = this.getPresentationEX; - if (rawVals === undefined) { - return rawVals; - } - return JSON.stringify(rawVals?.result, null, 2); - } - - get proofValues(): Record[] | undefined { - const rawVals = - this.getPresentationEX?.result?.presentation?.requested_proof - ?.revealed_attr_groups?.["self-verify-proof"]?.values; - if (rawVals === undefined) { - return rawVals; - } - return Object.keys(rawVals).map((key) => { - return { attr_name: key, attr_val: rawVals[key].raw }; - }); + return base } get rawData(): unknown { @@ -340,22 +252,11 @@ export default class CredentialDetail extends Vue { if (sourceId && credentialId) { await Promise.all([ this.fetchSelectedCredential(credentialId), - this.fetchPresId(credentialId), this.fetchFormattedIdentifiedTopic({ sourceId, type, }), ]); - - // DEPRECATED: need a small timeout because the credential isn't always verified after fetchPresId returns - await new Promise((r) => setTimeout(r, 1000)); - - if (this.getPresentationId) { - await this.fetchPresEx({ - id: credentialId, - presId: this.getPresentationId, - }); - } } else { router.push("/search"); } diff --git a/src/services/api/v3/credential-verify.service.ts b/src/services/api/v3/credential-verify.service.ts index af59b59..e95b20d 100644 --- a/src/services/api/v3/credential-verify.service.ts +++ b/src/services/api/v3/credential-verify.service.ts @@ -9,14 +9,6 @@ export default class CredentialVerifier extends ApiResource { baseVersion = "v3"; basePath = "credential"; - async credentialVerify( - id: string - ): Promise> { - return await Http.get( - this.formatEndpointUrl(`${id}/verify`) - ); - } - async credentialVerifyPresEx( id: string, exId: string diff --git a/src/store/modules/credential-detail.ts b/src/store/modules/credential-detail.ts index a1cb460..47730e5 100644 --- a/src/store/modules/credential-detail.ts +++ b/src/store/modules/credential-detail.ts @@ -25,9 +25,6 @@ const state: State = { const getters = { getSelectedCredential: (state: State): ICredentialFormatted | undefined => state.selectedCredential, - getPresentationId: (state: State): string => state.presentationId, - getPresentationEX: (state: State): ICredentialProof | undefined => - state.presentationEX, }; const actions = { @@ -42,31 +39,6 @@ const actions = { console.error(e); } }, - async fetchPresId( - { commit }: ActionContext, - id: string - ): Promise { - try { - const res = await credVerificationService.credentialVerify(id); - commit("setPresId", res.data.presentation_exchange_id); - } catch (e) { - console.error(e); - } - }, - async fetchPresEx( - { commit }: ActionContext, - params: { id: string; presId: string } - ): Promise { - try { - const res = await credVerificationService.credentialVerifyPresEx( - params.id, - params.presId - ); - commit("setPresEX", res.data); - } catch (e) { - console.error(e); - } - }, }; const mutations = {