Documentation
¶
Overview ¶
@author: vikram@github.com/devtron-labs @description: user crud
Index ¶
- Constants
- type AuditLog
- type CiArtifact
- type CiArtifactRepository
- type CiArtifactRepositoryImpl
- type CvePolicy
- type CvePolicyRepository
- type CvePolicyRepositoryImpl
- type CveStore
- type CveStoreRepository
- type CveStoreRepositoryImpl
- func (impl CveStoreRepositoryImpl) FindAll() ([]*CveStore, error)
- func (impl CveStoreRepositoryImpl) FindByCveNames(names []string) ([]*CveStore, error)
- func (impl CveStoreRepositoryImpl) FindByName(name string) (*CveStore, error)
- func (impl CveStoreRepositoryImpl) GetConnection() (dbConnection *pg.DB)
- func (impl CveStoreRepositoryImpl) Save(model *CveStore) error
- func (impl CveStoreRepositoryImpl) SaveInBatch(model []*CveStore, tx *pg.Tx) error
- func (impl CveStoreRepositoryImpl) Update(team *CveStore) error
- func (impl CveStoreRepositoryImpl) UpdateInBatch(models []*CveStore, tx *pg.Tx) ([]*CveStore, error)
- type DockerArtifactStore
- type DockerArtifactStoreRepository
- type DockerArtifactStoreRepositoryImpl
- type ImageScanDeployInfo
- type ImageScanDeployInfoRepository
- type ImageScanDeployInfoRepositoryImpl
- func (impl ImageScanDeployInfoRepositoryImpl) FetchByAppIdAndEnvId(appId int, envId int) (*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FetchListingGroupByObject() ([]*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindAll() ([]*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindByIds(ids []int) ([]*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindByObjectTypeAndId(scanObjectMetaId int, objectType string) (*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindLatestChildParentInfoId(parentInfoId int) (*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindOne(id int) (*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) Save(model *ImageScanDeployInfo) error
- func (impl ImageScanDeployInfoRepositoryImpl) Update(team *ImageScanDeployInfo) error
- type ImageScanExecutionHistory
- type ImageScanExecutionResult
- type ImageScanHistoryRepository
- type ImageScanHistoryRepositoryImpl
- func (impl ImageScanHistoryRepositoryImpl) FindAll() ([]*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImage(image string) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImageDigest(image string) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImageWithNoSource(image string) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImageWithSource(image string) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindLatestByParentScanHistory(parentScanHistoryId int) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindOne(id int) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) GetConnection() (dbConnection *pg.DB)
- func (impl ImageScanHistoryRepositoryImpl) Save(tx *pg.Tx, model *ImageScanExecutionHistory) error
- func (impl ImageScanHistoryRepositoryImpl) Update(team *ImageScanExecutionHistory) error
- type ImageScanObjectMeta
- type ImageScanObjectMetaRepository
- type ImageScanObjectMetaRepositoryImpl
- func (impl ImageScanObjectMetaRepositoryImpl) FindAll() ([]*ImageScanObjectMeta, error)
- func (impl ImageScanObjectMetaRepositoryImpl) FindByNameAndType(name string, types string) ([]*ImageScanObjectMeta, error)
- func (impl ImageScanObjectMetaRepositoryImpl) FindOne(id int) (*ImageScanObjectMeta, error)
- func (impl ImageScanObjectMetaRepositoryImpl) Save(model *ImageScanObjectMeta) error
- func (impl ImageScanObjectMetaRepositoryImpl) Update(team *ImageScanObjectMeta) error
- type ImageScanResultRepository
- type ImageScanResultRepositoryImpl
- func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionId(scanExecutionId int) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindAll() ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindByCveName(name string) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindOne(id int) (*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) Save(model *ImageScanExecutionResult) error
- func (impl ImageScanResultRepositoryImpl) SaveInBatch(models []*ImageScanExecutionResult, tx *pg.Tx) error
- func (impl ImageScanResultRepositoryImpl) Update(team *ImageScanExecutionResult) error
- type PolicyAction
- type PolicyLevel
- type RegistryIndexMapping
- type RegistryIndexMappingRepository
- type RegistryIndexMappingRepositoryImpl
- type RemoteConnectionConfig
- type RemoteConnectionRepository
- type RemoteConnectionRepositoryImpl
- type ResourceScanFormat
- type ResourceScanResult
- type ResourceScanResultRepository
- type ResourceScanResultRepositoryImpl
- type ResourceScanType
- type ScanStepCondition
- type ScanStepConditionMapping
- type ScanStepConditionMappingRepository
- type ScanStepConditionMappingRepositoryImpl
- func (repo *ScanStepConditionMappingRepositoryImpl) Save(model *ScanStepConditionMapping) (*ScanStepConditionMapping, error)
- func (repo *ScanStepConditionMappingRepositoryImpl) SaveBulk(model []*ScanStepConditionMapping) ([]*ScanStepConditionMapping, error)
- func (repo *ScanStepConditionMappingRepositoryImpl) Update(model *ScanStepConditionMapping) (*ScanStepConditionMapping, error)
- func (repo *ScanStepConditionMappingRepositoryImpl) UpdateBulk(model []*ScanStepConditionMapping) ([]*ScanStepConditionMapping, error)
- type ScanStepConditionRepository
- type ScanStepConditionRepositoryImpl
- func (repo *ScanStepConditionRepositoryImpl) FindAllByToolStepId(toolStepId int) ([]*ScanStepCondition, error)
- func (repo *ScanStepConditionRepositoryImpl) MarkAllConditionsDeletedByToolStepId(toolStepId int) error
- func (repo *ScanStepConditionRepositoryImpl) MarkDeletedById(id int) error
- func (repo *ScanStepConditionRepositoryImpl) Save(model *ScanStepCondition) (*ScanStepCondition, error)
- func (repo *ScanStepConditionRepositoryImpl) SaveBulk(model []*ScanStepCondition) ([]*ScanStepCondition, error)
- func (repo *ScanStepConditionRepositoryImpl) Update(model *ScanStepCondition) (*ScanStepCondition, error)
- func (repo *ScanStepConditionRepositoryImpl) UpdateBulk(model []*ScanStepCondition) ([]*ScanStepCondition, error)
- type ScanTargetType
- type ScanToolExecutionHistoryMapping
- type ScanToolExecutionHistoryMappingRepository
- type ScanToolExecutionHistoryMappingRepositoryImpl
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIdAndStates(executionHistoryId int, states []bean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByState(state bean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) MarkAllRunningStateAsFailedHavingTryCountReachedLimit(tryCount int) error
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) Save(tx *pg.Tx, model *ScanToolExecutionHistoryMapping) error
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) SaveInBatch(models []*ScanToolExecutionHistoryMapping) error
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) UpdateStateByToolAndExecutionHistoryId(executionHistoryId, toolId int, state bean.ScanExecutionProcessState, ...) error
- type ScanToolMetadata
- type ScanToolMetadataRepository
- type ScanToolMetadataRepositoryImpl
- func (repo *ScanToolMetadataRepositoryImpl) FindActiveById(id int) (*ScanToolMetadata, error)
- func (repo *ScanToolMetadataRepositoryImpl) FindActiveToolByScanTarget(scanTargetType ScanTargetType) (*ScanToolMetadata, error)
- func (repo *ScanToolMetadataRepositoryImpl) FindAllActiveTools() ([]*ScanToolMetadata, error)
- func (repo *ScanToolMetadataRepositoryImpl) FindByNameAndVersion(name, version string) (*ScanToolMetadata, error)
- func (repo *ScanToolMetadataRepositoryImpl) MarkToolDeletedById(id int) error
- func (repo *ScanToolMetadataRepositoryImpl) Save(model *ScanToolMetadata) (*ScanToolMetadata, error)
- func (repo *ScanToolMetadataRepositoryImpl) Update(model *ScanToolMetadata) (*ScanToolMetadata, error)
- type ScanToolStep
- type ScanToolStepRepository
- type ScanToolStepRepositoryImpl
- func (repo *ScanToolStepRepositoryImpl) FindAllByScanToolId(scanToolId int) ([]*ScanToolStep, error)
- func (repo *ScanToolStepRepositoryImpl) MarkAllStepsDeletedByToolId(scanToolId int) error
- func (repo *ScanToolStepRepositoryImpl) MarkDeletedById(id int) error
- func (repo *ScanToolStepRepositoryImpl) Save(model *ScanToolStep) (*ScanToolStep, error)
- func (repo *ScanToolStepRepositoryImpl) SaveInBatch(model []*ScanToolStep) ([]*ScanToolStep, error)
- func (repo *ScanToolStepRepositoryImpl) Update(model *ScanToolStep) (*ScanToolStep, error)
- func (repo *ScanToolStepRepositoryImpl) UpdateInBatch(model []*ScanToolStep) ([]*ScanToolStep, error)
- type UserModel
- type UserRepository
- type UserRepositoryImpl
- func (impl UserRepositoryImpl) CreateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
- func (impl UserRepositoryImpl) DeleteUser(userModel *UserModel, tx *pg.Tx) (bool, error)
- func (impl UserRepositoryImpl) FetchUserByEmail(email string) (bean.UserInfo, error)
- func (impl UserRepositoryImpl) FetchUserByEmailV2(email string) (*UserModel, error)
- func (impl UserRepositoryImpl) FetchUserDetailByEmailV2(email string) (*UserModel, error)
- func (impl UserRepositoryImpl) GetAll() ([]UserModel, error)
- func (impl UserRepositoryImpl) GetByEmailId(email string) ([]UserModel, error)
- func (impl UserRepositoryImpl) GetById(id int32) (*UserModel, error)
- func (impl UserRepositoryImpl) GetByIds(ids []int32) ([]UserModel, error)
- func (impl *UserRepositoryImpl) GetConnection() (dbConnection *pg.DB)
- func (impl UserRepositoryImpl) GetUsersByFilter(size int, from int) ([]UserModel, error)
- func (impl UserRepositoryImpl) UpdateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
- type UserRoleModel
Constants ¶
View Source
const ( REGISTRYTYPE_ECR = "ecr" REGISTRYTYPE_OTHER = "other" REGISTRYTYPE_DOCKER_HUB = "docker-hub" REGISTRYTYPE_GCR = "gcr" REGISTRYTYPE_ARTIFACTREGISTRY = "artifact-registry" )
View Source
const ( ScanObjectType_APP string = "app" ScanObjectType_CHART string = "chart" ScanObjectType_POD string = "pod" ScanObjectType_CHART_HISTORY string = "chart-history" ScanObjectType_CI_Workflow string = "ci-workflow" ScanObjectType_CD_Workflow string = "cd-workflow" )
View Source
const ( CycloneDxSbom ResourceScanFormat = 1 //SBOM TrivyJson = 2 Json = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CiArtifact ¶
type CiArtifact struct {
Id int `sql:"id,pk"`
PipelineId int `sql:"pipeline_id,notnull"` //id of the ci pipeline from which this webhook was triggered
Image string `sql:"image,notnull"`
ImageDigest string `sql:"image_digest,notnull"`
MaterialInfo string `sql:"material_info"` //git material metadata json array string
DataSource string `sql:"data_source,notnull"`
WorkflowId *int `sql:"ci_workflow_id"`
ParentCiArtifact int `sql:"parent_ci_artifact"`
ScanEnabled bool `sql:"scan_enabled"`
Scanned bool `sql:"scanned"`
DeployedTime time.Time `sql:"-"`
Deployed bool `sql:"-"`
Latest bool `sql:"-"`
AuditLog
// contains filtered or unexported fields
}
type CiArtifactRepository ¶
type CiArtifactRepository interface {
Update(artifact *CiArtifact) error
Get(imageDigest string) (*CiArtifact, error)
}
type CiArtifactRepositoryImpl ¶
type CiArtifactRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewCiArtifactRepositoryImpl ¶
func NewCiArtifactRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiArtifactRepositoryImpl
func (CiArtifactRepositoryImpl) Get ¶
func (impl CiArtifactRepositoryImpl) Get(imageDigest string) (*CiArtifact, error)
func (CiArtifactRepositoryImpl) Update ¶
func (impl CiArtifactRepositoryImpl) Update(artifact *CiArtifact) error
type CvePolicy ¶
type CvePolicy struct {
Id int `sql:"id,pk"`
Global bool
ClusterId int
EnvironmentId int
AppId int
CVEStoreId int
Action PolicyAction
Severity bean.Severity
Deleted bool
AuditLog
*CveStore
// contains filtered or unexported fields
}
func (*CvePolicy) PolicyLevel ¶
func (policy *CvePolicy) PolicyLevel() PolicyLevel
type CvePolicyRepository ¶
type CvePolicyRepositoryImpl ¶
type CvePolicyRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*CvePolicyRepositoryImpl) GetAppEnvPolicies ¶
func (*CvePolicyRepositoryImpl) GetEnvPolicies ¶
func (impl *CvePolicyRepositoryImpl) GetEnvPolicies(clusterId int, environmentId int) (policies []*CvePolicy, err error)
type CveStore ¶
type CveStore struct {
Name string `sql:"name,pk"`
// Deprecated: Severity, use StandardSeverity for all read purposes
Severity bean.Severity `sql:"severity,notnull"`
// Deprecated: Package
Package string `sql:"package,notnull"` // deprecated, storing package data in image_scan_execution_result table
// Deprecated: Version
Version string `sql:"version,notnull"`
// Deprecated: FixedVersion
FixedVersion string `sql:"fixed_version,notnull"`
// StandardSeverity is the actual severity. use GetSeverity method to get severity of the vulnerability
// earlier severity is maintained in Severity column by merging HIGH and CRITICAL severities.
// later we introduced new column StandardSeverity to store raw severity, but didn't migrate the existing Severity data to StandardSeverity.
// currently, we deprecated Severity.
StandardSeverity *bean.Severity `sql:"standard_severity"`
AuditLog
// contains filtered or unexported fields
}
func (*CveStore) CreateAuditLog ¶
func (*CveStore) GetSeverity ¶
GetSeverity returns the actual severity of the vulnerability.
func (*CveStore) SetStandardSeverity ¶
func (*CveStore) UpdateNewSeverityInCveStore ¶
type CveStoreRepository ¶
type CveStoreRepository interface {
GetConnection() (dbConnection *pg.DB)
Save(model *CveStore) error
SaveInBatch(model []*CveStore, tx *pg.Tx) error
FindAll() ([]*CveStore, error)
FindByCveNames(names []string) ([]*CveStore, error)
FindByName(name string) (*CveStore, error)
Update(model *CveStore) error
UpdateInBatch(model []*CveStore, tx *pg.Tx) ([]*CveStore, error)
}
type CveStoreRepositoryImpl ¶
type CveStoreRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewCveStoreRepositoryImpl ¶
func NewCveStoreRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CveStoreRepositoryImpl
func (CveStoreRepositoryImpl) FindAll ¶
func (impl CveStoreRepositoryImpl) FindAll() ([]*CveStore, error)
func (CveStoreRepositoryImpl) FindByCveNames ¶
func (impl CveStoreRepositoryImpl) FindByCveNames(names []string) ([]*CveStore, error)
func (CveStoreRepositoryImpl) FindByName ¶
func (impl CveStoreRepositoryImpl) FindByName(name string) (*CveStore, error)
func (CveStoreRepositoryImpl) GetConnection ¶
func (impl CveStoreRepositoryImpl) GetConnection() (dbConnection *pg.DB)
func (CveStoreRepositoryImpl) Save ¶
func (impl CveStoreRepositoryImpl) Save(model *CveStore) error
func (CveStoreRepositoryImpl) SaveInBatch ¶
func (impl CveStoreRepositoryImpl) SaveInBatch(model []*CveStore, tx *pg.Tx) error
func (CveStoreRepositoryImpl) Update ¶
func (impl CveStoreRepositoryImpl) Update(team *CveStore) error
func (CveStoreRepositoryImpl) UpdateInBatch ¶
func (impl CveStoreRepositoryImpl) UpdateInBatch(models []*CveStore, tx *pg.Tx) ([]*CveStore, error)
UpdateInBatch updates the cve store model in bulk in db, returns the updated models
type DockerArtifactStore ¶
type DockerArtifactStore struct {
Id string `sql:"id,pk" json:"id,,omitempty"`
PluginId string `sql:"plugin_id,notnull" json:"pluginId,omitempty"`
RemoteConnectionConfigId int `sql:"remote_connection_config_id" json:"remoteConnectionConfigId,omitempty"`
RegistryURL string `sql:"registry_url" json:"registryUrl,omitempty"`
RegistryType common.RegistryType `sql:"registry_type,notnull" json:"registryType,omitempty"`
AWSAccessKeyId string `sql:"aws_accesskey_id" json:"awsAccessKeyId,omitempty" `
AWSSecretAccessKey string `sql:"aws_secret_accesskey" json:"awsSecretAccessKey,omitempty"`
AWSRegion string `sql:"aws_region" json:"awsRegion,omitempty"`
Username string `sql:"username" json:"username,omitempty"`
Password string `sql:"password" json:"password,omitempty"`
IsDefault bool `sql:"is_default,notnull" json:"isDefault"`
Connection string `sql:"connection" json:"connection,omitempty"`
Cert string `sql:"cert" json:"cert,omitempty"`
Active bool `sql:"active,notnull" json:"active"`
RemoteConnectionConfig *RemoteConnectionConfig
AuditLog
// contains filtered or unexported fields
}
func (*DockerArtifactStore) GetRegistryLocation ¶
func (store *DockerArtifactStore) GetRegistryLocation() (registryLocation string, err error)
type DockerArtifactStoreRepository ¶
type DockerArtifactStoreRepository interface {
FindActiveDefaultStore() (*DockerArtifactStore, error)
FindById(id string) (*DockerArtifactStore, error)
}
type DockerArtifactStoreRepositoryImpl ¶
type DockerArtifactStoreRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewDockerArtifactStoreRepositoryImpl ¶
func NewDockerArtifactStoreRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *DockerArtifactStoreRepositoryImpl
func (DockerArtifactStoreRepositoryImpl) FindActiveDefaultStore ¶
func (impl DockerArtifactStoreRepositoryImpl) FindActiveDefaultStore() (*DockerArtifactStore, error)
func (DockerArtifactStoreRepositoryImpl) FindById ¶
func (impl DockerArtifactStoreRepositoryImpl) FindById(id string) (*DockerArtifactStore, error)
type ImageScanDeployInfo ¶
type ImageScanDeployInfo struct {
Id int `sql:"id,pk"`
ImageScanExecutionHistoryId []int `sql:"image_scan_execution_history_id,notnull" pg:",array"`
ScanObjectMetaId int `sql:"scan_object_meta_id,notnull"`
ObjectType string `sql:"object_type,notnull"`
EnvId *int `sql:"env_id"`
ClusterId *int `sql:"cluster_id"`
AuditLog
// contains filtered or unexported fields
}
* this table contains scanned images registry for deployed object and apps, images which are deployed on cluster by anyway and has scanned result
func (*ImageScanDeployInfo) CreateAuditLog ¶
func (r *ImageScanDeployInfo) CreateAuditLog()
func (*ImageScanDeployInfo) UpdateImageScanExecutionHistoryIdList ¶
func (r *ImageScanDeployInfo) UpdateImageScanExecutionHistoryIdList(historyId int)
type ImageScanDeployInfoRepository ¶
type ImageScanDeployInfoRepository interface {
Save(model *ImageScanDeployInfo) error
FindAll() ([]*ImageScanDeployInfo, error)
FindOne(id int) (*ImageScanDeployInfo, error)
FindByIds(ids []int) ([]*ImageScanDeployInfo, error)
Update(model *ImageScanDeployInfo) error
FetchListingGroupByObject() ([]*ImageScanDeployInfo, error)
FetchByAppIdAndEnvId(appId int, envId int) (*ImageScanDeployInfo, error)
FindByObjectTypeAndId(scanObjectMetaId int, objectType string) (*ImageScanDeployInfo, error)
FindLatestChildParentInfoId(parentInfoId int) (*ImageScanDeployInfo, error)
}
type ImageScanDeployInfoRepositoryImpl ¶
type ImageScanDeployInfoRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanDeployInfoRepositoryImpl ¶
func NewImageScanDeployInfoRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanDeployInfoRepositoryImpl
func (ImageScanDeployInfoRepositoryImpl) FetchByAppIdAndEnvId ¶
func (impl ImageScanDeployInfoRepositoryImpl) FetchByAppIdAndEnvId(appId int, envId int) (*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FetchListingGroupByObject ¶
func (impl ImageScanDeployInfoRepositoryImpl) FetchListingGroupByObject() ([]*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindAll ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindAll() ([]*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindByIds ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindByIds(ids []int) ([]*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindByObjectTypeAndId ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindByObjectTypeAndId(scanObjectMetaId int, objectType string) (*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindLatestChildParentInfoId ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindLatestChildParentInfoId(parentInfoId int) (*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindOne ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindOne(id int) (*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) Save ¶
func (impl ImageScanDeployInfoRepositoryImpl) Save(model *ImageScanDeployInfo) error
func (ImageScanDeployInfoRepositoryImpl) Update ¶
func (impl ImageScanDeployInfoRepositoryImpl) Update(team *ImageScanDeployInfo) error
type ImageScanExecutionHistory ¶
type ImageScanExecutionHistory struct {
Id int `sql:"id,pk"`
Image string `sql:"image,notnull"`
ImageHash string `sql:"image_hash,notnull"` // TODO Migrate to request metadata
ExecutionTime time.Time `sql:"execution_time"`
ExecutedBy int `sql:"executed_by,notnull"`
SourceMetadataJson string `sql:"source_metadata_json"` // to have relevant info to process a scan for a given source type and subtype
ExecutionHistoryDirectoryPath string `sql:"execution_history_directory_path"` // Deprecated
SourceType common.SourceType `sql:"source_type"`
SourceSubType common.SourceSubType `sql:"source_sub_type"`
ParentId int `sql:"parent_id"`
IsLatest bool `sql:"is_latest"`
// contains filtered or unexported fields
}
func (*ImageScanExecutionHistory) IsSourceAndSubSourceTypeSame ¶
func (r *ImageScanExecutionHistory) IsSourceAndSubSourceTypeSame(sourceType common.SourceType, sourceSubType common.SourceSubType) bool
func (*ImageScanExecutionHistory) UpdateIsLatest ¶
func (r *ImageScanExecutionHistory) UpdateIsLatest(isLatest bool) *ImageScanExecutionHistory
func (*ImageScanExecutionHistory) UpdateParentId ¶
func (r *ImageScanExecutionHistory) UpdateParentId(parentId int)
type ImageScanExecutionResult ¶
type ImageScanExecutionResult struct {
Id int `sql:"id,pk"`
CveStoreName string `sql:"cve_store_name,notnull"`
ImageScanExecutionHistoryId int `sql:"image_scan_execution_history_id"` //TODO: remove this
ScanToolId int `sql:"scan_tool_id"`
Package string `sql:"package"`
Version string `sql:"version"`
FixedVersion string `sql:"fixed_version"`
Target string `sql:"target"`
Type string `sql:"type"`
Class string `sql:"class"`
CveStore CveStore
ImageScanExecutionHistory ImageScanExecutionHistory
// contains filtered or unexported fields
}
type ImageScanHistoryRepository ¶
type ImageScanHistoryRepository interface {
GetConnection() (dbConnection *pg.DB)
Save(tx *pg.Tx, model *ImageScanExecutionHistory) error
FindAll() ([]*ImageScanExecutionHistory, error)
FindOne(id int) (*ImageScanExecutionHistory, error)
FindByImageDigest(image string) (*ImageScanExecutionHistory, error)
FindByImageDigests(digest []string) ([]*ImageScanExecutionHistory, error)
Update(model *ImageScanExecutionHistory) error
FindByImage(image string) (*ImageScanExecutionHistory, error)
FindByImageWithNoSource(image string) (*ImageScanExecutionHistory, error)
FindByImageWithSource(image string) (*ImageScanExecutionHistory, error)
FindLatestByParentScanHistory(parentScanHistoryId int) (*ImageScanExecutionHistory, error)
}
type ImageScanHistoryRepositoryImpl ¶
type ImageScanHistoryRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanHistoryRepositoryImpl ¶
func NewImageScanHistoryRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanHistoryRepositoryImpl
func (ImageScanHistoryRepositoryImpl) FindAll ¶
func (impl ImageScanHistoryRepositoryImpl) FindAll() ([]*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImage ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImage(image string) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImageDigest ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImageDigest(image string) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImageDigests ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImageWithNoSource ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImageWithNoSource(image string) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImageWithSource ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImageWithSource(image string) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindLatestByParentScanHistory ¶
func (impl ImageScanHistoryRepositoryImpl) FindLatestByParentScanHistory(parentScanHistoryId int) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindOne ¶
func (impl ImageScanHistoryRepositoryImpl) FindOne(id int) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) GetConnection ¶
func (impl ImageScanHistoryRepositoryImpl) GetConnection() (dbConnection *pg.DB)
func (ImageScanHistoryRepositoryImpl) Save ¶
func (impl ImageScanHistoryRepositoryImpl) Save(tx *pg.Tx, model *ImageScanExecutionHistory) error
func (ImageScanHistoryRepositoryImpl) Update ¶
func (impl ImageScanHistoryRepositoryImpl) Update(team *ImageScanExecutionHistory) error
type ImageScanObjectMeta ¶
type ImageScanObjectMetaRepository ¶
type ImageScanObjectMetaRepository interface {
Save(model *ImageScanObjectMeta) error
FindAll() ([]*ImageScanObjectMeta, error)
FindOne(id int) (*ImageScanObjectMeta, error)
FindByNameAndType(name string, types string) ([]*ImageScanObjectMeta, error)
Update(model *ImageScanObjectMeta) error
}
type ImageScanObjectMetaRepositoryImpl ¶
type ImageScanObjectMetaRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanObjectMetaRepositoryImpl ¶
func NewImageScanObjectMetaRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanObjectMetaRepositoryImpl
func (ImageScanObjectMetaRepositoryImpl) FindAll ¶
func (impl ImageScanObjectMetaRepositoryImpl) FindAll() ([]*ImageScanObjectMeta, error)
func (ImageScanObjectMetaRepositoryImpl) FindByNameAndType ¶
func (impl ImageScanObjectMetaRepositoryImpl) FindByNameAndType(name string, types string) ([]*ImageScanObjectMeta, error)
func (ImageScanObjectMetaRepositoryImpl) FindOne ¶
func (impl ImageScanObjectMetaRepositoryImpl) FindOne(id int) (*ImageScanObjectMeta, error)
func (ImageScanObjectMetaRepositoryImpl) Save ¶
func (impl ImageScanObjectMetaRepositoryImpl) Save(model *ImageScanObjectMeta) error
func (ImageScanObjectMetaRepositoryImpl) Update ¶
func (impl ImageScanObjectMetaRepositoryImpl) Update(team *ImageScanObjectMeta) error
type ImageScanResultRepository ¶
type ImageScanResultRepository interface {
Save(model *ImageScanExecutionResult) error
SaveInBatch(models []*ImageScanExecutionResult, tx *pg.Tx) error
FindAll() ([]*ImageScanExecutionResult, error)
FindOne(id int) (*ImageScanExecutionResult, error)
FindByCveName(name string) ([]*ImageScanExecutionResult, error)
Update(model *ImageScanExecutionResult) error
FetchByScanExecutionId(id int) ([]*ImageScanExecutionResult, error)
FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error)
}
type ImageScanResultRepositoryImpl ¶
type ImageScanResultRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanResultRepositoryImpl ¶
func NewImageScanResultRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanResultRepositoryImpl
func (ImageScanResultRepositoryImpl) FetchByScanExecutionId ¶
func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionId(scanExecutionId int) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FetchByScanExecutionIds ¶
func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindAll ¶
func (impl ImageScanResultRepositoryImpl) FindAll() ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindByCveName ¶
func (impl ImageScanResultRepositoryImpl) FindByCveName(name string) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindOne ¶
func (impl ImageScanResultRepositoryImpl) FindOne(id int) (*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) Save ¶
func (impl ImageScanResultRepositoryImpl) Save(model *ImageScanExecutionResult) error
func (ImageScanResultRepositoryImpl) SaveInBatch ¶
func (impl ImageScanResultRepositoryImpl) SaveInBatch(models []*ImageScanExecutionResult, tx *pg.Tx) error
func (ImageScanResultRepositoryImpl) Update ¶
func (impl ImageScanResultRepositoryImpl) Update(team *ImageScanExecutionResult) error
type PolicyAction ¶
type PolicyAction int
const ( Inherit PolicyAction = iota Allow Block )
func (PolicyAction) String ¶
func (d PolicyAction) String() string
type PolicyLevel ¶
type PolicyLevel int
const ( Global PolicyLevel = iota Cluster Environment App )
func (PolicyLevel) String ¶
func (d PolicyLevel) String() string
type RegistryIndexMapping ¶
type RegistryIndexMapping struct {
Id int `sql:"id,pk"`
Registry common.RegistryType `sql:"registry_type"`
Index int `sql:"starting_index"`
ScanToolId int `sql:"scan_tool_id"`
// contains filtered or unexported fields
}
type RegistryIndexMappingRepository ¶
type RegistryIndexMappingRepository interface {
GetStartingIndexForARegistryAndATool(scanToolid int, registry common.RegistryType) (*RegistryIndexMapping, error)
}
type RegistryIndexMappingRepositoryImpl ¶
type RegistryIndexMappingRepositoryImpl struct {
DbConnection *pg.DB
Logger *zap.SugaredLogger
}
func NewRegistryIndexMappingRepositoryImpl ¶
func NewRegistryIndexMappingRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *RegistryIndexMappingRepositoryImpl
func (*RegistryIndexMappingRepositoryImpl) GetStartingIndexForARegistryAndATool ¶
func (repo *RegistryIndexMappingRepositoryImpl) GetStartingIndexForARegistryAndATool(scanToolid int, registry common.RegistryType) (*RegistryIndexMapping, error)
type RemoteConnectionConfig ¶
type RemoteConnectionConfig struct {
Id int `sql:"id,pk"`
ConnectionMethod bean.RemoteConnectionMethod `sql:"connection_method"`
ProxyUrl string `sql:"proxy_url"`
SSHServerAddress string `sql:"ssh_server_address"`
SSHUsername string `sql:"ssh_username"`
SSHPassword string `sql:"ssh_password"`
SSHAuthKey string `sql:"ssh_auth_key"`
Deleted bool `sql:"deleted,notnull"`
AuditLog
// contains filtered or unexported fields
}
type RemoteConnectionRepository ¶
type RemoteConnectionRepository interface {
GetById(id int) (*RemoteConnectionConfig, error)
}
type RemoteConnectionRepositoryImpl ¶
type RemoteConnectionRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewRemoteConnectionRepositoryImpl ¶
func NewRemoteConnectionRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *RemoteConnectionRepositoryImpl
func (*RemoteConnectionRepositoryImpl) GetById ¶
func (repo *RemoteConnectionRepositoryImpl) GetById(id int) (*RemoteConnectionConfig, error)
type ResourceScanFormat ¶
type ResourceScanFormat int
type ResourceScanResult ¶
type ResourceScanResult struct {
Id int `sql:"id,pk"`
ImageScanExecutionHistoryId int `sql:"image_scan_execution_history_id"`
ScanDataJson string `sql:"scan_data_json"`
Format ResourceScanFormat `sql:"format"`
Types []int `sql:"types" pg:",array"`
ScanToolId int `sql:"scan_tool_id"`
// contains filtered or unexported fields
}
type ResourceScanResultRepository ¶
type ResourceScanResultRepository interface {
SaveInBatch(models []*ResourceScanResult) error
FetchByScanHistoryIdAndFormatType(scanHistoryId int, format int) ([]*ResourceScanResult, error)
}
type ResourceScanResultRepositoryImpl ¶
type ResourceScanResultRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewResourceScanResultRepositoryImpl ¶
func NewResourceScanResultRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ResourceScanResultRepositoryImpl
func (ResourceScanResultRepositoryImpl) FetchByScanHistoryIdAndFormatType ¶
func (impl ResourceScanResultRepositoryImpl) FetchByScanHistoryIdAndFormatType(scanHistoryId int, format int) ([]*ResourceScanResult, error)
func (ResourceScanResultRepositoryImpl) SaveInBatch ¶
func (impl ResourceScanResultRepositoryImpl) SaveInBatch(models []*ResourceScanResult) error
type ResourceScanType ¶
type ResourceScanType int
const ( Vulnerabilities ResourceScanType = 1 License ResourceScanType = 2 Config ResourceScanType = 3 Secrets ResourceScanType = 4 )
func (ResourceScanType) ToInt ¶
func (t ResourceScanType) ToInt() int
type ScanStepCondition ¶
type ScanStepCondition struct {
Id int `sql:"id,pk"`
ConditionVariableFormat bean.VariableFormat `sql:"condition_variable_format"`
ConditionalOperator string `sql:"conditional_operator"`
ConditionalValue string `sql:"conditional_value"`
ConditionOn string `sql:"condition_on"` //json path of variable on which condition is to be applied
Deleted bool `sql:"deleted,notnull"`
AuditLog
// contains filtered or unexported fields
}
type ScanStepConditionMapping ¶
type ScanStepConditionMapping struct {
Id int `sql:"id,pk"`
ScanStepConditionId int `sql:"scan_step_condition_id"`
ScanStepConditionMappingId int `sql:"scan_tool_step_id"`
ScanToolMetadata
ScanStepCondition
AuditLog
// contains filtered or unexported fields
}
type ScanStepConditionMappingRepository ¶
type ScanStepConditionMappingRepository interface {
Save(model *ScanStepConditionMapping) (*ScanStepConditionMapping, error)
Update(model *ScanStepConditionMapping) (*ScanStepConditionMapping, error)
SaveBulk(model []*ScanStepConditionMapping) ([]*ScanStepConditionMapping, error)
UpdateBulk(model []*ScanStepConditionMapping) ([]*ScanStepConditionMapping, error)
}
type ScanStepConditionMappingRepositoryImpl ¶
type ScanStepConditionMappingRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewScanStepConditionMappingRepositoryImpl ¶
func NewScanStepConditionMappingRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanStepConditionMappingRepositoryImpl
func (*ScanStepConditionMappingRepositoryImpl) Save ¶
func (repo *ScanStepConditionMappingRepositoryImpl) Save(model *ScanStepConditionMapping) (*ScanStepConditionMapping, error)
func (*ScanStepConditionMappingRepositoryImpl) SaveBulk ¶
func (repo *ScanStepConditionMappingRepositoryImpl) SaveBulk(model []*ScanStepConditionMapping) ([]*ScanStepConditionMapping, error)
func (*ScanStepConditionMappingRepositoryImpl) Update ¶
func (repo *ScanStepConditionMappingRepositoryImpl) Update(model *ScanStepConditionMapping) (*ScanStepConditionMapping, error)
func (*ScanStepConditionMappingRepositoryImpl) UpdateBulk ¶
func (repo *ScanStepConditionMappingRepositoryImpl) UpdateBulk(model []*ScanStepConditionMapping) ([]*ScanStepConditionMapping, error)
type ScanStepConditionRepository ¶
type ScanStepConditionRepository interface {
Save(model *ScanStepCondition) (*ScanStepCondition, error)
Update(model *ScanStepCondition) (*ScanStepCondition, error)
SaveBulk(model []*ScanStepCondition) ([]*ScanStepCondition, error)
UpdateBulk(model []*ScanStepCondition) ([]*ScanStepCondition, error)
FindAllByToolStepId(toolStepId int) ([]*ScanStepCondition, error)
MarkDeletedById(id int) error
MarkAllConditionsDeletedByToolStepId(toolStepId int) error
}
type ScanStepConditionRepositoryImpl ¶
type ScanStepConditionRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewScanStepConditionRepositoryImpl ¶
func NewScanStepConditionRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanStepConditionRepositoryImpl
func (*ScanStepConditionRepositoryImpl) FindAllByToolStepId ¶
func (repo *ScanStepConditionRepositoryImpl) FindAllByToolStepId(toolStepId int) ([]*ScanStepCondition, error)
func (*ScanStepConditionRepositoryImpl) MarkAllConditionsDeletedByToolStepId ¶
func (repo *ScanStepConditionRepositoryImpl) MarkAllConditionsDeletedByToolStepId(toolStepId int) error
func (*ScanStepConditionRepositoryImpl) MarkDeletedById ¶
func (repo *ScanStepConditionRepositoryImpl) MarkDeletedById(id int) error
func (*ScanStepConditionRepositoryImpl) Save ¶
func (repo *ScanStepConditionRepositoryImpl) Save(model *ScanStepCondition) (*ScanStepCondition, error)
func (*ScanStepConditionRepositoryImpl) SaveBulk ¶
func (repo *ScanStepConditionRepositoryImpl) SaveBulk(model []*ScanStepCondition) ([]*ScanStepCondition, error)
func (*ScanStepConditionRepositoryImpl) Update ¶
func (repo *ScanStepConditionRepositoryImpl) Update(model *ScanStepCondition) (*ScanStepCondition, error)
func (*ScanStepConditionRepositoryImpl) UpdateBulk ¶
func (repo *ScanStepConditionRepositoryImpl) UpdateBulk(model []*ScanStepCondition) ([]*ScanStepCondition, error)
type ScanTargetType ¶
type ScanTargetType string
const ( ImageScanTargetType ScanTargetType = "IMAGE" CodeScanTargetType ScanTargetType = "CODE" )
type ScanToolExecutionHistoryMapping ¶
type ScanToolExecutionHistoryMapping struct {
Id int `sql:"id,pk"`
ImageScanExecutionHistoryId int `sql:"image_scan_execution_history_id"`
ScanToolId int `sql:"scan_tool_id"`
ExecutionStartTime time.Time `sql:"execution_start_time,notnull"`
ExecutionFinishTime time.Time `sql:"execution_finish_time,notnull"`
State bean.ScanExecutionProcessState `sql:"state"`
ErrorMessage string `sql:"error_message"`
TryCount int `sql:"try_count"`
AuditLog
// contains filtered or unexported fields
}
type ScanToolExecutionHistoryMappingRepository ¶
type ScanToolExecutionHistoryMappingRepository interface {
Save(tx *pg.Tx, model *ScanToolExecutionHistoryMapping) error
SaveInBatch(models []*ScanToolExecutionHistoryMapping) error
UpdateStateByToolAndExecutionHistoryId(executionHistoryId, toolId int, state bean.ScanExecutionProcessState, executionFinishTime time.Time, errorMessage string) error
MarkAllRunningStateAsFailedHavingTryCountReachedLimit(tryCount int) error
GetAllScanHistoriesByState(state bean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
GetAllScanHistoriesByExecutionHistoryIdAndStates(executionHistoryId int, states []bean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
}
type ScanToolExecutionHistoryMappingRepositoryImpl ¶
type ScanToolExecutionHistoryMappingRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewScanToolExecutionHistoryMappingRepositoryImpl ¶
func NewScanToolExecutionHistoryMappingRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanToolExecutionHistoryMappingRepositoryImpl
func (*ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIdAndStates ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIdAndStates(executionHistoryId int, states []bean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
func (*ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByState ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByState(state bean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
func (*ScanToolExecutionHistoryMappingRepositoryImpl) MarkAllRunningStateAsFailedHavingTryCountReachedLimit ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) MarkAllRunningStateAsFailedHavingTryCountReachedLimit(tryCount int) error
func (*ScanToolExecutionHistoryMappingRepositoryImpl) Save ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) Save(tx *pg.Tx, model *ScanToolExecutionHistoryMapping) error
func (*ScanToolExecutionHistoryMappingRepositoryImpl) SaveInBatch ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) SaveInBatch(models []*ScanToolExecutionHistoryMapping) error
func (*ScanToolExecutionHistoryMappingRepositoryImpl) UpdateStateByToolAndExecutionHistoryId ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) UpdateStateByToolAndExecutionHistoryId(executionHistoryId, toolId int, state bean.ScanExecutionProcessState, executionFinishTime time.Time, errorMessage string) error
type ScanToolMetadata ¶
type ScanToolMetadata struct {
Id int `sql:"id,pk"`
Name string `sql:"name"`
Version string `sql:"version"`
ServerBaseUrl string `sql:"server_base_url"`
ResultDescriptorTemplate string `sql:"result_descriptor_template"`
ScanTarget ScanTargetType `sql:"scan_target"`
Active bool `sql:"active,notnull"`
Deleted bool `sql:"deleted,notnull"`
ToolMetaData string `sql:"tool_metadata"`
AuditLog
// contains filtered or unexported fields
}
type ScanToolMetadataRepository ¶
type ScanToolMetadataRepository interface {
FindActiveToolByScanTarget(scanTarget ScanTargetType) (*ScanToolMetadata, error)
FindByNameAndVersion(name, version string) (*ScanToolMetadata, error)
FindActiveById(id int) (*ScanToolMetadata, error)
Save(model *ScanToolMetadata) (*ScanToolMetadata, error)
Update(model *ScanToolMetadata) (*ScanToolMetadata, error)
MarkToolDeletedById(id int) error
FindAllActiveTools() ([]*ScanToolMetadata, error)
}
type ScanToolMetadataRepositoryImpl ¶
type ScanToolMetadataRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewScanToolMetadataRepositoryImpl ¶
func NewScanToolMetadataRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanToolMetadataRepositoryImpl
func (*ScanToolMetadataRepositoryImpl) FindActiveById ¶
func (repo *ScanToolMetadataRepositoryImpl) FindActiveById(id int) (*ScanToolMetadata, error)
func (*ScanToolMetadataRepositoryImpl) FindActiveToolByScanTarget ¶
func (repo *ScanToolMetadataRepositoryImpl) FindActiveToolByScanTarget(scanTargetType ScanTargetType) (*ScanToolMetadata, error)
func (*ScanToolMetadataRepositoryImpl) FindAllActiveTools ¶
func (repo *ScanToolMetadataRepositoryImpl) FindAllActiveTools() ([]*ScanToolMetadata, error)
func (*ScanToolMetadataRepositoryImpl) FindByNameAndVersion ¶
func (repo *ScanToolMetadataRepositoryImpl) FindByNameAndVersion(name, version string) (*ScanToolMetadata, error)
func (*ScanToolMetadataRepositoryImpl) MarkToolDeletedById ¶
func (repo *ScanToolMetadataRepositoryImpl) MarkToolDeletedById(id int) error
func (*ScanToolMetadataRepositoryImpl) Save ¶
func (repo *ScanToolMetadataRepositoryImpl) Save(model *ScanToolMetadata) (*ScanToolMetadata, error)
func (*ScanToolMetadataRepositoryImpl) Update ¶
func (repo *ScanToolMetadataRepositoryImpl) Update(model *ScanToolMetadata) (*ScanToolMetadata, error)
type ScanToolStep ¶
type ScanToolStep struct {
Id int `sql:"id,pk"`
ScanToolId int `sql:"scan_tool_id"`
Index int `sql:"index"`
StepExecutionType bean.ScanExecutionType `sql:"step_execution_type"`
StepExecutionSync bool `sql:"step_execution_sync,notnull"` //sync if true, else async
RetryCount int `sql:"retry_count"` //only applicable if step fails
ExecuteStepOnFail int `sql:"execute_step_on_fail"` //fail means that at least one condition is not matched (not applicable for async process)
ExecuteStepOnPass int `sql:"execute_step_on_pass"` //pass means that all conditions are matched
RenderInputDataFromStep int `sql:"render_input_data_from_step"` //use this steps output to render input data, -1 if not needed
HttpInputPayload json.RawMessage `sql:"http_input_payload"`
HttpMethodType string `sql:"http_method_type"`
HttpReqHeaders json.RawMessage `sql:"http_req_headers"`
HttpQueryParams json.RawMessage `sql:"http_query_params"`
CliCommand string `sql:"cli_command"` //consists of sub command and flags along with applicable values
CliOutputType cli_util.CliOutputType `sql:"cli_output_type"`
Deleted bool `sql:"deleted,notnull"`
AuditLog
// contains filtered or unexported fields
}
type ScanToolStepRepository ¶
type ScanToolStepRepository interface {
Save(model *ScanToolStep) (*ScanToolStep, error)
Update(model *ScanToolStep) (*ScanToolStep, error)
SaveInBatch(model []*ScanToolStep) ([]*ScanToolStep, error)
UpdateInBatch(model []*ScanToolStep) ([]*ScanToolStep, error)
FindAllByScanToolId(scanToolId int) ([]*ScanToolStep, error)
MarkDeletedById(id int) error
MarkAllStepsDeletedByToolId(scanToolId int) error
}
type ScanToolStepRepositoryImpl ¶
type ScanToolStepRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewScanToolStepRepositoryImpl ¶
func NewScanToolStepRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanToolStepRepositoryImpl
func (*ScanToolStepRepositoryImpl) FindAllByScanToolId ¶
func (repo *ScanToolStepRepositoryImpl) FindAllByScanToolId(scanToolId int) ([]*ScanToolStep, error)
func (*ScanToolStepRepositoryImpl) MarkAllStepsDeletedByToolId ¶
func (repo *ScanToolStepRepositoryImpl) MarkAllStepsDeletedByToolId(scanToolId int) error
func (*ScanToolStepRepositoryImpl) MarkDeletedById ¶
func (repo *ScanToolStepRepositoryImpl) MarkDeletedById(id int) error
func (*ScanToolStepRepositoryImpl) Save ¶
func (repo *ScanToolStepRepositoryImpl) Save(model *ScanToolStep) (*ScanToolStep, error)
func (*ScanToolStepRepositoryImpl) SaveInBatch ¶
func (repo *ScanToolStepRepositoryImpl) SaveInBatch(model []*ScanToolStep) ([]*ScanToolStep, error)
func (*ScanToolStepRepositoryImpl) Update ¶
func (repo *ScanToolStepRepositoryImpl) Update(model *ScanToolStep) (*ScanToolStep, error)
func (*ScanToolStepRepositoryImpl) UpdateInBatch ¶
func (repo *ScanToolStepRepositoryImpl) UpdateInBatch(model []*ScanToolStep) ([]*ScanToolStep, error)
type UserRepository ¶
type UserRepository interface {
CreateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
UpdateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
GetById(id int32) (*UserModel, error)
GetAll() ([]UserModel, error)
GetUsersByFilter(size int, from int) ([]UserModel, error)
FetchUserByEmail(email string) (bean.UserInfo, error)
FetchUserByEmailV2(email string) (*UserModel, error)
FetchUserDetailByEmailV2(email string) (*UserModel, error)
GetByIds(ids []int32) ([]UserModel, error)
DeleteUser(userModel *UserModel, tx *pg.Tx) (bool, error)
GetConnection() (dbConnection *pg.DB)
GetByEmailId(email string) ([]UserModel, error)
}
type UserRepositoryImpl ¶
type UserRepositoryImpl struct {
Logger *zap.SugaredLogger
// contains filtered or unexported fields
}
func NewUserRepositoryImpl ¶
func NewUserRepositoryImpl(dbConnection *pg.DB) *UserRepositoryImpl
func (UserRepositoryImpl) CreateUser ¶
func (UserRepositoryImpl) DeleteUser ¶
func (UserRepositoryImpl) FetchUserByEmail ¶
func (impl UserRepositoryImpl) FetchUserByEmail(email string) (bean.UserInfo, error)
func (UserRepositoryImpl) FetchUserByEmailV2 ¶
func (impl UserRepositoryImpl) FetchUserByEmailV2(email string) (*UserModel, error)
func (UserRepositoryImpl) FetchUserDetailByEmailV2 ¶
func (impl UserRepositoryImpl) FetchUserDetailByEmailV2(email string) (*UserModel, error)
func (UserRepositoryImpl) GetAll ¶
func (impl UserRepositoryImpl) GetAll() ([]UserModel, error)
func (UserRepositoryImpl) GetByEmailId ¶
func (impl UserRepositoryImpl) GetByEmailId(email string) ([]UserModel, error)
func (UserRepositoryImpl) GetById ¶
func (impl UserRepositoryImpl) GetById(id int32) (*UserModel, error)
func (UserRepositoryImpl) GetByIds ¶
func (impl UserRepositoryImpl) GetByIds(ids []int32) ([]UserModel, error)
func (*UserRepositoryImpl) GetConnection ¶
func (impl *UserRepositoryImpl) GetConnection() (dbConnection *pg.DB)
func (UserRepositoryImpl) GetUsersByFilter ¶
func (impl UserRepositoryImpl) GetUsersByFilter(size int, from int) ([]UserModel, error)
func (UserRepositoryImpl) UpdateUser ¶
Source Files
¶
- CiArtifactRepository.go
- CvePolicyControle.go
- CveStoreRepository.go
- DockerArtifactStoreRepository.go
- ImageScanDeployInfoRepository.go
- ImageScanHistoryRepository.go
- ImageScanObjectMetaRepository.go
- ImageScanResultRepository.go
- RegistryIndexMappingRepository.go
- ResourceScanExecutionResultRepository.go
- ScanStepConditionMappingRepository.go
- ScanStepConditionRepository.go
- ScanToolExecutionHistoryMappingRepository.go
- ScanToolMetadataRepository.go
- ScanToolStepRepository.go
- ServerConnectionRepository.go
- UserRepository.go
Click to show internal directories.
Click to hide internal directories.