api

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

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

func New

func New(cfg config.Config) (Endpoint, error)

New creates an Intigriti endpoint object to use this is the main object to interact with the SDK

func (*Endpoint) GetPrograms

func (e *Endpoint) GetPrograms() ([]Program, error)

GetPrograms returns all Intigriti programs for the current company

func (*Endpoint) GetSubmissions

func (e *Endpoint) GetSubmissions(programId string) ([]Submission, error)

GetSubmissions returns all submissions for the given program identifier

func (*Endpoint) IsAuthenticated

func (e *Endpoint) IsAuthenticated() bool

IsAuthenticated returns whether the current SDK instance has successfully authenticated

func (*Endpoint) IsKnownIP

func (e *Endpoint) IsKnownIP(ip net.IP) (bool, error)

IsKnownIP verifies whether the IP address is known to the Intigriti platform this can be as a researcher or company account

type Program

type Program struct {
	ID            string `json:"id"`
	Handle        string `json:"handle"`
	CompanyID     string `json:"companyId"`
	CompanyHandle string `json:"companyHandle"`
	LogoURL       string `json:"logoUrl"`
	Name          string `json:"name"`
	Status        struct {
		ID    int    `json:"id"`
		Value string `json:"value"`
	} `json:"status"`
	ConfidentialityLevel struct {
		ID    int    `json:"id"`
		Value string `json:"value"`
	} `json:"confidentialityLevel"`
	WebLinks struct {
		Details string `json:"details"`
	} `json:"webLinks"`
	Type struct {
		ID    int    `json:"id"`
		Value string `json:"value"`
	} `json:"type"`
}

type Submission

type Submission struct {
	Code              string      `json:"code"`
	InternalReference interface{} `json:"internalReference"`
	Title             string      `json:"title"`
	ProgramID         string      `json:"programId"`
	Severity          struct {
		ID     int         `json:"id"`
		Vector interface{} `json:"vector"`
		Value  string      `json:"value"`
	} `json:"severity"`
	State struct {
		Status struct {
			ID    int    `json:"id"`
			Value string `json:"value"`
		} `json:"status"`
		CloseReason struct {
			ID    int    `json:"id"`
			Value string `json:"value"`
		} `json:"closeReason"`
	} `json:"state"`
	TotalPayout struct {
		Value    float64 `json:"value"`
		Currency string  `json:"currency"`
	} `json:"totalPayout"`
	CreatedAt        int  `json:"createdAt"`
	LastUpdatedAt    int  `json:"lastUpdatedAt"`
	AwaitingFeedback bool `json:"awaitingFeedback"`
	Destroyed        bool `json:"destroyed"`
	Assignee         struct {
		AvatarURL string `json:"avatarUrl"`
		Email     string `json:"email"`
		Role      string `json:"role"`
		UserID    string `json:"userId"`
		Username  string `json:"userName"`
	} `json:"assignee"`
	Tags      []interface{} `json:"tags"`
	GroupID   interface{}   `json:"groupId"`
	Submitter struct {
		Ranking struct {
			Rank       int         `json:"rank"`
			Reputation int         `json:"reputation"`
			Streak     interface{} `json:"streak"`
		} `json:"ranking"`
		IdentityChecked bool   `json:"identityChecked"`
		UserID          string `json:"userId"`
		UserName        string `json:"userName"`
		AvatarURL       string `json:"avatarUrl"`
		Role            string `json:"role"`
	} `json:"submitter"`
	CollaboratorCount int `json:"collaboratorCount"`
	WebLinks          struct {
		Details string `json:"details"`
	} `json:"webLinks"`
}

func (*Submission) IsActive

func (s *Submission) IsActive() bool

func (*Submission) IsClosed

func (s *Submission) IsClosed() bool

type TaggedRoundTripper

type TaggedRoundTripper struct {
	Proxied http.RoundTripper
	Logger  *logrus.Logger
}

func (TaggedRoundTripper) RoundTrip

func (t TaggedRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip injects a http request header on every request and logs request/response

Jump to

Keyboard shortcuts

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