Documentation ¶
Index ¶
- Constants
- func IsConflict(err error) bool
- func IsNotFound(err error) bool
- func IsNotModified(err error) bool
- func IsUnauthorized(err error) bool
- type AdminUser
- type AdminUsers
- type Alias
- type ApiKey
- type BomSubmitRequest
- type Client
- type Component
- type ConfigProperty
- type Finding
- type NewUser
- type Option
- type Options
- type Permission
- type Project
- type ProjectMetric
- type Tag
- type Tags
- type Team
- type User
- type Vulnerability
Constants ¶
View Source
const ( AccessManagementPermission = Permission("ACCESS_MANAGEMENT") PolicyManagementPermission = Permission("POLICY_MANAGEMENT") PolicyViolationAnalysisPermission = Permission("POLICY_VIOLATION_ANALYSIS") SystemConfigurationPermission = Permission("SYSTEM_CONFIGURATION") ViewPolicyViolationPermission = Permission("VIEW_POLICY_VIOLATION") ViewPortfolioPermission = Permission("VIEW_PORTFOLIO") ViewVulnerabilityPermission = Permission("VIEW_VULNERABILITY") )
View Source
const EmailPostfix = "@nais.io"
Variables ¶
This section is empty.
Functions ¶
func IsConflict ¶
func IsNotFound ¶
func IsNotModified ¶
func IsUnauthorized ¶
Types ¶
type AdminUsers ¶
type AdminUsers struct {
Users []AdminUser `json:"users,omitempty" yaml:"users,omitempty"`
}
type BomSubmitRequest ¶
type Client ¶
type Client interface { Version(ctx context.Context) (string, error) AddToTeam(ctx context.Context, username, uuid string) error ChangeAdminPassword(ctx context.Context, oldPassword, newPassword string) error CreateAdminUsers(ctx context.Context, users *AdminUsers, teamUuid string) error CreateManagedUser(ctx context.Context, username, password string) error CreateOidcUser(ctx context.Context, email string) error CreateProject(ctx context.Context, name, version, group string, tags []string) (*Project, error) UpdateProject(ctx context.Context, uuid, name, version, group string, tags []string) (*Project, error) CreateChildProject(ctx context.Context, project *Project, name, version, group, classifier string, tags []string) (*Project, error) CreateTeam(ctx context.Context, teamName string, permissions []Permission) (*Team, error) DeleteManagedUser(ctx context.Context, username string) error DeleteOidcUser(ctx context.Context, username string) error DeleteProject(ctx context.Context, uuid string) error DeleteProjects(ctx context.Context, name string) error DeleteTeam(ctx context.Context, uuid string) error DeleteUserMembership(ctx context.Context, uuid, username string) error GenerateApiKey(ctx context.Context, uuid string) (string, error) GetOidcUsers(ctx context.Context) ([]User, error) GetProjects(ctx context.Context) ([]*Project, error) GetProject(ctx context.Context, name, version string) (*Project, error) GetProjectsByTag(ctx context.Context, tag string) ([]*Project, error) GetTeam(ctx context.Context, team string) (*Team, error) GetTeams(ctx context.Context) ([]Team, error) PortfolioRefresh(ctx context.Context) error RemoveAdminUsers(ctx context.Context, users *AdminUsers) error UpdateProjectInfo(ctx context.Context, uuid, version, group string, tags []string) error UploadProject(ctx context.Context, name, version, parentUuid string, autoCreate bool, bom []byte) error ConfigPropertyAggregate(ctx context.Context, properties []ConfigProperty) ([]ConfigProperty, error) GetConfigProperties(ctx context.Context) ([]ConfigProperty, error) GetEcosystems(ctx context.Context) ([]string, error) GetFindings(ctx context.Context, projectUuid string) ([]*Finding, error) TriggerAnalysis(ctx context.Context, projectUuid string) error GetCurrentProjectMetric(ctx context.Context, projectUuid string) (*ProjectMetric, error) GetProjectMetricsByDate(ctx context.Context, projectUuid, date string) ([]*ProjectMetric, error) auth.Auth }
type ConfigProperty ¶
type Finding ¶
type Finding struct { Component Component `json:"component"` Vulnerability Vulnerability `json:"vulnerability"` }
type NewUser ¶
type NewUser struct { Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` NewPassword string `json:"newPassword,omitempty"` ConfirmPassword string `json:"confirmPassword,omitempty"` Fullname string `json:"fullname,omitempty"` Suspended bool `json:"suspended,omitempty"` ForcePasswordChange bool `json:"forcePasswordChange,omitempty"` NonExpiryPassword bool `json:"nonExpiryPassword,omitempty"` }
type Option ¶
type Option = func(c *Options)
func WithApiKeySource ¶
func WithAuthSource ¶
func WithHttpClient ¶
func WithLogger ¶
type Permission ¶
type Permission string
type Project ¶
type Project struct { Active bool `json:"active"` Author string `json:"author"` Classifier string `json:"classifier"` Group string `json:"group"` Name string `json:"name"` LastBomImportFormat string `json:"lastBomImportFormat,omitempty"` LastBomImport int64 `json:"lastBomImport,omitempty"` LastInheritedRiskScore float64 `json:"lastInheritedRiskScore,omitempty"` Publisher string `json:"publisher"` Tags []Tag `json:"tags"` Uuid string `json:"uuid"` Version string `json:"version"` Parent *Project `json:"parent"` Metrics *ProjectMetric `json:"metrics,omitempty"` }
type ProjectMetric ¶
type ProjectMetric struct { Critical int `json:"critical"` High int `json:"high"` Medium int `json:"medium"` Low int `json:"low"` Unassigned int `json:"unassigned"` Vulnerabilities int `json:"vulnerabilities"` VulnerableComponents int `json:"vulnerableComponents"` Components int `json:"components"` Suppressed int `json:"suppressed"` FindingsTotal int `json:"findingsTotal"` FindingsAudited int `json:"findingsAudited"` FindingsUnaudited int `json:"findingsUnaudited"` InheritedRiskScore float64 `json:"inheritedRiskScore"` FirstOccurrence int64 `json:"firstOccurrence"` LastOccurrence int64 `json:"lastOccurrence"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.