client

package
v0.15.19 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package client provides an HTTP client for selected Aqua Enterprise API endpoints.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrUnauthorized = errors.New("unauthorized")

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	Basic *UsernameAndPassword
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents Aqua API client.

Currently it is not possible to generate API clientset from Swagger / Open API specs, but if that was possible this implementations would be deprecated.

func NewClient

func NewClient(baseURL string, authorization Authorization) (*Client, error)

NewClient constructs a new API client with the specified base URL and authorization details.

func (*Client) Images

func (c *Client) Images() ImagesInterface

func (*Client) Registries

func (c *Client) Registries() RegistriesInterface

type Clientset

type Clientset interface {
	Registries() RegistriesInterface
	Images() ImagesInterface
}

Clientset defines methods of the Aqua API client.

type Images

type Images struct {
	// contains filtered or unexported fields
}

func (*Images) Vulnerabilities

func (i *Images) Vulnerabilities(registry, repo, tag string) (VulnerabilitiesResponse, error)

type ImagesInterface

type ImagesInterface interface {
	Vulnerabilities(registry, repo, tag string) (VulnerabilitiesResponse, error)
}

type Registries

type Registries struct {
	// contains filtered or unexported fields
}

func (*Registries) List

func (r *Registries) List() ([]RegistryResponse, error)

type RegistriesInterface

type RegistriesInterface interface {
	List() ([]RegistryResponse, error)
}

type RegistryResponse

type RegistryResponse struct {
	Name        string   `json:"name"`
	Type        string   `json:"type"` // e.g. HUB, API
	Description string   `json:"description"`
	URL         string   `json:"url"`
	Prefixes    []string `json:"prefixes"`
}

type Resource

type Resource struct {
	Type    string `json:"type"`   // e.g. package
	Format  string `json:"format"` // e.g. deb
	Path    string `json:"path"`
	Name    string `json:"name"`    // e.g. libxml2
	Version string `json:"version"` // e.g. 2.9.4+dfsg1-7+b3
}

type UsernameAndPassword

type UsernameAndPassword struct {
	Username string
	Password string
}

type VulnerabilitiesResponse

type VulnerabilitiesResponse struct {
	Count   int                             `json:"count"`
	Results []VulnerabilitiesResponseResult `json:"result"`
}

type VulnerabilitiesResponseResult

type VulnerabilitiesResponseResult struct {
	Registry            string   `json:"registry"`
	ImageRepositoryName string   `json:"image_repository_name"`
	Resource            Resource `json:"resource"`
	Name                string   `json:"name"` // e.g. CVE-2020-3910
	Description         string   `json:"description"`
	AquaSeverity        string   `json:"aqua_severity"`
	AquaVectors         string   `json:"aqua_vectors"`
	AquaScoringSystem   string   `json:"aqua_scoring_system"`
	FixVersion          string   `json:"fix_version"`
}

Jump to

Keyboard shortcuts

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