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

fix hash link for intoto entries #59

Merged
merged 2 commits into from
Jul 21, 2023
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
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions src/modules/api/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface RekorClientContext {
}

export const RekorClientContext = createContext<RekorClientContext | undefined>(
undefined
undefined,
);

export const RekorClientProvider: FunctionComponent<PropsWithChildren<{}>> = ({
Expand Down Expand Up @@ -50,7 +50,7 @@ export function useRekorClient(): RekorClient {

export function useRekorBaseUrl(): [
RekorClientContext["baseUrl"],
RekorClientContext["setBaseUrl"]
RekorClientContext["setBaseUrl"],
] {
const ctx = useContext(RekorClientContext);

Expand Down
8 changes: 4 additions & 4 deletions src/modules/api/rekor_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,21 @@ export function useRekorSearch() {
return queryEntries(client, { hash });
}
},
[client]
[client],
);
}

async function queryEntries(
client: RekorClient,
query: SearchIndex
query: SearchIndex,
): Promise<RekorEntries> {
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,
Expand Down
6 changes: 3 additions & 3 deletions src/modules/components/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion src/modules/components/HashedRekord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function HashedRekordViewer({
hashedRekord: RekorSchema;
}) {
const certContent = window.atob(
hashedRekord.signature.publicKey?.content || ""
hashedRekord.signature.publicKey?.content || "",
);

const publicKey = {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/components/Intoto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function IntotoViewer({ intoto }: { intoto: IntotoV002Schema }) {
sx={{ py: 1 }}
>
<NextLink
href={`/?hash=${intoto.content.hash?.algorithm}:${intoto.content.hash?.value}`}
href={`/?hash=${intoto.content.payloadHash?.algorithm}:${intoto.content.payloadHash?.value}`}
passHref
>
<Link>Hash</Link>
Expand All @@ -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}`}
</SyntaxHighlighter>

<Typography
Expand Down
2 changes: 1 addition & 1 deletion src/modules/components/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function SearchForm({ defaultValues, onSubmit, isLoading }: FormProps) {
pattern: undefined,
min: undefined,
},
inputConfigByAttribute[watchAttribute].rules
inputConfigByAttribute[watchAttribute].rules,
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/modules/x509/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function textDecoder(rawExtension: Extension): string {

function utf8StringDecoder(rawExtension: Extension): string {
return AsnUtf8StringConverter.fromASN(
AsnAnyConverter.toASN(rawExtension.value)
AsnAnyConverter.toASN(rawExtension.value),
);
}

Expand Down
Loading