summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors <[email protected]>2025-11-06 21:06:00 -0500
committers <[email protected]>2025-11-06 21:06:00 -0500
commitadf3c2d3005b4dddcea32486ddd1ed58d7ab75b3 (patch)
tree0954bfe03c023dc5ba38e3b0d575579b4c961dad
parent6b3320ef9c5f21f8961686c4acb24678f1552685 (diff)
downloaddborg-adf3c2d3005b4dddcea32486ddd1ed58d7ab75b3.tar.gz
dborg-adf3c2d3005b4dddcea32486ddd1ed58d7ab75b3.zip
refactor: replace single map flag with separate google and osm options for bssid lookup
-rw-r--r--cmd/osint.go10
-rw-r--r--internal/client/osint.go9
-rw-r--r--internal/models/osint.go20
3 files changed, 21 insertions, 18 deletions
diff --git a/cmd/osint.go b/cmd/osint.go
index 4f459ad..13c3c6e 100644
--- a/cmd/osint.go
+++ b/cmd/osint.go
@@ -1,11 +1,11 @@
package cmd
import (
+ "encoding/json"
+ "fmt"
"git.db.org.ai/dborg/internal/client"
"git.db.org.ai/dborg/internal/config"
"git.db.org.ai/dborg/internal/models"
- "encoding/json"
- "fmt"
"github.com/spf13/cobra"
)
@@ -42,7 +42,8 @@ func init() {
osintUsernameCmd.Flags().IntP("max_tasks", "m", 50, "Maximum concurrent tasks")
osintBSSIDCmd.Flags().BoolP("all", "a", false, "Show all related results instead of exact match only")
- osintBSSIDCmd.Flags().BoolP("map", "m", false, "Include Google Maps URL for the location")
+ osintBSSIDCmd.Flags().BoolP("google", "g", false, "Include Google Maps URL for the location")
+ osintBSSIDCmd.Flags().BoolP("osm", "o", false, "Include OpenStreetMap URL for the location")
}
func runOsintUsernameCheck(cmd *cobra.Command, args []string) error {
@@ -86,7 +87,8 @@ func runOsintBSSIDLookup(cmd *cobra.Command, args []string) error {
BSSID: args[0],
}
params.All, _ = cmd.Flags().GetBool("all")
- params.Map, _ = cmd.Flags().GetBool("map")
+ params.Google, _ = cmd.Flags().GetBool("google")
+ params.OSM, _ = cmd.Flags().GetBool("osm")
response, err := c.LookupBSSID(params)
if err != nil {
diff --git a/internal/client/osint.go b/internal/client/osint.go
index 123cf32..98f42f3 100644
--- a/internal/client/osint.go
+++ b/internal/client/osint.go
@@ -1,9 +1,9 @@
package client
import (
- "git.db.org.ai/dborg/internal/models"
"encoding/json"
"fmt"
+ "git.db.org.ai/dborg/internal/models"
"net/url"
)
@@ -14,8 +14,11 @@ func (c *Client) LookupBSSID(params *models.BSSIDParams) (*models.BSSIDLookupRes
if params.All {
queryParams.Add("all", "true")
}
- if params.Map {
- queryParams.Add("map", "true")
+ if params.Google {
+ queryParams.Add("google", "true")
+ }
+ if params.OSM {
+ queryParams.Add("osm", "true")
}
data, err := c.Get(path, queryParams)
diff --git a/internal/models/osint.go b/internal/models/osint.go
index 7170c27..d403d57 100644
--- a/internal/models/osint.go
+++ b/internal/models/osint.go
@@ -1,9 +1,10 @@
package models
type BSSIDParams struct {
- BSSID string
- All bool
- Map bool
+ BSSID string
+ All bool
+ Google bool
+ OSM bool
}
type LocationInfo struct {
@@ -13,16 +14,13 @@ type LocationInfo struct {
}
type BSSIDResult struct {
- BSSID string `json:"bssid"`
- Location *LocationInfo `json:"location"`
- MapURL string `json:"map_url,omitempty"`
+ BSSID string `json:"bssid"`
+ Location *LocationInfo `json:"location"`
+ GoogleMap string `json:"google_map,omitempty"`
+ OpenStreetMap string `json:"openstreetmap,omitempty"`
}
-type BSSIDLookupResponse struct {
- BSSID string `json:"bssid"`
- Results []BSSIDResult `json:"results"`
- MapURL string `json:"map_url,omitempty"`
-}
+type BSSIDLookupResponse []BSSIDResult
type ErrorResponse struct {
Error string `json:"error"`