models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultCleanupCron = "0 2 * * *"

DefaultCleanupCron is the schedule applied when a policy has none (daily at 02:00 UTC).

Variables

View Source
var ErrInvalidCleanupPolicy = errors.New("invalid cleanup policy")

ErrInvalidCleanupPolicy is wrapped by every CleanupPolicy.Validate error.

Functions

This section is empty.

Types

type AIAnalysis

type AIAnalysis struct {
	ID                    string    `json:"id"`
	RepositoryID          string    `json:"repository_id"`
	ArtifactID            string    `json:"artifact_id"`     // generic reference (component ID, npm version ID, etc.)
	ArtifactFormat        string    `json:"artifact_format"` // "npm", "maven", "deb", "rpm", "helm", "pypi", etc.
	ArtifactName          string    `json:"artifact_name"`
	ArtifactVersion       string    `json:"artifact_version"`
	Summary               string    `json:"summary"`
	Tags                  []string  `json:"tags"`           // stored as JSONB
	LicenseStatus         string    `json:"license_status"` // "SAFE", "REVIEW_REQUIRED", "UNKNOWN"
	LicenseName           string    `json:"license_name"`
	SecurityNotes         string    `json:"security_notes"`
	QuarantineRecommended bool      `json:"quarantine_recommended"`
	Status                string    `json:"status"` // "pending", "processing", "completed", "failed"
	ErrorMessage          string    `json:"error_message"`
	ModelUsed             string    `json:"model_used"`
	PromptTokens          int       `json:"prompt_tokens"`
	CompletionTokens      int       `json:"completion_tokens"`
	CreatedAt             time.Time `json:"created_at"`
	UpdatedAt             time.Time `json:"updated_at"`
}

AIAnalysis stores the AI-generated analysis for an artifact.

type AuditLog

type AuditLog struct {
	ID           string          `db:"id"`
	Action       string          `db:"action"`
	OrgID        *string         `db:"org_id"`
	RepositoryID *string         `db:"repository_id"`
	ActorID      *string         `db:"actor_id"`
	ActorType    *string         `db:"actor_type"`
	DetailsJSON  json.RawMessage `db:"details_json"`
	ResourceType *string         `db:"resource_type"`
	ResourceID   *string         `db:"resource_id"`
	IPAddress    *string         `db:"ip_address"`
	CreatedAt    time.Time       `db:"created_at"`
}

AuditLog mirrors the audit_logs table schema: structured columns for compliance-grade auditing.

type BackupJob

type BackupJob struct {
	ID           string
	Status       string // "pending", "running", "completed", "failed"
	Type         string // "full", "metadata-only"
	StoragePath  string
	SizeBytes    int64
	ErrorMessage string
	StartedAt    *time.Time
	CompletedAt  *time.Time
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type BundlePromotion

type BundlePromotion struct {
	ID           string          `db:"id"`
	BundleID     string          `db:"bundle_id"`
	FromStage    *string         `db:"from_stage"`
	ToStage      string          `db:"to_stage"`
	TargetRepoID string          `db:"target_repo_id"`
	Status       PromotionStatus `db:"status"`
	PromotedBy   string          `db:"promoted_by"`
	Notes        string          `db:"notes"`
	ErrorMessage *string         `db:"error_message"`
	ItemCount    int             `db:"item_count"`
	StartedAt    time.Time       `db:"started_at"`
	CompletedAt  *time.Time      `db:"completed_at"`
}

type BundleState

type BundleState string
const (
	BundleStateDraft    BundleState = "draft"
	BundleStateSealed   BundleState = "sealed"
	BundleStateArchived BundleState = "archived"
)

type CargoCrate

type CargoCrate struct {
	ID            string
	RepositoryID  string
	Name          string
	Version       string
	Description   string
	Homepage      string
	Documentation string
	Repository    string
	License       string
	Keywords      []string
	Categories    []string
	Authors       []string
	Readme        string
	MetadataJSON  []byte
	BlobKey       string
	Checksum      string
	Yanked        bool
	DownloadCount int
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

type ClaimMapping

type ClaimMapping struct {
	UsernameClaim string `json:"username_claim"`
	EmailClaim    string `json:"email_claim"`
	NameClaim     string `json:"name_claim"`
	GroupsClaim   string `json:"groups_claim"`
}

type CleanupPolicy

type CleanupPolicy struct {
	ID                      string     `json:"id"`
	RepositoryID            string     `json:"repository_id"`
	Name                    string     `json:"name"`
	Enabled                 bool       `json:"enabled"`
	KeepLastN               *int       `json:"keep_last_n"`
	KeepSinceDays           *int       `json:"keep_since_days"`
	KeepDownloadedSinceDays *int       `json:"keep_downloaded_since_days"`
	NamePattern             string     `json:"name_pattern"`
	ScheduleCron            string     `json:"schedule_cron"`
	LastRunAt               *time.Time `json:"last_run_at"`
	LastRunDeleted          *int       `json:"last_run_deleted"`
	LastRunError            string     `json:"last_run_error"`
	CreatedAt               time.Time  `json:"created_at"`
	UpdatedAt               time.Time  `json:"updated_at"`
}

func (*CleanupPolicy) Validate added in v0.2.0

func (p *CleanupPolicy) Validate() error

Validate checks that the policy can safely be executed: at least one retention criterion, strictly positive values (zero or negative values would select every artifact for deletion), a compilable name pattern and a valid cron schedule. keep_downloaded_since_days is rejected because download timestamps are not tracked, so it could never be honoured.

type Component

type Component struct {
	ID            string
	RepositoryID  string
	ArtifactID    string
	SHA256        string
	Format        string
	Name          string
	Version       string
	Release       string
	Epoch         int
	Arch          string
	Summary       string
	Description   string
	License       string
	URL           string
	Vendor        string
	Group         string
	Packager      string
	SourceRPM     string
	BuildHost     string
	BuildTime     int64
	PackageSize   int64
	InstalledSize int64
	ArchiveSize   int64
	Filename      string
	// HeaderStart/HeaderEnd are the RPM header byte range (rpm packages only).
	HeaderStart int64
	HeaderEnd   int64
	// RPMExtra is JSON-encoded dependency/file/changelog data (rpm packages only).
	RPMExtra  []byte
	CreatedAt time.Time
	UpdatedAt time.Time
}

type ConanPackage

type ConanPackage struct {
	ID             string
	RepositoryID   string
	Name           string
	Version        string
	UserChannel    string
	RecipeRevision string
	BlobKey        string
	ConanFile      string
	ConanInfo      string
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type CondaPackage

type CondaPackage struct {
	ID           string
	RepositoryID string
	Name         string
	Version      string
	BuildString  string
	Platform     string
	Depends      []string
	BlobKey      string
	SizeBytes    int64
	SHA256       string
	MD5          string
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type DebPackage

type DebPackage struct {
	ID             string
	RepositoryID   string
	DistributionID string
	ComponentID    string
	BlobID         string
	Name           string
	Version        string
	Arch           string
	Summary        string
	Description    string
	License        string
	Maintainer     string
	Homepage       string
	Filename       string
	InstalledSize  int64
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

DebPackage represents a Debian package stored in the deb_packages table.

type DebPackageEntry added in v0.2.0

type DebPackageEntry struct {
	ID             string
	Name           string
	Version        string
	Arch           string
	Filename       string
	DistributionID string
	Distribution   string
	ComponentName  string
	SHA256         string
	Size           int64
	InstalledSize  int64
	ControlFields  map[string]string
}

DebPackageEntry is a deb package joined with everything needed to render a Packages stanza: blob checksum/size, distribution/component names and the stored control fields.

type DebianArchitecture

type DebianArchitecture struct {
	ID             string
	DistributionID string
	Name           string // e.g., "amd64", "i386", "arm64"
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

DebianArchitecture represents a supported architecture.

type DebianComponent

type DebianComponent struct {
	ID             string
	DistributionID string
	Name           string // e.g., "main", "universe", "restricted"
	Description    string
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

DebianComponent represents a component within a distribution (main, universe, etc.)

type DebianDistribution

type DebianDistribution struct {
	ID           string
	RepositoryID string
	Name         string // e.g., "focal", "jammy"
	Description  string
	Codename     string // e.g., "20.04", "22.04"
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

DebianDistribution represents a Debian distribution (e.g., focal, jammy).

type DockerBlob

type DockerBlob struct {
	ID           string    `db:"id"`
	RepositoryID string    `db:"repository_id"`
	Digest       string    `db:"digest"` // sha256:<hex>
	MediaType    string    `db:"media_type"`
	Size         int64     `db:"size"`
	BlobSHA256   string    `db:"blob_sha256"` // blobstore key
	CreatedAt    time.Time `db:"created_at"`
}

DockerBlob represents a content-addressable blob (layer or config).

type DockerManifest

type DockerManifest struct {
	ID            string `db:"id"`
	RepositoryID  string `db:"repository_id"`
	Digest        string `db:"digest"` // sha256:<hex>
	MediaType     string `db:"media_type"`
	BlobID        string `db:"blob_id"`
	Size          int64  `db:"size"`
	SubjectDigest string `db:"subject_digest"` // OCI referrers
	// BlobSHA256 is populated only by ListDockerManifestsByRepo (a JOIN with
	// blobs, used for backup export) since BlobID above is a live blobs.id
	// UUID that doesn't survive a restore into a fresh DB.
	BlobSHA256 string    `db:"-"`
	CreatedAt  time.Time `db:"created_at"`
	UpdatedAt  time.Time `db:"updated_at"`
}

DockerManifest stores an OCI or Docker v2 image manifest.

type DockerRepository

type DockerRepository struct {
	ID           string    `db:"id"`
	RepositoryID string    `db:"repository_id"`
	CreatedAt    time.Time `db:"created_at"`
}

DockerRepository holds Docker-specific config for a repository.

type DockerTag

type DockerTag struct {
	ID             string    `db:"id"`
	RepositoryID   string    `db:"repository_id"`
	Name           string    `db:"name"`
	ManifestDigest string    `db:"manifest_digest"`
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
}

DockerTag is a named reference to a manifest.

type DockerUpload

type DockerUpload struct {
	ID           string    `db:"id"`
	RepositoryID string    `db:"repository_id"`
	UploadUUID   string    `db:"upload_uuid"`
	Offset       int64     `db:"offset"`
	CreatedAt    time.Time `db:"created_at"`
	UpdatedAt    time.Time `db:"updated_at"`
}

DockerUpload tracks an in-progress chunked blob upload.

type GoModule

type GoModule struct {
	ID           string
	RepositoryID string
	ModulePath   string
	Version      string
	GoModContent string
	ZipBlobKey   string
	ModBlobKey   string
	ZipSizeBytes int64
	ZipHash      string
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type Group

type Group struct {
	ID          string
	Name        string
	Description *string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type HelmChart

type HelmChart struct {
	ID           string
	RepositoryID string
	Name         string
	Version      string
	AppVersion   string
	Description  string
	Keywords     []string
	Home         string
	Sources      []string
	Maintainers  []map[string]string // [{name, email, url}]
	Icon         string
	APIVersion   string
	Type         string
	BlobKey      string
	Digest       string
	SizeBytes    int64
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type IvyArtifact

type IvyArtifact struct {
	ID           string
	RepositoryID string
	Organisation string
	Module       string
	Revision     string
	ArtifactName string
	ArtifactType string
	ArtifactExt  string
	BlobKey      string
	SizeBytes    int64
	SHA256       string
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type LicensePolicy

type LicensePolicy struct {
	ID              string
	RepositoryID    *string // nil = global policy
	Name            string
	Description     string
	Action          string // "warn", "block", "allow"
	AllowedLicenses []string
	DeniedLicenses  []string
	Enabled         bool
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

LicensePolicy represents a license compliance policy.

type LicenseScanResult

type LicenseScanResult struct {
	ID              string
	RepositoryID    string
	ArtifactID      string
	Licenses        []string
	SPDXExpressions []string
	ScanStatus      string // "pending", "completed", "failed"
	ScanError       string
	ScannedAt       *time.Time
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

LicenseScanResult represents a license scan result for an artifact.

type MavenArtifact

type MavenArtifact struct {
	ID                  string
	RepositoryID        string
	BlobID              string
	GroupID             string
	ArtifactCoord       string
	Version             string
	Classifier          string
	Extension           string
	SnapshotTimestamp   string
	SnapshotBuildNumber int
	IsSnapshot          bool
	RepoPath            string
	MD5                 string
	SHA1                string
	SHA256              string
	SHA512              string
	// BlobSHA256/BlobSizeBytes are populated only by ListMavenArtifactsByRepo
	// (a JOIN with blobs, used for backup export) since BlobID above is a
	// live blobs.id UUID that doesn't survive a restore into a fresh DB.
	BlobSHA256    string
	BlobSizeBytes int64
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

func (*MavenArtifact) Coordinate

func (m *MavenArtifact) Coordinate() pkgmaven.Coordinate

type NPMDistTag

type NPMDistTag struct {
	ID        string
	PackageID string
	Tag       string
	Version   string
	UpdatedAt time.Time
}

type NPMPackage

type NPMPackage struct {
	ID             string
	RepositoryID   string
	Scope          string
	Name           string
	FullName       string
	LatestVersion  string
	PackumentStale bool
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type NPMVersion

type NPMVersion struct {
	ID              string
	PackageID       string
	Version         string
	ManifestJSON    []byte
	Integrity       string
	Shasum          string
	BlobID          string
	TarballFilename string
	// BlobSHA256/BlobSizeBytes are populated only by ListNPMVersionsByRepo
	// (a JOIN with blobs, used for backup export) since BlobID above is a
	// live blobs.id UUID that doesn't survive a restore into a fresh DB.
	BlobSHA256    string
	BlobSizeBytes int64
	CreatedAt     time.Time
}

type NuGetPackage

type NuGetPackage struct {
	ID                       string
	RepositoryID             string
	PackageID                string
	Version                  string
	Title                    string
	Description              string
	Summary                  string
	Authors                  string
	Owners                   string
	Tags                     string
	ProjectURL               string
	LicenseURL               string
	IconURL                  string
	RequireLicenseAcceptance bool
	IsPrerelease             bool
	MinClientVersion         string
	BlobKey                  string
	PackageHash              string
	PackageHashAlgorithm     string
	PackageSize              int64
	DownloadCount            int
	CreatedAt                time.Time
	UpdatedAt                time.Time
}

type OIDCConfig

type OIDCConfig struct {
	Issuer        string   `json:"issuer"`
	ClientID      string   `json:"client_id"`
	ClientSecret  string   `json:"client_secret"`
	Scopes        []string `json:"scopes"`
	UsernameClaim string   `json:"username_claim"`
	EmailClaim    string   `json:"email_claim"`
	NameClaim     string   `json:"name_claim"`
	GroupsClaim   string   `json:"groups_claim"`
}

type OrgMember

type OrgMember struct {
	ID        string
	OrgID     string
	UserID    string
	Role      string // "owner", "admin", "member"
	CreatedAt time.Time
}

type Organization

type Organization struct {
	ID          string
	Name        string
	DisplayName *string
	Description *string
	OwnerID     *string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type PackageDelta

type PackageDelta struct {
	ID           string
	RepositoryID string
	// Source package (the version the client already has)
	FromSHA256   string
	FromFilename string
	// Target package (the version the client wants)
	ToSHA256   string
	ToFilename string
	// The delta blob (stored in BlobStore keyed by DeltaSHA256)
	DeltaSHA256 string
	DeltaSize   int64
	// Format: "deb" or "rpm"
	Format    string
	CreatedAt time.Time
}

PackageDelta represents a pre-computed bsdiff patch between two package versions. Clients that already have the "from" version can download the delta instead of the full package, saving significant bandwidth for incremental updates.

type PermissionAssignment

type PermissionAssignment struct {
	ID                 string
	PermissionTargetID string
	PrincipalType      string
	PrincipalID        string
	CreatedAt          time.Time
}

type PermissionTarget

type PermissionTarget struct {
	ID               string
	Name             string
	RepositoryFilter string
	PathPattern      string
	Actions          []string
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

type PipelineStage

type PipelineStage struct {
	Name         string `json:"name"`
	RepositoryID string `json:"repo_id"`
}

PipelineStage is one element in a PromotionPipeline.Stages slice.

type PromotionPipeline

type PromotionPipeline struct {
	ID          string          `db:"id"`
	Name        string          `db:"name"`
	Description string          `db:"description"`
	Stages      []PipelineStage `db:"-"`
	StagesRaw   json.RawMessage `db:"stages"`
	CreatedBy   string          `db:"created_by"`
	CreatedAt   time.Time       `db:"created_at"`
	UpdatedAt   time.Time       `db:"updated_at"`
}

type PromotionStatus

type PromotionStatus string
const (
	PromotionStatusInProgress PromotionStatus = "in_progress"
	PromotionStatusSuccess    PromotionStatus = "success"
	PromotionStatusFailed     PromotionStatus = "failed"
)

type ProxyCacheEntry

type ProxyCacheEntry struct {
	ID           string
	RepositoryID string
	CacheKey     string
	BlobKey      string
	ContentType  string
	StatusCode   int
	SizeBytes    int64
	HitCount     int
	LastHitAt    *time.Time
	ExpiresAt    time.Time
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type PyPIPackage

type PyPIPackage struct {
	ID             string
	RepositoryID   string
	Name           string
	Version        string
	Filename       string
	PackageType    string
	PythonVersion  string
	RequiresPython string
	Summary        string
	Author         string
	AuthorEmail    string
	License        string
	Keywords       string
	Classifiers    []string
	BlobKey        string
	MD5Digest      string
	SHA256Digest   string
	SizeBytes      int64
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type RPMRepo

type RPMRepo struct {
	ID                    string
	RepositoryID          string
	BaseArch              string
	MetadataStale         bool
	SigningKeyID          string
	SigningKeyFingerprint string
	CreatedAt             time.Time
	UpdatedAt             time.Time
}

type RawArtifact

type RawArtifact struct {
	ID           string
	RepositoryID string
	Path         string
	ContentType  string
	BlobID       string
	SizeBytes    int64
	SHA256       string
	BlobKey      string
	Metadata     map[string]any
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

RawArtifact mirrors the raw_artifacts table. BlobID is UUID FK to blobs table; SizeBytes is for response display.

type ReleaseBundle

type ReleaseBundle struct {
	ID           string      `db:"id"`
	Name         string      `db:"name"`
	Version      string      `db:"version"`
	Description  string      `db:"description"`
	State        BundleState `db:"state"`
	PipelineID   *string     `db:"pipeline_id"`
	CurrentStage *string     `db:"current_stage"`
	CreatedBy    string      `db:"created_by"`
	SealedAt     *time.Time  `db:"sealed_at"`
	SealedBy     *string     `db:"sealed_by"`
	ArchivedAt   *time.Time  `db:"archived_at"`
	ArchivedBy   *string     `db:"archived_by"`
	GPGKeyID     *string     `db:"gpg_key_id"`
	GPGSignature *string     `db:"gpg_signature"`
	CreatedAt    time.Time   `db:"created_at"`
	UpdatedAt    time.Time   `db:"updated_at"`
}

func (*ReleaseBundle) IsMutable

func (b *ReleaseBundle) IsMutable() bool

IsMutable returns true only for draft bundles.

type ReleaseBundleItem

type ReleaseBundleItem struct {
	ID           string    `db:"id"`
	BundleID     string    `db:"bundle_id"`
	SourceRepoID string    `db:"source_repo_id"`
	ComponentID  *string   `db:"component_id"`
	SHA256       string    `db:"sha256"`
	ArtifactPath string    `db:"artifact_path"`
	Format       string    `db:"format"`
	SizeBytes    int64     `db:"size_bytes"`
	AddedBy      string    `db:"added_by"`
	AddedAt      time.Time `db:"added_at"`
}

type RepoMetadata

type RepoMetadata struct {
	ID            string
	RepositoryID  string
	Path          string
	BlobSHA256    string
	BlobSize      int64
	LastGenerated time.Time
}

type Repository

type Repository struct {
	ID                      string
	Name                    string
	Format                  string
	Description             string
	Public                  bool
	AllowFullUnpublish      bool
	RepoType                string // "hosted", "proxy", "group"
	UpstreamURL             string // proxy only
	UpstreamUsername        string // proxy only
	UpstreamPasswordEnc     string // proxy only — AES-256-GCM encrypted
	CacheTTLSeconds         int    // proxy only, default 3600
	NegativeCacheTTLSeconds int    // proxy only, default 60
	Blocked                 bool   // proxy only
	OrgID                   *string
	CreatedAt               time.Time
	UpdatedAt               time.Time
}

type RepositoryGroupMember

type RepositoryGroupMember struct {
	GroupRepoID  string
	MemberRepoID string
	Priority     int
	CreatedAt    time.Time
}

type RpmPackage

type RpmPackage struct {
	ID            string
	RepositoryID  string
	BlobID        string
	Name          string
	Version       string
	Release       string
	Epoch         int
	Arch          string
	Summary       string
	Description   string
	License       string
	URL           string
	Vendor        string
	GroupName     string
	Packager      string
	SourceRPM     string
	BuildHost     string
	BuildTime     *time.Time
	Filename      string
	PackageSize   int64
	InstalledSize int64
	ArchiveSize   int64
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

RpmPackage represents an RPM package stored in the rpm_packages table.

type RubyGem

type RubyGem struct {
	ID             string
	RepositoryID   string
	Name           string
	Version        string
	Platform       string
	Description    string
	Summary        string
	Homepage       string
	Authors        []string
	Licenses       []string
	Dependencies   []byte // JSON array
	MetadataJSON   []byte
	BlobKey        string
	ChecksumSHA256 string
	Yanked         bool
	DownloadCount  int
	Size           int64 // gem file size in bytes
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type SAMLConfig

type SAMLConfig struct {
	IDPMetadataURL    string `json:"idp_metadata_url"`
	IDPMetadataXML    string `json:"idp_metadata_xml"`
	UsernameAttribute string `json:"username_attribute"`
	EmailAttribute    string `json:"email_attribute"`
	NameAttribute     string `json:"name_attribute"`
	GroupsAttribute   string `json:"groups_attribute"`
}

type SBOMReport

type SBOMReport struct {
	ID             string
	RepositoryID   string
	ArtifactID     string
	Format         string // "cyclonedx" or "spdx"
	SpecVersion    string // "1.4" or "2.3"
	ContentType    string
	SBOMData       map[string]any // for JSON SBOMs (cyclonedx); populated by the API layer from the generator, not persisted directly
	SBOMText       string         // for text SBOMs (spdx); ditto
	BlobSHA256     string         // sha256 of the blob store object holding the raw SBOM bytes; "" if not (yet) persisted. Set by the caller before CreateSBOMReport; populated on reads via a JOIN with blobs.
	BlobSizeBytes  int64          // size of that blob; only meaningful together with BlobSHA256, used by CreateSBOMReport to upsert the blobs row
	ComponentCount int
	GeneratedAt    time.Time
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type SBTArtifact

type SBTArtifact struct {
	ID           string
	RepositoryID string
	GroupID      string
	ArtifactID   string
	Version      string
	ScalaVersion string
	Filename     string
	BlobKey      string
	SizeBytes    int64
	SHA256       string
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type SSOProvider

type SSOProvider struct {
	ID                 string            `json:"id,omitempty"`
	Slug               string            `json:"slug"`
	Kind               string            `json:"kind"`
	DisplayName        string            `json:"display_name"`
	Enabled            bool              `json:"enabled"`
	OIDCConfig         json.RawMessage   `json:"oidc_config,omitempty"`
	SAMLConfig         json.RawMessage   `json:"saml_config,omitempty"`
	ClaimMapping       json.RawMessage   `json:"claim_mapping,omitempty"`
	GroupMapping       map[string]string `json:"group_mapping,omitempty"`
	PermissionMapping  map[string]string `json:"permission_mapping,omitempty"`
	AutoProvisionUsers bool              `json:"auto_provision_users"`
	LinkByEmail        bool              `json:"link_by_email"`
	CreatedAt          time.Time         `json:"created_at"`
	UpdatedAt          time.Time         `json:"updated_at"`
}

type SecretFinding

type SecretFinding struct {
	Type          string `json:"type"`
	Description   string `json:"description"`
	Severity      string `json:"severity"` // low, medium, high, critical
	RedactedValue string `json:"redacted_value"`
	LineHint      string `json:"line_hint"`
}

SecretFinding represents a single secret finding in a scan.

type SecretScanResult

type SecretScanResult struct {
	ID           string
	RepositoryID string
	ArtifactID   string
	ScanStatus   string // "pending", "completed", "failed", "clean", "flagged"
	Findings     []SecretFinding
	FindingCount int
	Quarantined  bool
	ScanError    string
	ScannedAt    *time.Time
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

SecretScanResult represents a secret scan result for an artifact.

type Session

type Session struct {
	ID         string
	UserID     string
	TokenHash  string
	IPAddress  *string
	UserAgent  *string
	ExpiresAt  time.Time
	CreatedAt  time.Time
	LastSeenAt time.Time
}

type StorageBackend

type StorageBackend struct {
	ID            string
	Name          string
	Kind          string // filesystem, s3, gcs, azure
	IsDefault     bool
	Config        []byte // JSON: type-specific configuration
	Status        string // ok, degraded, error, unknown
	StatusMessage *string
	LastCheckedAt *time.Time
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

StorageBackend represents a configured storage backend.

type StorageQuota

type StorageQuota struct {
	ID                   string
	RepositoryID         string
	MaxSizeBytes         int64
	MaxArtifactCount     int
	WarnThresholdPercent int
	CurrentSizeBytes     int64
	CurrentArtifactCount int
	CreatedAt            time.Time
	UpdatedAt            time.Time
}

func (*StorageQuota) IsExceeded

func (q *StorageQuota) IsExceeded() bool

func (*StorageQuota) UsagePercent

func (q *StorageQuota) UsagePercent() float64

type Token

type Token struct {
	ID         string
	UserID     string
	Name       string
	Kind       string
	TokenHash  string
	Scopes     []string
	ExpiresAt  *time.Time
	LastUsedAt *time.Time
	CreatedAt  time.Time
	RevokedAt  *time.Time
}

type User

type User struct {
	ID                 string
	Username           string
	Email              *string
	PasswordHash       *string
	FullName           *string
	Disabled           bool
	MustChangePassword bool
	LastLoginAt        *time.Time
	CreatedAt          time.Time
	UpdatedAt          time.Time
	ExternalID         *string
	ProviderSlug       *string
	SSOManagedGroups   bool
}

type UserGroup

type UserGroup struct {
	UserID  string
	GroupID string
}

type VulnScanResult

type VulnScanResult struct {
	ID              string
	RepositoryID    string
	ArtifactID      string
	PackageName     string
	PackageVersion  string
	Ecosystem       string
	Scanner         string // "osv", "trivy", "grype"
	ScanStatus      string // "pending", "scanning", "completed", "failed"
	Vulnerabilities []Vulnerability
	VulnCount       int
	CriticalCount   int
	HighCount       int
	MediumCount     int
	LowCount        int
	Quarantined     bool
	ScanError       string
	ScannedAt       *time.Time
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

VulnScanResult represents a vulnerability scan result for an artifact.

type Vulnerability

type Vulnerability struct {
	ID          string   `json:"id"` // CVE-2021-1234 or GHSA-xxxx
	Summary     string   `json:"summary"`
	Severity    string   `json:"severity"` // CRITICAL, HIGH, MEDIUM, LOW, UNKNOWN
	CVSS        float64  `json:"cvss"`
	FixedIn     string   `json:"fixed_in"` // version that fixes it
	References  []string `json:"references"`
	PublishedAt string   `json:"published_at"`
}

Vulnerability represents a single vulnerability finding.

type Webhook

type Webhook struct {
	ID             string    `json:"id"`
	RepositoryID   string    `json:"repository_id"` // empty = global
	Name           string    `json:"name"`
	URL            string    `json:"url"`
	SecretEnc      string    `json:"-"` // AES-256-GCM encrypted HMAC signing secret (internal/crypto); never serialised
	Enabled        bool      `json:"enabled"`
	Events         []string  `json:"events"` // ["artifact.uploaded", "artifact.deleted", "artifact.downloaded"]
	ContentType    string    `json:"content_type"`
	SSLVerify      bool      `json:"ssl_verify"`
	MaxRetries     int       `json:"max_retries"`
	TimeoutSeconds int       `json:"timeout_seconds"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type WebhookDelivery

type WebhookDelivery struct {
	ID             string         `json:"id"`
	WebhookID      string         `json:"webhook_id"`
	EventType      string         `json:"event_type"`
	Payload        map[string]any `json:"payload"`
	Status         string         `json:"status"` // "pending", "success", "failed"
	ResponseStatus int            `json:"response_status"`
	ResponseBody   string         `json:"response_body"`
	AttemptCount   int            `json:"attempt_count"`
	NextRetryAt    *time.Time     `json:"next_retry_at"`
	DeliveredAt    *time.Time     `json:"delivered_at"`
	CreatedAt      time.Time      `json:"created_at"`
	UpdatedAt      time.Time      `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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