macaron
macaron copied to clipboard
Support PURL aliases in the data model
The PURL specification allows multiple PURL strings pointing to the same software component:
pkg:maven/org.apache.xmlgraphics/[email protected]
can be equivalent to
pkg:github.com/apache/xmlgraphics-batik@7464826697a268a20d6f871bf265915a71214a91
We need to support such aliases in the data model and load the same component from the database. One way to add support can be to add a new mapped object for PURL aliases, with a foreign key to the Component object.
At the moment, the implementation for determining the output directory for the report files relies on the PURL string (implementation here). This could potentially make the reports of two alias PURL strings got stored into two different places:
pkg:maven/org.apache.xmlgraphics/[email protected]-><output>/reports/maven/org_apache_xmlgraphics/batik_animpkg:github.com/apache/xmlgraphics-batik@7464826697a268a20d6f871bf265915a71214a91-><output>/reports/github_com/apache/xmlgraphics-batik
Therefore, we also need to make the behavior consistent when encountering alias PURL strings.