Documentation
¶
Overview ¶
Copyright (C) 2024 Tim Bastin, l3montree GmbH
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2026 l3montree GmbH ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Variables
- func BatchedVersionPredicate(interpretation normalize.VersionInterpretationType) string
- func BuildQualifierQuery(db *gorm.DB, qualifiers packageurl.Qualifiers, namespace string) *gorm.DB
- func BuildQueryBasedOnMatchContext(db *gorm.DB, ctx *normalize.PurlMatchContext) *gorm.DB
- func NewAffectedComponentRepository(db *gorm.DB) *affectedCmpRepository
- func NewArtifactRepository(db *gorm.DB) *artifactRepository
- func NewArtifactRiskHistoryRepository(db *gorm.DB) *artifactRiskHistoryRepository
- func NewAssetRepository(db *gorm.DB) *assetRepository
- func NewAssetVersionRepository(db *gorm.DB, synchronizer utils.FireAndForgetSynchronizer) *assetVersionRepository
- func NewAttestationRepository(db *gorm.DB) *attestationRepository
- func NewCVERepository(db *gorm.DB) *cveRepository
- func NewCWERepository(db *gorm.DB) *cweRepository
- func NewComponentProjectRepository(db *gorm.DB) *componentProjectRepository
- func NewComponentRepository(db *gorm.DB) *componentRepository
- func NewConfigRepository(db *gorm.DB) *configRepository
- func NewCveRelationshipRepository(db *gorm.DB) *cveRelationshipRepository
- func NewDependencyProxyRepository(db *gorm.DB) *dependencyProxySecretRepository
- func NewDependencyVulnRepository(db *gorm.DB) *dependencyVulnRepository
- func NewExploitRepository(db *gorm.DB) *exploitRepository
- func NewExternalReferenceRepository(db *gorm.DB) shared.ExternalReferenceRepository
- func NewExternalUserRepository(db *gorm.DB) *externalUserRepository
- func NewFirstPartyVulnerabilityRepository(db *gorm.DB) *firstPartyVulnerabilityRepository
- func NewGitLabIntegrationRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *gitlabIntegrationRepository
- func NewGithubAppInstallationRepository(db *gorm.DB) *githubAppInstallationRepository
- func NewGitlabOauth2TokenRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *gitlabOauth2TokenRepository
- func NewInTotoLinkRepository(db *gorm.DB) *inTotoLinkRepository
- func NewJiraIntegrationRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *jiraIntegrationRepository
- func NewOrgRepository(db *gorm.DB) *orgRepository
- func NewPATRepository(db *gorm.DB) *gormPatRepository
- func NewPolicyRepository(db *gorm.DB) *policyRepository
- func NewProjectRepository(db *gorm.DB) *projectRepository
- func NewReleaseRepository(db *gorm.DB) *releaseRepository
- func NewStatisticsRepository(db *gorm.DB) *statisticsRepository
- func NewSupplyChainRepository(db *gorm.DB) *supplyChainRepository
- func NewTrustedEntityRepository(db *gorm.DB) *trustedEntityRepository
- func NewUpstreamVEXRuleRepository(db *gorm.DB) *upstreamVEXRuleRepository
- func NewVEXRuleRecommendationRepository(db *gorm.DB) *vexRuleRecommendationRepository
- func NewVEXRuleRepository(db *gorm.DB) *vexRuleRepository
- func NewVulnEventRepository(db *gorm.DB) *eventRepository
- func NewWebhookRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *webhookRepository
- func QualifierEcosystemPattern(qualifiers packageurl.Qualifiers, namespace string) string
- type AdminRepository
- type AdvisoryRepository
- func (advisoryRepository *AdvisoryRepository) Create(ctx context.Context, tx *gorm.DB, advisory *models.Advisory) error
- func (advisoryRepository *AdvisoryRepository) Delete(ctx context.Context, tx *gorm.DB, id int64) error
- func (advisoryRepository *AdvisoryRepository) GetAllAdvisoriesByAssetID(ctx context.Context, tx *gorm.DB, assetID uuid.UUID) ([]models.Advisory, error)
- func (advisoryRepository *AdvisoryRepository) ReadAdvisory(ctx context.Context, tx *gorm.DB, id int64) (models.Advisory, error)
- func (advisoryRepository *AdvisoryRepository) ReadAll(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, ...) (shared.Paged[models.Advisory], error)
- func (advisoryRepository *AdvisoryRepository) Update(ctx context.Context, tx *gorm.DB, id int64, advisory *models.Advisory) error
- type AggregatedVulnRepository
- func (a AggregatedVulnRepository) ApplyAndSave(ctx context.Context, tx *gorm.DB, vuln models.Vuln, ...) error
- func (a AggregatedVulnRepository) FindByTicketID(ctx context.Context, tx *gorm.DB, ticketID string) (models.Vuln, error)
- func (a AggregatedVulnRepository) GetOrgFromVuln(ctx context.Context, tx *gorm.DB, vuln models.Vuln) (models.Org, error)
- func (a AggregatedVulnRepository) Save(ctx context.Context, tx *gorm.DB, vuln *models.Vuln) error
- func (a AggregatedVulnRepository) Transaction(ctx context.Context, txFunc func(tx *gorm.DB) error) error
- type ComplianceComponentRepository
- func (r *ComplianceComponentRepository) CreateStatement(ctx context.Context, tx *gorm.DB, ...) (*models.ComplianceComponentImplementsControlStatement, error)
- func (r *ComplianceComponentRepository) DeleteStatement(ctx context.Context, tx *gorm.DB, statementID uuid.UUID) (*models.ComplianceComponentImplementsControlStatement, error)
- func (r *ComplianceComponentRepository) GetDB(ctx context.Context, tx *gorm.DB) *gorm.DB
- func (r *ComplianceComponentRepository) GetDetails(ctx context.Context, tx *gorm.DB, id uuid.UUID) (*models.ComplianceComponent, error)
- func (r *ComplianceComponentRepository) ListAll(ctx context.Context, tx *gorm.DB, filter []shared.FilterQuery) ([]models.ComplianceComponent, error)
- func (r *ComplianceComponentRepository) UpdateStatement(ctx context.Context, tx *gorm.DB, statementID uuid.UUID, ...) (*models.ComplianceComponentImplementsControlStatement, error)
- type CompliancePostureRepository
- func (r *CompliancePostureRepository) ApplyAndSave(ctx context.Context, tx *gorm.DB, posture *models.CompliancePosture, ...) error
- func (r *CompliancePostureRepository) FindOrCreate(ctx context.Context, tx *gorm.DB, posture models.CompliancePosture) (*models.CompliancePosture, error)
- func (r *CompliancePostureRepository) GetAllControls(ctx context.Context, tx *gorm.DB, assetVersionName *string, assetID *uuid.UUID, ...) ([]dtos.CompliancePostureWithDetailsDTO, error)
- func (r *CompliancePostureRepository) GetForAllControlsPaged(ctx context.Context, tx *gorm.DB, assetVersionName *string, assetID *uuid.UUID, ...) (shared.Paged[dtos.CompliancePostureWithControlDTO], error)
- func (r *CompliancePostureRepository) GetForControl(ctx context.Context, tx *gorm.DB, controlID string, assetVersionName *string, ...) (*models.CompliancePosture, error)
- func (r *CompliancePostureRepository) GetStatsForAllControls(ctx context.Context, tx *gorm.DB, assetVersionName *string, assetID *uuid.UUID, ...) (dtos.CompliancePostureStatsDTO, error)
- type FrameworkControlRepository
- type GormRepository
- func (g *GormRepository[ID, T]) Activate(ctx context.Context, tx *gorm.DB, id ID) error
- func (g *GormRepository[ID, T]) All(ctx context.Context, tx *gorm.DB) ([]T, error)
- func (g *GormRepository[ID, T]) Begin(ctx context.Context) *gorm.DB
- func (g *GormRepository[ID, T]) CleanupOrphanedRecords(ctx context.Context) error
- func (g *GormRepository[ID, T]) Create(ctx context.Context, tx *gorm.DB, t *T) error
- func (g *GormRepository[ID, T]) CreateBatch(ctx context.Context, tx *gorm.DB, ts []T) error
- func (g *GormRepository[ID, T]) Delete(ctx context.Context, tx *gorm.DB, id ID) error
- func (g *GormRepository[ID, T]) DeleteBatch(ctx context.Context, tx *gorm.DB, m []T) error
- func (g *GormRepository[ID, T]) GetDB(ctx context.Context, tx *gorm.DB) *gorm.DB
- func (g *GormRepository[ID, T]) List(ctx context.Context, tx *gorm.DB, ids []ID) ([]T, error)
- func (g *GormRepository[ID, T]) Read(ctx context.Context, tx *gorm.DB, id ID) (T, error)
- func (g *GormRepository[ID, T]) Save(ctx context.Context, tx *gorm.DB, t *T) error
- func (g *GormRepository[ID, T]) SaveBatch(ctx context.Context, tx *gorm.DB, ts []T) error
- func (g *GormRepository[ID, T]) SaveBatchBestEffort(ctx context.Context, tx *gorm.DB, ts []T) error
- func (g *GormRepository[ID, T]) Transaction(ctx context.Context, f func(tx *gorm.DB) error) error
- func (g *GormRepository[ID, T]) Upsert(ctx context.Context, tx *gorm.DB, t *[]*T, conflictingColumns []clause.Column, ...) error
- type InvitationRepository
- func (g *InvitationRepository) FindByCode(ctx context.Context, tx *gorm.DB, code string) (models.Invitation, error)
- func (g *InvitationRepository) FindByOrgID(ctx context.Context, tx *gorm.DB, orgID string) ([]models.Invitation, error)
- func (g *InvitationRepository) Save(ctx context.Context, tx *gorm.DB, invitation *models.Invitation) error
- type LicenseRiskRepository
- func (repository *LicenseRiskRepository) ApplyAndSave(ctx context.Context, tx *gorm.DB, licenseRisk *models.LicenseRisk, ...) error
- func (repository *LicenseRiskRepository) DeleteByComponentPurl(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, assetVersionName string, ...) error
- func (repository *LicenseRiskRepository) GetAllLicenseRisksForAssetVersion(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, assetVersionName string) ([]models.LicenseRisk, error)
- func (repository *LicenseRiskRepository) GetAllLicenseRisksForAssetVersionPaged(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, assetVersionName string, ...) (shared.Paged[models.LicenseRisk], error)
- func (repository *LicenseRiskRepository) GetAllOverwrittenLicensesForAssetVersion(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, assetVersionName string) ([]models.LicenseRisk, error)
- func (repository *LicenseRiskRepository) GetByAssetID(ctx context.Context, tx *gorm.DB, assetID uuid.UUID) ([]models.LicenseRisk, error)
- func (repository *LicenseRiskRepository) GetLicenseRisksByOtherAssetVersions(ctx context.Context, tx *gorm.DB, assetVersionName string, assetID uuid.UUID) ([]models.LicenseRisk, error)
- func (repository *LicenseRiskRepository) ListByArtifactName(ctx context.Context, tx *gorm.DB, assetVersionName string, assetID uuid.UUID, ...) ([]models.LicenseRisk, error)
- func (repository *LicenseRiskRepository) MaybeGetLicenseOverwriteForComponent(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, assetVersionName string, ...) (models.LicenseRisk, error)
- func (repository *LicenseRiskRepository) Read(ctx context.Context, tx *gorm.DB, vulnID uuid.UUID) (models.LicenseRisk, error)
- type MaliciousPackageRepository
- func (r *MaliciousPackageRepository) GetDB(ctx context.Context, tx *gorm.DB) *gorm.DB
- func (r *MaliciousPackageRepository) GetMaliciousAffectedComponents(ctx context.Context, tx *gorm.DB, purl packageurl.PackageURL) ([]models.MaliciousAffectedComponent, error)
- func (r *MaliciousPackageRepository) GetMaliciousPackageByID(ctx context.Context, tx *gorm.DB, id string) (models.MaliciousPackage, error)
- type VulnStats
- type VulnerabilityRepository
- func (r *VulnerabilityRepository[T]) FindByTicketID(ctx context.Context, tx *gorm.DB, ticketID string) (T, error)
- func (r *VulnerabilityRepository[T]) GetAllByAssetIDAndState(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, state dtos.VulnState, ...) ([]T, error)
- func (r *VulnerabilityRepository[T]) GetAllOpenVulnsByAssetVersionNameAndAssetID(ctx context.Context, tx *gorm.DB, assetVersionName string, assetID uuid.UUID) ([]T, error)
- func (r *VulnerabilityRepository[T]) GetAllVulnsByAssetID(ctx context.Context, tx *gorm.DB, assetID uuid.UUID) ([]T, error)
- func (r *VulnerabilityRepository[T]) GetByAssetID(ctx context.Context, tx *gorm.DB, assetID uuid.UUID) ([]T, error)
Constants ¶
This section is empty.
Variables ¶
var CleanupOrphanedRecordsSQL = `` /* 1736-byte string literal not displayed */
var Module = fx.Options( fx.Provide(fx.Annotate(NewPATRepository, fx.As(new(shared.PersonalAccessTokenRepository)))), fx.Provide(fx.Annotate(NewFrameworkControlRepository, fx.As(new(shared.FrameworkControlRepository)))), fx.Provide(fx.Annotate(NewAssetRepository, fx.As(new(shared.AssetRepository)))), fx.Provide(fx.Annotate(NewArtifactRiskHistoryRepository, fx.As(new(shared.ArtifactRiskHistoryRepository)))), fx.Provide(fx.Annotate(NewAssetVersionRepository, fx.As(new(shared.AssetVersionRepository)))), fx.Provide(fx.Annotate(NewStatisticsRepository, fx.As(new(shared.StatisticsRepository)))), fx.Provide(fx.Annotate(NewReleaseRepository, fx.As(new(shared.ReleaseRepository)))), fx.Provide(fx.Annotate(NewProjectRepository, fx.As(new(shared.ProjectRepository)))), fx.Provide(fx.Annotate(NewComponentRepository, fx.As(new(shared.ComponentRepository)))), fx.Provide(fx.Annotate(NewVulnEventRepository, fx.As(new(shared.VulnEventRepository)))), fx.Provide(fx.Annotate(NewOrgRepository, fx.As(new(shared.OrganizationRepository)))), fx.Provide(fx.Annotate(NewCVERepository, fx.As(new(shared.CveRepository)))), fx.Provide(fx.Annotate(NewCWERepository, fx.As(new(shared.CweRepository)))), fx.Provide(fx.Annotate(NewExploitRepository, fx.As(new(shared.ExploitRepository)))), fx.Provide(fx.Annotate(NewAffectedComponentRepository, fx.As(new(shared.AffectedComponentRepository)))), fx.Provide(fx.Annotate(NewDependencyVulnRepository, fx.As(new(shared.DependencyVulnRepository)))), fx.Provide(fx.Annotate(NewFirstPartyVulnerabilityRepository, fx.As(new(shared.FirstPartyVulnRepository)))), fx.Provide(fx.Annotate(NewInTotoLinkRepository, fx.As(new(shared.InTotoLinkRepository)))), fx.Provide(fx.Annotate(NewSupplyChainRepository, fx.As(new(shared.SupplyChainRepository)))), fx.Provide(fx.Annotate(NewAttestationRepository, fx.As(new(shared.AttestationRepository)))), fx.Provide(fx.Annotate(NewPolicyRepository, fx.As(new(shared.PolicyRepository)))), fx.Provide(fx.Annotate(NewLicenseRiskRepository, fx.As(new(shared.LicenseRiskRepository)))), fx.Provide(fx.Annotate(NewWebhookRepository, fx.As(new(shared.WebhookIntegrationRepository)))), fx.Provide(fx.Annotate(NewArtifactRepository, fx.As(new(shared.ArtifactRepository)))), fx.Provide(fx.Annotate(NewInvitationRepository, fx.As(new(shared.InvitationRepository)))), fx.Provide(fx.Annotate(NewExternalUserRepository, fx.As(new(shared.ExternalUserRepository)))), fx.Provide(fx.Annotate(NewComponentProjectRepository, fx.As(new(shared.ComponentProjectRepository)))), fx.Provide(fx.Annotate(NewGitLabIntegrationRepository, fx.As(new(shared.GitlabIntegrationRepository)))), fx.Provide(fx.Annotate(NewGitlabOauth2TokenRepository, fx.As(new(shared.GitLabOauth2TokenRepository)))), fx.Provide(fx.Annotate(NewAggregatedVulnRepository, fx.As(new(shared.VulnRepository)))), fx.Provide(fx.Annotate(NewGithubAppInstallationRepository, fx.As(new(shared.GithubAppInstallationRepository)))), fx.Provide(fx.Annotate(NewJiraIntegrationRepository, fx.As(new(shared.JiraIntegrationRepository)))), fx.Provide(fx.Annotate(NewCveRelationshipRepository, fx.As(new(shared.CVERelationshipRepository)))), fx.Provide(fx.Annotate(NewVEXRuleRepository, fx.As(new(shared.VEXRuleRepository)))), fx.Provide(fx.Annotate(NewExternalReferenceRepository, fx.As(new(shared.ExternalReferenceRepository)))), fx.Provide(fx.Annotate(NewTrustedEntityRepository, fx.As(new(shared.TrustedEntityRepository)))), fx.Provide(fx.Annotate(NewDependencyProxyRepository, fx.As(new(shared.DependencyProxySecretRepository)))), fx.Provide(fx.Annotate(NewAdminRepository, fx.As(new(shared.AdminRepository)))), fx.Provide(fx.Annotate(NewAdvisoryRepository, fx.As(new(shared.AdvisoryRepository)))), fx.Provide(fx.Annotate(NewCompliancePostureRepository, fx.As(new(shared.CompliancePostureRepository)))), fx.Provide(fx.Annotate(NewComplianceComponentRepository, fx.As(new(shared.ComplianceComponentRepository)))), fx.Provide(fx.Annotate(NewUpstreamVEXRuleRepository, fx.As(new(shared.UpstreamVEXRuleRepository)))), fx.Provide(fx.Annotate(NewVEXRuleRecommendationRepository, fx.As(new(shared.VEXRuleRecommendationRepository)))), )
Module provides all repository constructors as their interfaces
Functions ¶
func BatchedVersionPredicate ¶ added in v1.12.0
func BatchedVersionPredicate(interpretation normalize.VersionInterpretationType) string
BatchedVersionPredicate expresses the same version matching rules as BuildQueryBasedOnMatchContext, but against a version coming from a joined relation instead of a bound parameter, so that many purls can be matched in one round trip. Keep the two in sync.
The returned SQL references the affected components as "ac" and the joined candidates as "q" (with a text column "version"). An empty string means the mode carries no SQL-expressible version predicate: EcosystemSpecificVersion has to be narrowed in Go by the caller.
func BuildQualifierQuery ¶
func BuildQualifierQuery(db *gorm.DB, qualifiers packageurl.Qualifiers, namespace string) *gorm.DB
BuildQualifierQuery creates the database query for qualifier matching
func NewArtifactRepository ¶
func NewAssetRepository ¶
func NewAssetVersionRepository ¶
func NewAssetVersionRepository(db *gorm.DB, synchronizer utils.FireAndForgetSynchronizer) *assetVersionRepository
func NewCVERepository ¶
func NewCWERepository ¶
func NewComponentRepository ¶
func NewConfigRepository ¶
func NewDependencyProxyRepository ¶ added in v1.3.0
func NewExploitRepository ¶
func NewExternalReferenceRepository ¶
func NewExternalReferenceRepository(db *gorm.DB) shared.ExternalReferenceRepository
func NewGitLabIntegrationRepository ¶
func NewGitLabIntegrationRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *gitlabIntegrationRepository
func NewGitlabOauth2TokenRepository ¶
func NewGitlabOauth2TokenRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *gitlabOauth2TokenRepository
func NewInTotoLinkRepository ¶
func NewJiraIntegrationRepository ¶
func NewJiraIntegrationRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *jiraIntegrationRepository
func NewOrgRepository ¶
func NewPATRepository ¶
func NewPolicyRepository ¶
func NewProjectRepository ¶
func NewReleaseRepository ¶
func NewStatisticsRepository ¶
func NewTrustedEntityRepository ¶ added in v1.2.0
func NewUpstreamVEXRuleRepository ¶ added in v1.12.0
func NewVEXRuleRecommendationRepository ¶ added in v1.12.0
func NewVEXRuleRepository ¶
func NewVulnEventRepository ¶
func NewWebhookRepository ¶
func NewWebhookRepository(db *gorm.DB, encryptionService shared.DBEncryptionService) *webhookRepository
func QualifierEcosystemPattern ¶ added in v1.12.0
func QualifierEcosystemPattern(qualifiers packageurl.Qualifiers, namespace string) string
QualifierEcosystemPattern derives the `ecosystem LIKE ...` pattern implied by a purl's distro qualifier, or "" if the purl carries no usable distro. Purl qualifier keys are unique, so there is at most one distro to look at.
BuildQualifierQuery turns the pattern into a where clause; the batched lookup in vulndb/scan instead groups purls by it, so that purls sharing a distro can be matched in one query.
Types ¶
type AdminRepository ¶ added in v1.6.1
type AdminRepository struct {
// contains filtered or unexported fields
}
func NewAdminRepository ¶ added in v1.6.1
func NewAdminRepository(db *gorm.DB) AdminRepository
func (AdminRepository) GetAllExternalEntityOrganizations ¶ added in v1.6.1
type AdvisoryRepository ¶ added in v1.10.0
type AdvisoryRepository struct {
utils.Repository[int64, models.Advisory, *gorm.DB]
// contains filtered or unexported fields
}
func NewAdvisoryRepository ¶ added in v1.10.0
func NewAdvisoryRepository(db *gorm.DB) *AdvisoryRepository
func (*AdvisoryRepository) GetAllAdvisoriesByAssetID ¶ added in v1.10.0
func (*AdvisoryRepository) ReadAdvisory ¶ added in v1.10.0
type AggregatedVulnRepository ¶
type AggregatedVulnRepository struct {
// contains filtered or unexported fields
}
func NewAggregatedVulnRepository ¶
func NewAggregatedVulnRepository(db *gorm.DB) *AggregatedVulnRepository
func (AggregatedVulnRepository) ApplyAndSave ¶
func (AggregatedVulnRepository) FindByTicketID ¶
func (AggregatedVulnRepository) GetOrgFromVuln ¶
func (AggregatedVulnRepository) Transaction ¶
type ComplianceComponentRepository ¶ added in v1.10.0
type ComplianceComponentRepository struct {
// contains filtered or unexported fields
}
func NewComplianceComponentRepository ¶ added in v1.10.0
func NewComplianceComponentRepository(db *gorm.DB) *ComplianceComponentRepository
func (*ComplianceComponentRepository) CreateStatement ¶ added in v1.10.0
func (r *ComplianceComponentRepository) CreateStatement(ctx context.Context, tx *gorm.DB, statement models.ComplianceComponentImplementsControlStatement) (*models.ComplianceComponentImplementsControlStatement, error)
func (*ComplianceComponentRepository) DeleteStatement ¶ added in v1.10.0
func (r *ComplianceComponentRepository) DeleteStatement(ctx context.Context, tx *gorm.DB, statementID uuid.UUID) (*models.ComplianceComponentImplementsControlStatement, error)
func (*ComplianceComponentRepository) GetDetails ¶ added in v1.10.0
func (r *ComplianceComponentRepository) GetDetails(ctx context.Context, tx *gorm.DB, id uuid.UUID) (*models.ComplianceComponent, error)
func (*ComplianceComponentRepository) ListAll ¶ added in v1.10.0
func (r *ComplianceComponentRepository) ListAll(ctx context.Context, tx *gorm.DB, filter []shared.FilterQuery) ([]models.ComplianceComponent, error)
func (*ComplianceComponentRepository) UpdateStatement ¶ added in v1.10.0
type CompliancePostureRepository ¶ added in v1.10.0
type CompliancePostureRepository struct {
utils.Repository[uuid.UUID, models.CompliancePosture, *gorm.DB]
// contains filtered or unexported fields
}
func NewCompliancePostureRepository ¶ added in v1.10.0
func NewCompliancePostureRepository(db *gorm.DB) *CompliancePostureRepository
func (*CompliancePostureRepository) ApplyAndSave ¶ added in v1.10.0
func (r *CompliancePostureRepository) ApplyAndSave(ctx context.Context, tx *gorm.DB, posture *models.CompliancePosture, ev *models.VulnEvent) error
func (*CompliancePostureRepository) FindOrCreate ¶ added in v1.10.0
func (r *CompliancePostureRepository) FindOrCreate(ctx context.Context, tx *gorm.DB, posture models.CompliancePosture) (*models.CompliancePosture, error)
func (*CompliancePostureRepository) GetAllControls ¶ added in v1.10.0
func (*CompliancePostureRepository) GetForAllControlsPaged ¶ added in v1.10.0
func (r *CompliancePostureRepository) GetForAllControlsPaged(ctx context.Context, tx *gorm.DB, assetVersionName *string, assetID *uuid.UUID, projectID *uuid.UUID, orgID uuid.UUID, pageInfo shared.PageInfo, search string, filter []shared.FilterQuery, sort []shared.SortQuery) (shared.Paged[dtos.CompliancePostureWithControlDTO], error)
func (*CompliancePostureRepository) GetForControl ¶ added in v1.10.0
func (*CompliancePostureRepository) GetStatsForAllControls ¶ added in v1.10.0
type FrameworkControlRepository ¶ added in v1.10.0
type FrameworkControlRepository struct {
utils.Repository[uuid.UUID, models.FrameworkControl, *gorm.DB]
// contains filtered or unexported fields
}
func NewFrameworkControlRepository ¶ added in v1.10.0
func NewFrameworkControlRepository(db *gorm.DB) *FrameworkControlRepository
func (*FrameworkControlRepository) GetAll ¶ added in v1.10.0
func (r *FrameworkControlRepository) GetAll(ctx context.Context, tx *gorm.DB, framework *string) ([]models.FrameworkControl, error)
func (*FrameworkControlRepository) ListFrameworkControls ¶ added in v1.10.0
func (r *FrameworkControlRepository) ListFrameworkControls(ctx context.Context, tx *gorm.DB) ([]string, error)
ListFrameworkControls returns the unique set of framework names
type GormRepository ¶
type GormRepository[ID comparable, T utils.Tabler] struct { // contains filtered or unexported fields }
func (*GormRepository[ID, T]) Begin ¶
func (g *GormRepository[ID, T]) Begin(ctx context.Context) *gorm.DB
func (*GormRepository[ID, T]) CleanupOrphanedRecords ¶ added in v1.2.0
func (g *GormRepository[ID, T]) CleanupOrphanedRecords(ctx context.Context) error
func (*GormRepository[ID, T]) CreateBatch ¶
func (*GormRepository[ID, T]) DeleteBatch ¶
func (*GormRepository[ID, T]) SaveBatchBestEffort ¶
func (g *GormRepository[ID, T]) SaveBatchBestEffort( ctx context.Context, tx *gorm.DB, ts []T, ) error
it does not save any associations, so it is the caller's responsibility to save them separately if needed
func (*GormRepository[ID, T]) Transaction ¶
type InvitationRepository ¶
type InvitationRepository struct {
utils.Repository[uuid.UUID, models.Invitation, *gorm.DB]
// contains filtered or unexported fields
}
func NewInvitationRepository ¶
func NewInvitationRepository(db *gorm.DB) *InvitationRepository
func (*InvitationRepository) FindByCode ¶
func (g *InvitationRepository) FindByCode(ctx context.Context, tx *gorm.DB, code string) (models.Invitation, error)
func (*InvitationRepository) FindByOrgID ¶ added in v1.9.0
func (g *InvitationRepository) FindByOrgID(ctx context.Context, tx *gorm.DB, orgID string) ([]models.Invitation, error)
func (*InvitationRepository) Save ¶
func (g *InvitationRepository) Save(ctx context.Context, tx *gorm.DB, invitation *models.Invitation) error
type LicenseRiskRepository ¶
type LicenseRiskRepository struct {
utils.Repository[uuid.UUID, models.LicenseRisk, *gorm.DB]
// contains filtered or unexported fields
}
func NewLicenseRiskRepository ¶
func NewLicenseRiskRepository(db *gorm.DB) *LicenseRiskRepository
func (*LicenseRiskRepository) ApplyAndSave ¶
func (repository *LicenseRiskRepository) ApplyAndSave(ctx context.Context, tx *gorm.DB, licenseRisk *models.LicenseRisk, vulnEvent *models.VulnEvent) error
func (*LicenseRiskRepository) DeleteByComponentPurl ¶
func (repository *LicenseRiskRepository) DeleteByComponentPurl(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, assetVersionName string, pURL packageurl.PackageURL) error
func (*LicenseRiskRepository) GetAllLicenseRisksForAssetVersion ¶
func (*LicenseRiskRepository) GetAllLicenseRisksForAssetVersionPaged ¶
func (*LicenseRiskRepository) GetAllOverwrittenLicensesForAssetVersion ¶
func (*LicenseRiskRepository) GetByAssetID ¶
func (repository *LicenseRiskRepository) GetByAssetID(ctx context.Context, tx *gorm.DB, assetID uuid.UUID) ([]models.LicenseRisk, error)
func (*LicenseRiskRepository) GetLicenseRisksByOtherAssetVersions ¶
func (*LicenseRiskRepository) ListByArtifactName ¶
func (*LicenseRiskRepository) MaybeGetLicenseOverwriteForComponent ¶
func (repository *LicenseRiskRepository) MaybeGetLicenseOverwriteForComponent(ctx context.Context, tx *gorm.DB, assetID uuid.UUID, assetVersionName string, pURL packageurl.PackageURL) (models.LicenseRisk, error)
type MaliciousPackageRepository ¶
type MaliciousPackageRepository struct {
// contains filtered or unexported fields
}
func NewMaliciousPackageRepository ¶
func NewMaliciousPackageRepository(db *gorm.DB) *MaliciousPackageRepository
func (*MaliciousPackageRepository) GetMaliciousAffectedComponents ¶
func (r *MaliciousPackageRepository) GetMaliciousAffectedComponents(ctx context.Context, tx *gorm.DB, purl packageurl.PackageURL) ([]models.MaliciousAffectedComponent, error)
GetMaliciousAffectedComponents finds malicious packages for a given purl (similar to GetAffectedComponents)
func (*MaliciousPackageRepository) GetMaliciousPackageByID ¶ added in v1.4.0
func (r *MaliciousPackageRepository) GetMaliciousPackageByID(ctx context.Context, tx *gorm.DB, id string) (models.MaliciousPackage, error)
type VulnerabilityRepository ¶
type VulnerabilityRepository[T utils.Tabler] struct { utils.Repository[uuid.UUID, T, *gorm.DB] // contains filtered or unexported fields }
func NewVulnerabilityRepository ¶
func NewVulnerabilityRepository[T utils.Tabler](db *gorm.DB) *VulnerabilityRepository[T]
func (*VulnerabilityRepository[T]) FindByTicketID ¶
func (*VulnerabilityRepository[T]) GetAllByAssetIDAndState ¶
func (*VulnerabilityRepository[T]) GetAllOpenVulnsByAssetVersionNameAndAssetID ¶
func (*VulnerabilityRepository[T]) GetAllVulnsByAssetID ¶
func (*VulnerabilityRepository[T]) GetByAssetID ¶
Source Files
¶
- admin_repository.go
- advisory_repository.go
- affected_component_repository.go
- artifact_repository.go
- artifact_risk_history_repository.go
- asset_repository.go
- asset_version_repository.go
- attestation_repository.go
- compliance_component_repository.go
- compliance_posture_repository.go
- component_project_repository.go
- component_repository.go
- config_repository.go
- cve_relationship_repository.go
- cve_repository.go
- cwe_repository.go
- dependency_proxy_secret_repository.go
- dependency_vuln_repository.go
- exploit_repository.go
- external_reference_repository.go
- external_user_repository.go
- first_party_vuln_repository.go
- framework_control_repository.go
- github_app_installation_repository.go
- gitlab_integration_repository.go
- gorm_repository.go
- intoto_link_repository.go
- invitation_repository.go
- jira_integration_repository.go
- license_risk_repository.go
- malicious_package_repository.go
- org_repository.go
- pat_repository.go
- policy_repository.go
- project_repository.go
- providers.go
- purl_matcher.go
- release_repository.go
- slugs.go
- statistics_repository.go
- supply_chain_repository.go
- trusted_entities_repository.go
- vex_rule_repository.go
- vulnerability_repository.go
- vulnevent_repository.go
- webhook_repository.go