-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from edytuk/v2.8.3
Merge sylabs/sif through v2.8.3
- Loading branch information
Showing
16 changed files
with
203 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// Apptainer a Series of LF Projects LLC. | ||
// For website terms of use, trademark policy, privacy policy and other | ||
// project policies see https://lfprojects.org/policies | ||
// Copyright (c) 2018-2021, Sylabs Inc. All rights reserved. | ||
// Copyright (c) 2018-2022, Sylabs Inc. All rights reserved. | ||
// Copyright (c) 2018, Divya Cote <[email protected]> All rights reserved. | ||
// Copyright (c) 2017, SingularityWare, LLC. All rights reserved. | ||
// Copyright (c) 2017, Yannick Cote <[email protected]> All rights reserved. | ||
|
@@ -115,16 +115,25 @@ func writeList(w io.Writer, f *sif.FileImage) error { | |
if err == nil { | ||
fmt.Fprintf(w, "|%s (%s/%s/%s)\n", dt, fs, pt, arch) | ||
} | ||
|
||
case sif.DataSignature: | ||
ht, _, err := d.SignatureMetadata() | ||
if err == nil { | ||
fmt.Fprintf(w, "|%s (%s)\n", dt, ht) | ||
} | ||
|
||
case sif.DataCryptoMessage: | ||
ft, mt, err := d.CryptoMessageMetadata() | ||
if err == nil { | ||
fmt.Fprintf(w, "|%s (%s/%s)\n", dt, ft, mt) | ||
} | ||
|
||
case sif.DataSBOM: | ||
f, err := d.SBOMMetadata() | ||
if err == nil { | ||
fmt.Fprintf(w, "|%s (%s)\n", dt, f) | ||
} | ||
|
||
default: | ||
fmt.Fprintf(w, "|%s\n", dt) | ||
} | ||
|
@@ -199,7 +208,10 @@ func writeInfo(w io.Writer, v sif.Descriptor) error { | |
} | ||
|
||
fmt.Fprintf(tw, "\tHash Type:\t%v\n", ht) | ||
fmt.Fprintf(tw, "\tEntity:\t%X\n", fp) | ||
|
||
if len(fp) > 0 { | ||
fmt.Fprintf(tw, "\tEntity:\t%X\n", fp) | ||
} | ||
|
||
case sif.DataCryptoMessage: | ||
ft, mt, err := v.CryptoMessageMetadata() | ||
|
@@ -209,6 +221,14 @@ func writeInfo(w io.Writer, v sif.Descriptor) error { | |
|
||
fmt.Fprintf(tw, "\tFormat Type:\t%v\n", ft) | ||
fmt.Fprintf(tw, "\tMessage Type:\t%v\n", mt) | ||
|
||
case sif.DataSBOM: | ||
f, err := v.SBOMMetadata() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
fmt.Fprintf(tw, "\tFormat:\t%v\n", f) | ||
} | ||
|
||
return tw.Flush() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
internal/app/siftool/testdata/TestApp_Header/OneObjectSBOM.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Version: 01 | ||
Descriptors Free: 47 | ||
Descriptors Total: 48 | ||
Descriptors Offset: 4096 | ||
Descriptors Size: 27 KiB | ||
Data Offset: 32176 | ||
Data Size: 454 B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Data Type: SBOM | ||
ID: 1 | ||
Group ID: 1 | ||
Linked ID: NONE | ||
Offset: 32176 | ||
Size: 454 | ||
Format: cyclonedx-json |
4 changes: 4 additions & 0 deletions
4
internal/app/siftool/testdata/TestApp_List/OneObjectSBOM.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
------------------------------------------------------------------------------ | ||
ID |GROUP |LINK |SIF POSITION (start-end) |TYPE | ||
------------------------------------------------------------------------------ | ||
1 |1 |NONE |32176-32630 |SBOM (cyclonedx-json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.