Skip to content

Commit cffa21f

Browse files
committed
fix: SCA-69 encode murphyjson referenceLocator in base64
1 parent 453d9c4 commit cffa21f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

inspector/textual_formatter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package inspector
22

33
import (
4+
"encoding/base64"
45
"encoding/json"
56
"fmt"
67
"strings"
@@ -95,7 +96,7 @@ func BuildSpdx(task *model.ScanTask) []byte {
9596
}
9697
externalRefs = append(externalRefs, map[string]any{
9798
"referenceCategory": "PACKAGE-MANAGER",
98-
"referenceLocator": string(must.A(json.Marshal(node))),
99+
"referenceLocator": base64.StdEncoding.EncodeToString(must.A(json.Marshal(node))),
99100
"referenceType": "murphyjson",
100101
})
101102
if len(externalRefs) != 0 {

0 commit comments

Comments
 (0)