-
Notifications
You must be signed in to change notification settings - Fork 29
add support for OpenChain Telco compliance #261
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
Merged
riteshnoronha
merged 9 commits into
interlynk-io:main
from
viveksahu26:openchain_telco_report_#243
Jul 1, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
79597cf
add compliance cmd support for openchain telco sboms standards
viveksahu26 c5d0a3c
refractor and added test for oct compliance report
viveksahu26 cb79644
update impacted changes due to refractoring
viveksahu26 20a34d1
set unknown value for few data fields
viveksahu26 ff467f2
more refraction and added test for remaining oct attributed
viveksahu26 6f88a1e
add test for failure cases
viveksahu26 70ee307
remove unwanted code
viveksahu26 ef301ac
run go mod tidy
viveksahu26 32eefc4
remove unnecessary details
viveksahu26 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
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 |
|---|---|---|
|
|
@@ -17,19 +17,23 @@ package compliance | |
| import ( | ||
| "context" | ||
| "errors" | ||
| "fmt" | ||
|
|
||
| "github.com/interlynk-io/sbomqs/pkg/logger" | ||
| "github.com/interlynk-io/sbomqs/pkg/sbom" | ||
| ) | ||
|
|
||
| const CRA_REPORT = "CRA" | ||
| const NTIA_REPORT = "NTIA" | ||
| const ( | ||
| CRA_REPORT = "CRA" | ||
| NTIA_REPORT = "NTIA" | ||
| OCT_TELCO = "OCT" | ||
| ) | ||
|
|
||
| func ComplianceResult(ctx context.Context, doc sbom.Document, reportType, fileName, outFormat string) error { | ||
| log := logger.FromContext(ctx) | ||
| log.Debug("compliance.ComplianceResult()") | ||
|
|
||
| if reportType != CRA_REPORT && reportType != NTIA_REPORT { | ||
| if reportType != CRA_REPORT && reportType != NTIA_REPORT && reportType != OCT_TELCO { | ||
| log.Debugf("Invalid report type: %s\n", reportType) | ||
| return errors.New("invalid report type") | ||
| } | ||
|
|
@@ -57,5 +61,13 @@ func ComplianceResult(ctx context.Context, doc sbom.Document, reportType, fileNa | |
| ntiaResult(ctx, doc, fileName, outFormat) | ||
| } | ||
|
|
||
| if reportType == OCT_TELCO { | ||
| if doc.Spec().GetSpecType() != "spdx" { | ||
| fmt.Println("The Provided SBOM spec is other than SPDX. Open Chain Telco only support SPDX specs SBOMs.") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| return nil | ||
| } | ||
| octResult(ctx, doc, fileName, outFormat) | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
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.
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.
Remove all the details in () not required. e.g DataLicense(SBOM_LICENSE) we don't require (SBOM_LICENSE)