Skip to content

Commit 2bf3edc

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent efbbbf4 commit 2bf3edc

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

tools/src/test/resources/1.7/invalid-citations-1.7.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
{
3333
"bom-ref": "citation-1",
3434
"pointers": [ "/components/0/name" ],
35-
"expressions": [ "expression here" ],
35+
"expressions": [ "$..[?(@.bom-ref=='component-1')].version" ],
3636
"timestamp": "2025-05-01T14:00:00Z",
3737
"note": "Should not have both a pointer and expression."
3838
}

tools/src/test/resources/1.7/invalid-citations-1.7.textproto

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,32 @@ components {
1717
bom_ref: "component-1"
1818
name: "example-lib"
1919
version: "1.2.3"
20-
20+
licenses {
21+
license {
22+
id: "Apache-2.0"
23+
}
24+
}
2125
}
2226

23-
// continue here
27+
## !! NO formal check possible
28+
#citations {
29+
# bom_ref: "citation-1"
30+
# pointers: { pointer: "/components/0/name" }
31+
# timestamp {
32+
# seconds: 1746108000
33+
# nanos: 0
34+
# }
35+
# note: "Should have at least one of the following property sets: property 'attributedTo' or property 'process'"
36+
#}
37+
38+
39+
citations {
40+
bom_ref: "citation-1"
41+
pointers: { pointer: "/components/0/name" }
42+
expressions: { expression: "$..[?(bom_ref=='component-1')].version" }
43+
timestamp {
44+
seconds: 1746108000
45+
nanos: 0
46+
}
47+
note: "Should not have both a pointer and expression."
48+
}

tools/src/test/resources/1.7/invalid-citations-1.7.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<pointer>/components/0/licenses/0/license/id</pointer>
9090
</pointers>
9191
<expressions>
92-
<expression>expression here</expression>
92+
<expression>//*[@bom-ref='component-1']/version</expression>
9393
</expressions>
9494
<timestamp>2025-05-01T14:05:00Z</timestamp>
9595
<process>task-license-scan</process>

tools/src/test/resources/1.7/valid-citations-1.7.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@
4646
},
4747
{
4848
"bom-ref": "citation-3",
49+
"expression": "$..[?(@.bom-ref=='component-1')].version",
50+
"timestamp": "2025-05-01T14:00:00Z",
51+
"process": "task-license-scan",
52+
"note": "Semi-manually entered by Alice Example - with `process`"
53+
},
54+
{
55+
"bom-ref": "citation-4",
4956
"expressions": [ "$.components[*].licenses[*].license.id" ],
5057
"timestamp": "2025-05-01T14:05:00Z",
5158
"attributedTo": "scan-tool-1",

tools/src/test/resources/1.7/valid-citations-1.7.textproto

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ citations [
4141
note: "Manually entered by Alice Example"
4242
},
4343
{
44-
bom_ref: "citation-1"
44+
bom_ref: "citation-2"
4545
pointers: { pointer: "/components/0/name" }
4646
timestamp: {
4747
seconds: 1746108000
@@ -52,6 +52,16 @@ citations [
5252
},
5353
{
5454
bom_ref: "citation-3"
55+
expressions: { expression: "$..[?(bom_ref=='component-1')].version" }
56+
timestamp: {
57+
seconds: 1746108000
58+
nanos: 0
59+
}
60+
process: "task-license-scan"
61+
note: "Semi-manually entered by Alice Example - with `process`"
62+
},
63+
{
64+
bom_ref: "citation-4"
5565
expressions: { expression: "$.components[*].licenses[*].license.id" }
5666
timestamp: {
5767
seconds: 1746108000

tools/src/test/resources/1.7/valid-citations-1.7.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@
6767
<note>Semi-manually entered by Alice Example - with `process`</note>
6868
</citation>
6969
<citation bom-ref="citation-3">
70+
<expressions>
71+
<expression>//*[@bom-ref='component-1']/version</expression>
72+
</expressions>
73+
<timestamp>2025-05-01T14:00:00Z</timestamp>
74+
<attributedTo>person-1</attributedTo>
75+
<note>Semi-manually entered by Alice Example - with `process`</note>
76+
</citation>
77+
<citation bom-ref="citation-4">
7078
<expressions>
7179
<expression>/components/component/licenses/license/id</expression>
7280
</expressions>

0 commit comments

Comments
 (0)