Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the """ WalkthroughThe changes update the ZoomEye integration to use the new unified API endpoint and request format, removing previous region-specific handling. The code now sends POST requests with base64-encoded queries, uses strongly-typed response structs, and simplifies API key configuration and extraction. Documentation and legacy logic were updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Agent
participant ZoomEyeAPI
User->>Agent: Submit search query
Agent->>Agent: Encode query in base64
Agent->>ZoomEyeAPI: POST /v2/search with JSON body (base64 query, page, pageSize)
ZoomEyeAPI-->>Agent: JSON response with results (typed fields)
Agent->>Agent: Parse response using ZoomEyeResult struct
Agent->>User: Return structured results
Assessment against linked issues
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
sources/provider.go (1)
149-156: 🛠️ Refactor suggestionEnvironment variable loading still expects
ZOOMEYE_HOST, contradicting new single-token design
appendIfAllExists(provider.ZoomEye, "ZOOMEYE_API_KEY", "ZOOMEYE_HOST")forces users to set an additional variable that is no longer used. It also builds the deprecatedtoken:hoststring discussed above.-provider.ZoomEye = appendIfAllExists(provider.ZoomEye, "ZOOMEYE_API_KEY", "ZOOMEYE_HOST") +// ZoomEye now requires only the API key +provider.ZoomEye = appendIfExists(provider.ZoomEye, "ZOOMEYE_API_KEY")Remember to delete the helper at the bottom of this function if it becomes unused.
🧹 Nitpick comments (3)
README.md (1)
185-194: Documentation drift – host-selection guidance is obsoleteThe paragraph explaining
zoomeye.orgvszoomeye.hksurvives, but the code has hard-wiredhttps://api.zoomeye.ai/v2/searchand no longer accepts a custom host. Please either:
- delete this section, or
- re-introduce host selection in code & provider config.
Keeping stale instructions will confuse users during migration.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
192-192: Unordered list indentation
Expected: 0; Actual: 1(MD007, ul-indent)
193-193: Unordered list indentation
Expected: 0; Actual: 1(MD007, ul-indent)
sources/agent/zoomeye/zoomeye.go (2)
82-88: Header spelling & additional resilienceZoomEye’s docs currently accept
API-KEY, but some examples showX-API-KEY. To be future-proof you could set both headers:request.Header.Set("API-KEY", session.Keys.ZoomEyeToken) request.Header.Set("X-API-KEY", session.Keys.ZoomEyeToken)Not mandatory, yet avoids sudden breakage if the service deprecates one header.
104-114: Minor optimisation – reusesourceResultallocationWithin tight loops this tiny optimisation avoids repeated allocations:
- for _, result := range zoomeyeResponse.Results { - sourceResult := sources.Result{Source: agent.Name()} - ... - } +for _, r := range zoomeyeResponse.Results { + sr := sources.Result{Source: agent.Name(), IP: r.IP, Port: r.Port, Host: r.Hostname} + sr.Raw, _ = json.Marshal(r) + results <- sr +}Not critical, but improves GC behaviour for large result sets.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
README.md(2 hunks)sources/agent/zoomeye/response.go(1 hunks)sources/agent/zoomeye/zoomeye.go(4 hunks)sources/keys.go(0 hunks)sources/provider.go(1 hunks)
💤 Files with no reviewable changes (1)
- sources/keys.go
🧰 Additional context used
🧬 Code Graph Analysis (1)
sources/agent/zoomeye/zoomeye.go (4)
sources/agent.go (1)
Query(3-6)sources/util.go (1)
NewHTTPRequest(10-17)sources/keys.go (1)
Keys(3-20)sources/result.go (1)
Result(8-17)
🪛 markdownlint-cli2 (0.17.2)
README.md
45-45: Bare URL used
null
(MD034, no-bare-urls)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Test Builds (macOS-13, 1.22.x)
- GitHub Check: Test Builds (windows-latest, 1.22.x)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
sources/agent/zoomeye/response.go (1)
4-11: Typed response greatly improves safety – nice work!Replacing the
map[string]interface{}approach with a concreteZoomEyeResultstruct eliminates repetitive type assertions and makes downstream code clearer.
ehsandeep
left a comment
There was a problem hiding this comment.
$ ./uncover -zoomeye 'app="MinIO Browser"'
__ ______ _________ _ _____ _____
/ / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ / __/ /
\__,_/_/ /_/\___/\____/|___/\___/_/
projectdiscovery.io
[INF] Current uncover version v1.0.10 (latest)
182.160.16.234:60217
182.160.16.234:60217
182.160.16.163:60217
182.160.16.163:60217
173.230.132.95:8822
173.230.132.95:8822
173.230.132.59:8822
173.230.132.59:8822
173.230.132.80:8822
173.230.132.80:8822
69.164.213.20:19200
69.164.213.20:19200
Closes #664
Summary by CodeRabbit
Documentation
New Features
Refactor