diff options
| author | s <[email protected]> | 2025-11-10 08:31:32 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-10 08:31:32 -0500 |
| commit | 7c0f4b692c3b712bf4a0da3bbac008ff75c405de (patch) | |
| tree | 9ba8faa5c23541f4b000f6996b2589931925b5fd /cmd/osint.go | |
| parent | 65acee9a9b500c17b9426f80997401758ec326b1 (diff) | |
| download | dborg-7c0f4b692c3b712bf4a0da3bbac008ff75c405de.tar.gz dborg-7c0f4b692c3b712bf4a0da3bbac008ff75c405de.zip | |
feat: add x replies/search commands and improve api key validationv0.7.0
Diffstat (limited to 'cmd/osint.go')
| -rw-r--r-- | cmd/osint.go | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/cmd/osint.go b/cmd/osint.go index eb1ec50..33b5416 100644 --- a/cmd/osint.go +++ b/cmd/osint.go @@ -159,10 +159,9 @@ func runOsintUsernameCheck(cmd *cobra.Command, args []string) error { } func runOsintBSSIDLookup(cmd *cobra.Command, args []string) error { - apiKey, _ := cmd.Flags().GetString("api-key") - cfg := config.New().WithAPIKey(apiKey) + cfg := config.New() - c, err := client.New(cfg) + c, err := client.NewUnauthenticated(cfg) if err != nil { return err } @@ -183,10 +182,9 @@ func runOsintBSSIDLookup(cmd *cobra.Command, args []string) error { } func runOsintBreachForumSearch(cmd *cobra.Command, args []string) error { - apiKey, _ := cmd.Flags().GetString("api-key") - cfg := config.New().WithAPIKey(apiKey) + cfg := config.New() - c, err := client.New(cfg) + c, err := client.NewUnauthenticated(cfg) if err != nil { return err } @@ -231,6 +229,9 @@ 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) c, err := client.New(cfg) @@ -252,6 +253,9 @@ 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) c, err := client.New(cfg) @@ -276,6 +280,9 @@ 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) c, err := client.New(cfg) @@ -302,6 +309,9 @@ 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) c, err := client.New(cfg) |
