CxSASTClientGo

package module
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 17 Imported by: 1

README

Simple GoLang client for Checkmarx CxSAST platform - built against Cx9.5 but should also work with 9.x.

This client is not feature-complete and should not be used in production, but can serve as an example or basis from which to build custom GoLang applications.

Documentation

Index

Constants

View Source
const (
	PreScanAction  = "SOURCE_CONTROL_COMMAND"
	PostScanAction = "POST_SCAN_COMMAND"
)

Variables

This section is empty.

Functions

func OauthCodeCallbackURL

func OauthCodeCallbackURL(base_url, client_id, redirect_uri, scope, state string) string

func OauthCodeHTTPClient

func OauthCodeHTTPClient(client *http.Client, base_url, client_id, oauth_code, oauth_scope, oauth_redirect_uri string) (*http.Client, error)

func OauthCredentialClient

func OauthCredentialClient(client *http.Client, base_url, client_id, client_secret, username, password string, scopes []string) *http.Client

func ShortenGUID

func ShortenGUID(guid string) string

Types

type ApplicationVersion added in v0.0.11

type ApplicationVersion struct {
	ApplicationVersion string
	EnginePack         string
	HotFix             int
}

type AuthenticationProvider

type AuthenticationProvider struct {
	ID           uint64
	Name         string
	ProviderID   uint64
	ProviderType string
	IsExternal   bool
	Active       bool
}

func (*AuthenticationProvider) String added in v0.0.11

func (c *AuthenticationProvider) String() string

type CustomTask added in v0.0.11

type CustomTask struct {
	ID   uint64
	Name string
	Type string
	Data string
}

type EngineConfiguration added in v0.0.11

type EngineConfiguration struct {
	ID   uint64
	Name string
}

type IssueTracker added in v0.0.11

type IssueTracker struct {
	ID   uint64
	Name string
	Type string
	URL  string
}
type Link struct {
	Rel string `json:"rel"`
	URI string `json:"uri"`
}
type Links struct {
	Report Link `json:"report"`
	Status Link `json:"status"`
}

type OIDCClaim

type OIDCClaim struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type OIDCClient

type OIDCClient struct {
	ID                                uint64      `json:"id"`
	UpdateAccessTokenClaimsOnRefresh  bool        `json:"updateAccessTokenClaimsOnRefresh"`
	AccessTokenType                   uint64      `json:"accessTokenType"`
	IncludeJwtID                      bool        `json:"includeJwtId"`
	AlwaysIncludeUserClaimsInIDToken  bool        `json:"alwaysIncludeUserClaimsInIdToken"`
	ClientID                          string      `json:"clientId"`
	ClientName                        string      `json:"clientName"`
	AllowOfflineAccess                bool        `json:"allowOfflineAccess"`
	ClientSecrets                     []string    `json:"clientSecrets"`
	AllowedGrantTypes                 []string    `json:"allowedGrantTypes"`
	AllowedScopes                     []string    `json:"allowedScopes"`
	Enabled                           bool        `json:"enabled"`
	RequireClientSecret               bool        `json:"requireClientSecret"`
	RedirectUris                      []string    `json:"redirectUris"`
	PostLogoutRedirectUris            []string    `json:"postLogoutRedirectUris"`
	FrontChannelLogoutUri             *string     `json:"frontChannelLogoutUri"`
	FrontChannelLogoutSessionRequired bool        `json:"frontChannelLogoutSessionRequired"`
	BackChannelLogoutUri              *string     `json:"backChannelLogoutUri"`
	BackChannelLogoutSessionRequired  bool        `json:"backChannelLogoutSessionRequired"`
	IdentityTokenLifetime             uint64      `json:"identityTokenLifetime"`
	AccessTokenLifetime               uint64      `json:"accessTokenLifetime"`
	AuthorizationCodeLifetime         uint64      `json:"authorizationCodeLifetime"`
	AbsoluteRefreshTokenLifetime      uint64      `json:"absoluteRefreshTokenLifetime"`
	SlidingRefreshTokenLifetime       uint64      `json:"slidingRefreshTokenLifetime"`
	RefreshTokenUsage                 uint64      `json:"refreshTokenUsage"`
	RefreshTokenExpiration            uint64      `json:"refreshTokenExpiration"`
	AllowedCorsOrigins                []string    `json:"allowedCorsOrigins"`
	AllowAccessTokensViaBrowser       bool        `json:"allowAccessTokensViaBrowser"`
	Claims                            []OIDCClaim `json:"claims"`
	ClientClaimsPrefix                string      `json:"clientClaimsPrefix"`
	RequirePkce                       bool        `json:"requirePkce"`
}

type PasswordConfig

type PasswordConfig struct {
	Config      oauth2.Config
	Username    string
	Password    string
	ReuseSource *PasswordTokenSource
}

func (*PasswordConfig) Client

func (c *PasswordConfig) Client(ctx context.Context) *http.Client

func (*PasswordConfig) Token

func (c *PasswordConfig) Token(ctx context.Context) (*oauth2.Token, error)

func (*PasswordConfig) TokenSource

func (c *PasswordConfig) TokenSource(ctx context.Context) oauth2.TokenSource

type PasswordTokenSource

type PasswordTokenSource struct {
	LastToken *oauth2.Token
	// contains filtered or unexported fields
}

func (*PasswordTokenSource) Token

func (c *PasswordTokenSource) Token() (*oauth2.Token, error)

type PathNode

type PathNode struct {
	FileName string
	Line     uint64
	Column   uint64
	Name     string
	Length   uint64
}

type Preset

type Preset struct {
	PresetID uint64 `json:"id"`
	Name     string
	QueryIDs []uint64
	Filled   bool    `json:"-"`
	Queries  []Query `json:"-"`
}

func (*Preset) LinkQueries added in v0.0.14

func (p *Preset) LinkQueries(queries *QueryCollection)

func (*Preset) String

func (p *Preset) String() string

Presets

type Project

type Project struct {
	ProjectID    uint64 `json:"id"`
	TeamID       uint64
	Name         string
	IsPublic     bool
	SourceType   string
	Settings     *ProjectSettings
	Repo         *ProjectRepo
	Filters      *SourceFilters
	CustomFields []ProjectCustomField
}

func ConvertProjects

func ConvertProjects(pps *[]ProjectComplex) []Project

func (*Project) String

func (p *Project) String() string

type ProjectComplex

type ProjectComplex struct {
	ProjectID          uint64 `json:"id"`
	TeamID             uint64
	Name               string
	IsPublic           bool
	SourceSettingsLink struct {
		Type string
		Rel  string
		Uri  string
	}
	CustomFields []ProjectCustomField
	Links        []map[string]string
}

this type is used temporarily to convert into the 'simpler' format defined in types.go

func (ProjectComplex) ToProject

func (pp ProjectComplex) ToProject() Project

type ProjectCustomField

type ProjectCustomField struct {
	ID    uint   `json:"id"`
	Value string `json:"value"`
	Name  string `json:"name"`
}

type ProjectRepo

type ProjectRepo struct {
	URL    string
	Branch string
	UseSSH bool
}

func (*ProjectRepo) String

func (pr *ProjectRepo) String() string

type ProjectSettings

type ProjectSettings struct {
	ProjectID             uint64
	PresetID              uint64
	PresetName            string
	EngineConfigurationID uint64
	PostScanAction        int64
	EmailNotifications    struct {
		FailedScan []string
		BeforeScan []string
		AfterScan  []string
	}
}

type Query

type Query struct {
	Name         string
	QueryID      uint64 `xml:"QueryId"`
	BaseQueryID  uint64
	CWE          uint64 `xml:"Cwe"`
	Severity     int
	PackageID    uint64 `xml:"PackageId"`
	Language     string
	Group        string
	IsExecutable bool `xml:"IsExecutable"`
}

func (*Query) IsCustom

func (q *Query) IsCustom() bool

func (*Query) String

func (q *Query) String() string

type QueryCollection

type QueryCollection struct {
	QueryLanguages []QueryLanguage
}

func (*QueryCollection) AddQuery

func (qc *QueryCollection) AddQuery(l *QueryLanguage, g *QueryGroup, q *Query)

func (*QueryCollection) FromXML added in v0.0.13

func (qc *QueryCollection) FromXML(response []byte) error

func (*QueryCollection) GetCustomQueryCollection

func (qc *QueryCollection) GetCustomQueryCollection() QueryCollection

func (*QueryCollection) GetQuery

func (qc *QueryCollection) GetQuery(language, group, query string) *Query

func (*QueryCollection) GetQueryByID

func (qc *QueryCollection) GetQueryByID(qid uint64) *Query

func (*QueryCollection) GetQueryLanguage

func (qc *QueryCollection) GetQueryLanguage(language string) *QueryLanguage

func (*QueryCollection) LinkBaseQueries added in v0.0.13

func (qc *QueryCollection) LinkBaseQueries()

func (*QueryCollection) String added in v0.0.13

func (qc *QueryCollection) String() string

type QueryGroup

type QueryGroup struct {
	Name            string
	PackageID       uint64
	Queries         []Query
	Language        string `xml:"languageName"`
	OwningProjectID uint64 `xml:"ProjectId"`
	PackageType     string `xml:"PackageTypeName"`
	OwningTeamID    uint64 `xml:"OwningTeam"`
}

func (*QueryGroup) GetQuery

func (qg *QueryGroup) GetQuery(name string) *Query

func (*QueryGroup) IsCustom

func (q *QueryGroup) IsCustom() bool

func (*QueryGroup) String

func (q *QueryGroup) String() string

type QueryLanguage

type QueryLanguage struct {
	Name        string
	LanguageID  uint64
	QueryGroups []QueryGroup
}

func (*QueryLanguage) GetQueryGroup

func (ql *QueryLanguage) GetQueryGroup(group string) *QueryGroup

func (*QueryLanguage) GetQueryGroupByID added in v0.0.13

func (ql *QueryLanguage) GetQueryGroupByID(packageId uint64) *QueryGroup

func (*QueryLanguage) String

func (q *QueryLanguage) String() string

type Report

type Report struct {
	ReportID uint64 `json:"reportId"`
	Links    Links  `json:"links"`
}

type ReportStatus

type ReportStatus struct {
	ID    int    `json:"id"`
	Value string `json:"value"`
}

ReportStatus - ReportStatus Structure

type ReportStatusResponse

type ReportStatusResponse struct {
	Location    string       `json:"location"`
	ContentType string       `json:"contentType"`
	Status      ReportStatus `json:"status"`
}

ReportStatusResponse - ReportStatusResponse Structure

type ResultState added in v0.0.11

type ResultState struct {
	Name       string `xml:"ResultName"`
	ID         uint   `xml:"ResultID"`
	Permission string `xml:"ResultPermission"`
	IsCustom   bool
}

type Role

type Role struct {
	RoleID        uint64 `json:"id"`
	IsSystemRole  bool
	Name          string
	Description   string
	PermissionIDs []uint64
}

func (*Role) String

func (r *Role) String() string

Roles

type SASTCache

type SASTCache struct {
	Projects     []Project
	ProjectsByID map[uint64]*Project `json:"-"`
	Teams        []Team
	TeamsByID    map[uint64]*Team `json:"-"`
	Users        []User
	UsersByID    map[uint64]*User `json:"-"`
	Queries      QueryCollection
	Presets      []Preset
	Roles        []Role
}

func (*SASTCache) GenerateProjectIDMap added in v0.0.14

func (c *SASTCache) GenerateProjectIDMap()

func (*SASTCache) GenerateTeamIDMap added in v0.0.14

func (c *SASTCache) GenerateTeamIDMap()

func (*SASTCache) GenerateUserIDMap added in v0.0.14

func (c *SASTCache) GenerateUserIDMap()

func (*SASTCache) GetPreset

func (c *SASTCache) GetPreset(presetID uint64) (*Preset, error)

func (*SASTCache) GetPresetByName

func (c *SASTCache) GetPresetByName(name string) (*Preset, error)

func (*SASTCache) GetProject

func (c *SASTCache) GetProject(projectID uint64) (*Project, error)

func (*SASTCache) GetProjectByName

func (c *SASTCache) GetProjectByName(name string) (*Project, error)

func (*SASTCache) GetProjectsByTeamID

func (c *SASTCache) GetProjectsByTeamID(teamID uint64) []*Project

func (*SASTCache) GetQuery

func (c *SASTCache) GetQuery(queryID uint64) (*Query, error)

func (*SASTCache) GetQueryByNames

func (c *SASTCache) GetQueryByNames(language, group, query string) (*Query, error)

func (*SASTCache) GetRole

func (c *SASTCache) GetRole(roleID uint64) (*Role, error)

func (*SASTCache) GetRoleByName

func (c *SASTCache) GetRoleByName(name string) (*Role, error)

func (*SASTCache) GetTeam

func (c *SASTCache) GetTeam(teamID uint64) (*Team, error)

func (*SASTCache) GetTeamByName

func (c *SASTCache) GetTeamByName(name string) (*Team, error)

func (*SASTCache) GetTeamsByParentID

func (c *SASTCache) GetTeamsByParentID(parentID uint64) []*Team

func (*SASTCache) GetUser

func (c *SASTCache) GetUser(userID uint64) (*User, error)

func (*SASTCache) GetUserByEmail

func (c *SASTCache) GetUserByEmail(email string) (*User, error)

func (*SASTCache) GetUsersInTeam

func (c *SASTCache) GetUsersInTeam(teamID uint64) []*User

func (*SASTCache) GetUsersInTeams

func (c *SASTCache) GetUsersInTeams(teams []Team) []*User

func (*SASTCache) MatchTeamProjects added in v0.0.14

func (c *SASTCache) MatchTeamProjects()

func (*SASTCache) MatchTeamUsers added in v0.0.14

func (c *SASTCache) MatchTeamUsers()

func (*SASTCache) PresetSummary

func (c *SASTCache) PresetSummary() string

func (*SASTCache) ProjectSummary

func (c *SASTCache) ProjectSummary() string

func (*SASTCache) QuerySummary

func (c *SASTCache) QuerySummary() string

func (*SASTCache) Refresh

func (c *SASTCache) Refresh(client *SASTClient) []error

func (*SASTCache) RefreshPresets

func (c *SASTCache) RefreshPresets(client *SASTClient) error

func (*SASTCache) RefreshProjects

func (c *SASTCache) RefreshProjects(client *SASTClient) error

func (*SASTCache) RefreshQueries

func (c *SASTCache) RefreshQueries(client *SASTClient) error

func (*SASTCache) RefreshRoles

func (c *SASTCache) RefreshRoles(client *SASTClient) error

func (*SASTCache) RefreshTeams

func (c *SASTCache) RefreshTeams(client *SASTClient) error

func (*SASTCache) RefreshUsers

func (c *SASTCache) RefreshUsers(client *SASTClient) error

func (*SASTCache) String

func (c *SASTCache) String() string

func (*SASTCache) TeamSummary

func (c *SASTCache) TeamSummary() string

func (*SASTCache) TeamTree

func (c *SASTCache) TeamTree() string

func (*SASTCache) UserSummary

func (c *SASTCache) UserSummary() string

type SASTClient

type SASTClient struct {
	CurrentUser *User
	// contains filtered or unexported fields
}

func New

func New(client *http.Client, soap_client *http.Client, base_url string, logger *logrus.Logger) (*SASTClient, error)

If you want to provide your own authenticated HTTP Client (prepared through OAuth2 library) you can use this instead. this is useful if you are using SAST authentication on a third-party website with authorization_code style oauth oauth authorization_code helper function are implemented in sastpassclient.go

func NewTokenClient

func NewTokenClient(client *http.Client, base_url string, username string, password string, logger *logrus.Logger) (*SASTClient, error)

NewTokenClient will authenticate with SAST using the standard OIDC clients included in the platform

func (SASTClient) ClientsValid

func (c SASTClient) ClientsValid() (bool, bool)

func (SASTClient) CreateOIDCClient

func (c SASTClient) CreateOIDCClient(client *OIDCClient) error

func (SASTClient) CreateTeam

func (c SASTClient) CreateTeam(name string, parentId uint64) (uint64, error)

func (SASTClient) DeleteOIDCClient

func (c SASTClient) DeleteOIDCClient(client *OIDCClient) error

func (SASTClient) DeleteTeam

func (c SASTClient) DeleteTeam(teamId uint64) error

func (SASTClient) DeleteTeamByID

func (c SASTClient) DeleteTeamByID(teamId uint64) error

func (SASTClient) DownloadReport

func (c SASTClient) DownloadReport(reportID uint64) ([]byte, error)

func (SASTClient) DownloadReportByID

func (c SASTClient) DownloadReportByID(reportID uint64) ([]byte, error)

func (SASTClient) GenerateAndDownloadReport

func (c SASTClient) GenerateAndDownloadReport(scanID uint64, reportType string) ([]byte, error)

convenience function

func (SASTClient) GenerateAndDownloadReportByID

func (c SASTClient) GenerateAndDownloadReportByID(scanID uint64, reportType string) ([]byte, error)

func (SASTClient) GetAuthenticationProviders

func (c SASTClient) GetAuthenticationProviders() ([]AuthenticationProvider, error)

func (SASTClient) GetCurrentUser

func (c SASTClient) GetCurrentUser() (User, error)

func (SASTClient) GetCustomTasks added in v0.0.11

func (c SASTClient) GetCustomTasks() ([]CustomTask, error)

func (SASTClient) GetEngineConfigurations added in v0.0.11

func (c SASTClient) GetEngineConfigurations() ([]EngineConfiguration, error)

func (SASTClient) GetEngineConfigurationsSOAP added in v0.0.11

func (c SASTClient) GetEngineConfigurationsSOAP() ([]EngineConfiguration, error)

func (SASTClient) GetIssueTrackers added in v0.0.11

func (c SASTClient) GetIssueTrackers() ([]IssueTracker, error)

func (SASTClient) GetLastScan

func (c SASTClient) GetLastScan(projectid uint64) (Scan, error)

func (SASTClient) GetLastScanByID

func (c SASTClient) GetLastScanByID(projectid uint64) (Scan, error)

func (SASTClient) GetOIDCClientByID

func (c SASTClient) GetOIDCClientByID(clientId string) (OIDCClient, error)

convenience

func (SASTClient) GetOIDCClients

func (c SASTClient) GetOIDCClients() ([]OIDCClient, error)

func (SASTClient) GetPresetByID

func (c SASTClient) GetPresetByID(presetID uint64) (Preset, error)

func (SASTClient) GetPresetByName

func (c SASTClient) GetPresetByName(name string) (Preset, error)

func (SASTClient) GetPresetContents

func (c SASTClient) GetPresetContents(p *Preset, queries *QueryCollection) error

func (SASTClient) GetPresets

func (c SASTClient) GetPresets() ([]Preset, error)

func (SASTClient) GetProject

func (c SASTClient) GetProject(id uint64) (Project, error)

func (SASTClient) GetProjectByID

func (c SASTClient) GetProjectByID(id uint64) (Project, error)

func (SASTClient) GetProjectByIDV

func (c SASTClient) GetProjectByIDV(id uint64, version string) (Project, error)

func (SASTClient) GetProjectCustomFields

func (c SASTClient) GetProjectCustomFields(project *Project) error

func (SASTClient) GetProjectRepository

func (c SASTClient) GetProjectRepository(project *Project) error

func (SASTClient) GetProjectSettings

func (c SASTClient) GetProjectSettings(project *Project) error

func (SASTClient) GetProjectSettingsByID

func (c SASTClient) GetProjectSettingsByID(projectid uint64) (ProjectSettings, error)

func (SASTClient) GetProjectSourceFilters added in v0.0.12

func (c SASTClient) GetProjectSourceFilters(project *Project) error

func (SASTClient) GetProjects

func (c SASTClient) GetProjects() ([]Project, error)

func (SASTClient) GetProjectsInTeam

func (c SASTClient) GetProjectsInTeam(teamid uint64) ([]Project, error)

func (SASTClient) GetProjectsInTeamByID

func (c SASTClient) GetProjectsInTeamByID(teamid uint64) ([]Project, error)

func (SASTClient) GetQueriesSOAP

func (c SASTClient) GetQueriesSOAP() (QueryCollection, error)

func (SASTClient) GetQueriesSOAPRaw added in v0.0.13

func (c SASTClient) GetQueriesSOAPRaw() ([]byte, error)

func (SASTClient) GetQueryByID

func (c SASTClient) GetQueryByID(qid uint64, queries *[]Query) *Query

func (SASTClient) GetReportStatus

func (c SASTClient) GetReportStatus(reportID uint64) (ReportStatusResponse, error)

func (SASTClient) GetReportStatusByID

func (c SASTClient) GetReportStatusByID(reportID uint64) (ReportStatusResponse, error)

func (SASTClient) GetResultStateListSOAP added in v0.0.11

func (c SASTClient) GetResultStateListSOAP() ([]ResultState, error)

func (SASTClient) GetResultsFromXML

func (c SASTClient) GetResultsFromXML(xmlReportData []byte) ([]ScanResult, error)

func (SASTClient) GetRoles

func (c SASTClient) GetRoles() ([]Role, error)

func (SASTClient) GetScan

func (c SASTClient) GetScan(scanid uint64) (Scan, error)

func (SASTClient) GetScanByID

func (c SASTClient) GetScanByID(scanid uint64) (Scan, error)

func (SASTClient) GetScanPresetSOAP

func (c SASTClient) GetScanPresetSOAP(scanid uint64) (Preset, error)

func (SASTClient) GetScanResultSummary

func (c SASTClient) GetScanResultSummary(results []ScanResult) ScanResultSummary

func (SASTClient) GetTeamByID

func (c SASTClient) GetTeamByID(teamId uint64) (Team, error)

func (SASTClient) GetTeams

func (c SASTClient) GetTeams() ([]Team, error)

func (SASTClient) GetUsers

func (c SASTClient) GetUsers() ([]User, error)

func (SASTClient) GetVersionSOAP added in v0.0.11

func (c SASTClient) GetVersionSOAP() (ApplicationVersion, error)
func (c SASTClient) PresetLink(p *Preset) string
func (c SASTClient) ProjectLink(p *Project) string

Links to objects in the portal

func (c SASTClient) QueryGroupLink(q *QueryGroup) string
func (c SASTClient) QueryLanguageLink(q *QueryLanguage) string
func (c SASTClient) QueryLink(q *Query) string

func (SASTClient) RequestNewReport

func (c SASTClient) RequestNewReport(scanID uint64, reportType string) (Report, error)

func (SASTClient) RequestNewReportByID

func (c SASTClient) RequestNewReportByID(scanID uint64, reportType string) (Report, error)
func (c SASTClient) RoleLink(r *Role) string

func (SASTClient) SaveOIDCClient

func (c SASTClient) SaveOIDCClient(client *OIDCClient) error

func (SASTClient) ScanProjectByID

func (c SASTClient) ScanProjectByID(projectID uint64, isIncremental, isPublic, forceScan bool, comment string) (uint64, error)

func (SASTClient) ScanProjectWithSettingsByID

func (c SASTClient) ScanProjectWithSettingsByID(settings *ScanSettings) (uint64, error)

func (SASTClient) String

func (c SASTClient) String() string
func (c SASTClient) TeamLink(t *Team) string

func (SASTClient) UploadBytesForProjectByID

func (c SASTClient) UploadBytesForProjectByID(projectID uint64, fileContents *[]byte) error

func (SASTClient) UploadFileForProjectByID

func (c SASTClient) UploadFileForProjectByID(projectID uint64, filename string) error
func (c SASTClient) UserLink(u *User) string

type Scan

type Scan struct {
	ScanID  uint64 `json:"id"`
	Project struct {
		ID   uint64
		Name string
	}
	Status struct {
		ID   uint64
		Name string
	}
	ScanState struct {
		SourceID string `json:"sourceId"`
	}
	FinishTime time.Time
}

func (*Scan) String

func (s *Scan) String() string

type ScanResult

type ScanResult struct {
	QueryName         string
	QueryID           uint64
	PathID            uint64
	Line              uint64
	Column            uint64
	DetectionDate     string
	Filename          string
	DeepLink          string
	Status            string
	Severity          string
	State             string
	SimilarityID      int64
	SourceMethod      string
	DestinationMethod string
	Group             string
	Language          string
	Nodes             []PathNode
}

func (ScanResult) String

func (r ScanResult) String() string

type ScanResultStatusSummary

type ScanResultStatusSummary struct {
	ToVerify               uint64
	NotExploitable         uint64
	Confirmed              uint64
	ProposedNotExploitable uint64
	Urgent                 uint64
}

func (ScanResultStatusSummary) String

func (s ScanResultStatusSummary) String() string

func (ScanResultStatusSummary) Total

func (s ScanResultStatusSummary) Total() uint64

type ScanResultSummary

type ScanResultSummary struct {
	High        ScanResultStatusSummary
	Medium      ScanResultStatusSummary
	Low         ScanResultStatusSummary
	Information ScanResultStatusSummary
}

func (ScanResultSummary) String

func (s ScanResultSummary) String() string

type ScanSettings

type ScanSettings struct {
	ProjectID              uint64  `json:"projectID"`
	OverrideProjectSetting bool    `json:"overrideProjectSetting"`
	IsIncremental          bool    `json:"isIncremental"`
	IsPublic               bool    `json:"isPublic"`
	ForceScan              bool    `json:"forceScan"`
	Comment                string  `json:"comment"`
	PresetID               uint64  `json:"presetId"`
	EngineConfigurationID  uint64  `json:"engineConfigurationId"`
	ZippedSource           *[]byte `json:"zippedSource,omitempty"`
}

type SourceFilters added in v0.0.12

type SourceFilters struct {
	ProjectID      uint64 `json:"projectId"`
	FoldersPattern string `json:"excludeFoldersPattern"`
	FilesPattern   string `json:"excludeFilesPattern"`
	PathPattern    string `json:"pathFilter"`
}

func (SourceFilters) HasFilters added in v0.0.12

func (f SourceFilters) HasFilters() bool

func (SourceFilters) ToGlob added in v0.0.12

func (f SourceFilters) ToGlob() string

type Team

type Team struct {
	TeamID         uint64 `json:"id"`
	Name           string
	FullName       string
	ParentID       uint64
	Projects       []*Project
	Users          []uint64
	InheritedUsers []uint64
}

func (Team) HasInheritedUsers added in v0.0.11

func (t Team) HasInheritedUsers() bool

func (Team) HasProjects

func (t Team) HasProjects() bool

func (Team) HasUsers added in v0.0.11

func (t Team) HasUsers() bool

func (*Team) String

func (t *Team) String() string

Teams

type User

type User struct {
	UserID        uint64 `json:"id"`
	FirstName     string
	LastName      string
	UserName      string
	LastLoginDate string
	Email         string
	IDPID         uint64 `json:"authenticationProviderId"`
	RoleIDs       []uint64
	TeamIDs       []uint64
	AccessToUI    bool `json:"accessToUi"`
}

func (User) IsInTeam added in v0.0.11

func (u User) IsInTeam(teamID uint64) bool

func (*User) String

func (u *User) String() string

Users

Jump to

Keyboard shortcuts

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