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

Invalid license URL is generated #889

Open
andreycha opened this issue Jun 27, 2024 · 3 comments
Open

Invalid license URL is generated #889

andreycha opened this issue Jun 27, 2024 · 3 comments
Labels
enhancement New feature or request ready for development Issue is sufficiently defined and suitable for contributors to start working

Comments

@andreycha
Copy link
Contributor

andreycha commented Jun 27, 2024

Hi,

Version 3.0.5 (tried also 3.0.8) seems to generate invalid license URL for one of the components. Note whitespace at the end:

    {
      "type": "library",
      "bom-ref": "pkg:nuget/[email protected]",
      "author": "Microsoft",
      "name": "Mvc4Futures",
      "version": "4.0.20710",
      "description": "ASP.NET MVC Futures includes unsupported prototype features for ASP.NET MVC, from the MVC team.",
      "scope": "required",
      "hashes": [
        {
          "alg": "SHA-512",
          "content": "FA3D285759CDD2BEDAD5632B267F76D0275DADE15B81EAA3DED2865B56C5A416E42BD558E1957E7A44D9BA63A719FCCBED30F586B7504ADE80441EA4F74C5031"
        }
      ],
      "licenses": [
        {
          "license": {
            "name": "Unknown - See URL",
            "url": "http://www.microsoft.com/web/webpi/eula/aspnetcomponent_enu.htm " <-- here
          }
        }
      ],
      "copyright": "Microsoft",
      "purl": "pkg:nuget/[email protected]",
      "externalReferences": [
        {
          "url": "http://aspnet.codeplex.com/",
          "type": "website"
        }
      ]
    }

BOM is generated as following:

dotnet cyclonedx "D:\BuildAgent\work\233fec8a519c12d7\Services\ServiceName\ServiceName.sln" -o dist\BOM
 -f bom.json -j -sn "ServiceName" -sv 1.2.3.4 --github-username *** --github-token ***

Not sure where the whitespace comes from, component page on Nuget.org has a valid URL.

Would appreciate any help.

@github-actions github-actions bot added the triage Don't know what to do with this yet label Jun 27, 2024
@andreycha
Copy link
Contributor Author

andreycha commented Jun 27, 2024

Okay, the nasty whitespace comes from nuspec file: https://api.nuget.org/v3-flatcontainer/Mvc4Futures/4.0.20710/Mvc4Futures.nuspec

Would it be possible/make sense to trim all urls for example?

@mtsfoni
Copy link
Contributor

mtsfoni commented Jun 28, 2024

I think a valid URL can never start or end with a whitespace, so I see no problem with that

@mtsfoni mtsfoni added enhancement New feature or request ready for development Issue is sufficiently defined and suitable for contributors to start working and removed triage Don't know what to do with this yet labels Jun 28, 2024
@andreycha
Copy link
Contributor Author

True. DependencyTrack has recently started to validate BOMs according to the specification. It requires all URLs to be valid RFC 3987 IRI-references where whitespace is not a valid character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready for development Issue is sufficiently defined and suitable for contributors to start working
Projects
None yet
Development

No branches or pull requests

2 participants