api

package
v0.0.0-...-aca7f8d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	ent.AdapterModelRead
}

type AdapterGetRequest

type AdapterGetRequest struct {
	Name string `json:"name,omitempty" query:"name"`
	Tag  string `json:"tag,omitempty" query:"tag"`
}

type AdapterGetResponse

type AdapterGetResponse struct {
	Adapters []*Adapter `json:"adapters,omitempty"`
}

type AdapterSaveRequest

type AdapterSaveRequest struct {
	Adapter *ent.AdapterModelCreate `json:"adapter,omitempty" validate:"required"`
}

type ArtifactLogRequest

type ArtifactLogRequest struct {
	Artifact *ent.ArtifactModelCreate `json:"artifact,omitempty"`
	Commit   *string                  `json:"commit,omitempty"`
}

type CodeScan

type CodeScan struct {
	ent.CodeScanModelCreate `json:"code_scan" validate:"required" mapstructure:",squash"`
	Issues                  []*CodeScanIssue     `json:"issues,omitempty" validate:"dive,required"`
	Components              []*CodeScanComponent `json:"components,omitempty" validate:"dive,required"`
}

type CodeScanComponent

type CodeScanComponent struct {
	ent.ComponentModelCreate `validate:"required" mapstructure:",squash"`
	Vulnerabilities          []*Vulnerability `json:"vulnerabilities" validate:"dive,required" mapstructure:"vulnerabilities"`
	Licenses                 []*License       `json:"licenses" validate:"dive,required" mapstructure:"licenses"`
}

type CodeScanIssue

type CodeScanIssue struct {
	ent.CodeIssueModelCreate `validate:"required" mapstructure:",squash"`
}

type CodeScanRequest

type CodeScanRequest struct {
	CodeScan *CodeScan `json:"code_scan,omitempty" validate:"required"`
	Commit   *string   `json:"commit,omitempty" validate:"required"`
}

type Component

type Component struct {
	ent.ComponentModelRead `validate:"required"`
}

type ComponentGetRequest

type ComponentGetRequest struct {
}

type ComponentGetResponse

type ComponentGetResponse struct {
	Components []*Component
}

type ComponentVulnerability

type ComponentVulnerability struct {
	ComponentID     *int             `json:"component_id" validate:"required"`
	Vulnerabilities []*Vulnerability `json:"vulnerabilities,omitempty" validate:"dive,required"`
}

type ComponentVulnerabilityRequest

type ComponentVulnerabilityRequest struct {
	DataSource *string                   `json:"data_source,omitempty" validate:"required"`
	Components []*ComponentVulnerability `json:"components,omitempty" validate:"required,dive,required"`
}

type EventGetRequest

type EventGetRequest struct {
	Project        string `json:"project,omitempty" query:"project" mapstructure:"project,omitempty"`
	Repo           string `json:"repo,omitempty" query:"repo" mapstructure:"repo,omitempty"`
	ReleaseName    string `json:"release_name,omitempty" query:"release_name" mapstructure:"release_name,omitempty"`
	ReleaseVersion string `json:"release_version,omitempty" query:"release_version" mapstructure:"release_version,omitempty"`
	Commit         string `json:"commit,omitempty" query:"commit" mapstructure:"commit,omitempty"`
	Last           string `json:"last,omitempty" query:"last" mapstructure:"last,omitempty" validate:"number"`
}

type EventGetResponse

type EventGetResponse struct {
	Events []*ent.Event `json:"events,omitempty" query:"events"`
}

type EventSaveRequest

type EventSaveRequest struct {
	Event     *ent.EventModelCreate `json:"event,omitempty" validate:"required"`
	ReleaseID *int                  `json:"release_id,omitempty"`
	RepoID    *int                  `json:"repo_id,omitempty"`
	ProjectID *int                  `json:"project_id,omitempty"`
}

type License

type License struct {
	ent.LicenseModelCreate `validate:"required" mapstructure:",squash"`
}

type Order

type Order struct {
	Field     string         `query:"sort_by"`
	Direction OrderDirection `query:"order"`
}

func OrderFromSortBy

func OrderFromSortBy(sortBy string) (*Order, error)

func (Order) Func

func (o Order) Func(field string) ent.OrderFunc

type OrderDirection

type OrderDirection string
const (
	OrderDirectionAsc  OrderDirection = "asc"
	OrderDirectionDesc OrderDirection = "desc"
)

func (OrderDirection) String

func (o OrderDirection) String() string

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

type OrderField

type OrderField string

func (OrderField) String

func (o OrderField) String() string

type Project

type Project struct {
	ent.ProjectModelRead
}

type ProjectCreateRequest

type ProjectCreateRequest struct {
	Project *ent.ProjectModelCreate `json:"project,omitempty" validate:"required"`
}

type ProjectGetRequest

type ProjectGetRequest struct {
	Name string `query:"name"`
}

type ProjectGetResponse

type ProjectGetResponse struct {
	Projects []*Project `json:"projects"`
}

type Release

type Release struct {
	Project    *ent.ProjectModelRead                  `json:"project,omitempty" validate:"required"`
	Repo       *ent.RepoModelRead                     `json:"repo,omitempty" validate:"required"`
	Commit     *ent.GitCommitModelRead                `json:"commit,omitempty" validate:"required"`
	Release    *ent.ReleaseModelRead                  `json:"release,omitempty" validate:"required"`
	Policies   []*ent.ReleasePolicyModelRead          `json:"policies,omitempty" validate:"dive,required"`
	Violations []*ent.ReleasePolicyViolationModelRead `json:"violations,omitempty" validate:"dive,required"`
	Entries    []*ent.ReleaseEntryModelRead           `json:"entries,omitempty" validate:"dive,required"`
}

type ReleaseCreateRequest

type ReleaseCreateRequest struct {
	Project *ent.ProjectModelCreate   `json:"project,omitempty" validate:"required"`
	Repo    *ent.RepoModelCreate      `json:"repo,omitempty" validate:"required"`
	Commit  *ent.GitCommitModelCreate `json:"commit,omitempty" validate:"required"`
	Release *ent.ReleaseModelCreate   `json:"release,omitempty" validate:"required"`
}

type ReleaseGetByIDRequest

type ReleaseGetByIDRequest struct {
	ID int `param:"id"`
}

type ReleaseGetByIDResponse

type ReleaseGetByIDResponse struct {
	Release *Release `json:"release,omitempty" validate:"required"`
}

type ReleaseGetRequest

type ReleaseGetRequest struct {
	Commit   string `json:"commit,omitempty" query:"commit"`
	Repos    string `json:"repos,omitempty" query:"repos"`
	Projects string `json:"projects,omitempty" query:"projects"`
	Policies bool   `json:"policies,string" query:"policies"`
	Log      bool   `json:"log,string" query:"log"`
	HeadOnly bool   `json:"head_only,string" query:"head_only"`

	SortBy string `json:"sort_by,omitempty" query:"sort_by"`
}

type ReleaseGetResponse

type ReleaseGetResponse struct {
	Releases []*Release `json:"releases" validate:"dive,required"`
}

type ReleasePolicy

type ReleasePolicy struct {
	ent.ReleasePolicyModelRead
	Affects *ReleasePolicyAffects `json:"affects,omitempty"`
}

type ReleasePolicyAffects

type ReleasePolicyAffects struct {
	Projects []string `json:"projects,omitempty"`
	Repos    []string `json:"repos,omitempty"`
}

ReleasePolicyAffects

type ReleasePolicyAffectsSet

type ReleasePolicyAffectsSet struct {
	Projects    []string `json:"projects,omitempty"`
	NotProjects []string `json:"not_projects,omitempty"`

	Repos    []string `json:"repos,omitempty"`
	NotRepos []string `json:"not_repos,omitempty"`
}

ReleasePolicyAffectsSet defines the entities that a policy should affect. The Not will remove the entity from the policy relationship (if exists).

type ReleasePolicyCreate

type ReleasePolicyCreate struct {
	ent.ReleasePolicyModelCreate
	Affects *ReleasePolicyAffectsSet `json:"affects,omitempty"`
}

type ReleasePolicyGetRequest

type ReleasePolicyGetRequest struct {
	Name string `json:"name" query:"name"`

	WithAffects bool `json:"with_affects,string" query:"with_affects"`
}

type ReleasePolicyGetResponse

type ReleasePolicyGetResponse struct {
	Policies []*ReleasePolicy `json:"policies"`
}

type ReleasePolicySaveRequest

type ReleasePolicySaveRequest struct {
	Policy *ReleasePolicyCreate `json:"policy,omitempty" validate:"required"`
}

type ReleasePolicyUpdate

type ReleasePolicyUpdate struct {
	ent.ReleasePolicyModelUpdate
	Affects *ReleasePolicyAffectsSet `json:"affects,omitempty"`
}

type ReleasePolicyUpdateRequest

type ReleasePolicyUpdateRequest struct {
	ID     *int                 `param:"id" validate:"required"`
	Policy *ReleasePolicyUpdate `json:"policy,omitempty" validate:"required"`
}

type TestRun

type TestRun struct {
	ent.TestRunModelCreate `mapstructure:",squash"`
	TestCases              []*TestRunCase `json:"test_cases,omitempty" validate:"dive,required"`
}

type TestRunCase

type TestRunCase struct {
	ent.TestCaseModelCreate `validate:"required" alias:"test_case"`
}

type TestRunRequest

type TestRunRequest struct {
	TestRun *TestRun `json:"test_run,omitempty"`
	Commit  *string  `json:"commit,omitempty"`
}

type Vulnerability

type Vulnerability struct {
	ent.VulnerabilityModelCreate `validate:"required" mapstructure:",squash"`
	Patch                        *VulnerabilityPatch `json:"patch,omitempty" mapstructure:"patch"`
}

type VulnerabilityPatch

type VulnerabilityPatch struct {
	Note *string `json:"note,omitempty" validate:"required" mapstructure:"note"`
}

type VulnerabilityReview

type VulnerabilityReview struct {
	ent.VulnerabilityReviewModelRead
	Vulnerability *ent.VulnerabilityReviewModelRead
	Projects      []*ent.ProjectModelRead
	Repos         []*ent.RepoModelRead
}

type VulnerabilityReviewAffects

type VulnerabilityReviewAffects struct {
	Projects    []string
	NotProjects []string

	Repos    []string
	NotRepos []string

	Commits    []string
	NotCommits []string
}

VulnerabilityReviewAffects defines the entities that a review should affect. The Not* will remove the entity from the affects relationship (if exists).

type VulnerabilityReviewGetRequest

type VulnerabilityReviewGetRequest struct {
	// Vulnerabilities contains a slice of vulnerability IDs.
	Vulnerabilities string `json:"vulnerabilities,omitempty" query:"vulnerabilities" mapstructure:"vulnerabilities"`
	Projects        string `json:"projects,omitempty" query:"projects" mapstructure:"projects"`
	Repos           string `json:"repos,omitempty" query:"repos" mapstructure:"repos"`
	Commit          string `json:"commit,omitempty" query:"commit" mapstructure:"commit"`

	WithProjects bool `json:"with_projects,omitempty" query:"with_projects" mapstructure:"with_projects"`
	WithRepos    bool `json:"with_repos,omitempty" query:"with_repos" mapstructure:"with_repos"`
}

type VulnerabilityReviewGetResponse

type VulnerabilityReviewGetResponse struct {
	Reviews []*VulnerabilityReview
}

type VulnerabilityReviewSaveRequest

type VulnerabilityReviewSaveRequest struct {
	Review          *ent.VulnerabilityReviewModelCreate `json:"review,omitempty" validate:"required"`
	VulnerabilityID *string                             `json:"vulnerability_id,omitempty" validate:"required"`
	Affects         *VulnerabilityReviewAffects         `json:"affects,omitempty"`
}

type VulnerabilityReviewUpdateRequest

type VulnerabilityReviewUpdateRequest struct {
	ID      *int                                `json:"id,omitempty" validate:"required"`
	Review  *ent.VulnerabilityReviewModelUpdate `json:"review,omitempty" validate:"required"`
	Affects *VulnerabilityReviewAffects         `json:"affects,omitempty"`
}

Jump to

Keyboard shortcuts

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