// Copyright 2022 The go-github AUTHORS. All rights reserved.//// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package githubimport ()// Dependency represents the vulnerable dependency.typeDependencystruct { Package *VulnerabilityPackage`json:"package,omitempty"` ManifestPath *string`json:"manifest_path,omitempty"` Scope *string`json:"scope,omitempty"`}// AdvisoryCVSS represents the advisory pertaining to the Common Vulnerability Scoring System.typeAdvisoryCVSSstruct { Score *float64`json:"score,omitempty"` VectorString *string`json:"vector_string,omitempty"`}// AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration.typeAdvisoryCWEsstruct { CWEID *string`json:"cwe_id,omitempty"` Name *string`json:"name,omitempty"`}// DependabotSecurityAdvisory represents the GitHub Security Advisory.typeDependabotSecurityAdvisorystruct { GHSAID *string`json:"ghsa_id,omitempty"` CVEID *string`json:"cve_id,omitempty"` Summary *string`json:"summary,omitempty"` Description *string`json:"description,omitempty"` Vulnerabilities []*AdvisoryVulnerability`json:"vulnerabilities,omitempty"` Severity *string`json:"severity,omitempty"` CVSS *AdvisoryCVSS`json:"cvss,omitempty"` CWEs []*AdvisoryCWEs`json:"cwes,omitempty"` Identifiers []*AdvisoryIdentifier`json:"identifiers,omitempty"` References []*AdvisoryReference`json:"references,omitempty"` PublishedAt *Timestamp`json:"published_at,omitempty"` UpdatedAt *Timestamp`json:"updated_at,omitempty"` WithdrawnAt *Timestamp`json:"withdrawn_at,omitempty"`}// DependabotAlert represents a Dependabot alert.typeDependabotAlertstruct { Number *int`json:"number,omitempty"` State *string`json:"state,omitempty"` Dependency *Dependency`json:"dependency,omitempty"` SecurityAdvisory *DependabotSecurityAdvisory`json:"security_advisory,omitempty"` SecurityVulnerability *AdvisoryVulnerability`json:"security_vulnerability,omitempty"` URL *string`json:"url,omitempty"` HTMLURL *string`json:"html_url,omitempty"` CreatedAt *Timestamp`json:"created_at,omitempty"` UpdatedAt *Timestamp`json:"updated_at,omitempty"` DismissedAt *Timestamp`json:"dismissed_at,omitempty"` DismissedBy *User`json:"dismissed_by,omitempty"` DismissedReason *string`json:"dismissed_reason,omitempty"` DismissedComment *string`json:"dismissed_comment,omitempty"` FixedAt *Timestamp`json:"fixed_at,omitempty"` AutoDismissedAt *Timestamp`json:"auto_dismissed_at,omitempty"`// The repository is always empty for events Repository *Repository`json:"repository,omitempty"`}// DependabotAlertState represents the state of a Dependabot alert to update.typeDependabotAlertStatestruct {// The state of the Dependabot alert. A dismissed_reason must be provided when setting the state to dismissed. State string`json:"state"`// Required when state is dismissed. A reason for dismissing the alert. // Can be one of: fix_started, inaccurate, no_bandwidth, not_used, tolerable_risk DismissedReason *string`json:"dismissed_reason,omitempty"`// An optional comment associated with dismissing the alert. DismissedComment *string`json:"dismissed_comment,omitempty"`}// ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts// and DependabotService.ListOrgAlerts methods.typeListAlertsOptionsstruct { State *string`url:"state,omitempty"` Severity *string`url:"severity,omitempty"` Ecosystem *string`url:"ecosystem,omitempty"` Package *string`url:"package,omitempty"` Scope *string`url:"scope,omitempty"` Sort *string`url:"sort,omitempty"` Direction *string`url:"direction,omitempty"`ListOptionsListCursorOptions}func ( *DependabotService) ( context.Context, string, *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { , := addOptions(, )if != nil {returnnil, nil, } , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, }var []*DependabotAlert , := .client.Do(, , &)if != nil {returnnil, , }return , , nil}// ListRepoAlerts lists all Dependabot alerts of a repository.//// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository////meta:operation GET /repos/{owner}/{repo}/dependabot/alertsfunc ( *DependabotService) ( context.Context, , string, *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { := fmt.Sprintf("repos/%v/%v/dependabot/alerts", , )return .listAlerts(, , )}// ListOrgAlerts lists all Dependabot alerts of an organization.//// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization////meta:operation GET /orgs/{org}/dependabot/alertsfunc ( *DependabotService) ( context.Context, string, *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { := fmt.Sprintf("orgs/%v/dependabot/alerts", )return .listAlerts(, , )}// GetRepoAlert gets a single repository Dependabot alert.//// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert////meta:operation GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}func ( *DependabotService) ( context.Context, , string, int) (*DependabotAlert, *Response, error) { := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", , , ) , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, } := new(DependabotAlert) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// UpdateAlert updates a Dependabot alert.//// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert////meta:operation PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}func ( *DependabotService) ( context.Context, , string, int, *DependabotAlertState) (*DependabotAlert, *Response, error) { := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", , , ) , := .client.NewRequest("PATCH", , )if != nil {returnnil, nil, } := new(DependabotAlert) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.