Repository navigation
Conversation
The -max-results flag was only honored by the virustotal source; every other paginating source kept walking its cursor/pages and burning API quota even when a cap was requested. Apply the same early-stop pattern to the remaining paginating sources (censys, certspotter, shodan, securitytrails, quake, dnsdb, onyphe, rsecloud, redhuntlabs, urlscan, merklemap, commoncrawl): once session.MaxResults results have been emitted the source returns instead of requesting the next page. Single-request sources are unaffected. Add httptest-based coverage for censys and certspotter proving the cap stops pagination and bounds the request count, and update the flag help text and docs to reflect the broader support.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe CLI documentation now defines ChangesMax-results enforcement
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Session
participant Source
participant ProviderAPI
participant ResultsChannel
Session->>Source: provide MaxResults
Source->>ProviderAPI: request page or stream
ProviderAPI-->>Source: return subdomain results
Source->>ResultsChannel: emit results
Source->>Source: stop when MaxResults is reached
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/subscraping/sources/onyphe/onyphe.go`:
- Around line 103-112: Update the emit helper in the Onyphe source to send
results with a select that also observes ctx.Done(), returning immediately with
the appropriate uncapped status when cancellation occurs. Preserve the existing
empty-subdomain filtering, result counting, and maxResults cap behavior for
successful channel sends.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1dad9316-2714-4d9d-86b5-82c711ab6647
📒 Files selected for processing (16)
README.mdpkg/runner/options.gopkg/subscraping/sources/censys/censys.gopkg/subscraping/sources/censys/censys_maxresults_test.gopkg/subscraping/sources/certspotter/certspotter.gopkg/subscraping/sources/certspotter/certspotter_test.gopkg/subscraping/sources/commoncrawl/commoncrawl.gopkg/subscraping/sources/dnsdb/dnsdb.gopkg/subscraping/sources/merklemap/merklemap.gopkg/subscraping/sources/onyphe/onyphe.gopkg/subscraping/sources/quake/quake.gopkg/subscraping/sources/redhuntlabs/redhuntlabs.gopkg/subscraping/sources/rsecloud/rsecloud.gopkg/subscraping/sources/securitytrails/securitytrails.gopkg/subscraping/sources/shodan/shodan.gopkg/subscraping/sources/urlscan/urlscan.go
|
Good catch — updated the onyphe |
subfinder 2.16.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre><!-- Release notes generated using configuration in .github/release.yml at main --> ## What's Changed * feat(sources): honor -max-results across paginating sources by @Gerijacki in projectdiscovery/subfinder#1810 * fix(extractor): match the target domain literally and reject partial hosts by @Gerijacki in projectdiscovery/subfinder#1811 * fix(subscraping): cap untrusted source response bodies with a size limit by @adamsjack711-ux in projectdiscovery/subfinder#1809 * fix(subscraping): use DialContext instead of the deprecated Dial by @jonaslejon in projectdiscovery/subfinder#1835 * feat: add scanmalware passive source by @jonaslejon in projectdiscovery/subfinder#1834 * fix(crtsh): set statement_timeout via SQL query to avoid PgBouncer handshake rejection (#1828) by @gcoinstash-cmd in projectdiscovery/subfinder#1832 ## New Contributors * @J12934 made their first contribution in projectdiscovery/subfinder#1823 * @adamsjack711-ux made their first contribution in projectdiscovery/subfinder#1809 * @gcoinstash-cmd made their first contribution in projectdiscovery/subfinder#1832 **Full Changelog**: https://github.com/projectdiscovery/subfinder/compare/v2.15.0...v2.16.0</pre> <p>View the full release notes at <a href="https://github.com/projectdiscovery/subfinder/releases/tag/v2.16.0">https://github.com/projectdiscovery/subfinder/releases/tag/v2.16.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!17505
Summary
-max-results(-mr) is currently honored only by thevirustotalsource. Every other paginating source keeps walking its cursor/pages to the end and burns API quota even when the user explicitly asked for a cap.This applies the same early-stop pattern already used by
virustotalto the rest of the paginating sources: oncesession.MaxResultsresults have been emitted, the source returns instead of requesting the next page.Sources updated
censys,certspotter,shodan,securitytrails,quake,dnsdb,onyphe,rsecloud,redhuntlabs,urlscan,merklemap,commoncrawl.Single-request sources are unaffected (there is nothing to paginate).
Behavior
0(default) means unlimited — existing behavior is unchanged, paid keys are never silently truncated.Tests
Added
httptest-based coverage forcensysandcertspotterproving that the cap stops pagination and bounds the number of requests, following the existingvirustotaltest pattern. Also updated the flag help text and README.Summary by CodeRabbit
max-resultsenforcement across multiple subdomain discovery sources.0continues to mean unlimited results.