Skip to content
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

feat: Add complete License-Text to SBOM result #33

Open
jkowalleck opened this issue Mar 13, 2024 · 3 comments
Open

feat: Add complete License-Text to SBOM result #33

jkowalleck opened this issue Mar 13, 2024 · 3 comments
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@jkowalleck
Copy link
Member

jkowalleck commented Mar 13, 2024

caused by #22

similar to


Is your feature request related to a problem? Please describe.

For legal documentation, we need the original text of the licenses of components.

Describe the solution you'd like

An option to enable integration of the license-text in the BOM file, like the old @cyclonedx/bom package had, would be great to have again here.


read https://cyclonedx.org/news/cyclonedx-v1.3-released/#copyright-and-license-evidence

Acceptance criteria

  • the feature to add license texts should be enabled by a CLI switch called --gather-license-evidence (name to be discussed)
  • the feature is disabled per default
  • only if the feature is enabled:
    • for all components, meta-components, root-components and nested components:
      regardless of SPDX license ID, SPDX license expression or named license, the deteced license texts should be added, each as an evidence
      Examples:
      {
        //...
        "evidence": { 
          "licenses": [
            {"id":"Apache-2.0", "text": {
              "contentType": "text/plain",
              "encoding": "base64",
              // base64 of content of file `LICENSE`
              "content": "bG9yZW0gaXBzdW0="
            }}
            {"name":"file: NOTICE", "text": {
              "contentType": "text/plain",
              "encoding": "base64",
              // base46 of content of file `NOTICE`
              "content": "bG9yZW0gaXBzdW0="
            }}
          ]
        },
        // ...
      }
    • if a license text is detected with the package, it would be added to Component's @.evicence.licenses
      • @.name would be 'License of : '
      • @.text would hold the test
        • the content type is to be derived from file extension
        • the content SHOULD be base64 encoded
    • license files patterns are:
      • LICEN[CS]E*
      • NOTICE* -- addendum for Apache-2.0 and others
    • if no license text is shipped with a package, no license test is added as a evidence.
      Nope, no license template is derived from package's declared SPDX license id.
      Reason: license templates (like BSD clause 3) are designed to be modified (unlike others, like Apache2, which is not a template but a complete text)
@jkowalleck jkowalleck added the enhancement New feature or request label Mar 13, 2024
@jkowalleck jkowalleck added the help wanted Extra attention is needed label May 28, 2024
@jkowalleck
Copy link
Member Author

The license text feature was removed from the code, to ease the way to v1.0/MVP.
With the v1.0 release candidate being public for some time now, i do not expect any internal refactoring or changes soon. This means, the implementation is ready to be extended.

@AugustusKling, are you still interested in working on a license text gathering for component evidences?

@AugustusKling
Copy link
Contributor

@jkowalleck I'm still willing to provide code to add the license gathering. That said, I'm somewhat occupied these days so I don't know when this will happen.

So far I didn't even find time to go through your changes to the implementation nor to try it out to provide feedback.

@jkowalleck jkowalleck changed the title feat: Add complete License-Text to cyclonedx bom feat: Add complete License-Text to SBOM result Oct 8, 2024
@jkowalleck
Copy link
Member Author

A similar feature was added to the webpack plugin
see CycloneDX/cyclonedx-webpack-plugin#1309
see CycloneDX/cyclonedx-webpack-plugin#1312

AugustusKling added a commit to AugustusKling/cyclonedx-node-yarn that referenced this issue Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants