Skip to content

Clean up device-detection terminology incorrectly ported to IP Intelligence #108

@justadreamer

Description

@justadreamer

Summary

Several identifiers, class names, test utilities, comments, and constants were ported verbatim from device-detection-java and still reference device-detection-specific concepts (Hash algorithm, User-Agent, Client Hints, TAC) that have no relevance to IP Intelligence. This also applies to ip-intelligence-java-examples.

ip-intelligence-java

1. "Hash" in class/file names

Rename or remove - "Hash" is the DD algorithm name, not relevant to IPI:

  • IPIntelligenceDataHash (interface)
  • IPIntelligenceDataHashDefault (class)
  • WrapperHash, DataValidatorHash, MetaDataHashTests, MetaDataHasherHash, ValueHashTests (test classes)
  • MetaDataHasher (test interface in shared module)
  • @ElementBuilder(alternateName = "HashIPIntelligence") in IPIntelligenceOnPremiseEngineBuilder.java:56
  • dataDownloadType = "HashV41" in IPIntelligenceOnPremiseEngineBuilder.java:62
  • Enums.java with IPIntelligenceAlgorithm { Hash, Pattern } - already @Deprecated, should be removed
  • On-premise Enums.java:27 - "match methods used by the Hash engine"
  • getHashFileName(), getHashFile() in FileUtils.java
  • HASH_URL in ClientHintsExampleTestBase.java:57
  • Test methods: Process_Hash_NoEvidence, Process_Hash_EmptyUserAgent, EvidenceKeys_Hash_*, MetaData_Hash_*, Values_Hash_*

2. User-Agent references

IPI works with IP addresses, not User-Agents:

  • UserAgentGenerator.java - entire class should be replaced with IP address test data
  • UA_FILE constant in FileUtils.java:47
  • IPIntelligenceOnPremiseEngine.java:48 - Javadoc: "This engine takes User-Agents and other relevant HTTP headers..."
  • Tests using UserAgentGenerator: IPIntelligenceTests.java, TestsBase.java (on-premise + cloud), ValueCloudTests.java
  • emptyUserAgent() in ProcessTests.java / Process_Hash_EmptyUserAgent test
  • ci/README.md:51 - "Evidence and User-Agent files"

3. Client Hints references

Entire ClientHintsExampleTestBase.java is DD-only - contains CHROME_UA, EDGE_UA, FIREFOX_UA, SAFARI_UA, CURL_UA, SEC-CH-UA-* header constants, DD property names (HardwareVendor, DeviceType, etc.). Remove or replace.

4. TAC / native model constants

TAC (Type Allocation Code) is a mobile device identifier, not IPI:

  • Constants.java - EVIDENCE_TAC_SUFFIX, EVIDENCE_QUERY_TAC_KEY, EVIDENCE_NATIVE_MODEL_SUFFIX, EVIDENCE_QUERY_NATIVE_MODEL_KEY
  • MultiIPIDataCloud.java:41 - "when certain evidence is provided (e.g. TAC)"
  • ci/README.md:25-26 - "downloading the enterprise TAC hash file", Product=V4TAC

ip-intelligence-java-examples

Note: The "mixed" examples (GettingStartedMixed, GettingStartedWebMixed) intentionally combine DD + IPI - DD references there are expected. The issues below are in pure IPI code and shared helpers.

5. Pure IPI examples with DD leftovers

OfflineProcessing.java (pure IPI example)

  • Lines 78-84: Javadoc shows User-Agent + Client Hints YAML evidence as the example format (header.user-agent, header.sec-ch-ua, header.sec-ch-ua-*). Should show IP addresses instead.

MetadataOnPrem.java (pure IPI example)

  • Lines 139-141: Evidence filter check uses header.user-agent as the example key. Should use an IP-related evidence key.

6. Shared web helper with DD-specific content

HtmlContentHelper.java (used by both pure IPI and mixed examples)

  • Line 94-98: Warning about "User-Agent Client Hints" browser support - not relevant when rendering pure IPI results
  • Line 126: Comment "we assume a CloudRequest or a HashEngine" - should say "IPIntelligenceOnPremiseEngine" (already correct on line 129, but the comment still says HashEngine)
  • Lines 179-197: doUachInfo() method outputs a full explanation of Client Hints (Sec-CH-UA, Accept-CH headers) - entirely DD-specific, not relevant to IPI

These DD-specific sections are shown even on pure IPI web pages. They should either be removed or conditionally rendered only when DD is present.

7. TAC references in examples shared code

  • KeyHelper.java:89-90 - "TAC lookup and Native Model are not available as a free service"
  • tacCloud.xml:27 - "TAC lookup and Native Model" comment - DD-specific config
  • .gitignore:45-46 - TAC-HashV41.hash and TAC-HashV41.hash.gz entries
  • pom.xml:143 - Comment about "special resource key with license for running TAC and Native Model examples"
  • 51Degrees-Cloud-Test.xml:31-33 - Comment referencing DD properties BrowserName, BrowserVendor, HardwareName, HardwareVendor, PlatformName, etc. (also has typo "HardeareVendor")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions