summaryrefslogtreecommitdiffstats
path: root/cmd/osint.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/osint.go')
-rw-r--r--cmd/osint.go22
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)