Skip to content

Commit e5e9b43

Browse files
Merge pull request #295 from pangeacyber/PAN-17213
Add support for `domains` field in `v2/user/breached` endpoint in Use…
2 parents f006294 + b7d77b7 commit e5e9b43

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Detect-only Redact for Sanitize.
13+
- Support for `domains` field in `v2/user/breached` endpoint in User Intel service
1314

1415
## 3.11.0 - 2024-09-25
1516

pangea-sdk/v3/service/user_intel/api.go

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type UserBreachedBulkRequest struct {
8383
Usernames []string `json:"usernames,omitempty"`
8484
PhoneNumbers []string `json:"phone_numbers,omitempty"`
8585
IPs []string `json:"ips,omitempty"`
86+
Domains []string `json:"domains,omitempty"`
8687
Start string `json:"start,omitempty"`
8788
End string `json:"end,omitempty"`
8889
Verbose *bool `json:"verbose,omitempty"`

pangea-sdk/v3/service/user_intel/integration_test.go

+23
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,29 @@ func Test_Integration_UserBreachedByIPBulk(t *testing.T) {
203203
assert.Equal(t, len(resp.Result.Data), 2)
204204
}
205205

206+
func Test_Integration_UserBreachedByDomainBulk(t *testing.T) {
207+
ctx, cancelFn := context.WithTimeout(context.Background(), 60*time.Second)
208+
defer cancelFn()
209+
210+
intelcli := user_intel.New(pangeatesting.IntegrationConfig(t, testingEnvironment))
211+
212+
input := &user_intel.UserBreachedBulkRequest{
213+
Domains: []string{"example.com"},
214+
Raw: pangea.Bool(true),
215+
Verbose: pangea.Bool(true),
216+
Provider: "spycloud",
217+
}
218+
resp, err := intelcli.UserBreachedBulk(ctx, input)
219+
if err != nil {
220+
t.Fatalf("expected no error got: %v", err)
221+
}
222+
223+
assert.NotNil(t, resp)
224+
assert.NotNil(t, resp.Result)
225+
assert.NotNil(t, resp.Result.Data)
226+
assert.Equal(t, len(resp.Result.Data), 1)
227+
}
228+
206229
func Test_Integration_UserBreachedDefaultProvider(t *testing.T) {
207230
ctx, cancelFn := context.WithTimeout(context.Background(), 60*time.Second)
208231
defer cancelFn()

0 commit comments

Comments
 (0)