add custom fingerprint support - #2263
Conversation
WalkthroughAdds a new CLI option and Options field to load a custom Wappalyzer fingerprint file. Runner initialization now conditionally creates the Wappalyzer client from the user-provided file when set; otherwise it uses the default. Documentation updated to list the new -cff/--custom-fingerprint-file probe option. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant CLI as CLI Parser
participant Runner as Runner.New
participant Wap as Wappalyzer
User->>CLI: httpx ... -tech-detect [-cff finger.json]
CLI->>Runner: Options{TechDetect, CustomFingerprintFile}
alt CustomFingerprintFile provided
Runner->>Wap: NewFromFile(file, includeCats=true, includeImplies=true)
Wap-->>Runner: *Wappalyze / error
else Default fingerprints
Runner->>Wap: New()
Wap-->>Runner: *Wappalyze / error
end
alt init error
Runner-->>CLI: return wrapped error
else success
Runner-->>CLI: initialized runner with wappalyzer
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks (3 passed, 2 inconclusive)❌ Failed checks (2 inconclusive)
✅ Passed checks (3 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. ✨ Finishing Touches
🧪 Generate unit tests
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
runner/options.go (1)
387-387: Early-validate -cff path and clarify help text
- Suggest validating that the file exists upfront to fail fast with a precise message.
- Minor: help text can mention the expected Wappalyzer fingerprints JSON format.
Apply in ValidateOptions (outside this hunk):
func (options *Options) ValidateOptions() error { + if options.CustomFingerprintFile != "" && !fileutil.FileExists(options.CustomFingerprintFile) { + return fmt.Errorf("custom fingerprint file '%s' does not exist", options.CustomFingerprintFile) + }Optional help-text tweak (this line):
- flagSet.StringVarP(&options.CustomFingerprintFile, "custom-fingerprint-file", "cff", "", "path to a custom fingerprint file for technology detection"), + flagSet.StringVarP(&options.CustomFingerprintFile, "custom-fingerprint-file", "cff", "", "path to a custom Wappalyzer fingerprints JSON file (fingerprints_data.json format) for technology detection"),runner/runner.go (1)
122-127: Replace vs. merge semantics for custom fingerprints; wrap error with file pathCurrent call loads embedded fingerprints and then supersedes with the file. If the intent is “use instead of the built-in database,” prefer loadEmbedded=false (supersede ignored). Also wrap the error with the file path for clearer diagnostics. Signature: NewFromFile(filePath string, loadEmbedded, supersede bool). (pkg.go.dev)
- runner.wappalyzer, err = func() (*wappalyzer.Wappalyze, error) { - if options.CustomFingerprintFile != "" { - return wappalyzer.NewFromFile(options.CustomFingerprintFile, true, true) - } - return wappalyzer.New() - }() + runner.wappalyzer, err = func() (*wappalyzer.Wappalyze, error) { + if options.CustomFingerprintFile != "" { + wa, err := wappalyzer.NewFromFile(options.CustomFingerprintFile, false, false) + if err != nil { + return nil, errors.Wrapf(err, "load custom fingerprints from %q", options.CustomFingerprintFile) + } + return wa, nil + } + return wappalyzer.New() + }()If you actually want “overlay and override” behavior (keep built-ins + custom overrides), keep loadEmbedded=true, supersede=true, but please confirm this matches the product expectation.
README.md (1)
118-119: Help text: specify expected file formatTo reduce ambiguity, note that the file should be a Wappalyzer fingerprints JSON (fingerprints_data.json-compatible). Keep README in sync with the CLI help string.
- -cff, -custom-fingerprint-file string path to a custom fingerprint file for technology detection + -cff, -custom-fingerprint-file string path to a custom Wappalyzer fingerprints JSON file (fingerprints_data.json) for technology detection
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.md(1 hunks)runner/options.go(2 hunks)runner/runner.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Test Builds (windows-latest)
- GitHub Check: Test Builds (macOS-latest)
- GitHub Check: Test Builds (ubuntu-latest)
- GitHub Check: Functional Test (macOS-latest)
- GitHub Check: Functional Test (windows-latest)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
runner/options.go (1)
260-260: CustomFingerprintFile on Options — LGTMExported field is consistent with existing config/flag plumbing.
closes #1803
Summary by CodeRabbit
New Features
Documentation