feat(rescan): add rescan command for live rescans - #84
Open
Aidan Holland (thehappydinoa) wants to merge 5 commits into
Open
Aidan Holland (thehappydinoa) wants to merge 5 commits into
Aidan Holland (thehappydinoa) wants to merge 5 commits into
Conversation
Adds `censys rescan` command that initiates a live rescan via the Censys API and polls for completion, reporting progress as it waits. - Client: CreateTrackedScan and GetTrackedScan methods on GlobalDataClient - App service: rescan.Service handles target construction, initiation, and polling loop - Command: supports --ip/--port/--protocol/--transport-protocol for service targets and --hostname/--port for web origin targets - Context: RescanService memoized factory + WithRescanService test opt - Root: wired into command tree Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lags Replaces --ip/--hostname/--port/--protocol with a single <url> argument. The scheme maps to the application protocol (uppercased), host determines target type (IP → service, hostname → web origin), and port is parsed from the URL. --transport-protocol remains as an optional flag (default tcp). Examples: censys rescan http://1.1.1.1:80 censys rescan rtsp://203.0.113.5:554 censys rescan http://example.com:8088/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a lookup table for common URL schemes so users can omit the port when it is implied (e.g. http://1.1.1.1 → port 80) and maps TLS variants to their base Censys protocol name (https→HTTP, smtps→SMTP, ldaps→LDAP, etc.). Each scheme also carries a default transport protocol so dns:// correctly uses UDP without needing --transport-protocol. --transport-protocol still overrides the scheme default when explicitly set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Returning cerr directly preserves the structured ClientError title and status code. Wrapping in cenclierrors.NewCencliError() would lose that context and show "Unknown Error" for 403/402 responses. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
censys rescan <url>command that initiates a live rescan via the Censys API and polls until completionhttps://→HTTP,dns://→DNS/UDP,smtps://→SMTP)https://1.1.1.1→ port 443)--transport-protocolflag overrides the scheme-derived default when neededcompleted: trueTest plan
censys rescan http://1.1.1.1:80— service target, completes successfullycensys rescan https://1.1.1.1— maps to HTTP/443/tcp without specifying port🤖 Generated with Claude Code