Documentation
¶
Index ¶
- type Account
- type Artifact
- type AuthenticatedUser
- type AzureDevOpsApiClient
- func (a AzureDevOpsApiClient) DownloadArtifactZip(url string) ([]byte, *resty.Response, error)
- func (a AzureDevOpsApiClient) GetAuthenticatedUser() (*AuthenticatedUser, *resty.Response, error)
- func (a AzureDevOpsApiClient) GetLog(organization string, project string, buildId int, logId int) ([]byte, *resty.Response, error)
- func (a AzureDevOpsApiClient) ListAccounts(ownerId string) ([]Account, *resty.Response, error)
- func (a AzureDevOpsApiClient) ListBuildArtifacts(continuationToken string, organization string, project string, buildId int) ([]Artifact, *resty.Response, string, error)
- func (a AzureDevOpsApiClient) ListBuildLogs(organization string, project string, buildId int) ([]BuildLog, *resty.Response, error)
- func (a AzureDevOpsApiClient) ListBuilds(continuationToken string, organization string, project string) ([]Build, *resty.Response, string, error)
- func (a AzureDevOpsApiClient) ListProjects(continuationToken string, organization string) ([]Project, *resty.Response, string, error)
- type Build
- type BuildLog
- type PaginatedResponse
- type Project
- type ScanOptions
- type Scanner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
ID int `json:"id"`
Name string `json:"name"`
Source string `json:"source"`
Resource struct {
Type string `json:"type"`
Data string `json:"data"`
Properties struct {
Localpath string `json:"localpath"`
Artifactsize string `json:"artifactsize"`
} `json:"properties"`
URL string `json:"url"`
DownloadURL string `json:"downloadUrl"`
} `json:"resource"`
}
type AuthenticatedUser ¶
type AzureDevOpsApiClient ¶
type AzureDevOpsApiClient struct {
Client resty.Client
BaseURL string
VsspsURL string // URL for profile/account APIs
}
https://learn.microsoft.com/en-us/rest/api/azure/devops/
func NewClient ¶
func NewClient(username string, password string, baseURL string) AzureDevOpsApiClient
func (AzureDevOpsApiClient) DownloadArtifactZip ¶
func (AzureDevOpsApiClient) GetAuthenticatedUser ¶
func (a AzureDevOpsApiClient) GetAuthenticatedUser() (*AuthenticatedUser, *resty.Response, error)
func (AzureDevOpsApiClient) GetLog ¶
func (AzureDevOpsApiClient) ListAccounts ¶
func (AzureDevOpsApiClient) ListBuildArtifacts ¶
func (a AzureDevOpsApiClient) ListBuildArtifacts(continuationToken string, organization string, project string, buildId int) ([]Artifact, *resty.Response, string, error)
https://learn.microsoft.com/en-us/rest/api/azure/devops/build/artifacts/list?view=azure-devops-rest-7.1 this endpoint is NOT paged
func (AzureDevOpsApiClient) ListBuildLogs ¶
func (a AzureDevOpsApiClient) ListBuildLogs(organization string, project string, buildId int) ([]BuildLog, *resty.Response, error)
https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/get-build-logs?view=azure-devops-rest-7.2 this endpoint is NOT paged
func (AzureDevOpsApiClient) ListBuilds ¶
func (a AzureDevOpsApiClient) ListBuilds(continuationToken string, organization string, project string) ([]Build, *resty.Response, string, error)
https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/list?view=azure-devops-rest-7.2
func (AzureDevOpsApiClient) ListProjects ¶
type Build ¶
type Build struct {
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
Web struct {
Href string `json:"href"`
} `json:"web"`
SourceVersionDisplayURI struct {
Href string `json:"href"`
} `json:"sourceVersionDisplayUri"`
Timeline struct {
Href string `json:"href"`
} `json:"timeline"`
Badge struct {
Href string `json:"href"`
} `json:"badge"`
} `json:"_links"`
Properties struct {
} `json:"properties"`
Tags []interface{} `json:"tags"`
ValidationResults []interface{} `json:"validationResults"`
Plans []struct {
PlanID string `json:"planId"`
} `json:"plans"`
TriggerInfo struct {
} `json:"triggerInfo"`
ID int `json:"id"`
BuildNumber string `json:"buildNumber"`
Status string `json:"status"`
Result string `json:"result"`
QueueTime time.Time `json:"queueTime"`
StartTime time.Time `json:"startTime"`
FinishTime time.Time `json:"finishTime"`
URL string `json:"url"`
Definition struct {
Drafts []interface{} `json:"drafts"`
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
URI string `json:"uri"`
Path string `json:"path"`
Type string `json:"type"`
QueueStatus string `json:"queueStatus"`
Revision int `json:"revision"`
Project struct {
ID string `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
State string `json:"state"`
Revision int `json:"revision"`
Visibility string `json:"visibility"`
LastUpdateTime time.Time `json:"lastUpdateTime"`
} `json:"project"`
} `json:"definition"`
BuildNumberRevision int `json:"buildNumberRevision"`
Project struct {
ID string `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
State string `json:"state"`
Revision int `json:"revision"`
Visibility string `json:"visibility"`
LastUpdateTime time.Time `json:"lastUpdateTime"`
} `json:"project"`
URI string `json:"uri"`
SourceBranch string `json:"sourceBranch"`
SourceVersion string `json:"sourceVersion"`
Queue struct {
ID int `json:"id"`
Name string `json:"name"`
Pool struct {
ID int `json:"id"`
Name string `json:"name"`
IsHosted bool `json:"isHosted"`
} `json:"pool"`
} `json:"queue"`
Priority string `json:"priority"`
Reason string `json:"reason"`
RequestedFor struct {
DisplayName string `json:"displayName"`
URL string `json:"url"`
Links struct {
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
} `json:"_links"`
ID string `json:"id"`
UniqueName string `json:"uniqueName"`
ImageURL string `json:"imageUrl"`
Descriptor string `json:"descriptor"`
} `json:"requestedFor"`
RequestedBy struct {
DisplayName string `json:"displayName"`
URL string `json:"url"`
Links struct {
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
} `json:"_links"`
ID string `json:"id"`
UniqueName string `json:"uniqueName"`
ImageURL string `json:"imageUrl"`
Descriptor string `json:"descriptor"`
} `json:"requestedBy"`
LastChangedDate time.Time `json:"lastChangedDate"`
LastChangedBy struct {
DisplayName string `json:"displayName"`
URL string `json:"url"`
Links struct {
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
} `json:"_links"`
ID string `json:"id"`
UniqueName string `json:"uniqueName"`
ImageURL string `json:"imageUrl"`
Descriptor string `json:"descriptor"`
} `json:"lastChangedBy"`
OrchestrationPlan struct {
PlanID string `json:"planId"`
} `json:"orchestrationPlan"`
Logs struct {
ID int `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
} `json:"logs"`
Repository struct {
ID string `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
URL string `json:"url"`
Clean interface{} `json:"clean"`
CheckoutSubmodules bool `json:"checkoutSubmodules"`
} `json:"repository"`
RetainedByRelease bool `json:"retainedByRelease"`
TriggeredByBuild interface{} `json:"triggeredByBuild"`
AppendCommitMessageToRunName bool `json:"appendCommitMessageToRunName"`
}
type PaginatedResponse ¶
type ScanOptions ¶
type ScanOptions struct {
Username string
AccessToken string
ConfidenceFilter []string
MaxScanGoRoutines int
TruffleHogVerification bool
MaxBuilds int
Organization string
Project string
Artifacts bool
DevOpsURL string
MaxArtifactSize int64
HitTimeout time.Duration
Context context.Context
Client AzureDevOpsApiClient
}
ScanOptions contains configuration options for Azure DevOps scanning operations.
func InitializeOptions ¶
func InitializeOptions(username, accessToken, devOpsURL, organization, project, maxArtifactSizeStr string, artifacts, truffleHogVerification bool, maxBuilds, maxScanGoRoutines int, confidenceFilter []string, hitTimeout time.Duration) (ScanOptions, error)
InitializeOptions prepares scan options from CLI parameters.
type Scanner ¶
type Scanner interface {
pkgscanner.BaseScanner
}
func NewScanner ¶
func NewScanner(opts ScanOptions) Scanner
Click to show internal directories.
Click to hide internal directories.