Skip to content

Commit d294a99

Browse files
Added callstack support back into spec and test cases.
Signed-off-by: Steve Springett <[email protected]>
1 parent 04de7dc commit d294a99

File tree

5 files changed

+205
-0
lines changed

5 files changed

+205
-0
lines changed

schema/bom-1.5.schema.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,66 @@
13451345
}
13461346
}
13471347
},
1348+
"callstack": {
1349+
"type": "object",
1350+
"description": "Evidence of the components use through the callstack.",
1351+
"additionalProperties": false,
1352+
"properties": {
1353+
"frames": {
1354+
"type": "array",
1355+
"title": "Methods",
1356+
"additionalItems": false,
1357+
"items": {
1358+
"type": "object",
1359+
"required": [
1360+
"module"
1361+
],
1362+
"additionalProperties": false,
1363+
"properties": {
1364+
"package": {
1365+
"title": "Package",
1366+
"description": "A package organizes modules into namespaces, providing a unique namespace for each type it contains.",
1367+
"type": "string"
1368+
},
1369+
"module": {
1370+
"title": "Module",
1371+
"description": "A module or class that encloses functions/methods and other code.",
1372+
"type": "string"
1373+
},
1374+
"function": {
1375+
"title": "Function",
1376+
"description": "A block of code designed to perform a particular task.",
1377+
"type": "string"
1378+
},
1379+
"parameters": {
1380+
"title": "Parameters",
1381+
"description": "Optional arguments that are passed to the module or function.",
1382+
"type": "array",
1383+
"additionalItems": false,
1384+
"items": {
1385+
"type": "string"
1386+
}
1387+
},
1388+
"line": {
1389+
"title": "Line",
1390+
"description": "The line number the code that is called resides on.",
1391+
"type": "integer"
1392+
},
1393+
"column": {
1394+
"title": "Column",
1395+
"description": "The column the code that is called resides.",
1396+
"type": "integer"
1397+
},
1398+
"fullFilename": {
1399+
"title": "Full Filename",
1400+
"description": "The full path and filename of the module.",
1401+
"type": "string"
1402+
}
1403+
}
1404+
}
1405+
}
1406+
}
1407+
},
13481408
"licenses": {
13491409
"type": "array",
13501410
"additionalItems": false,

schema/bom-1.5.xsd

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,81 @@ limitations under the License.
18241824
</xs:sequence>
18251825
</xs:complexType>
18261826
</xs:element>
1827+
<xs:element name="callstack" minOccurs="0" maxOccurs="1">
1828+
<xs:annotation>
1829+
<xs:documentation>Evidence of the components use through the callstack.</xs:documentation>
1830+
</xs:annotation>
1831+
<xs:complexType>
1832+
<xs:sequence>
1833+
<xs:element name="frames" minOccurs="0" maxOccurs="1">
1834+
<xs:complexType>
1835+
<xs:sequence>
1836+
<xs:element name="frame" minOccurs="0" maxOccurs="unbounded">
1837+
<xs:complexType>
1838+
<xs:sequence>
1839+
<xs:element name="package" type="xs:string" minOccurs="0" maxOccurs="1">
1840+
<xs:annotation>
1841+
<xs:documentation>A package organizes modules into namespaces, providing a unique namespace for each type it contains.</xs:documentation>
1842+
</xs:annotation>
1843+
</xs:element>
1844+
<xs:element name="module" type="xs:string" minOccurs="1" maxOccurs="1">
1845+
<xs:annotation>
1846+
<xs:documentation>A module or class that encloses functions/methods and other code.</xs:documentation>
1847+
</xs:annotation>
1848+
</xs:element>
1849+
<xs:element name="function" type="xs:string" minOccurs="0" maxOccurs="1">
1850+
<xs:annotation>
1851+
<xs:documentation>A block of code designed to perform a particular task.</xs:documentation>
1852+
</xs:annotation>
1853+
</xs:element>
1854+
<xs:element name="parameters" minOccurs="0" maxOccurs="1">
1855+
<xs:annotation>
1856+
<xs:documentation>Optional arguments that are passed to the module or function.</xs:documentation>
1857+
</xs:annotation>
1858+
<xs:complexType>
1859+
<xs:sequence>
1860+
<xs:element name="parameter" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
1861+
</xs:sequence>
1862+
</xs:complexType>
1863+
</xs:element>
1864+
<xs:element name="line" type="xs:integer" minOccurs="0" maxOccurs="1">
1865+
<xs:annotation>
1866+
<xs:documentation>The line number the code that is called resides on.</xs:documentation>
1867+
</xs:annotation>
1868+
</xs:element>
1869+
<xs:element name="column" type="xs:integer" minOccurs="0" maxOccurs="1">
1870+
<xs:annotation>
1871+
<xs:documentation>The column the code that is called resides.</xs:documentation>
1872+
</xs:annotation>
1873+
</xs:element>
1874+
<xs:element name="fullFilename" type="xs:string" minOccurs="0" maxOccurs="1">
1875+
<xs:annotation>
1876+
<xs:documentation>The full path and filename of the module.</xs:documentation>
1877+
</xs:annotation>
1878+
</xs:element>
1879+
</xs:sequence>
1880+
</xs:complexType>
1881+
</xs:element>
1882+
</xs:sequence>
1883+
</xs:complexType>
1884+
</xs:element>
1885+
<xs:element name="tools" minOccurs="0" maxOccurs="1">
1886+
<xs:annotation>
1887+
<xs:documentation>
1888+
The object in the BOM identified by its bom-ref. This is often a component or service,
1889+
but may be any object type supporting bom-refs. Tools used for analysis should already
1890+
be defined in the BOM, either in the metadata/tools, components, or formulation.
1891+
</xs:documentation>
1892+
</xs:annotation>
1893+
<xs:complexType>
1894+
<xs:sequence>
1895+
<xs:element name="tool" type="bom:bomReferenceType" minOccurs="0" maxOccurs="unbounded"/>
1896+
</xs:sequence>
1897+
</xs:complexType>
1898+
</xs:element>
1899+
</xs:sequence>
1900+
</xs:complexType>
1901+
</xs:element>
18271902
<xs:element name="licenses" type="bom:licenseChoiceType" minOccurs="0" maxOccurs="1"/>
18281903
<xs:element name="copyright" type="bom:copyrightsType" minOccurs="0" maxOccurs="1"/>
18291904
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">

tools/src/test/resources/1.5/valid-evidence-1.5.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@
5353
"location": "/another/path/to/component"
5454
}
5555
],
56+
"callstack": {
57+
"frames": [
58+
{
59+
60+
"package": "com.apache.logging.log4j.core",
61+
"module": "Logger.class",
62+
"function": "logMessage",
63+
"parameters": [
64+
"com.acme.HelloWorld", "Level.INFO", "null", "Hello World"
65+
],
66+
"line": 150,
67+
"column": 17,
68+
"fullFilename": "/path/to/log4j-core-2.14.0.jar!/org/apache/logging/log4j/core/Logger.class",
69+
},
70+
{
71+
"module": "HelloWorld.class",
72+
"function": "main",
73+
"line": 20,
74+
"column": 12,
75+
"fullFilename": "/path/to/HelloWorld.class"
76+
}
77+
]
78+
},
5679
"licenses": [
5780
{
5881
"license": {

tools/src/test/resources/1.5/valid-evidence-1.5.textproto

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ components {
5252
location: "/another/path/to/component"
5353
}
5454
],
55+
callstack: {
56+
frames: [
57+
{
58+
package: "com.apache.logging.log4j.core"
59+
module: "Logger.class"
60+
function: "logMessage"
61+
parameters: [
62+
"com.acme.HelloWorld", "Level.INFO", "null", "Hello World"
63+
],
64+
line: 150
65+
column: 17
66+
fullFilename: "/path/to/log4j-core-2.14.0.jar!/org/apache/logging/log4j/core/Logger.class"
67+
},
68+
{
69+
module: "HelloWorld.class"
70+
function: "main"
71+
line: 20
72+
column: 12
73+
fullFilename: "/path/to/HelloWorld.class"
74+
}
75+
]
76+
},
5577
licenses {
5678
license {
5779
id: "Apache-2.0"

tools/src/test/resources/1.5/valid-evidence-1.5.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,31 @@
4545
<location>/another/path/to/component</location>
4646
</occurrence>
4747
</occurrences>
48+
<callstack>
49+
<frames>
50+
<frame>
51+
<package>com.apache.logging.log4j.core</package>
52+
<module>Logger.class</module>
53+
<function>logMessage</function>
54+
<parameters>
55+
<parameter>com.acme.HelloWorld</parameter>
56+
<parameter>Level.INFO</parameter>
57+
<parameter>null</parameter>
58+
<parameter>Hello World</parameter>
59+
</parameters>
60+
<line>150</line>
61+
<column>17</column>
62+
<fullFilename>/path/to/log4j-core-2.14.0.jar!/org/apache/logging/log4j/core/Logger.class</fullFilename>
63+
</frame>
64+
<frame>
65+
<module>HelloWorld.class</module>
66+
<function>main</function>
67+
<line>20</line>
68+
<column>12</column>
69+
<fullFilename>/path/to/HelloWorld.class</fullFilename>
70+
</frame>
71+
</frames>
72+
</callstack>
4873
<licenses>
4974
<license>
5075
<id>Apache-2.0</id>

0 commit comments

Comments
 (0)