这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mukesh-dream11
Copy link
Contributor

@mukesh-dream11 mukesh-dream11 commented Oct 1, 2025

Refer to #1649.

I've not tested the RemoveWildcard = true path yet, but the code looks fine to me. I've removed the original ResultCallback calls and placed them where they will be called sooner, which is hopefully acceptable.

Summary by CodeRabbit

  • New Features

    • Results now stream in real time: discovered subdomains are emitted immediately, and entries from wildcard resolution are surfaced as they’re resolved. This reduces latency and improves interactive workflows and integrations.
  • Refactor

    • Removed the final consolidated emission at the end of a run. Consumers should handle streaming updates during execution rather than relying on a single end-of-run callback. Existing output files and wildcard result queuing behavior remain unchanged.

@coderabbitai
Copy link

coderabbitai bot commented Oct 1, 2025

Walkthrough

Adds immediate ResultCallback emissions when a subdomain is discovered (if RemoveWildcard is false) and when wildcard-resolution produces a non-wildcard result; removes the final consolidated callback emission loop while keeping output writing and wildcard queuing intact.

Changes

Cohort / File(s) Summary
Runner enumeration callbacks
pkg/runner/enumerate.go
Emit HostEntry to ResultCallback at discovery time (when RemoveWildcard is false) and at wildcard-resolution time; remove the final aggregated callback emission loop; preserve output writing and wildcard result queuing.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant E as Enumerator
  participant D as DNS/Discovery
  participant W as Wildcard Resolver Pool
  participant C as ResultCallback

  rect rgba(220,235,255,0.4)
  note right of E: Discovery path (RemoveWildcard = false)
  E->>D: Discover subdomain
  D-->>E: HostEntry discovered
  E-->>C: Callback(HostEntry) [immediate]
  end

  rect rgba(235,255,220,0.4)
  note right of E: Wildcard resolution path
  E->>D: Queue candidate host(s)
  D-->>W: Submit for wildcard resolution
  W-->>E: Resolved HostEntry (non-wildcard)
  E-->>C: Callback(HostEntry) [on resolution]
  end

  rect rgba(255,230,230,0.15)
  note over E: Removed final aggregated emission loop
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through hosts with nimble cheer,
Ping! A name appears — I shout it clear.
No waiting till the end of run,
I share the news as soon as it's done.
Wildcards trimmed, the stream is near — thump-thump, real-time here! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change of emitting subdomain enumeration results in realtime via the updated callbacks, matching the modifications made to trigger these emissions earlier in the flow.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6ad51 and 50bbe41.

📒 Files selected for processing (1)
  • pkg/runner/enumerate.go (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/runner/enumerate.go (1)
pkg/resolve/resolve.go (1)
  • HostEntry (27-31)
⏰ 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). (4)
  • GitHub Check: Test Builds (ubuntu-latest)
  • GitHub Check: Test Builds (macOS-latest)
  • GitHub Check: Test Builds (windows-latest)
  • GitHub Check: Analyze (go)
🔇 Additional comments (2)
pkg/runner/enumerate.go (2)

97-99: LGTM: Real-time callback emission for non-wildcard path.

The callback is correctly invoked with a complete HostEntry (including Domain, Host, and Source) immediately upon discovery when wildcard removal is disabled. This achieves the real-time emission goal stated in the PR objectives.


131-133: LGTM: Real-time callback emission for wildcard-resolved results.

The callback correctly includes the Domain field (the issue flagged in the past review has been resolved). The HostEntry is now consistent with the non-wildcard path at lines 97-99, providing real-time emission of wildcard-resolved subdomains.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1464ef0 and 7e6ad51.

📒 Files selected for processing (1)
  • pkg/runner/enumerate.go (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/runner/enumerate.go (1)
pkg/resolve/resolve.go (1)
  • HostEntry (27-31)
🔇 Additional comments (1)
pkg/runner/enumerate.go (1)

97-99: Verify concurrent safety of OnResultCallback
OnResultCallback (type func(*resolve.HostEntry)) is now invoked from multiple goroutines (e.g., in enumerate.go), so any provided callback must safely handle concurrent calls.

@dogancanbakir dogancanbakir linked an issue Oct 2, 2025 that may be closed by this pull request
@dogancanbakir
Copy link
Member

Thanks for the PR!

@dogancanbakir dogancanbakir merged commit 1af75eb into projectdiscovery:dev Oct 2, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return enumerated subdomain results in realtime

2 participants