fix(content): generic contentlet deterministic id seed now includes all non-system field values (#36855) - #37274
Conversation
…entlet deterministic id seed (#36855)
|
Claude finished @gortiz-dotcms's task in 1m 59s —— View job 🔍 dotCMS Backend ReviewRe-reviewed after the latest push ( Resolved
New Issues
Test gaps (non-blocking)
Nothing here blocks merge — the escaping and log redaction correctly close the two prior findings. |
🔍 dotCMS Backend Review[🟡 Medium]
Logger.debug(DeterministicIdentifierAPIImpl.class,
String.format(" assetType: %s, assetName: %s, deterministicId: %s",
assetType, assetName, deterministicId));💡 Don't log the raw [🟡 Medium]
.map(field -> {
final Object value = contentlet.get(field.variable());
return value != null ? field.variable() + "=" + value : null;
})
.filter(Objects::nonNull)
.collect(Collectors.joining("|"));💡 Escape Next steps
|
…g log (#36855) Escape backslash, pipe, and equals in field values so crafted values cannot produce an identical seed for different contentlets. Replace raw assetName in the debug log with its character count to avoid leaking field data when DEBUG logging is enabled. Refs: #36855 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
816686b
Summary
DeterministicIdentifierAPIImpl.resolveAssetName(Versionable)fell back tocontentlet.getTitle()for all non-Host/FileAsset/HTMLPage/Persona contentlets. Two independently authored contentlets on separate instances with the same type, host, folder, and title received an identical SHA-256 seed — and thus the same deterministic identifier — regardless of all other field values.fieldVar=value|fieldVar2=value2). Two contentlets with the same title but different data produce distinct seeds; two truly identical contentlets still hash to the same identifier, preserving legitimate cross-environment push matching.Test plan
./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false -Dit.test=DeterministicIdentifierAPITest— all existing tests must pass, including the newTest_GenericContentlet_SameTitleDifferentFieldValues_GetDifferentIdsDevicecontentlet on System Host withname=iphonebut different CSS Width values — verify both get different identifiers (reproduces the issue Deterministic identifier for generic contentlets is seeded only on title, causing cross-environment collisions and silent overwrite on push publish #36855 scenario)Closes #36855
🤖 Generated with Claude Code