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

Port: Fix BOM validation failing when URL contains encoded [ and ] characters #755

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Jun 24, 2024

Description

Warning

This PR is based on #754, please review and merge that one first!

Ports DependencyTrack/dependency-track#3866 from Dependency-Track v4.11.4.

Addressed Issue

Relates to DependencyTrack/hyades#1190

Additional Details

N/A

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

* Updates `cyclonedx-core-java` to version `9.0.3`
* ~Bumps Jackson to version `2.17.1` to resolve compatibility issues with `cyclonedx-core-java`~
    * Jackson was already updated
* Resolve various compilation errors due to refactoring in `cyclonedx-core-java`
* Add validator tests for all CycloneDX versions

Note that BOM exports will continue to use v1.5 for the time being. This avoids breaking users' workflows in case their tooling doesn't yet support v1.6.

Ports DependencyTrack/dependency-track#3863 from Dependency-Track v4.11.4.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro added defect Something isn't working v4-port PRs that were ported from the Dependency-Track v4.x code base labels Jun 24, 2024
@nscuro nscuro added this to the 5.5.0 milestone Jun 24, 2024
Caused by updating the transitive dependency on https://github.com/networknt/json-schema-validator via `cyclonedx-core-java`.

Signed-off-by: nscuro <[email protected]>
…acters

Also drop dependency on outdated `xercesImpl`. `xercesImpl` does not support the `http://javax.xml.XMLConstants/property/accessExternalDTD` property that `cyclonedx-core-java` is using:

```
java.lang.IllegalArgumentException: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
	at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(Unknown Source)
	at org.cyclonedx.parsers.XmlParser.createSecureDocument(XmlParser.java:339)
	at org.cyclonedx.parsers.XmlParser.extractAllNamespaceDeclarations(XmlParser.java:310)
	at org.cyclonedx.parsers.XmlParser.identifySchemaVersion(XmlParser.java:296)
	at org.cyclonedx.parsers.XmlParser.parse(XmlParser.java:97)
```

~The remaining code relying on `xerces` turned out to be unused, and was consequently removed as well.~ Code depending on `xercesImpl` was removed already.

Ports DependencyTrack/dependency-track#3866 from Dependency-Track v4.11.4.

Signed-off-by: nscuro <[email protected]>
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.01% (target: -1.00%) 62.07% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d6a5ec9) 20484 16718 81.61%
Head commit (3e4ebeb) 20489 (+5) 16721 (+3) 81.61% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#755) 29 18 62.07%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences


🚀 Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

VithikaS
VithikaS previously approved these changes Jun 25, 2024
@nscuro nscuro dismissed VithikaS’s stale review June 25, 2024 09:03

The merge-base changed after approval.

@nscuro nscuro merged commit db16305 into main Jun 25, 2024
8 of 9 checks passed
@nscuro nscuro deleted the port-pr-3866 branch June 25, 2024 09:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
defect Something isn't working v4-port PRs that were ported from the Dependency-Track v4.x code base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants