-
Notifications
You must be signed in to change notification settings - Fork 697
Detect license ID from full text when incidentally provided as a value #3876
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
Conversation
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
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
5 tasks
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
spiffcs
commented
May 12, 2025
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
f70743a
to
d569180
Compare
wagoodman
reviewed
May 12, 2025
wagoodman
reviewed
May 12, 2025
wagoodman
reviewed
May 12, 2025
wagoodman
reviewed
May 12, 2025
wagoodman
reviewed
May 12, 2025
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
* main: Translate Portage license strings to SPDX expressions (#1763) fix: stop emitting redis redis CPE for PHP PECL redis (#3881) feat: Add PURL list input/output format (#3853) chore(deps): update CPE dictionary index (#3877) chore(deps): update tools to latest versions (#3878) do not search binary contents for version for go package (#3874) fix: remove race when writing errors in generic cataloger (#3875) clear devel version for go packages (#3873) Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
wagoodman
reviewed
May 13, 2025
wagoodman
reviewed
May 13, 2025
wagoodman
reviewed
May 13, 2025
wagoodman
reviewed
May 13, 2025
wagoodman
reviewed
May 13, 2025
wagoodman
reviewed
May 13, 2025
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
2604d47
to
e5f45f0
Compare
…scaner Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
wagoodman
reviewed
May 13, 2025
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman
approved these changes
May 13, 2025
This was referenced May 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR makes the following changes:
pkg.License.Content
field and fills in the ID topkg.License.Value
license.content
configuration, deprecating the existinglicense.include-unknown-license-content
configuration. The configuration allows for the following values:unknown
(default): only include contents for licenses that cannot be identifiednone
: never include license contentsall
: include license contents wherever possiblelicense.license-coverage
withlicense.coverage
Development details
The current license constructors have been deprecated. The new constructors are copies of the old ones but
WithContext
and acceptcontext.Context
as their new initial argument.By refactoring these constructors we can now access the
License Scanner
during license construction. This allows all catalogers the have afile.ReadCloser
to query the license scanner during license construction.This enables #3088 to be solved.
The new builder (under the ctx license constructors) has better logic surrounding how to detect if a metadata value is a license ID, some custom license title string, or actually the full contents itself. By detecting this at construction and running the scanner against metadata values that are likely license contents we can prevent
license.Value
from being populated with the full contents of the license text.All catalogers now return the full content of the licenses discovered. These contents are dropped from the licenses in a post processing step.
The user is given the option to enable if they want the contents of licenses to appear in their SBOM.
SPDX OtherLicenses
Given some of the changes made regarding how the values and IDs are set during license construction in this PR, the SPDX OtherLicenses format code has been moved to be done with SPDX package creation in syft's format modules.
When SPDX packages are having their
concluded
anddeclared
fields decorated, the spdx format code is now using the available license information to maintain a set ofspdx.OtherLicense
that will be returned with the packages.This is different from our previous approach where
spdx.OtherLicense
would be recomputed after packages had already been assembled. This new approach is easier to test given that the licenses under packages are compared withspdx.OtherLicense
when external validator tools are run against spdx formatted SBOM.Type of change
Checklist