feat: implement license resolution and identification#356
feat: implement license resolution and identification#356soul2zimate merged 4 commits intoguacsec:mainfrom
Conversation
Add license analysis features that detect the project license, check dependency license compatibility, and include license information in generated SBOMs. This mirrors the JavaScript client implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review Summary by QodoImplement license resolution and identification with compatibility checking
WalkthroughsDescription• Implement comprehensive license resolution and identification features for Java client • Add componentAnalysisWithLicense() API method that performs component analysis with automatic license checking • Implement license detection from ecosystem-specific manifests (pom.xml, package.json, Cargo.toml) with LICENSE file fallback • Add license compatibility checking based on restrictiveness hierarchy (permissive < weak copyleft < strong copyleft) • Integrate license information into generated SBOMs with SPDX normalization • Add CLI license command to display project license information • Implement SPDX pattern matching for common licenses (Apache, MIT, GPL, LGPL, AGPL, BSD) • Create LicenseUtils, LicenseCheck, and ProjectLicense utility classes for license operations • Update all providers (Maven, JavaScript, Cargo, Go, Python, Gradle) to extract and include license information • Add comprehensive documentation and CLI help for license features • Update test fixtures and add new test cases for license extraction across ecosystems Diagramflowchart LR
A["Component Analysis"] -->|includes| B["License Detection"]
B -->|from manifest| C["Ecosystem Providers"]
B -->|fallback| D["LICENSE File"]
C -->|Maven| E["pom.xml"]
C -->|JavaScript| F["package.json"]
C -->|Cargo| G["Cargo.toml"]
B -->|backend| H["License Identification"]
H -->|SPDX| I["Normalized License"]
I -->|compatibility check| J["LicenseCheck"]
J -->|result| K["ComponentAnalysisResult"]
K -->|include in| L["SBOM with License"]
M["CLI license command"] -->|display| N["Project License Info"]
File Changes1. src/main/java/io/github/guacsec/trustifyda/impl/ExhortApi.java
|
Code Review by Qodo
1.
|
ruromero
left a comment
There was a problem hiding this comment.
The new feature must work great but I just noticed 2 small issues. One is mainly cosmetic
src/main/java/io/github/guacsec/trustifyda/providers/JavaMavenProvider.java
Show resolved
Hide resolved
src/main/java/io/github/guacsec/trustifyda/providers/CargoProvider.java
Outdated
Show resolved
Hide resolved
|
thanks @ruromero I have updated the PR with suggested changes. |
feat: implement license resolution and identification
Add license analysis features that detect the project license, check dependency license compatibility, and include license information in generated SBOMs. This mirrors the JavaScript client implementation.
resolve #355