From af18da4de14a57ede20f3aab99d59bb970d7a0d0 Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Fri, 21 Jul 2023 06:18:48 -0700 Subject: [PATCH] fix hash link for intoto entries (#59) --- package-lock.json | 18 +++++++++--------- package.json | 2 +- src/modules/api/context.tsx | 4 ++-- src/modules/api/rekor_api.ts | 8 ++++---- src/modules/components/Explorer.tsx | 6 +++--- src/modules/components/HashedRekord.tsx | 2 +- src/modules/components/Intoto.tsx | 4 ++-- src/modules/components/SearchForm.tsx | 2 +- src/modules/x509/extensions.ts | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a9899e..6d97f08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "caniuse-lite": "^1.0.30001441", "eslint": "8.10.0", "eslint-config-next": "13.0.0", - "prettier": "^2.8.2", + "prettier": "^3.0.0", "typescript": "4.6.2" }, "engines": { @@ -4478,15 +4478,15 @@ } }, "node_modules/prettier": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.5.tgz", - "integrity": "sha512-3gzuxrHbKUePRBB4ZeU08VNkUcqEHaUaouNt0m7LGP4Hti/NuB07C7PPTM/LkWqXoJYJn2McEo5+kxPNrtQkLQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -8743,9 +8743,9 @@ "dev": true }, "prettier": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.5.tgz", - "integrity": "sha512-3gzuxrHbKUePRBB4ZeU08VNkUcqEHaUaouNt0m7LGP4Hti/NuB07C7PPTM/LkWqXoJYJn2McEo5+kxPNrtQkLQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true }, "prismjs": { diff --git a/package.json b/package.json index fc4db30..5635e7f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "caniuse-lite": "^1.0.30001441", "eslint": "8.10.0", "eslint-config-next": "13.0.0", - "prettier": "^2.8.2", + "prettier": "^3.0.0", "typescript": "4.6.2" } } diff --git a/src/modules/api/context.tsx b/src/modules/api/context.tsx index 32157e1..e849fd6 100644 --- a/src/modules/api/context.tsx +++ b/src/modules/api/context.tsx @@ -15,7 +15,7 @@ export interface RekorClientContext { } export const RekorClientContext = createContext( - undefined + undefined, ); export const RekorClientProvider: FunctionComponent> = ({ @@ -50,7 +50,7 @@ export function useRekorClient(): RekorClient { export function useRekorBaseUrl(): [ RekorClientContext["baseUrl"], - RekorClientContext["setBaseUrl"] + RekorClientContext["setBaseUrl"], ] { const ctx = useContext(RekorClientContext); diff --git a/src/modules/api/rekor_api.ts b/src/modules/api/rekor_api.ts index 31c1e5e..fc523c1 100644 --- a/src/modules/api/rekor_api.ts +++ b/src/modules/api/rekor_api.ts @@ -73,21 +73,21 @@ export function useRekorSearch() { return queryEntries(client, { hash }); } }, - [client] + [client], ); } async function queryEntries( client: RekorClient, - query: SearchIndex + query: SearchIndex, ): Promise { const logIndexes = await client.index.searchIndex({ query }); const uuidToRetrieve = logIndexes.slice(0, 20); const entries = await Promise.all( uuidToRetrieve.map(entryUuid => - client.entries.getLogEntryByUuid({ entryUuid }) - ) + client.entries.getLogEntryByUuid({ entryUuid }), + ), ); return { totalCount: logIndexes.length, diff --git a/src/modules/components/Explorer.tsx b/src/modules/components/Explorer.tsx index c908313..98eccc0 100644 --- a/src/modules/components/Explorer.tsx +++ b/src/modules/components/Explorer.tsx @@ -139,15 +139,15 @@ export function Explorer() { }, }, `/?${formInputs.attribute}=${formInputs.value}`, - { shallow: true } + { shallow: true }, ); }, - [router] + [router], ); useEffect(() => { const attribute = Object.keys(router.query).find(key => - isAttribute(key) + isAttribute(key), ) as Attribute | undefined; const value = attribute && router.query[attribute]; diff --git a/src/modules/components/HashedRekord.tsx b/src/modules/components/HashedRekord.tsx index 45326c7..7ffc783 100644 --- a/src/modules/components/HashedRekord.tsx +++ b/src/modules/components/HashedRekord.tsx @@ -12,7 +12,7 @@ export function HashedRekordViewer({ hashedRekord: RekorSchema; }) { const certContent = window.atob( - hashedRekord.signature.publicKey?.content || "" + hashedRekord.signature.publicKey?.content || "", ); const publicKey = { diff --git a/src/modules/components/Intoto.tsx b/src/modules/components/Intoto.tsx index 99d53e9..91b3263 100644 --- a/src/modules/components/Intoto.tsx +++ b/src/modules/components/Intoto.tsx @@ -29,7 +29,7 @@ export function IntotoViewer({ intoto }: { intoto: IntotoV002Schema }) { sx={{ py: 1 }} > Hash @@ -40,7 +40,7 @@ export function IntotoViewer({ intoto }: { intoto: IntotoV002Schema }) { language="text" style={atomDark} > - {`${intoto.content.hash?.algorithm}:${intoto.content.hash?.value}`} + {`${intoto.content.payloadHash?.algorithm}:${intoto.content.payloadHash?.value}`}