Skip to content

Commit

Permalink
fix vulnerability rest call
Browse files Browse the repository at this point in the history
  • Loading branch information
czeumer committed May 31, 2022
1 parent b9e319f commit 5722aac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rest/client_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,5 @@ type TaskControllerInterface interface {
type VulnerabilityControllerInterface interface {
GetLastScanAgent(arg1 AgentId, params *VulnerabilityControllerGetLastScanAgentParams, reqEditors ...RequestEditorFn) (*AllItemsResponseLastScan, error)
GetVulnerabilitiesFieldSummary(arg1 AgentId, arg2 VulnerabilityControllerGetVulnerabilitiesFieldSummaryParamsField, params *VulnerabilityControllerGetVulnerabilitiesFieldSummaryParams, reqEditors ...RequestEditorFn) (*ApiResponse, error)
GetVulnerabilityAgent(arg1 AgentId, params *VulnerabilityControllerGetVulnerabilityAgentParams, reqEditors ...RequestEditorFn) (*AllItemsResponseVulnerability, error)
GetVulnerabilityAgent(arg1 AgentId, params *VulnerabilityControllerGetVulnerabilityAgentParams, reqEditors ...RequestEditorFn) (*AllItemsResponseVulnerabilities, error)
}
10 changes: 6 additions & 4 deletions rest/controller_implementation.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package rest

import "io"
import (
"io"
)

// AgentController implementation of the AgentController interface
type AgentController struct {
Expand Down Expand Up @@ -2221,7 +2223,7 @@ func (c *VulnerabilityController) GetVulnerabilitiesFieldSummary(arg1 AgentId, a
}

// GetVulnerabilityAgent calls the Vulnerability controller´s function
func (c *VulnerabilityController) GetVulnerabilityAgent(arg1 AgentId, params *VulnerabilityControllerGetVulnerabilityAgentParams, reqEditors ...RequestEditorFn) (*AllItemsResponseVulnerability, error) {
func (c *VulnerabilityController) GetVulnerabilityAgent(arg1 AgentId, params *VulnerabilityControllerGetVulnerabilityAgentParams, reqEditors ...RequestEditorFn) (*AllItemsResponseVulnerabilities, error) {
if c.ClientInterface.(*Client).token == "" {
err := c.Authenticate()
if err != nil {
Expand All @@ -2232,8 +2234,8 @@ func (c *VulnerabilityController) GetVulnerabilityAgent(arg1 AgentId, params *Vu
if err != nil {
return nil, err
}
// convert to *ApiResponse
if i, ok := r.(*AllItemsResponseVulnerability); ok {
// convert to *AllItemsResponseVulnerabilities
if i, ok := r.(*AllItemsResponseVulnerabilities); ok {
return i, nil
}

Expand Down
8 changes: 3 additions & 5 deletions rest/missing_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Vulnerability struct {
Title *string `json:"title,omitempty"`
Version *string `json:"version,omitempty"`
Architecture *string `json:"architecture,omitempty"`
Detection_time *string `json:"detection_time,omitempty"`
DetectionTime *string `json:"detection_time,omitempty"`
Type *string `json:"type,omitempty"`
Status *string `json:"status,omitempty"`
Condition *string `json:"condition,omitempty"`
Expand All @@ -42,6 +42,7 @@ type Vulnerability struct {
ExternalReferences []string `json:"external_references,omitempty"`
CVSS2Score *float32 `json:"cvss2_score,omitempty"`
CVSS3Score *float32 `json:"cvss3_score,omitempty"`
Severity *string `json:"severity,omitempty"`
}

// AllItemsResponseAgentsSimple defines model for AllItemsResponseAgentsSimple.
Expand All @@ -57,8 +58,5 @@ type AllItemsResponseVulnerability struct {
// Embedded struct due to allOf(#/components/schemas/ApiResponse)
ApiResponse `yaml:",inline"`
// Embedded fields due to inline allOf schema
Data *struct {
// Embedded struct due to allOf(#/components/schemas/AllItemsResponseAgentIDs)
AllItemsResponseVulnerabilities `yaml:",inline"`
} `json:"data,omitempty"`
Data *AllItemsResponseVulnerabilities `json:"data,omitempty"`
}

0 comments on commit 5722aac

Please sign in to comment.