diff options
| author | s <[email protected]> | 2025-11-10 15:22:32 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-10 15:22:32 -0500 |
| commit | 8383a241fc3cf5b022c9c53f8f19690edf04177b (patch) | |
| tree | 887a489f7931d07373530c7e053f0343dca65e1d /cmd/osint.go | |
| parent | 9a9e79f232b83d3bd2a816287272515863df1299 (diff) | |
| download | dborg-8383a241fc3cf5b022c9c53f8f19690edf04177b.tar.gz dborg-8383a241fc3cf5b022c9c53f8f19690edf04177b.zip | |
refactor: restructure client modules and add config file supportv0.8.1
- Split large osint.go client into focused modules (bssid.go, breachforum.go, buckets.go, etc.)
- Add config file support with init command for API key management
- Remove api-key flag in favor of config file + env var fallback
- Update API paths to remove /osint prefix
- Add crawl endpoint streaming support
- Improve error handling with 402 payment required status
Diffstat (limited to 'cmd/osint.go')
| -rw-r--r-- | cmd/osint.go | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/cmd/osint.go b/cmd/osint.go index 33b5416..9f2cfef 100644 --- a/cmd/osint.go +++ b/cmd/osint.go @@ -228,11 +228,7 @@ func runOsintFilesSearch(cmd *cobra.Command, args []string) error { } func runOsintBucketsSearch(cmd *cobra.Command, args []string) error { - apiKey, _ := cmd.Flags().GetString("api-key") - if apiKey == "" { - return fmt.Errorf("API key required for buckets endpoint") - } - cfg := config.New().WithAPIKey(apiKey) + cfg := config.New() c, err := client.New(cfg) if err != nil { @@ -252,11 +248,7 @@ func runOsintBucketsSearch(cmd *cobra.Command, args []string) error { } func runOsintBucketFilesSearch(cmd *cobra.Command, args []string) error { - apiKey, _ := cmd.Flags().GetString("api-key") - if apiKey == "" { - return fmt.Errorf("API key required for bucket files endpoint") - } - cfg := config.New().WithAPIKey(apiKey) + cfg := config.New() c, err := client.New(cfg) if err != nil { @@ -279,11 +271,7 @@ func runOsintBucketFilesSearch(cmd *cobra.Command, args []string) error { } func runOsintShortlinksSearch(cmd *cobra.Command, args []string) error { - apiKey, _ := cmd.Flags().GetString("api-key") - if apiKey == "" { - return fmt.Errorf("API key required for shortlinks endpoint") - } - cfg := config.New().WithAPIKey(apiKey) + cfg := config.New() c, err := client.New(cfg) if err != nil { @@ -308,11 +296,7 @@ func runOsintShortlinksSearch(cmd *cobra.Command, args []string) error { } func runOsintGeoSearch(cmd *cobra.Command, args []string) error { - apiKey, _ := cmd.Flags().GetString("api-key") - if apiKey == "" { - return fmt.Errorf("API key required for geo endpoint (costs 1 credit)") - } - cfg := config.New().WithAPIKey(apiKey) + cfg := config.New() c, err := client.New(cfg) if err != nil { |
