Skip to content

Commit

Permalink
chore: regen from api spec for include_vuln_description query param
Browse files Browse the repository at this point in the history
Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
  • Loading branch information
westonsteimel committed Jan 16, 2024
1 parent 3adb23e commit 18e474e
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OPENAPI_GENERATOR_VERSION = v6.0.0

# --- anchore enterprise references
# a git tag/branch/commit within anchore/enterprise repo
ENTERPRISE_REF = 69076f95de2e2c329790b41058fa2ca000335f73
ENTERPRISE_REF = 2243734db7b69e62c54e6d3f66e8d8b223d2f889
ENTERPRISE_ROOT = $(PROJECT_ROOT)/enterprise
ENTERPRISE_OPENAPI_DOC = $(PROJECT_ROOT)/anchore-api-swagger-$(ENTERPRISE_REF).yaml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7797,6 +7797,11 @@ paths:
in: query
schema:
type: boolean
- name: include_vuln_description
in: query
schema:
type: boolean
default: false
- name: will_not_fix
in: query
description: Vulnerability data publishers explicitly won't fix some vulnerabilities.
Expand Down Expand Up @@ -8786,6 +8791,11 @@ paths:
that account, if permissions allow (admin only)
schema:
type: string
- name: include_vuln_description
in: query
schema:
type: boolean
default: false
requestBody:
content:
application/json:
Expand Down
16 changes: 16 additions & 0 deletions pkg/enterprise/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8692,6 +8692,14 @@ paths:
schema:
type: boolean
style: form
- explode: true
in: query
name: include_vuln_description
required: false
schema:
default: false
type: boolean
style: form
- description: "Vulnerability data publishers explicitly won't fix some vulnerabilities.\
\ This is captured by will_not_fix attribute of each result. If the query\
\ parameter is set, results matching it's value will be filtered. Results\
Expand Down Expand Up @@ -9742,6 +9750,14 @@ paths:
schema:
type: string
style: simple
- explode: true
in: query
name: include_vuln_description
required: false
schema:
default: false
type: boolean
style: form
requestBody:
content:
application/json:
Expand Down
9 changes: 9 additions & 0 deletions pkg/enterprise/api_sources.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions pkg/enterprise/api_vulnerabilities.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions pkg/enterprise/docs/SourcesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ No authorization required

## GetSourceVulnerabilities

> SourcePackageVulnerabilityResponse GetSourceVulnerabilities(ctx, sourceId, vulnType).ForceRefresh(forceRefresh).WillNotFix(willNotFix).XAnchoreAccount(xAnchoreAccount).Execute()
> SourcePackageVulnerabilityResponse GetSourceVulnerabilities(ctx, sourceId, vulnType).ForceRefresh(forceRefresh).IncludeVulnDescription(includeVulnDescription).WillNotFix(willNotFix).XAnchoreAccount(xAnchoreAccount).Execute()
Get vulnerabilities for the source by type

Expand All @@ -589,12 +589,13 @@ func main() {
sourceId := "sourceId_example" // string |
vulnType := "vulnType_example" // string |
forceRefresh := true // bool | (optional)
includeVulnDescription := true // bool | (optional) (default to false)
willNotFix := true // bool | Vulnerability data publishers explicitly won't fix some vulnerabilities. This is captured by will_not_fix attribute of each result. If the query parameter is set, results matching it's value will be filtered. Results are not filtered if the query parameter is unset (optional)
xAnchoreAccount := "xAnchoreAccount_example" // string | An account name to change the resource scope of the request to that account, if permissions allow (admin only) (optional)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SourcesApi.GetSourceVulnerabilities(context.Background(), sourceId, vulnType).ForceRefresh(forceRefresh).WillNotFix(willNotFix).XAnchoreAccount(xAnchoreAccount).Execute()
resp, r, err := apiClient.SourcesApi.GetSourceVulnerabilities(context.Background(), sourceId, vulnType).ForceRefresh(forceRefresh).IncludeVulnDescription(includeVulnDescription).WillNotFix(willNotFix).XAnchoreAccount(xAnchoreAccount).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SourcesApi.GetSourceVulnerabilities``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand Down Expand Up @@ -623,6 +624,7 @@ Name | Type | Description | Notes


**forceRefresh** | **bool** | |
**includeVulnDescription** | **bool** | | [default to false]
**willNotFix** | **bool** | Vulnerability data publishers explicitly won&#39;t fix some vulnerabilities. This is captured by will_not_fix attribute of each result. If the query parameter is set, results matching it&#39;s value will be filtered. Results are not filtered if the query parameter is unset |
**xAnchoreAccount** | **string** | An account name to change the resource scope of the request to that account, if permissions allow (admin only) |

Expand Down
6 changes: 4 additions & 2 deletions pkg/enterprise/docs/VulnerabilitiesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Method | HTTP request | Description

## VulnerabilityScanSbom

> SBOMVulnerabilitiesResponse VulnerabilityScanSbom(ctx).Sbom(sbom).XAnchoreAccount(xAnchoreAccount).Execute()
> SBOMVulnerabilitiesResponse VulnerabilityScanSbom(ctx).Sbom(sbom).XAnchoreAccount(xAnchoreAccount).IncludeVulnDescription(includeVulnDescription).Execute()
Return a vulnerability scan for the uploaded SBOM without storing the SBOM and without any side-effects in the system.

Expand All @@ -31,10 +31,11 @@ import (
func main() {
sbom := interface{}{ ... } // interface{} |
xAnchoreAccount := "xAnchoreAccount_example" // string | An account name to change the resource scope of the request to that account, if permissions allow (admin only) (optional)
includeVulnDescription := true // bool | (optional) (default to false)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.VulnerabilitiesApi.VulnerabilityScanSbom(context.Background()).Sbom(sbom).XAnchoreAccount(xAnchoreAccount).Execute()
resp, r, err := apiClient.VulnerabilitiesApi.VulnerabilityScanSbom(context.Background()).Sbom(sbom).XAnchoreAccount(xAnchoreAccount).IncludeVulnDescription(includeVulnDescription).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VulnerabilitiesApi.VulnerabilityScanSbom``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -57,6 +58,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**sbom** | **interface{}** | |
**xAnchoreAccount** | **string** | An account name to change the resource scope of the request to that account, if permissions allow (admin only) |
**includeVulnDescription** | **bool** | | [default to false]

### Return type

Expand Down
2 changes: 1 addition & 1 deletion pkg/enterprise/server_base_url.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18e474e

Please sign in to comment.