api

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Type       string `json:"type"`
	Id         string `json:"id"`
	Attributes struct {
		Message   *string   `json:"message"`
		CreatedAt time.Time `json:"created_at"`
		UpdatedAt time.Time `json:"updated_at"`
		Internal  bool      `json:"internal"`
	} `json:"attributes"`
	Relationships struct {
		// TODO add user/program etc.
		Attachments struct {
			Data []Attachment `json:"data"`
		} `json:"attachments,omitempty"`
	} `json:"relationships"`
}

type Address

type Address struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Name        string    `json:"name"`
		Street      string    `json:"street"`
		City        string    `json:"city"`
		PostalCode  string    `json:"postal_code"`
		State       string    `json:"state"`
		Country     string    `json:"country"`
		CreatedAt   time.Time `json:"created_at"`
		TShirtSize  string    `json:"tshirt_size"`
		PhoneNumber string    `json:"phone_number"`
	} `json:"attributes"`
}

type Attachment

type Attachment struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		ExpiringUrl string    `json:"expiring_url"`
		CreatedAt   time.Time `json:"created_at"`
		FileName    string    `json:"file_name"`
		ContentType string    `json:"content_type"`
		FileSize    int       `json:"file_size"`
	} `json:"attributes"`
}

type AutomatedRemediationGuidance

type AutomatedRemediationGuidance struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Reference string    `json:"reference"`
		CreatedAt time.Time `json:"created_at"`
	} `json:"attributes"`
}

type Bounty

type Bounty struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Amount             *string   `json:"amount"`
		BonusAmount        *string   `json:"bonus_amount"`
		AwardedAmount      *string   `json:"awarded_amount"`
		AwardedBonusAmount *string   `json:"awarded_bonus_amount"`
		AwardedCurrency    *string   `json:"awarded_currency"`
		CreatedAt          time.Time `json:"created_at"`
		Invitations        []struct {
			Id             string  `json:"id"`
			RecipientEmail *string `json:"recipient"`
			ClaimUrl       *string `json:"claim_url"`
		} `json:"invitations"`
	} `json:"attributes"`
}

type CreateReportInput

type CreateReportInput struct {
	TeamHandle               string `json:"team_handle"`
	Title                    string `json:"title"`
	VulnerabilityInformation string `json:"vulnerability_information"`
	Impact                   string `json:"impact"`
	SeverityRating           string `json:"severity_rating"`
	WeaknessId               int    `json:"weakness_id"`
	StructuredScopeId        int    `json:"structured_scope_id"`
}

type CustomRemediationGuidance

type CustomRemediationGuidance struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Message   string    `json:"message"`
		CreatedAt time.Time `json:"created_at"`
	} `json:"attributes"`
	Relationships struct {
		Author struct {
			Data struct {
				Id         string `json:"id"`
				Type       string `json:"type"`
				Attributes struct {
					Username       string `json:"username"`
					Name           string `json:"name"`
					Disabled       bool   `json:"disabled"`
					CreatedAt      string `json:"created_at"`
					ProfilePicture struct {
						X62  string `json:"62x62"`
						X82  string `json:"82x82"`
						X110 string `json:"110x110"`
						X260 string `json:"260x260"`
					} `json:"profile_picture"`
				} `json:"attributes"`
			} `json:"data"`
		} `json:"author"`
	} `json:"relationships"`
}

type Earning

type Earning struct {
	Id         int    `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Amount int `json:"amount"`
	} `json:"attributes"`
	Relationships struct {
		Team *struct {
			Data Program `json:"data"`
		} `json:"team"`
		Bounty *struct {
			Data Bounty `json:"data"`
		} `json:"bounty"`
		Pentester *struct {
			Data User `json:"data"`
		} `json:"pentester"`
		ReportRetestUser *struct {
			Data User `json:"data"`
		} `json:"report_retest_user"`
	} `json:"relationships"`
}

type Error

type Error struct {
	Status int    `json:"status"`
	Title  string `json:"title"`
	Detail string `json:"detail"`
	Source struct {
		Parameter string `json:"parameter"`
	} `json:"source"`
}

type Errors

type Errors struct {
	Errors []Error `json:"errors"`
}

func (*Errors) Error

func (e *Errors) Error() error
type Links struct {
	Prev string `json:"prev"`
	Self string `json:"self"`
	Next string `json:"next"`
}

type PageOptions

type PageOptions struct {
	// PageNumber is the page number of results to return. Starts at (and defaults to) 1.
	PageNumber int
	// PageSize is the number of records to return per page. 1-100 allowed. Defaults to 100.
	PageSize int
}

PageOptions allows the consumer to request a specific page number and/or size.

func (*PageOptions) GetPageNumber

func (p *PageOptions) GetPageNumber() int

GetPageNumber returns the input page number with corrections applied

func (*PageOptions) GetPageSize

func (p *PageOptions) GetPageSize() int

GetPageSize returns the input page size with corrections applied

type Payout

type Payout struct {
	Amount         int       `json:"amount"`
	PaidOutAt      time.Time `json:"paid_out_at"`
	Reference      string    `json:"reference"`
	PayoutProvider string    `json:"payout_provider"`
	Status         string    `json:"status"`
}

type Program

type Program struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Handle                          string     `json:"handle"`
		Name                            string     `json:"name"`
		Currency                        string     `json:"currency"`
		ProfilePicture                  string     `json:"profile_picture"`
		SubmissionState                 string     `json:"submission_state"`
		TriageActive                    bool       `json:"triage_active"`
		State                           string     `json:"state"`
		StartedAcceptingAt              time.Time  `json:"started_accepting_at"`
		NumberOfReportsForUser          int        `json:"number_of_reports_for_user"`
		NumberOfValidReportsForUser     int        `json:"number_of_valid_reports_for_user"`
		BountyEarnedForUser             float64    `json:"bounty_earned_for_user"`
		LastInvitationAcceptedAtForUser *time.Time `json:"last_invitation_accepted_at_for_user"`
		Bookmarked                      bool       `json:"bookmarked"`
		AllowsBountySplitting           bool       `json:"allows_bounty_splitting"`
		OffersBounties                  bool       `json:"offers_bounties"`
	} `json:"attributes"`
	Relationships struct {
		StructuredScopes struct {
			Data []StructuredScope `json:"data"`
		} `json:"structured_scopes"`
	} `json:"relationships"`
}

type ProgramSmall

type ProgramSmall struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Handle    string     `json:"handle"`
		CreatedAt *time.Time `json:"created_at"`
		UpdatedAt *time.Time `json:"updated_at"`
	} `json:"attributes"`
}

type Report

type Report struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Title                         string      `json:"title"`
		State                         ReportState `json:"state"`
		CreatedAt                     time.Time   `json:"created_at"`
		VulnerabilityInformation      *string     `json:"vulnerability_information"`
		TriagedAt                     *time.Time  `json:"triaged_at"`
		ClosedAt                      *time.Time  `json:"closed_at"`
		LastReporterActivityAt        *time.Time  `json:"last_reporter_activity_at"`
		FirstProgramActivityAt        *time.Time  `json:"first_program_activity_at"`
		LastProgramActivityAt         *time.Time  `json:"last_program_activity_at"`
		BountyAwardedAt               *time.Time  `json:"bounty_awarded_at"`
		SwagAwardedAt                 *time.Time  `json:"swag_awarded_at"`
		DisclosedAt                   *time.Time  `json:"disclosed_at"`
		ReporterAgreedOnGoingPublicAt *time.Time  `json:"reporter_agreed_on_going_public_at"`
		LastPublicActivityAt          *time.Time  `json:"last_public_activity_at"`
		LastActivityAt                *time.Time  `json:"last_activity_at"`
		CVEIDs                        []string    `json:"cve_ids"`
	} `json:"attributes"`
	Relationships struct {
		Program struct {
			Data ProgramSmall `json:"data"`
		} `json:"program"`
		Attachments struct {
			Data []Attachment `json:"data"`
		} `json:"attachments"`
		Swag struct {
			Data []interface{} `json:"data"`
		} `json:"swag"`
		Reporter *struct {
			Data User `json:"data"`
		} `json:"reporter"`
		Assignee *struct {
		} `json:"assignee"`
		Weakness *struct {
			Data Weakness `json:"data"`
		} `json:"weakness"`
		Severity *struct {
			Data Severity `json:"data"`
		} `json:"severity"`
		StructuredScope *struct {
			Data StructuredScope `json:"data"`
		} `json:"structured_scope"`
		Activities struct {
			Data []Activity `json:"data"`
		} `json:"activities"`
		Bounties struct {
			Data []interface{} `json:"data"`
		} `json:"bounties"`
		Summaries struct {
			Data []interface{} `json:"data"`
		} `json:"summaries"`
		TriggeredPreSubmissionTrigger *struct {
			Data Trigger `json:"data"`
		} `json:"triggered_pre_submission_trigger"`
		CustomFieldValues struct {
			Data []interface{} `json:"data"`
		} `json:"custom_field_values"`
		AutomatedRemediationGuidance *struct {
			Data AutomatedRemediationGuidance `json:"data"`
		} `json:"automated_remediation_guidance"`
		CustomRemediationGuidance *struct {
			Data CustomRemediationGuidance `json:"data"`
		} `json:"custom_remediation_guidance"`
	} `json:"relationships"`
}

type ReportState

type ReportState string
const (
	ReportStateNew                  ReportState = "new"
	ReportStatePendingProgramReview ReportState = "pending-program-review"
	ReportStateTriaged              ReportState = "triaged"
	ReportStateNeedsMoreInfo        ReportState = "needs-more-info"
	ReportStateResolved             ReportState = "resolved"
	ReportStateNotApplicable        ReportState = "not-applicable"
	ReportStateInformative          ReportState = "informative"
	ReportStateDuplicate            ReportState = "duplicate"
	ReportStateSpam                 ReportState = "spam"
	ReportStateRetesting            ReportState = "retesting"
)

type Severity

type Severity struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Rating             SeverityRating `json:"rating"`
		AuthorType         string         `json:"author_type"`
		UserId             int            `json:"user_id"`
		CreatedAt          time.Time      `json:"created_at"`
		Score              *float64       `json:"score"`
		AttackComplexity   string         `json:"attack_complexity"`
		AttackVector       *string        `json:"attack_vector"`
		Availability       string         `json:"availability"`
		Confidentiality    string         `json:"confidentiality"`
		Integrity          string         `json:"integrity"`
		PrivilegesRequired string         `json:"privileges_required"`
		UserInteraction    string         `json:"user_interaction"`
		Scope              *string        `json:"scope"`
	} `json:"attributes"`
}

type SeverityRating

type SeverityRating string
const (
	SeverityRatingNone     SeverityRating = "none"
	SeverityRatingLow      SeverityRating = "low"
	SeverityRatingMedium   SeverityRating = "medium"
	SeverityRatingHigh     SeverityRating = "high"
	SeverityRatingCritical SeverityRating = "critical"
)

type StructuredScope

type StructuredScope struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		AssetIdentifier            string    `json:"asset_identifier"`
		AssetType                  string    `json:"asset_type"`
		ConfidentialityRequirement *string   `json:"confidentiality_requirement"`
		IntegrityRequirement       *string   `json:"integrity_requirement"`
		AvailabilityRequirement    *string   `json:"availability_requirement"`
		MaxSeverity                string    `json:"max_severity"`
		CreatedAt                  time.Time `json:"created_at"`
		UpdatedAt                  time.Time `json:"updated_at"`
		Instruction                *string   `json:"instruction"`
		EligibleForBounty          bool      `json:"eligible_for_bounty"`
		EligibleForSubmission      bool      `json:"eligible_for_submission"`
		Reference                  *string   `json:"reference"`
	} `json:"attributes"`
}

type Swag

type Swag struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Sent      bool      `json:"sent"`
		CreatedAt time.Time `json:"created_at"`
	} `json:"attributes"`
	Relationships struct {
		User struct {
			Data User `json:"data"`
		} `json:"user"`
		Address struct {
			Data Address `json:"data"`
		} `json:"address"`
	} `json:"relationships"`
}

type Trigger

type Trigger struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Title string `json:"title"`
	} `json:"attributes"`
}

type User

type User struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Username       string    `json:"username"`
		Name           string    `json:"name"`
		Disabled       bool      `json:"disabled"`
		CreatedAt      time.Time `json:"created_at"`
		ProfilePicture struct {
			X62  string `json:"62x62"`
			X82  string `json:"82x82"`
			X110 string `json:"110x110"`
			X260 string `json:"260x260"`
		} `json:"profile_picture"`
	} `json:"attributes"`
}

type Weakness

type Weakness struct {
	Id         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Name        string    `json:"name"`
		Description string    `json:"description"`
		ExternalId  string    `json:"external_id"`
		CreatedAt   time.Time `json:"created_at"`
	} `json:"attributes"`
}

Jump to

Keyboard shortcuts

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