Skip to content

Do not display attestation-manifest and use short sha256 instead of full sha256 #32851

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

Merged
merged 10 commits into from
Dec 16, 2024
4 changes: 4 additions & 0 deletions modules/templates/util_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ func (su *StringUtils) EllipsisString(s string, maxLength int) string {
func (su *StringUtils) ToUpper(s string) string {
return strings.ToUpper(s)
}

func (su *StringUtils) TrimPrefix(s, prefix string) string {
return strings.TrimPrefix(s, prefix)
}
12 changes: 7 additions & 5 deletions templates/package/content/container.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
</thead>
<tbody>
{{range .PackageDescriptor.Metadata.Manifests}}
<tr>
<td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{.Digest}}</a></td>
<td>{{.Platform}}</td>
<td>{{FileSize .Size}}</td>
</tr>
{{if ne .Platform "unknown/unknown"}}
<tr>
<td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}</a></td>
<td>{{.Platform}}</td>
<td>{{FileSize .Size}}</td>
</tr>
{{end}}
{{end}}
</tbody>
</table>
Expand Down
Loading