Skip to content

T2.x.2 hardening: drop test-scope javafaker in sitemanage and metadata (fully removes snakeyaml 1.x) #100

Description

@natechadwick-intsof

Summary

PR #99 removed the production-scope javafaker from modules/perc-security-utils, but two test files still declare javafaker at <scope>test</scope> in their own poms and keep pulling in org.yaml:snakeyaml:1.23-android on the test classpath. This slice replaces the Faker calls in those two files with inline random text and removes the now-unused javafaker dep declarations, so the project's full dep graph has no snakeyaml:1.x left at any scope.

Why

After PR #99, Dependabot's 8 SnakeYAML alerts (#102-#109) were dismissed manually with reason not_used. The dismissal is correct — the remaining 1.23-android is dev-scope and unreachable from production — but a fully clean dep graph is the more defensible state: no future Dependabot re-scan can resurrect an alert, no new contributor is tempted to use Faker in production code, and the 16-CVE transitive goes away for good.

What changes

projects/sitemanage/.../PSDefaultPasswordEncryptionBeanTest.java

Replace:

Faker faker = new Faker();
String testPassword = faker.aquaTeenHungerForce().character().toString();

with:

// Use UUID for random test data; was com.github.javafaker.Faker (drops snakeyaml:1.23-android).
String testPassword = "test-" + java.util.UUID.randomUUID();

The test only checks that a password round-trips through encryption; the specific text content is irrelevant.

deliverytiersuite/delivery-tier-suite/metadata/.../PSMetadataQueryServiceTest.java

Replace the three Faker faker = new Faker(); blocks with simple string concatenation that uses the existing entryIdx counter (which is already incremented per entry). The categories are already derived from per-entry indices for the rest of the test; the faker calls were just adding noise that varied between runs.

projects/sitemanage/pom.xml and deliverytiersuite/delivery-tier-suite/metadata/pom.xml

Remove the javafaker <dependency> blocks. After the test changes, nothing references com.github.javafaker.* in either module.

Verification

  • ./mvn-env.sh dependency:tree -pl projects/sitemanage,deliverytiersuite/delivery-tier-suite/metadata -Dincludes=org.yaml:snakeyaml,com.github.javafaker → both filters return empty.
  • ./mvn-env.sh test -pl projects/sitemanage -Dtest=PSDefaultPasswordEncryptionBeanTest → passes.
  • ./mvn-env.sh test -pl deliverytiersuite/delivery-tier-suite/metadata -Dtest=PSMetadataQueryServiceTest → passes.
  • A grep for com.github.javafaker across the entire project source tree returns no files (the import + class references are all gone).

Out of scope

References

Co-Authored by Mavis v1.0.0 using minimax-m3 with agent mavis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency fileenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions