-
-
Notifications
You must be signed in to change notification settings - Fork 68
Added citation support and test cases. #630
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
Open
stevespringett
wants to merge
5
commits into
1.7-dev
Choose a base branch
from
1.7-dev-citations
base: 1.7-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
be626a9
Added citation support and test cases.
stevespringett 84f8e2e
Corrected tests
stevespringett ec18e41
corrected pointer repeating
stevespringett ddc4842
Added external ref for citation
stevespringett 7dba14f
docs: annotations
jkowalleck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,77 @@ | ||
{ | ||
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.7", | ||
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79", | ||
"version": 1, | ||
"metadata": { | ||
"timestamp": "2025-05-01T14:23:00Z", | ||
"authors": [ | ||
{ | ||
"bom-ref": "person-1", | ||
"name": "Alice Example", | ||
"email": "[email protected]" | ||
} | ||
] | ||
}, | ||
"components": [ | ||
{ | ||
"type": "library", | ||
"bom-ref": "component-1", | ||
"name": "example-lib", | ||
"version": "1.2.3", | ||
"licenses": [ | ||
{ | ||
"license": { | ||
"id": "Apache-2.0" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"citations": [ | ||
{ | ||
"bom-ref": "citation-1", | ||
"pointers": [ "/components/0/name" ], | ||
"timestamp": "2025-05-01T14:00:00Z", | ||
"attributedTo": "person-1", | ||
"note": "Manually entered by Alice Example" | ||
}, | ||
{ | ||
"bom-ref": "citation-2", | ||
"pointers": [ "/components/0/licenses/0/license/id" ], | ||
"timestamp": "2025-05-01T14:05:00Z", | ||
"attributedTo": "scan-tool-1", | ||
"process": "task-license-scan", | ||
"note": "Auto-detected by license scanner tool" | ||
} | ||
], | ||
"formulation": [ | ||
{ | ||
"components": [ | ||
{ | ||
"bom-ref": "scan-tool-1", | ||
"type": "application", | ||
"name": "My Scan Tool" | ||
} | ||
], | ||
"bom-ref": "workflow-1", | ||
"workflows": [ | ||
{ | ||
"bom-ref": "workflow-1", | ||
"uid": "259bae74-5ec4-4de8-9386-c91b1f7719b8", | ||
"name": "My workflow", | ||
"tasks": [ | ||
{ | ||
"bom-ref": "task-license-scan", | ||
"uid": "6d75f8d6-a008-41cf-8b65-c4129fc249f9", | ||
"taskTypes": [ "scan" ], | ||
"description": "License scan of the source files using OpenSourceScanner v2.1" | ||
} | ||
], | ||
"taskTypes": [ "scan" ] | ||
} | ||
] | ||
} | ||
] | ||
} |
75 changes: 75 additions & 0 deletions
75
tools/src/test/resources/1.7/valid-citations-1.7.textproto
This file contains hidden or 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,75 @@ | ||
# proto-file: schema/bom-1.7.proto | ||
# proto-message: Bom | ||
|
||
spec_version: "1.7" | ||
version: 1 | ||
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" | ||
|
||
metadata { | ||
timestamp { | ||
seconds: 1746118980 | ||
nanos: 0 | ||
} | ||
authors { | ||
bom_ref: "person-1" | ||
name: "Alice Example" | ||
email: "[email protected]" | ||
} | ||
} | ||
|
||
components { | ||
bom_ref: "component-1" | ||
type: CLASSIFICATION_LIBRARY | ||
name: "example-lib" | ||
version: "1.2.3" | ||
licenses { | ||
license { | ||
id: "Apache-2.0" | ||
} | ||
} | ||
} | ||
|
||
citations [ | ||
{ | ||
bom_ref: "citation-1" | ||
pointer: "/components/0/name" | ||
timestamp: { | ||
seconds: 1746108000 | ||
nanos: 0 | ||
} | ||
attributed_to: "person-1" | ||
note: "Manually entered by Alice Example" | ||
}, | ||
{ | ||
bom_ref: "citation-2" | ||
pointer: "/components/0/licenses/0/license/id" | ||
timestamp: { | ||
seconds: 1746108000 | ||
nanos: 0 | ||
} | ||
attributed_to: "scan-tool-1" | ||
process: "task-license-scan" | ||
note: "Auto-detected by license scanner tool" | ||
} | ||
] | ||
|
||
formulation { | ||
bom_ref: "workflow-1" | ||
components { | ||
bom_ref: "scan-tool-1" | ||
type: CLASSIFICATION_APPLICATION | ||
name: "My Scan Tool" | ||
} | ||
workflows { | ||
bom_ref: "workflow-1" | ||
uid: "259bae74-5ec4-4de8-9386-c91b1f7719b8" | ||
name: "My workflow" | ||
taskTypes: TASK_TYPE_SCAN | ||
tasks { | ||
bom_ref: "task-license-scan" | ||
uid: "6d75f8d6-a008-41cf-8b65-c4129fc249f9" | ||
taskTypes: TASK_TYPE_SCAN | ||
description: "License scan of the source files using OpenSourceScanner v2.1" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌
what is this
anyOf
supposed to mean?if i understand it correct, it means, atleast one of the following is required. ...
I missed a respective part in the XML and in the ProtoBuf - I would expect to see at least a text expressing this requirement.
i suggest
choice
if technically possible.