diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index d3df0bb..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [liamg] diff --git a/README.md b/README.md index f28a94b..f0e959b 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ HackerOne API Client in Go. -Current supports the entire [Hackers API](https://api.hackerone.com/getting-started-hacker-api/#getting-started-hacker-api). Support for the _Customers_ API may be added in future if there is any demand. - -Please see the [documentation](https://pkg.go.dev/github.com/liamg/hackerone) for further information. +This project is a fork of [liamg/hackerone](https://github.com/liamg/hackerone/). It adds the functionality to search through the Structured +Scope objects in the API. This addition allows you to automate the process of bug bounty target scanning, and large-scale automated security +testing. See the [sam-bee/security-hackerone-target-retrieval](https://github.com/sam-bee/security-hackerone-target-retrieval) project for real world usage. ## Usage Example diff --git a/_examples/reports/main.go b/_examples/reports/main.go index 9652e72..7978408 100644 --- a/_examples/reports/main.go +++ b/_examples/reports/main.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/liamg/hackerone" + "github.com/sam-bee/security-hackerone-api-client" ) func main() { diff --git a/entry.go b/entry.go index c764cea..34a6ca9 100644 --- a/entry.go +++ b/entry.go @@ -1,8 +1,8 @@ package hackerone import ( - "github.com/liamg/hackerone/pkg/client" - "github.com/liamg/hackerone/pkg/hackers" + "github.com/sam-bee/security-hackerone-api-client/pkg/client" + "github.com/sam-bee/security-hackerone-api-client/pkg/hackers" ) type API struct { diff --git a/go.mod b/go.mod index 81e3d76..4f33a17 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/liamg/hackerone +module github.com/sam-bee/security-hackerone-api-client go 1.18 diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 5a84d41..3d5adc6 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -7,7 +7,7 @@ import ( "net/http/httptest" "testing" - "github.com/liamg/hackerone/pkg/api" + "github.com/sam-bee/security-hackerone-api-client/pkg/api" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/client/transport.go b/pkg/client/transport.go index 360b706..a22f689 100644 --- a/pkg/client/transport.go +++ b/pkg/client/transport.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/liamg/hackerone/pkg/api" + "github.com/sam-bee/security-hackerone-api-client/pkg/api" "github.com/avast/retry-go" ) diff --git a/pkg/hackers/client.go b/pkg/hackers/client.go index fdfd31b..ca412c7 100644 --- a/pkg/hackers/client.go +++ b/pkg/hackers/client.go @@ -1,7 +1,7 @@ package hackers import ( - "github.com/liamg/hackerone/pkg/client" + "github.com/sam-bee/security-hackerone-api-client/pkg/client" ) type API struct { diff --git a/pkg/hackers/earnings.go b/pkg/hackers/earnings.go index 15ccb89..e2dd38b 100644 --- a/pkg/hackers/earnings.go +++ b/pkg/hackers/earnings.go @@ -4,16 +4,16 @@ import ( "context" "fmt" - api2 "github.com/liamg/hackerone/pkg/api" + "github.com/sam-bee/security-hackerone-api-client/pkg/api" ) type getEarningsResponse struct { - Data []api2.Earning `json:"data"` - Links api2.Links `json:"links"` + Data []api.Earning `json:"data"` + Links api.Links `json:"links"` } // GetEarnings returns a list of earnings made by the hacker. If there are further pages, nextPage will be >0. -func (a *API) GetEarnings(ctx context.Context, pageOptions *api2.PageOptions) (earnings []api2.Earning, nextPage int, err error) { +func (a *API) GetEarnings(ctx context.Context, pageOptions *api.PageOptions) (earnings []api.Earning, nextPage int, err error) { var response getEarningsResponse path := fmt.Sprintf( "/hackers/payments/earnings?page[number]=%d&page[size]=%d", diff --git a/pkg/hackers/payouts.go b/pkg/hackers/payouts.go index 9c9a2ab..d79bbd3 100644 --- a/pkg/hackers/payouts.go +++ b/pkg/hackers/payouts.go @@ -4,16 +4,16 @@ import ( "context" "fmt" - api2 "github.com/liamg/hackerone/pkg/api" + "github.com/sam-bee/security-hackerone-api-client/pkg/api" ) type getPayoutsResponse struct { - Data []api2.Payout `json:"data"` - Links api2.Links `json:"links"` + Data []api.Payout `json:"data"` + Links api.Links `json:"links"` } // GetPayouts returns a list of payouts received by the hacker. If there are further pages, nextPage will be >0. -func (a *API) GetPayouts(ctx context.Context, pageOptions *api2.PageOptions) (payouts []api2.Payout, nextPage int, err error) { +func (a *API) GetPayouts(ctx context.Context, pageOptions *api.PageOptions) (payouts []api.Payout, nextPage int, err error) { var response getPayoutsResponse path := fmt.Sprintf( "/hackers/payments/payouts?page[number]=%d&page[size]=%d", diff --git a/pkg/hackers/programs.go b/pkg/hackers/programs.go index 178f30c..a1abfc3 100644 --- a/pkg/hackers/programs.go +++ b/pkg/hackers/programs.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/liamg/hackerone/pkg/api" + "github.com/sam-bee/security-hackerone-api-client/pkg/api" ) type getProgramsResponse struct { diff --git a/pkg/hackers/reports.go b/pkg/hackers/reports.go index 343941a..e9c48a7 100644 --- a/pkg/hackers/reports.go +++ b/pkg/hackers/reports.go @@ -4,28 +4,28 @@ import ( "context" "fmt" - api2 "github.com/liamg/hackerone/pkg/api" + "github.com/sam-bee/security-hackerone-api-client/pkg/api" ) type getReportResponse struct { - Report api2.Report `json:"data"` + Report api.Report `json:"data"` } type getReportsResponse struct { - Reports []api2.Report `json:"data"` - Links api2.Links `json:"links"` + Reports []api.Report `json:"data"` + Links api.Links `json:"links"` } type createReportRequest struct { - Data api2.CreateReportInput `json:"data"` + Data api.CreateReportInput `json:"data"` } type createReportResponse struct { - Data api2.Report `json:"data"` + Data api.Report `json:"data"` } // GetReport returns the report for the given id. -func (a *API) GetReport(ctx context.Context, id int) (*api2.Report, error) { +func (a *API) GetReport(ctx context.Context, id int) (*api.Report, error) { var response getReportResponse path := fmt.Sprintf("/hackers/reports/%d", id) if err := a.client.Get(ctx, path, &response); err != nil { @@ -35,7 +35,7 @@ func (a *API) GetReport(ctx context.Context, id int) (*api2.Report, error) { } // GetReports returns a list of reports made by the hacker. If there are further pages, nextPage will be >0. -func (a *API) GetReports(ctx context.Context, pageOptions *api2.PageOptions) (reports []api2.Report, nextPage int, err error) { +func (a *API) GetReports(ctx context.Context, pageOptions *api.PageOptions) (reports []api.Report, nextPage int, err error) { var response getReportsResponse path := fmt.Sprintf( "/hackers/me/reports?page[number]=%d&page[size]=%d", @@ -52,7 +52,7 @@ func (a *API) GetReports(ctx context.Context, pageOptions *api2.PageOptions) (re } // CreateReport creates a new report. See https://api.hackerone.com/hacker-resources/#reports-create-report -func (a *API) CreateReport(ctx context.Context, report *api2.CreateReportInput) (*api2.Report, error) { +func (a *API) CreateReport(ctx context.Context, report *api.CreateReportInput) (*api.Report, error) { if report == nil { return nil, fmt.Errorf("report input cannot be nil") } diff --git a/pkg/hackers/structuredscopes.go b/pkg/hackers/structuredscopes.go index 25e6fc6..0d9e43d 100644 --- a/pkg/hackers/structuredscopes.go +++ b/pkg/hackers/structuredscopes.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/liamg/hackerone/pkg/api" + "github.com/sam-bee/security-hackerone-api-client/pkg/api" ) type getStructuredScopesResponse struct {