targets

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "targets"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [9]string{"List targets", "Targets summary", "Get target", "Create target", "List findings by target", "Get finding by target, issue and affected resource", "Get target MTTR", "Delete target team", "Delete team"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewCreateTargetEndpoint

func NewCreateTargetEndpoint(s Service) goa.Endpoint

NewCreateTargetEndpoint returns an endpoint function that calls the method "Create target" of service "targets".

func NewDeleteTargetTeamEndpoint added in v1.1.0

func NewDeleteTargetTeamEndpoint(s Service) goa.Endpoint

NewDeleteTargetTeamEndpoint returns an endpoint function that calls the method "Delete target team" of service "targets".

func NewDeleteTeamEndpoint added in v1.1.0

func NewDeleteTeamEndpoint(s Service) goa.Endpoint

NewDeleteTeamEndpoint returns an endpoint function that calls the method "Delete team" of service "targets".

func NewGetFindingByTargetIssueAndAffectedResourceEndpoint

func NewGetFindingByTargetIssueAndAffectedResourceEndpoint(s Service) goa.Endpoint

NewGetFindingByTargetIssueAndAffectedResourceEndpoint returns an endpoint function that calls the method "Get finding by target, issue and affected resource" of service "targets".

func NewGetTargetEndpoint

func NewGetTargetEndpoint(s Service) goa.Endpoint

NewGetTargetEndpoint returns an endpoint function that calls the method "Get target" of service "targets".

func NewGetTargetMTTREndpoint

func NewGetTargetMTTREndpoint(s Service) goa.Endpoint

NewGetTargetMTTREndpoint returns an endpoint function that calls the method "Get target MTTR" of service "targets".

func NewListFindingsByTargetEndpoint

func NewListFindingsByTargetEndpoint(s Service) goa.Endpoint

NewListFindingsByTargetEndpoint returns an endpoint function that calls the method "List findings by target" of service "targets".

func NewListTargetsEndpoint

func NewListTargetsEndpoint(s Service) goa.Endpoint

NewListTargetsEndpoint returns an endpoint function that calls the method "List targets" of service "targets".

func NewTargetsSummaryEndpoint

func NewTargetsSummaryEndpoint(s Service) goa.Endpoint

NewTargetsSummaryEndpoint returns an endpoint function that calls the method "Targets summary" of service "targets".

func NewViewedFinding

func NewViewedFinding(res *Finding, view string) *targetsviews.Finding

NewViewedFinding initializes viewed result type Finding from result type Finding using the given view.

func NewViewedFindingCollection

func NewViewedFindingCollection(res FindingCollection, view string) targetsviews.FindingCollection

NewViewedFindingCollection initializes viewed result type FindingCollection from result type FindingCollection using the given view.

func NewViewedTarget

func NewViewedTarget(res *Target, view string) *targetsviews.Target

NewViewedTarget initializes viewed result type Target from result type Target using the given view.

func NewViewedTargetCollection

func NewViewedTargetCollection(res TargetCollection, view string) targetsviews.TargetCollection

NewViewedTargetCollection initializes viewed result type TargetCollection from result type TargetCollection using the given view.

func NewViewedTargetSummaryCollection

func NewViewedTargetSummaryCollection(res TargetSummaryCollection, view string) targetsviews.TargetSummaryCollection

NewViewedTargetSummaryCollection initializes viewed result type TargetSummaryCollection from result type TargetSummaryCollection using the given view.

Types

type Client

type Client struct {
	ListTargetsEndpoint                                goa.Endpoint
	TargetsSummaryEndpoint                             goa.Endpoint
	GetTargetEndpoint                                  goa.Endpoint
	CreateTargetEndpoint                               goa.Endpoint
	ListFindingsByTargetEndpoint                       goa.Endpoint
	GetFindingByTargetIssueAndAffectedResourceEndpoint goa.Endpoint
	GetTargetMTTREndpoint                              goa.Endpoint
	DeleteTargetTeamEndpoint                           goa.Endpoint
	DeleteTeamEndpoint                                 goa.Endpoint
}

Client is the "targets" service client.

func NewClient

func NewClient(listTargets, targetsSummary, getTarget, createTarget, listFindingsByTarget, getFindingByTargetIssueAndAffectedResource, getTargetMTTR, deleteTargetTeam, deleteTeam goa.Endpoint) *Client

NewClient initializes a "targets" service client given the endpoints.

func (*Client) CreateTarget

func (c *Client) CreateTarget(ctx context.Context, p *CreateTargetPayload) (res *Target, err error)

CreateTarget calls the "Create target" endpoint of the "targets" service.

func (*Client) DeleteTargetTeam added in v1.1.0

func (c *Client) DeleteTargetTeam(ctx context.Context, p *DeleteTargetTeamPayload) (err error)

DeleteTargetTeam calls the "Delete target team" endpoint of the "targets" service.

func (*Client) DeleteTeam added in v1.1.0

func (c *Client) DeleteTeam(ctx context.Context, p *DeleteTeamPayload) (err error)

DeleteTeam calls the "Delete team" endpoint of the "targets" service.

func (*Client) GetFindingByTargetIssueAndAffectedResource

func (c *Client) GetFindingByTargetIssueAndAffectedResource(ctx context.Context, p *GetFindingByTargetIssueAndAffectedResourcePayload) (res *Finding, err error)

GetFindingByTargetIssueAndAffectedResource calls the "Get finding by target, issue and affected resource" endpoint of the "targets" service.

func (*Client) GetTarget

func (c *Client) GetTarget(ctx context.Context, p *GetTargetPayload) (res *Target, err error)

GetTarget calls the "Get target" endpoint of the "targets" service.

func (*Client) GetTargetMTTR

func (c *Client) GetTargetMTTR(ctx context.Context, p *GetTargetMTTRPayload) (res float32, err error)

GetTargetMTTR calls the "Get target MTTR" endpoint of the "targets" service.

func (*Client) ListFindingsByTarget

func (c *Client) ListFindingsByTarget(ctx context.Context, p *ListFindingsByTargetPayload) (res FindingCollection, err error)

ListFindingsByTarget calls the "List findings by target" endpoint of the "targets" service.

func (*Client) ListTargets

func (c *Client) ListTargets(ctx context.Context, p *ListTargetsPayload) (res TargetCollection, err error)

ListTargets calls the "List targets" endpoint of the "targets" service.

func (*Client) TargetsSummary

func (c *Client) TargetsSummary(ctx context.Context, p *TargetsSummaryPayload) (res TargetSummaryCollection, err error)

TargetsSummary calls the "Targets summary" endpoint of the "targets" service.

type CreateTargetPayload

type CreateTargetPayload struct {
	// Target Identifier
	Identifier *string
	// Target Teams
	Teams []string
}

CreateTargetPayload is the payload type of the targets service Create target method.

type DeleteTargetTeamPayload added in v1.1.0

type DeleteTargetTeamPayload struct {
	// Target ID
	TargetID *string
	// Team ID
	Team *string
	Auth string
}

DeleteTargetTeamPayload is the payload type of the targets service Delete target team method.

type DeleteTeamPayload added in v1.1.0

type DeleteTeamPayload struct {
	// Team ID
	Team *string
	Auth string
}

DeleteTeamPayload is the payload type of the targets service Delete team method.

type Endpoints

type Endpoints struct {
	ListTargets                                goa.Endpoint
	TargetsSummary                             goa.Endpoint
	GetTarget                                  goa.Endpoint
	CreateTarget                               goa.Endpoint
	ListFindingsByTarget                       goa.Endpoint
	GetFindingByTargetIssueAndAffectedResource goa.Endpoint
	GetTargetMTTR                              goa.Endpoint
	DeleteTargetTeam                           goa.Endpoint
	DeleteTeam                                 goa.Endpoint
}

Endpoints wraps the "targets" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "targets" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "targets" service endpoints.

type Finding

type Finding struct {
	// Finding ID
	ID *string
	// Issue
	Issue *Issue
	// Target
	Target *Target
	// Source
	Source *Sourcewithnotarget
	// Finding details
	Details *string
	// Finding impact details
	ImpactDetails *string
	// Finding status. Can be 'OPEN' or 'FIXED'.
	Status *string
	// Finding severity score
	Score *float32
	// Other resources associated with the finding
	Resources []*ResourceGroup
}

Finding is the result type of the targets service Get finding by target, issue and affected resource method.

func NewFinding

func NewFinding(vres *targetsviews.Finding) *Finding

NewFinding initializes result type Finding from viewed result type Finding.

type FindingCollection

type FindingCollection []*Finding

FindingCollection is the result type of the targets service List findings by target method.

func NewFindingCollection

func NewFindingCollection(vres targetsviews.FindingCollection) FindingCollection

NewFindingCollection initializes result type FindingCollection from viewed result type FindingCollection.

type GetFindingByTargetIssueAndAffectedResourcePayload

type GetFindingByTargetIssueAndAffectedResourcePayload struct {
	// Target ID
	TargetID *string
	// Issue ID
	IssueID *string
	// Resource identifier
	Resource *string
}

GetFindingByTargetIssueAndAffectedResourcePayload is the payload type of the targets service Get finding by target, issue and affected resource method.

type GetTargetMTTRPayload

type GetTargetMTTRPayload struct {
	// Target ID
	ID *string
}

GetTargetMTTRPayload is the payload type of the targets service Get target MTTR method.

type GetTargetPayload

type GetTargetPayload struct {
	// Target ID
	ID *string
}

GetTargetPayload is the payload type of the targets service Get target method.

type Issue

type Issue struct {
	// Issue ID
	ID *string
	// Issue summary
	Summary *string
	// Common Weakness Enumeration ID
	CweID *int
	// Issue description
	Description *string
	// Recommendations to fix the issue
	Recommendations []string
	// Documentation reference for the issue
	ReferenceLinks []string
	// Labels associated with the issue
	Labels []string
}

type ListFindingsByTargetPayload

type ListFindingsByTargetPayload struct {
	// Target ID
	ID *string
	// Finding status filter. Can be 'OPEN' or 'FIXED'.
	Status *string
	// Sorting criteria. Supported fields: score, -score (for descending order)
	SortBy *string
	// Number of page requested
	Page *int
	// Number of results per page
	Size *int
	// List of labels to filter by
	Labels *string
}

ListFindingsByTargetPayload is the payload type of the targets service List findings by target method.

type ListTargetsPayload

type ListTargetsPayload struct {
	// Targets team filter
	Team *string
	// Targets multiple team filter, separated by commas
	Teams *string
	// Targets identifier filter
	Identifier *string
	// Number of page requested
	Page *int
	// Number of results per page
	Size *int
	// Exact match in identifier filter
	Identifiermatch *bool
	// A list of asset identifiers
	Identifiers *string
}

ListTargetsPayload is the payload type of the targets service List targets method.

type ResourceGroup

type ResourceGroup struct {
	// Name of the resource group
	Name *string
	// Column names of the resource group in the order that should be rendered
	Attributes []string
	// List containing the resource rows as hashmap
	Resources []map[string]string
}

type Service

type Service interface {
	// ListTargets implements List targets.
	ListTargets(context.Context, *ListTargetsPayload) (res TargetCollection, err error)
	// TargetsSummary implements Targets summary.
	TargetsSummary(context.Context, *TargetsSummaryPayload) (res TargetSummaryCollection, err error)
	// GetTarget implements Get target.
	GetTarget(context.Context, *GetTargetPayload) (res *Target, err error)
	// CreateTarget implements Create target.
	CreateTarget(context.Context, *CreateTargetPayload) (res *Target, err error)
	// ListFindingsByTarget implements List findings by target.
	ListFindingsByTarget(context.Context, *ListFindingsByTargetPayload) (res FindingCollection, err error)
	// GetFindingByTargetIssueAndAffectedResource implements Get finding by target,
	// issue and affected resource.
	GetFindingByTargetIssueAndAffectedResource(context.Context, *GetFindingByTargetIssueAndAffectedResourcePayload) (res *Finding, err error)
	// GetTargetMTTR implements Get target MTTR.
	GetTargetMTTR(context.Context, *GetTargetMTTRPayload) (res float32, err error)
	// DeleteTargetTeam implements Delete target team.
	DeleteTargetTeam(context.Context, *DeleteTargetTeamPayload) (err error)
	// DeleteTeam implements Delete team.
	DeleteTeam(context.Context, *DeleteTeamPayload) (err error)
}

Targets endpoint.

type Sourcewithnotarget

type Sourcewithnotarget struct {
	// Source ID
	ID *string
	// Source name
	Name *string
	// Source component
	Component *string
	// Source instance
	Instance *string
	// Source options
	Options *string
	// Time on which the source scanned the target
	Time *string
}

type Target

type Target struct {
	// Target ID
	ID *string
	// Target identifier
	Identifier *string
	// List of teams associated with target
	Teams []string
}

Target is the result type of the targets service Get target method.

func NewTarget

func NewTarget(vres *targetsviews.Target) *Target

NewTarget initializes result type Target from viewed result type Target.

type TargetCollection

type TargetCollection []*Target

TargetCollection is the result type of the targets service List targets method.

func NewTargetCollection

func NewTargetCollection(vres targetsviews.TargetCollection) TargetCollection

NewTargetCollection initializes result type TargetCollection from viewed result type TargetCollection.

type TargetSummary

type TargetSummary struct {
	// Target ID
	TargetID *string
	// Target identifier
	Identifier *string
	// Number of findings for target
	FindingsCount *int
	// Number of issues for target
	IssuesCount *int
	// Max score for target
	MaxScore *float32
}

type TargetSummaryCollection

type TargetSummaryCollection []*TargetSummary

TargetSummaryCollection is the result type of the targets service Targets summary method.

func NewTargetSummaryCollection

func NewTargetSummaryCollection(vres targetsviews.TargetSummaryCollection) TargetSummaryCollection

NewTargetSummaryCollection initializes result type TargetSummaryCollection from viewed result type TargetSummaryCollection.

type TargetsSummaryPayload

type TargetsSummaryPayload struct {
	// Targets team filter
	Team *string
	// Targets multiple team filter, separated by commas
	Teams *string
	// Finding status filter. Can be 'OPEN' or 'FIXED'.
	Status *string
	// Sorting criteria. Supported fields: max_score, findings_count (use - for
	// descending order. E.g.: -max_score)
	SortBy *string
	// Number of page requested
	Page *int
	// Number of results per page
	Size *int
	// A list of asset identifiers
	Identifiers *string
	// List of associated issues labels to filter by
	Labels *string
}

TargetsSummaryPayload is the payload type of the targets service Targets summary method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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