bugcrowd

package module
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

go-bugcrowd

Build Status

This project is still in active development and is not ready for public use or production use.

Documentation

Overview

Package bugcrowd is a generated GoMock package.

Package assetattributor is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(auth BasicAuth, rt http.RoundTripper) *http.Client

NewTransport placeholder

Types

type Attachment added in v0.1.8

type Attachment struct {
	FileName    string `json:"file_name,omitempty"`
	FileSize    int    `json:"file_size,omitempty"`
	FileType    string `json:"file_type,omitempty"`
	S3SignedURL string `json:"s3_signed_url,omitempty"`
}

Attachment represents the structure of an attachment in bugcrowd

type AttachmentAPI added in v0.1.8

type AttachmentAPI interface {
	ViewSubmissionAttachments(ctx context.Context, uuid string) (*http.Response, *GetSubmissionsResponse, error)
}

AttachmentAPI is the interface used for mocking of Bounty API calls

type AttachmentService added in v0.1.8

type AttachmentService struct {
	// contains filtered or unexported fields
}

AttachmentService represents the Attachment Service struct itself and all required objects

func (*AttachmentService) RetrieveSubmission added in v0.1.8

RetrieveSubmission retrieves all bounty information from Bugcrowd that the you have access

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

BasicAuth forms basic auth to be passed in client creation to Auth to Bugcrowd

type Bounty

type Bounty struct {
	UUID                    string             `json:"uuid,omitempty"`
	BountyType              string             `json:"bountytype,omitempty"`
	Code                    string             `json:"code,omitempty"`
	CustomFieldLabels       []CustomFieldLabel `json:"custom_field_labels,omitempty"`
	DescriptionMarkdown     string             `json:"description_markdown,omitempty"`
	Demo                    bool               `json:"demo,omitempty"`
	EndsAt                  time.Time          `json:"ends_at,omitempty"`
	HighRewards             int                `json:"high_rewards,omitempty"`
	LowRewards              int                `json:"low_rewards,omitempty"`
	Participation           string             `json:"participation,omitempty"`
	PointsOnly              bool               `json:"points_only,omitempty"`
	StartsAt                time.Time          `json:"starts_at,omitempty"`
	TargetsOverviewMarkdown string             `json:"targets_overview_markdown,omitempty"`
	Tagline                 string             `json:"tagline,omitempty"`
	TotalPrizePool          string             `json:"total_prize_pool,omitempty"`
	RemainingPrizePool      string             `json:"remaining_prize_pool,omitempty"`
	Trial                   bool               `json:"trial,omitempty"`
	Status                  string             `json:"status,omitempty"`
	ServiceLevel            string             `json:"service_level,omitempty"`
	Organization            Organization       `json:"organization,omitempty"`
}

Bounty represents the information provided about a Bugcrowd Bounty

type BountyAPI

type BountyAPI interface {
	GetBounties(ctx context.Context, requestConfig *GetBountiesOptions) (*http.Response, *GetBountiesResponse, error)
	RetrieveBounty(ctx context.Context, uuid string) (*http.Response, *RetrieveBountyResponse, error)
}

BountyAPI is the interface used for mocking of Bounty API calls

type BountyService

type BountyService struct {
	// contains filtered or unexported fields
}

BountyService represents the Bounty Service struct itself and all required objects

func (*BountyService) GetBounties

func (b *BountyService) GetBounties(ctx context.Context, requestOptions *GetBountiesOptions) (*http.Response, *GetBountiesResponse, error)

GetBounties retrieves all bounty information from Bugcrowd that the you have access

func (*BountyService) RetrieveBounty

func (b *BountyService) RetrieveBounty(ctx context.Context, uuid string) (*http.Response, *RetrieveBountyResponse, error)

RetrieveBounty retrieves bounty with the given UUID If bounty with given ID is not found, an empty response will be returned with a nil error

type CVSSObject added in v0.1.3

type CVSSObject struct {
	Version    string `json:"version,omitempty"`
	Score      string `json:"score,omitempty"`
	CVSSString string `json:"cvss_string,omitempty"`
}

CVSSObject represents a CVSSObject in Bugcrowd

type Client

type Client struct {
	BaseURL          *url.URL
	Bounty           BountyAPI
	CustomFieldLabel CustomFieldLabelAPI
	Submission       SubmissionAPI
	// contains filtered or unexported fields
}

Client represents the basic struct for the Bugcrowd client

func NewClient

func NewClient(auth BasicAuth, rt http.RoundTripper) (*Client, error)

NewClient generates a new client to make outgoing calls to Bugcrowd

func (*Client) Do added in v0.0.2

func (c *Client) Do(ctx context.Context, r *http.Request, b interface{}) (*http.Response, error)

Do executes the passed in request and sets default headers to the request

func (*Client) DoWithDefault added in v0.1.1

func (c *Client) DoWithDefault(ctx context.Context, r *http.Request, b interface{}) (*http.Response, error)

DoWithDefault wraps a call around Do that adds the default Bugcrowd headers

func (*Client) NewRequest added in v0.1.7

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest placeholder

type CustomFieldLabel

type CustomFieldLabel struct {
	FieldID   string `json:"field_id,omitempty"`
	FieldName string `json:"field_name,omitempty"`
}

CustomFieldLabel represents any custom fields put into a bounty

type CustomFieldLabelAPI

type CustomFieldLabelAPI interface {
	GetCustomFieldLabels(uuid string) (GetCustomFieldLabelsResponse, error)
}

CustomFieldLabelAPI test

type CustomFieldLabelService

type CustomFieldLabelService struct {
	// contains filtered or unexported fields
}

CustomFieldLabelService test

func (*CustomFieldLabelService) GetCustomFieldLabels added in v0.0.2

func (c *CustomFieldLabelService) GetCustomFieldLabels(uuid string) (GetCustomFieldLabelsResponse, error)

GetCustomFieldLabels test

type CustomFieldSubmissionUpdate added in v0.1.7

type CustomFieldSubmissionUpdate struct {
	CustomFields map[string]string `json:"custom_fields,omitempty"`
}

CustomFieldSubmissionUpdate placeholder

type GetBountiesOptions added in v0.1.1

type GetBountiesOptions struct {
	Limit  string `url:"limit,omitempty"`
	Offset string `url:"offset,omitempty"`
}

GetBountiesOptions represents the URL options available to the GetBounties endpoint

type GetBountiesResponse

type GetBountiesResponse struct {
	Bounties []*Bounty `json:"bounties,omitempty"`
}

GetBountiesResponse is the wrapper object returned by Bugcrowd in its GetBounty response

type GetCustomFieldLabelsResponse

type GetCustomFieldLabelsResponse struct {
	CustomFieldLabels []CustomFieldLabel `json:"custom_field_labels,omitempty"`
}

GetCustomFieldLabelsResponse test

type GetSubmissionsOptions added in v0.1.5

type GetSubmissionsOptions struct {
	Search     string `url:"search,omitempty"`
	Assignment string `url:"assignment,omitempty"`
	Duplicate  string `url:"duplicate,omitempty"`
	Severity   string `url:"severity,omitempty"`
	Target     string `url:"target,omitempty"`
	Points     string `url:"points,omitempty"`
	Payments   string `url:"payments,omitempty"`
	Researcher string `url:"researcher,omitempty"`
	Source     string `url:"source,omitempty"`
	TargetType string `url:"target_type,omitempty"`
	BlockedBy  string `url:"blocked_by,omitempty"`
	Retest     string `url:"retest,omitempty"`
	Substate   string `url:"substate,omitempty"`
	Submitted  string `url:"submitted,omitempty"`
	VRT        string `url:"vrt,omitempty"`
	Filter     string `url:"filter,omitempty"`
	Sort       string `url:"sort,omitempty"`
	Offset     string `url:"offset,omitempty"`
	Limit      string `url:"limit,omitempty"`
}

GetSubmissionsOptions represents the URL options available to the GetSubmissions endpoint

type GetSubmissionsResponse added in v0.1.3

type GetSubmissionsResponse struct {
	Submissions []*Submission `json:"submissions,omitempty"`
}

GetSubmissionsResponse is the wrapper object returned by Bugcrowd in its GetBounty response

type Identity added in v0.1.3

type Identity struct {
	UUID string `json:"uuid,omitempty"`
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

Identity test

type MockBountyAPI

type MockBountyAPI struct {
	// contains filtered or unexported fields
}

MockBountyAPI is a mock of BountyAPI interface

func NewMockBountyAPI

func NewMockBountyAPI(ctrl *gomock.Controller) *MockBountyAPI

NewMockBountyAPI creates a new mock instance

func (*MockBountyAPI) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBountyAPI) GetBounties

func (m *MockBountyAPI) GetBounties(ctx context.Context, requestConfig *GetBountiesOptions) (*http.Response, *GetBountiesResponse, error)

GetBounties mocks base method

func (*MockBountyAPI) RetrieveBounty

func (m *MockBountyAPI) RetrieveBounty(ctx context.Context, uuid string) (*http.Response, *RetrieveBountyResponse, error)

RetrieveBounty mocks base method

type MockBountyAPIMockRecorder

type MockBountyAPIMockRecorder struct {
	// contains filtered or unexported fields
}

MockBountyAPIMockRecorder is the mock recorder for MockBountyAPI

func (*MockBountyAPIMockRecorder) GetBounties

func (mr *MockBountyAPIMockRecorder) GetBounties(ctx, requestConfig interface{}) *gomock.Call

GetBounties indicates an expected call of GetBounties

func (*MockBountyAPIMockRecorder) RetrieveBounty

func (mr *MockBountyAPIMockRecorder) RetrieveBounty(ctx, uuid interface{}) *gomock.Call

RetrieveBounty indicates an expected call of RetrieveBounty

type MockRoundTripper

type MockRoundTripper struct {
	// contains filtered or unexported fields
}

MockRoundTripper is a mock of RoundTripper interface

func NewMockRoundTripper

func NewMockRoundTripper(ctrl *gomock.Controller) *MockRoundTripper

NewMockRoundTripper creates a new mock instance

func (*MockRoundTripper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRoundTripper) RoundTrip

func (m *MockRoundTripper) RoundTrip(arg0 *http.Request) (*http.Response, error)

RoundTrip mocks base method

type MockRoundTripperMockRecorder

type MockRoundTripperMockRecorder struct {
	// contains filtered or unexported fields
}

MockRoundTripperMockRecorder is the mock recorder for MockRoundTripper

func (*MockRoundTripperMockRecorder) RoundTrip

func (mr *MockRoundTripperMockRecorder) RoundTrip(arg0 interface{}) *gomock.Call

RoundTrip indicates an expected call of RoundTrip

type MonetaryReward added in v0.1.3

type MonetaryReward struct {
	Amount string `json:"amount,omitempty"`
}

MonetaryReward test

type Organization

type Organization struct {
	UUID string `json:"uuid,omitempty"`
	Name string `json:"name,omitempty"`
}

Organization represents the organization a given bounty belongs.

type RetrieveAndUpdateSubmissionResponse added in v0.1.7

type RetrieveAndUpdateSubmissionResponse struct {
	Submission *Submission `json:"submission,omitempty"`
}

RetrieveAndUpdateSubmissionResponse is the wrapper object returned by Bugcrowd in its GetBounty response

type RetrieveBountyResponse

type RetrieveBountyResponse struct {
	Bounty *Bounty `json:"bounty,omitempty"`
}

RetrieveBountyResponse represents the body of the response from the Retrieve Bounty endpoint

type Submission added in v0.1.3

type Submission struct {
	BountyCode                     string            `json:"bounty_code,omitempty"`
	BugURL                         string            `json:"bug_url,omitempty"`
	Caption                        string            `json:"caption,omitempty"`
	CustomFields                   map[string]string `json:"custom_fields,omitempty"`
	CVSSString                     CVSSObject        `json:"cvss_string,omitempty"`
	DescriptionMarkdown            string            `json:"description_markdown,omitempty"`
	ExtraInfoMarkdown              string            `json:"extra_info_markdown,omitempty"`
	FileAttachmentsCount           int               `json:"file_attachments_count,omitempty"`
	HTTPRequest                    string            `json:"http_request,omitempty"`
	Identity                       Identity          `json:"identity,omitempty"`
	Priority                       int               `json:"priority,omitempty"`
	RemediationAdviceMarkdown      string            `json:"remediation_advice_markdown,omitempty"`
	ReferenceNumber                string            `json:"reference_number,omitempty"`
	SubmittedAt                    time.Time         `json:"submitted_at,omitempty"`
	Source                         string            `json:"source,omitempty"`
	Substate                       string            `json:"substate,omitempty"`
	RealSubstate                   string            `json:"real_substate,omitempty"`
	Title                          string            `json:"title,omitempty"`
	VRTID                          string            `json:"vrt_id,omitempty"`
	VRTVersion                     string            `json:"vrt_version,omitempty"`
	VulnerabilityReferenceMarkdown string            `json:"vulnerability_references_markdown,omitempty"`
	UUID                           string            `json:"uuid,omitempty"`
	Bounty                         Bounty            `json:"bounty,omitempty"`
	DuplicateOf                    *Submission       `json:"duplicate_of,omitempty"`
	Duplicate                      bool              `json:"duplicate,omitempty"`
	Assignee                       TrackerUser       `json:"assignee,omitempty"`
	User                           User              `json:"user,omitempty"`
	MonetaryRewards                []MonetaryReward  `json:"monetary_rewards,omitempty"`
	Target                         Target            `json:"target,omitempty"`
}

Submission represents the information provided about a Bugcrowd submission

type SubmissionAPI added in v0.1.2

type SubmissionAPI interface {
	GetSubmissions(ctx context.Context, uuid string, requestOptions *GetSubmissionsOptions) (*http.Response, *GetSubmissionsResponse, error)
	RetrieveSubmission(ctx context.Context, uuid string) (*http.Response, *RetrieveAndUpdateSubmissionResponse, error)
	UpdateSubmission(ctx context.Context, uuid string, update *UpdateSubmissionRequest) (*http.Response, *RetrieveAndUpdateSubmissionResponse, error)
	TransitionSubmission(ctx context.Context, uuid string, transitionrequest *TransitionSubmissionRequest) (*http.Response, error)
}

SubmissionAPI is the interface used for mocking of Bounty API calls

type SubmissionService added in v0.1.3

type SubmissionService struct {
	// contains filtered or unexported fields
}

SubmissionService represents the Submission Service struct itself and all required objects

func (*SubmissionService) GetSubmissions added in v0.1.3

func (s *SubmissionService) GetSubmissions(ctx context.Context, uuid string, requestOptions *GetSubmissionsOptions) (*http.Response, *GetSubmissionsResponse, error)

GetSubmissions retrieves all bounty information from Bugcrowd that the you have access

func (*SubmissionService) RetrieveSubmission added in v0.1.7

RetrieveSubmission retrieves all bounty information from Bugcrowd that the you have access

func (*SubmissionService) TransitionSubmission added in v0.1.7

func (s *SubmissionService) TransitionSubmission(ctx context.Context, uuid string, transitionrequest *TransitionSubmissionRequest) (*http.Response, error)

TransitionSubmission retrieves all bounty information from Bugcrowd that the you have access

func (*SubmissionService) UpdateSubmission added in v0.1.7

UpdateSubmission retrieves all bounty information from Bugcrowd that the you have access

type Target added in v0.1.3

type Target struct {
	Name             string `json:"name,omitempty"`
	BusinessPriority string `json:"business_priority,omitempty"`
}

Target test

type TrackerUser added in v0.1.3

type TrackerUser struct {
	DisplayName *string `json:"display_name,omitempty"`
}

TrackerUser test

type TransitionSubmissionRequest added in v0.1.7

type TransitionSubmissionRequest struct {
	SubState    string `json:"substate,omitempty"`
	DuplicateOf string `json:"duplicate_of,omitempty"`
}

TransitionSubmissionRequest transitions submissions to set substate

type Transport

type Transport struct {
	Authorization     BasicAuth
	OriginalTransport http.RoundTripper
}

Transport placeholder

func (*Transport) RoundTrip

func (st *Transport) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip placeholder

type UpdateSubmissionRequest added in v0.1.7

type UpdateSubmissionRequest struct {
	Submission CustomFieldSubmissionUpdate `json:"submission,omitempty"`
}

UpdateSubmissionRequest placeholder

type User added in v0.1.3

type User struct {
	Username *string `json:"username,omitempty"`
}

User test

type ViewSubmissionAttachmentsResponse added in v0.1.8

type ViewSubmissionAttachmentsResponse struct {
	FileAttachments []Attachment `json:"file_attachments,omitempty"`
}

ViewSubmissionAttachmentsResponse represents the response expected from the GetAttachments API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL