feat(security): prefer digest identity in scan history (#1610)

Retain scans and History search by digest when available, keep imageRefLike for compatibility, and surface digests in compare.
This commit is contained in:
Anso
2026-07-10 22:10:09 -04:00
committed by GitHub
parent 8fd526ba05
commit 4834e2e51d
17 changed files with 561 additions and 97 deletions
+10
View File
@@ -0,0 +1,10 @@
/**
* Shorten a Docker content digest or image ID for display.
* Accepts `sha256:…` or bare hex; returns up to 12 hex characters.
*/
export function formatShortDigest(id: string | null | undefined): string {
if (!id) return '';
const colon = id.indexOf(':');
const hex = colon >= 0 ? id.slice(colon + 1) : id;
return hex.slice(0, 12);
}