diff options
| author | s <[email protected]> | 2025-11-06 22:15:35 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-06 22:15:35 -0500 |
| commit | 5f0e15788032951f215bda1df3b5ce1e55125f59 (patch) | |
| tree | 79745064ecd7a38324520c8e9330c6f125a5fc2f /internal/client/osint.go | |
| parent | eab6a1b6899413154f855abbd200ac775b22be75 (diff) | |
| download | dborg-5f0e15788032951f215bda1df3b5ce1e55125f59.tar.gz dborg-5f0e15788032951f215bda1df3b5ce1e55125f59.zip | |
feat: add breachforum search command with api client integration
Diffstat (limited to 'internal/client/osint.go')
| -rw-r--r-- | internal/client/osint.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/client/osint.go b/internal/client/osint.go index 98f42f3..20f53ce 100644 --- a/internal/client/osint.go +++ b/internal/client/osint.go @@ -33,3 +33,25 @@ func (c *Client) LookupBSSID(params *models.BSSIDParams) (*models.BSSIDLookupRes return &response, nil } + +func (c *Client) SearchBreachForum(params *models.BreachForumSearchParams) (*models.BreachForumSearchResponse, error) { + path := "/osint/breachforum/search" + + queryParams := url.Values{} + queryParams.Add("search", params.Search) + if params.MaxHits > 0 { + queryParams.Add("max_hits", fmt.Sprintf("%d", params.MaxHits)) + } + + data, err := c.Get(path, queryParams) + if err != nil { + return nil, err + } + + var response models.BreachForumSearchResponse + if err := json.Unmarshal(data, &response); err != nil { + return nil, fmt.Errorf("failed to parse BreachForum search response: %w", err) + } + + return &response, nil +} |
