session

package
v0.0.0-...-82180e8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Client           providerapi.IClient `json:"-"` // Client holds the client for the target git server (github, gitlab)
	Config           *config.Config
	State            *State
	Router           *gin.Engine `json:"-"`
	SignatureVersion string
	GithubUsers      []*coreapi.Owner
	GithubUserLogins []string
	GithubUserOrgs   []string
	GithubUserRepos  []string
	Organizations    []*github.Organization
	Signatures       []signatures.Signature
}

Session contains all the necessary values and parameters used during a scan

func New

func New(scanType scanapi.ScanType) (*Session, error)

NewSession is the entry point for starting a new scan session

func NewWithConfig

func NewWithConfig(cfg *config.Config) (*Session, error)

func (*Session) Finish

func (s *Session) Finish()

Finish is called at the end of a scan session and used to generate discrete data points for a given scan session including setting the status of a scan to finished.

type State

type State struct {
	*sync.Mutex
	Stats        *stats.Stats
	Findings     map[string]*finding.Finding
	Targets      []*coreapi.Owner
	Repositories []*coreapi.Repository
}

func (*State) AddFinding

func (st *State) AddFinding(finding *finding.Finding) bool

AddFinding will add a finding that has been discovered during a session to the list of findings for that session

func (*State) AddRepository

func (st *State) AddRepository(repository *coreapi.Repository)

AddRepository will add a given repository to be scanned to a session. This counts as the total number of repos that have been gathered during a session.

func (*State) AddTarget

func (st *State) AddTarget(target *coreapi.Owner)

AddTarget will add a new target to a session to be scanned during that session

func (*State) AddTargets

func (st *State) AddTargets(targets []*coreapi.Owner)

AddTargets would iterate over the list and call AddTarget to append each one to the state list

func (*State) GetFindings

func (st *State) GetFindings() []*finding.Finding

Jump to

Keyboard shortcuts

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