responses

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 1 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

Overview

Package responses provides typed response structs for all API handler endpoints. They avoid ad-hoc map[string]interface{} payloads in the API handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityEntry added in v0.11.0

type ActivityEntry struct {
	ProjectActivityEntry

	// ActorName is the user, token owner or "system" behind the event ("" when unknown).
	ActorName string        `json:"actor_name"`
	Subject   *AuditSubject `json:"subject"`
}

ActivityEntry is a ProjectActivityEntry with the actor's and the subject's names resolved. It is the entry of the project and repository activity feeds.

type ActivityPage added in v0.11.0

type ActivityPage struct {
	Data       []ActivityEntry `json:"data"`
	PerPage    int             `json:"per_page"`
	HasMore    bool            `json:"has_more"`
	NextCursor string          `json:"next_cursor,omitempty"`
}

ActivityPage is GET /api/v1/projects/{project}/activity and GET /api/v1/repositories/{name}/activity: keyset paging only, no total. NextCursor is empty when HasMore is false.

type AdminTokenResponse

type AdminTokenResponse struct {
	TokenResponse

	UserID string `json:"user_id"`
	// Project, ProjectRole and CreatedBy are set for project tokens (CreatedBy
	// is the minting user's name); null for personal tokens.
	Project     *string `json:"project"`
	ProjectRole *string `json:"project_role"`
	CreatedBy   *string `json:"created_by"`
}

AdminTokenResponse extends TokenResponse with user_id for admin views.

type AttestationAttachResponse added in v0.8.0

type AttestationAttachResponse struct {
	ArtifactID    string `json:"artifact_id"`
	Kind          string `json:"kind"`
	PredicateType string `json:"predicate_type"`
	// Subject is the digest of the image manifest the attestation is attached to.
	Subject string `json:"subject"`
	// ArtifactType is the referrer's OCI artifactType.
	ArtifactType string `json:"artifact_type"`
	// ReferrerDigest is the digest of the referrer manifest.
	ReferrerDigest string `json:"referrer_digest"`
	// Created is false when an identical attestation was already attached.
	Created bool `json:"created"`
	// Replaced is the digest of the earlier attestation this one replaced.
	Replaced string `json:"replaced,omitempty"`
}

AttestationAttachResponse reports an attestation attached to a docker image as an OCI referrer.

type AttestationAttachSettingsResponse added in v0.8.0

type AttestationAttachSettingsResponse struct {
	Enabled bool `json:"enabled"`
}

AttestationAttachSettingsResponse is a repository's referrer-attach switch.

type AttestationKeyResponse added in v0.8.0

type AttestationKeyResponse struct {
	KeyID        string `json:"key_id"`
	Algorithm    string `json:"algorithm"`
	Source       string `json:"source"`
	PublicKeyPEM string `json:"public_key_pem"`
	PublicKeyURL string `json:"public_key_url"`
}

AttestationKeyResponse describes the key SBOM and VEX attestations are signed with.

type AuditEntryResponse

type AuditEntryResponse struct {
	ID        string         `json:"id"`
	Timestamp string         `json:"timestamp"`
	Actor     *string        `json:"actor"`
	Action    *string        `json:"action"`
	Target    *string        `json:"target"`
	Result    *string        `json:"result"`
	IP        *string        `json:"ip"`
	Details   map[string]any `json:"details"`
}

AuditEntryResponse represents an audit log entry.

type AuditSubject added in v0.11.0

type AuditSubject struct {
	// Kind is repository, package, project, user, group, token, bundle,
	// permission_target, gpg_key, sso_provider, setting, or the raw
	// resource_type of an event kind without a dedicated one.
	Kind    string  `json:"kind"`
	Name    *string `json:"name"`
	Version string  `json:"version,omitempty"`
	// Repository and Project name the repository and project the event belongs to.
	Repository string `json:"repository,omitempty"`
	Project    string `json:"project,omitempty"`
}

AuditSubject names what an audit event acted on, resolved server-side so clients do not look ids up. Name is null when the subject is gone and the event did not record its name.

type AvailabilityBatchRequest added in v0.24.0

type AvailabilityBatchRequest struct {
	Packages []AvailabilityQuery `json:"packages"`
}

AvailabilityBatchRequest is the body of POST /api/v1/repositories/{name}/availability.

type AvailabilityBatchResponse added in v0.24.0

type AvailabilityBatchResponse struct {
	Repository string                    `json:"repository"`
	Results    []AvailabilityBatchResult `json:"results"`
}

AvailabilityBatchResponse answers a batch availability request: one result per requested package version, in request order.

type AvailabilityBatchResult added in v0.24.0

type AvailabilityBatchResult struct {
	AvailabilityResponse

	Package string `json:"package"`
	Version string `json:"version"`
	// Status is "available", "held", "not_found" or "unknown" (a proxy whose
	// cached metadata cannot say whether the version exists).
	Status string `json:"status"`
	// Repository is the repository that decided: the repository asked, or for a
	// group the member that decides (the group itself when no member has the
	// version or the group is blocked).
	Repository string `json:"repository"`
}

AvailabilityBatchResult is the answer for one package version of a batch: the fields of the single-version answer plus the version it is about, a status and the repository that decided it.

type AvailabilityQuery added in v0.24.0

type AvailabilityQuery struct {
	Package string `json:"package"`
	Version string `json:"version"`
}

AvailabilityQuery is one package version of a batch availability request.

type AvailabilityReason added in v0.16.0

type AvailabilityReason struct {
	// Source is "min_age", "curation", "quarantine", "license_policy" or
	// "repository_blocked"; the batch answer adds "not_found" and "unknown".
	Source string `json:"source"`
	Detail string `json:"detail"`
	// Until is when a minimum-age hold ends (RFC 3339).
	Until string `json:"until,omitempty"`
	// RuleID is the curation rule that blocks the version; absent for a
	// version the allowlist does not list.
	RuleID string `json:"rule_id,omitempty"`
}

AvailabilityReason is one reason a package version is not available.

type AvailabilityResponse added in v0.16.0

type AvailabilityResponse struct {
	Available bool                 `json:"available"`
	Reasons   []AvailabilityReason `json:"reasons"`
	// PublishedAt is the publish time the upstream states (RFC 3339), when known.
	PublishedAt string `json:"published_at,omitempty"`
	// MinAge is "off" (no minimum age), "checked" or "unknown" (the repository
	// has a minimum age but the publish time is not known, so the version cannot
	// be held back).
	MinAge string `json:"min_age"`
}

AvailabilityResponse explains whether a package version can be fetched from a repository.

type BackupJobResponse

type BackupJobResponse struct {
	ID           string  `json:"id"`
	Status       string  `json:"status"`
	Type         string  `json:"type"`
	SizeBytes    int64   `json:"size_bytes"`
	CreatedAt    string  `json:"created_at"`
	UpdatedAt    string  `json:"updated_at"`
	ErrorMessage *string `json:"error_message"`
	StartedAt    *string `json:"started_at"`
	CompletedAt  *string `json:"completed_at"`
}

BackupJobResponse represents a backup job in API responses.

type CleanupPolicyResponse

type CleanupPolicyResponse struct {
	ID string `json:"id"`
	// RepositoryID is empty for a project default policy, which carries ProjectID.
	RepositoryID            string  `json:"repo_id,omitempty"`
	ProjectID               string  `json:"project_id,omitempty"`
	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"`
	CreatedAt               string  `json:"created_at"`
	UpdatedAt               string  `json:"updated_at"`
	LastRunAt               *string `json:"last_run_at"`
	LastRunDeleted          *int    `json:"last_run_deleted"`
	LastRunError            *string `json:"last_run_error"`
}

CleanupPolicyResponse represents a cleanup policy in API responses.

type CurationRuleResponse added in v0.16.0

type CurationRuleResponse struct {
	ID string `json:"id"`
	// Action is "block" or "allow".
	Action string `json:"action"`
	// PackagePattern is a glob over the normalized package name; VersionPattern
	// a glob over the version string ("" matches every version).
	PackagePattern string `json:"package_pattern"`
	VersionPattern string `json:"version_pattern"`
	Reason         string `json:"reason"`
	CreatedBy      string `json:"created_by"`
	CreatedAt      string `json:"created_at"`
}

CurationRuleResponse is one curation rule of a proxy repository.

type CurationRulesResponse added in v0.16.0

type CurationRulesResponse struct {
	Rules []CurationRuleResponse `json:"rules"`
}

CurationRulesResponse is the list answer of the curation rules endpoint.

type DeclarativeObjectResponse added in v0.8.1

type DeclarativeObjectResponse struct {
	Kind        string    `json:"kind"`
	Name        string    `json:"name"`
	ObjectID    string    `json:"object_id"`
	AppliedHash string    `json:"applied_hash"`
	AppliedAt   time.Time `json:"applied_at"`
}

DeclarativeObjectResponse is the ownership marker of one object managed by `oa apply`.

type DeclarativeObjectsResponse added in v0.8.1

type DeclarativeObjectsResponse struct {
	Items []DeclarativeObjectResponse `json:"items"`
}

DeclarativeObjectsResponse lists ownership markers.

type DependencyTrackEffectiveResponse added in v0.8.0

type DependencyTrackEffectiveResponse struct {
	Enabled        bool   `json:"enabled"`
	Ready          bool   `json:"ready"`
	Source         string `json:"source"`
	BaseURL        string `json:"base_url"`
	APIKeySet      bool   `json:"api_key_set"`
	ProjectName    string `json:"project_name"`
	ProjectVersion string `json:"project_version"`
	AutoPush       bool   `json:"auto_push"`
	PushVEX        bool   `json:"push_vex"`
}

DependencyTrackEffectiveResponse is the configuration that applies to a repository.

type DependencyTrackOverrideResponse added in v0.8.0

type DependencyTrackOverrideResponse struct {
	Enabled        bool   `json:"enabled"`
	BaseURL        string `json:"base_url"`
	APIKeySet      bool   `json:"api_key_set"`
	ProjectName    string `json:"project_name"`
	ProjectVersion string `json:"project_version"`
	AutoPush       *bool  `json:"auto_push"`
	PushVEX        *bool  `json:"push_vex"`
}

DependencyTrackOverrideResponse is a repository's override of the global configuration: empty strings and null booleans inherit.

type DependencyTrackPushResponse added in v0.8.0

type DependencyTrackPushResponse struct {
	ArtifactID     string  `json:"artifact_id"`
	State          string  `json:"state"`
	Detail         string  `json:"detail"`
	ProjectUUID    string  `json:"project_uuid"`
	ProjectName    string  `json:"project_name"`
	ProjectVersion string  `json:"project_version"`
	Components     int     `json:"components"`
	VEXStatements  int     `json:"vex_statements"`
	VEXApplied     int     `json:"vex_applied"`
	BOMPushedAt    *string `json:"bom_pushed_at"`
	VEXPushedAt    *string `json:"vex_pushed_at"`
	UpdatedAt      string  `json:"updated_at"`
}

DependencyTrackPushResponse is the last push of one artifact.

type DependencyTrackRepositoryResponse added in v0.8.0

type DependencyTrackRepositoryResponse struct {
	Override  *DependencyTrackOverrideResponse `json:"override"`
	Effective DependencyTrackEffectiveResponse `json:"effective"`
}

DependencyTrackRepositoryResponse is a repository's override and the effective configuration.

type DependencyTrackSettingsResponse added in v0.8.0

type DependencyTrackSettingsResponse struct {
	Enabled        bool   `json:"enabled"`
	BaseURL        string `json:"base_url"`
	APIKeySet      bool   `json:"api_key_set"`
	ProjectName    string `json:"project_name"`
	ProjectVersion string `json:"project_version"`
	AutoPush       bool   `json:"auto_push"`
	PushVEX        bool   `json:"push_vex"`
}

DependencyTrackSettingsResponse is the global Dependency-Track configuration. The API key is write-only; APIKeySet tells whether one is stored.

type DependencyTrackTestResponse added in v0.8.0

type DependencyTrackTestResponse struct {
	Version            string   `json:"version"`
	Permissions        []string `json:"permissions"`
	MissingPermissions []string `json:"missing_permissions"`
}

DependencyTrackTestResponse is the outcome of a connection test.

type ExploitFeedResponse added in v0.14.0

type ExploitFeedResponse struct {
	// Name is kev or epss.
	Name      string `json:"name"`
	SourceURL string `json:"source_url"`
	Version   string `json:"version"`
	// PublishedAt is when the feed says the data was released; null when never loaded.
	PublishedAt *string `json:"published_at"`
	EntryCount  int     `json:"entry_count"`
	// ImportedAt is when the data was last replaced; CheckedAt when the source
	// was last asked.
	ImportedAt *string `json:"imported_at"`
	CheckedAt  *string `json:"checked_at"`
	// LastError is the sanitized reason the last check failed; empty after a success.
	LastError string `json:"last_error"`
}

ExploitFeedResponse is the state of one exploitation-signal feed.

type ExploitFeedsResponse added in v0.14.0

type ExploitFeedsResponse struct {
	Feeds []ExploitFeedResponse `json:"feeds"`
	// EPSSThreshold is the EPSS score from which a finding has priority epss.
	EPSSThreshold float64 `json:"epss_threshold"`
	// Enabled is true when the feeds are loaded into this instance's database.
	Enabled bool `json:"enabled"`
}

ExploitFeedsResponse is GET /api/v1/security/exploit-feeds.

type GPGKeyResponse

type GPGKeyResponse struct {
	Fingerprint string  `json:"fingerprint"`
	UID         *string `json:"uid"`
	CreatedAt   *string `json:"created_at"`
	ExpiresAt   *string `json:"expires_at"`
	IsDefault   *bool   `json:"is_default"`
}

GPGKeyResponse represents a GPG key in API responses.

type GateCheck added in v0.21.0

type GateCheck struct {
	// Name is vulnerabilities, license, quarantine or attestations.
	Name string `json:"name"`
	Pass bool   `json:"pass"`
	// Detail is a short client-safe sentence.
	Detail string `json:"detail"`
}

GateCheck is one check of a gate verdict.

type GateResponse added in v0.21.0

type GateResponse struct {
	Pass   bool   `json:"pass"`
	Reason string `json:"reason,omitempty"`
	// Digest is the image the verdict is about.
	Digest string      `json:"digest"`
	Checks []GateCheck `json:"checks"`
	// ScanStatus is the status of the latest vulnerability scan of the image,
	// "none" when it has none.
	ScanStatus string `json:"scan_status"`
	// Scan is the id of that scan; empty when there is none.
	Scan string `json:"scan_id,omitempty"`
}

GateResponse is GET /api/v1/repositories/{name}/gate: the aggregate verdict for one image digest.

type GroupResponse

type GroupResponse struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	CreatedAt   string  `json:"created_at"`
	UpdatedAt   string  `json:"updated_at"`
}

GroupResponse represents a group in API responses.

type HeldBackResponse added in v0.16.0

type HeldBackResponse struct {
	// Supported is false when the repository's format cannot list the versions
	// of a package or the metadata is not cached yet; Versions is then empty.
	Supported bool              `json:"supported"`
	Versions  []HeldBackVersion `json:"versions"`
}

HeldBackResponse lists the versions of a proxy package its repository holds back, computed from the upstream metadata already cached.

type HeldBackVersion added in v0.16.0

type HeldBackVersion struct {
	Version string `json:"version"`
	// PublishedAt is the publish time the upstream states (RFC 3339), when known.
	PublishedAt string `json:"published_at,omitempty"`
	// Reasons is never empty; a reason has the shape of an availability reason.
	Reasons []AvailabilityReason `json:"reasons"`
}

HeldBackVersion is a version of a proxy package its repository keeps from clients, with why.

type LicensePolicyResponse

type LicensePolicyResponse struct {
	ID              string   `json:"id"`
	Name            string   `json:"name"`
	Description     *string  `json:"description"`
	Action          *string  `json:"action"`
	AllowedLicenses []string `json:"allowed_licenses"`
	DeniedLicenses  []string `json:"denied_licenses"`
	Enabled         bool     `json:"enabled"`
	CreatedAt       string   `json:"created_at"`
	UpdatedAt       string   `json:"updated_at"`
	RepositoryID    *string  `json:"repo_id"`
}

LicensePolicyResponse represents a license policy.

type LicenseScanResultResponse

type LicenseScanResultResponse struct {
	ID              string   `json:"id"`
	RepositoryID    string   `json:"repo_id"`
	ArtifactID      string   `json:"artifact_id"`
	Licenses        []string `json:"licenses"`
	ScanStatus      string   `json:"scan_status"`
	CreatedAt       string   `json:"created_at"`
	UpdatedAt       string   `json:"updated_at"`
	ScannedAt       *string  `json:"scanned_at"`
	ScanError       *string  `json:"scan_error"`
	SPDXExpressions []string `json:"spdx_expressions"`
	// UnresolvedLicenses are the entries of licenses that are not SPDX
	// expressions: raw text read from the artifact ("BSD", "BSD License"),
	// kept as written and flagged for review.
	UnresolvedLicenses []string `json:"unresolved_licenses"`
	// LicenseSource is "artifact" when the licenses include ones read from the
	// package file, "client_declared" when they only come from what a client
	// declared (license properties).
	LicenseSource string `json:"license_source"`
	// Quarantined: downloads of the artifact answer 403 until it is approved
	// (a blocking license policy matched its licenses).
	Quarantined bool `json:"quarantined"`
	// QuarantineApproved: an admin approved the artifact for these licenses.
	QuarantineApproved bool `json:"quarantine_approved"`
}

LicenseScanResultResponse represents a license scan result.

type OSVAttributionResponse added in v0.14.0

type OSVAttributionResponse struct {
	Source  string `json:"source"`
	License string `json:"license"`
	URL     string `json:"url"`
}

OSVAttributionResponse names the source and license of the advisory data.

type OSVMirrorEcosystemResponse added in v0.14.0

type OSVMirrorEcosystemResponse struct {
	// Ecosystem is the OSV ecosystem name, e.g. npm or crates.io.
	Ecosystem string `json:"ecosystem"`
	// Populated is true once an import completed: only then does the osv
	// scanner match against the mirror instead of the online API.
	Populated bool `json:"populated"`
	// Advisories counts the advisories that affect the ecosystem.
	Advisories int `json:"advisories"`
	// HighWater is the newest advisory modification imported.
	HighWater *string `json:"high_water"`
	// LastCheckedAt is when the export was last requested; LastImportedAt when
	// new data was last applied.
	LastCheckedAt  *string `json:"last_checked_at"`
	LastImportedAt *string `json:"last_imported_at"`
	// LastImportSeconds and LastRematchSeconds are the durations of the last
	// import and of the last re-match against the stored packages.
	LastImportSeconds  float64 `json:"last_import_seconds"`
	LastRematchSeconds float64 `json:"last_rematch_seconds"`
	// LastError is the failure of the last import, null when it succeeded.
	LastError *string `json:"last_error"`
	// RematchPending is true while changed advisories are not yet matched.
	RematchPending bool `json:"rematch_pending"`
}

OSVMirrorEcosystemResponse is the state of one ecosystem of the local OSV mirror.

type OSVMirrorStatusResponse added in v0.14.0

type OSVMirrorStatusResponse struct {
	// Enabled is false when osvMirror is off: the osv scanner then uses the online API.
	Enabled bool `json:"enabled"`
	// SourceURL is the configured export location, without credentials.
	SourceURL string `json:"source_url"`
	// IntervalSeconds is the import schedule.
	IntervalSeconds int                          `json:"interval_seconds"`
	Ecosystems      []OSVMirrorEcosystemResponse `json:"ecosystems"`
	Attribution     OSVAttributionResponse       `json:"attribution"`
}

OSVMirrorStatusResponse reports the local OSV mirror.

type PackageDependencyResponse added in v0.11.0

type PackageDependencyResponse struct {
	Name string `json:"name"`
	// Version is the version requirement as the format writes it.
	Version string `json:"version,omitempty"`
	// Kind is the role: runtime, dev, peer, optional, build, ... as the format names it.
	Kind string `json:"kind,omitempty"`
}

PackageDependencyResponse is one declared dependency of a package version.

type PackageDetailResponse added in v0.11.0

type PackageDetailResponse struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Version     string `json:"version"`
	Format      string `json:"format"`
	Arch        string `json:"arch"`
	Filename    string `json:"filename"`
	Size        int64  `json:"size"`
	SHA256      string `json:"sha256"`
	MD5         string `json:"md5,omitempty"`
	SHA1        string `json:"sha1,omitempty"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
	Summary     string `json:"summary,omitempty"`
	Description string `json:"description,omitempty"`
	License     string `json:"license,omitempty"`
	Homepage    string `json:"homepage,omitempty"`
	// Metadata is the format-specific fields, ordered by key.
	Metadata []PackageMetadataEntry `json:"metadata"`
	// Dependencies are the declared dependencies, for the formats that store them.
	Dependencies []PackageDependencyResponse `json:"dependencies"`
	// Files are all the files of this version (one per architecture,
	// classifier or distribution), this one included.
	Files []PackageFileResponse `json:"files"`
	// VersionCount and LatestVersion describe the package this version belongs to.
	VersionCount  int    `json:"version_count"`
	LatestVersion string `json:"latest_version"`
}

PackageDetailResponse is one package version with the metadata its format stores: GET /api/v1/repositories/{name}/packages/{id}.

type PackageFileResponse added in v0.11.0

type PackageFileResponse struct {
	ID       string `json:"id"`
	Filename string `json:"filename"`
	Arch     string `json:"arch"`
	Size     int64  `json:"size"`
	SHA256   string `json:"sha256"`
}

PackageFileResponse is one file of a package version.

type PackageGroupListResponse added in v0.11.0

type PackageGroupListResponse struct {
	Total    int                    `json:"total"`
	Page     int                    `json:"page"`
	Limit    int                    `json:"limit"`
	Packages []PackageGroupResponse `json:"packages"`
}

PackageGroupListResponse is a page of PackageGroupResponse.

type PackageGroupResponse added in v0.11.0

type PackageGroupResponse struct {
	Name          string `json:"name"`
	Format        string `json:"format"`
	LatestVersion string `json:"latest_version"`
	VersionCount  int    `json:"version_count"`
	// SizeBytes is the size of the latest version, all its files summed.
	SizeBytes int64 `json:"size_bytes"`
	// UpdatedAt is the latest modification of any version.
	UpdatedAt string `json:"updated_at"`
	// Security sums the latest version's files.
	Security PackageSecurity `json:"security"`
	Flagged  bool            `json:"flagged"`
	// ScannedAt is the latest completed scan of the latest version; absent when never scanned.
	ScannedAt *string `json:"scanned_at,omitempty"`
}

PackageGroupResponse is one package (repository, format, name) across its versions: the rollup of GET /api/v1/repositories/{name}/packages?group=package.

type PackageItem

type PackageItem struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	Version   string  `json:"version"`
	Format    string  `json:"format"`
	Arch      *string `json:"arch,omitempty"`
	Size      *int64  `json:"size,omitempty"`
	Filename  *string `json:"filename,omitempty"`
	CreatedAt string  `json:"created_at"`
}

PackageItem represents a package in list responses.

type PackageListResponse added in v0.11.0

type PackageListResponse struct {
	// Total is the number of matching files; absent on a request that carries a
	// cursor, which does not count.
	Total *int `json:"total,omitempty"`
	// TotalExact is false when Total is a lower bound (the count stops at a
	// ceiling on a huge repository): show it as "N+". Absent with Total.
	TotalExact *bool `json:"total_exact,omitempty"`
	Page       int   `json:"page"`
	Limit      int   `json:"limit"`
	// HasMore: the listing continues after this page.
	HasMore bool `json:"has_more"`
	// NextCursor, set whenever HasMore is true on the newest-first listing,
	// is the cursor query parameter that fetches the next page.
	NextCursor string            `json:"next_cursor,omitempty"`
	Packages   []PackageResponse `json:"packages"`
}

PackageListResponse is a page of PackageResponse.

type PackageMetadataEntry added in v0.11.0

type PackageMetadataEntry struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

PackageMetadataEntry is one format-specific field of a package version.

type PackageResponse added in v0.11.0

type PackageResponse struct {
	ID        string          `json:"id"`
	Name      string          `json:"name"`
	Version   string          `json:"version"`
	Format    string          `json:"format"`
	Arch      string          `json:"arch"`
	Size      int64           `json:"size"`
	SHA256    string          `json:"sha256"`
	Filename  string          `json:"filename"`
	CreatedAt string          `json:"created_at"`
	Security  PackageSecurity `json:"security"`
	// Flagged: a critical or high vulnerability, a secret finding or a
	// quarantined scan result.
	Flagged bool `json:"flagged"`
	// ScannedAt is the latest completed scan; absent when never scanned.
	ScannedAt *string `json:"scanned_at,omitempty"`
}

PackageResponse is one file of a repository's package listing.

type PackageSecurity added in v0.11.0

type PackageSecurity struct {
	Critical int64 `json:"critical"`
	High     int64 `json:"high"`
	Medium   int64 `json:"medium"`
	Low      int64 `json:"low"`
}

PackageSecurity is the vulnerability count of a package row by severity.

type PaginatedResponse

type PaginatedResponse struct {
	Data    any `json:"data"`
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
	Total   int `json:"total"`
}

PaginatedResponse is a generic paginated response envelope.

type PermissionAssignmentResponse added in v0.8.1

type PermissionAssignmentResponse struct {
	PrincipalType string `json:"principal_type"`
	PrincipalID   string `json:"principal_id"`
	PrincipalName string `json:"principal_name"`
}

PermissionAssignmentResponse is one principal a permission target is assigned to.

type PermissionTargetResponse

type PermissionTargetResponse struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	RepositoryFilter string   `json:"repository_filter"`
	PathPattern      string   `json:"path_pattern"`
	Actions          []string `json:"actions"`
	CreatedAt        string   `json:"created_at"`
	UpdatedAt        string   `json:"updated_at"`
}

PermissionTargetResponse represents a permission target in API responses.

type ProjectActivityEntry added in v0.7.0

type ProjectActivityEntry struct {
	ID           string  `json:"id"`
	Timestamp    string  `json:"timestamp"`
	Action       string  `json:"action"`
	Actor        string  `json:"actor"`
	ActorType    *string `json:"actor_type"`
	Message      string  `json:"message"`
	ResourceType *string `json:"resource_type"`
	ResourceID   *string `json:"resource_id"`
	RepositoryID *string `json:"repository_id"`
}

ProjectActivityEntry is one audit event of a project or of a repository it owns. It carries no client address: members see what happened, not from where.

type ProjectGroupResponse added in v0.6.0

type ProjectGroupResponse struct {
	ProjectID string `json:"project_id"`
	GroupID   string `json:"group_id"`
	GroupName string `json:"group_name"`
	Role      string `json:"role"`
	CreatedAt string `json:"created_at"`
}

ProjectGroupResponse represents a group attached to a project.

type ProjectListItem added in v0.11.0

type ProjectListItem struct {
	ProjectResponse

	// MemberCount is the number of direct members (group grants not counted).
	MemberCount int               `json:"member_count"`
	Usage       ProjectListUsage  `json:"usage"`
	Quota       *ProjectListQuota `json:"quota,omitempty"`
}

ProjectListItem is one project of GET /api/v1/projects: the project with its member count, usage and quota.

type ProjectListQuota added in v0.11.0

type ProjectListQuota struct {
	LimitBytes int64 `json:"limit_bytes"`
}

ProjectListQuota is the project's size ceiling; the object is omitted when the project has no size limit.

type ProjectListUsage added in v0.11.0

type ProjectListUsage struct {
	SizeBytes int64 `json:"size_bytes"`
}

ProjectListUsage is the stored size across the project's repositories.

type ProjectMemberResponse added in v0.6.0

type ProjectMemberResponse struct {
	ID        string `json:"id"`
	ProjectID string `json:"project_id"`
	UserID    string `json:"user_id"`
	Username  string `json:"username"`
	Role      string `json:"role"`
	CreatedAt string `json:"created_at"`
}

ProjectMemberResponse represents a project member in API responses.

type ProjectQuotaResponse added in v0.6.0

type ProjectQuotaResponse struct {
	Project              string `json:"project"`
	MaxSizeBytes         int64  `json:"max_size_bytes"`
	MaxArtifactCount     int64  `json:"max_artifact_count"`
	WarnThresholdPercent int    `json:"warn_threshold_percent"`
	CurrentSizeBytes     int64  `json:"current_size_bytes"`
	CurrentArtifactCount int64  `json:"current_artifact_count"`
	UsagePercent         int    `json:"usage_percent"`
	// Enforced is true when a limit is set, i.e. uploads must fit the project ceiling.
	Enforced  bool   `json:"enforced"`
	UpdatedAt string `json:"updated_at"`
}

ProjectQuotaResponse is a project's storage ceiling and its live usage (the sum of its repositories' counters). Limits of 0 mean unlimited.

type ProjectRepoUsageResponse added in v0.6.0

type ProjectRepoUsageResponse struct {
	Name                 string `json:"name"`
	Format               string `json:"format"`
	RepoType             string `json:"repo_type"`
	SizeBytes            int64  `json:"size_bytes"`
	ArtifactCount        int64  `json:"artifact_count"`
	MaxSizeBytes         int64  `json:"max_size_bytes"`
	MaxArtifactCount     int64  `json:"max_artifact_count"`
	WarnThresholdPercent int    `json:"warn_threshold_percent"`
	// QuotaEnforced is false for repositories whose bytes are not metered
	// (proxy and group repositories hold no uploaded packages).
	QuotaEnforced bool `json:"quota_enforced"`
}

ProjectRepoUsageResponse is one repository's line in a project usage report.

type ProjectResponse added in v0.6.0

type ProjectResponse struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	DisplayName *string `json:"display_name"`
	Description *string `json:"description"`
	OwnerID     *string `json:"owner_id"`
	// Slug is the URL-safe unique identifier derived from the name.
	Slug string `json:"slug"`
	// AllowedFormats limits the formats of self-service repositories; null
	// allows every format.
	AllowedFormats   []string `json:"allowed_formats"`
	AllowedRepoTypes []string `json:"allowed_repo_types"`
	RepoNamePrefix   string   `json:"repo_name_prefix"`
	AllowPublicRepos bool     `json:"allow_public_repos"`
	MaxRepositories  int      `json:"max_repositories"`
	TokenMaxTTLDays  int      `json:"token_max_ttl_days"`
	CreatedAt        string   `json:"created_at"`
	UpdatedAt        string   `json:"updated_at"`
	// MyRole is the caller's effective role in the project (viewer, developer,
	// maintainer or owner); a global admin who holds no role is an implicit owner.
	MyRole string `json:"my_role"`
	// RepositoryCount is the number of live (not trashed) repositories.
	RepositoryCount int `json:"repository_count"`
	// IsSystem marks the built-in system project ("unassigned"): it grants
	// nothing and cannot be deleted.
	IsSystem bool `json:"is_system"`
}

ProjectResponse represents a project in API responses.

type ProjectRoleResponse added in v0.6.0

type ProjectRoleResponse struct {
	Name string `json:"name"`
	Role string `json:"role"`
}

ProjectRoleResponse is one project role of the caller (GET /api/v1/auth/me).

type ProjectTokenCreateResponse added in v0.6.0

type ProjectTokenCreateResponse struct {
	ProjectTokenResponse

	Token string `json:"token"`
}

ProjectTokenCreateResponse includes the clear-text token on creation.

type ProjectTokenResponse added in v0.6.0

type ProjectTokenResponse struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Project string `json:"project"`
	// Role is viewer or developer.
	Role       string  `json:"role"`
	ExpiresAt  *string `json:"expires_at"`
	LastUsedAt *string `json:"last_used_at"`
	CreatedAt  string  `json:"created_at"`
	// CreatedBy is the ID of the user who minted the token.
	CreatedBy         string `json:"created_by"`
	CreatedByUsername string `json:"created_by_username"`
}

ProjectTokenResponse represents a project token in API responses.

type ProjectUsageResponse added in v0.6.0

type ProjectUsageResponse struct {
	Project       string                     `json:"project"`
	SizeBytes     int64                      `json:"size_bytes"`
	ArtifactCount int64                      `json:"artifact_count"`
	Quota         ProjectQuotaResponse       `json:"quota"`
	Repositories  []ProjectRepoUsageResponse `json:"repositories"`
}

ProjectUsageResponse is GET /api/v1/projects/{project}/usage.

type ProxyVersion added in v0.16.1

type ProxyVersion struct {
	Version string `json:"version"`
	// Status is "available" or "held" (the gate keeps it from clients).
	Status string `json:"status"`
	// PublishedAt is the publish time the upstream states (RFC 3339), when known.
	PublishedAt string `json:"published_at,omitempty"`
	// Cached is true when a file of the version is already in the proxy cache.
	Cached bool `json:"cached"`
	// Reasons is empty for an available version; a reason has the shape of an
	// availability reason.
	Reasons []AvailabilityReason `json:"reasons"`
}

ProxyVersion is a version of a proxy package named by the cached upstream metadata, with what the repository's gate says about it.

type ProxyVersionsResponse added in v0.16.1

type ProxyVersionsResponse struct {
	// Supported is false when the repository's format cannot list the versions
	// of a package or the metadata is not cached yet; Versions is then empty.
	Supported bool `json:"supported"`
	// CacheKnown is false when the format's cache keys name no versions: Cached
	// is then false for every version.
	CacheKnown bool           `json:"cache_known"`
	Versions   []ProxyVersion `json:"versions"`
}

ProxyVersionsResponse lists every version of a proxy package its cached upstream metadata names, newest first.

type QuotaLine added in v0.11.0

type QuotaLine struct {
	LimitBytes *int64 `json:"limit_bytes,omitempty"`
	UsedBytes  int64  `json:"used_bytes"`
	// SoftLimitBytes is the usage at which the warning threshold is crossed
	// (LimitBytes times WarnThresholdPercent), set with LimitBytes.
	SoftLimitBytes       *int64 `json:"soft_limit_bytes,omitempty"`
	WarnThresholdPercent int    `json:"warn_threshold_percent"`
	MaxArtifactCount     *int64 `json:"max_artifact_count,omitempty"`
	ArtifactCount        int64  `json:"artifact_count"`
	// UsagePercent is UsedBytes of LimitBytes (0 when unlimited); Exceeded is
	// true once the size or the artifact count limit is reached.
	UsagePercent int  `json:"usage_percent"`
	Exceeded     bool `json:"exceeded"`
}

QuotaLine is a quota next to its live usage. Limits are omitted when unlimited.

type QuotaOverviewItem added in v0.11.0

type QuotaOverviewItem struct {
	QuotaLine

	// Scope is "repository" or "project".
	Scope string `json:"scope"`
	Name  string `json:"name"`
	// Project is the project owning a repository (omitted for a project line
	// and for a repository without one).
	Project string `json:"project,omitempty"`
}

QuotaOverviewItem is one repository or project of GET /api/v1/admin/quotas.

type QuotaOverviewList added in v0.11.0

type QuotaOverviewList struct {
	Quotas []QuotaOverviewItem `json:"quotas"`
	Total  int                 `json:"total"`
	Page   int                 `json:"page"`
	Limit  int                 `json:"limit"`
}

QuotaOverviewList is GET /api/v1/admin/quotas.

type RecentPackageResponse added in v0.11.0

type RecentPackageResponse struct {
	Repository string `json:"repository"`
	Format     string `json:"format"`
	Name       string `json:"name"`
	Version    string `json:"version"`
	CreatedAt  string `json:"created_at"`
	// CreatedByName is the publisher. The server does not record who published
	// a package, so it is never set.
	CreatedByName string `json:"created_by_name,omitempty"`
}

RecentPackageResponse is a recently published package version.

type RecentPackagesResponse added in v0.11.0

type RecentPackagesResponse struct {
	Packages []RecentPackageResponse `json:"packages"`
}

RecentPackagesResponse is the list of recent package versions.

type ReplicaInfoResponse added in v0.9.0

type ReplicaInfoResponse struct {
	// Type is the backend kind (filesystem, s3, gcs, azure, ...).
	Type string `json:"type"`
	// Location is the directory, bucket or container the replica writes to.
	Location string `json:"location"`
}

ReplicaInfoResponse describes the replica backend without any credential.

type ReplicationStatusResponse added in v0.9.0

type ReplicationStatusResponse struct {
	// Enabled is false when no replica is configured (storage.replica.type is empty);
	// every other field is then empty.
	Enabled bool                 `json:"enabled"`
	Replica *ReplicaInfoResponse `json:"replica"`
	// ReadFallback is notfound, error or off.
	ReadFallback string `json:"read_fallback"`
	// BacklogCopy and BacklogDelete are the queued operations by kind.
	BacklogCopy   int64 `json:"backlog_copy"`
	BacklogDelete int64 `json:"backlog_delete"`
	// OldestPendingAgeSeconds is the replication lag: the age of the oldest queued operation.
	OldestPendingAgeSeconds float64 `json:"oldest_pending_age_seconds"`
	// Failing is the number of queued operations that failed repeatedly.
	Failing int64 `json:"failing"`
	// ReplicatedTotal and ReplicatedBytesTotal count what has been copied since replication began.
	ReplicatedTotal      int64 `json:"replicated_total"`
	ReplicatedBytesTotal int64 `json:"replicated_bytes_total"`
	// LastError is the most recent replication failure, empty when the last pass was clean.
	LastError   string     `json:"last_error"`
	LastErrorAt *time.Time `json:"last_error_at"`
	// VerifyRequested is true while an admin-requested verify pass waits to start.
	VerifyRequested bool                       `json:"verify_requested"`
	VerifyRunning   *ReplicationVerifyResponse `json:"verify_running"`
	LastVerify      *ReplicationVerifyResponse `json:"last_verify"`
}

ReplicationStatusResponse is the state of blob replication to the replica.

type ReplicationVerifyRequestedResponse added in v0.9.0

type ReplicationVerifyRequestedResponse struct {
	Requested bool `json:"requested"`
}

ReplicationVerifyRequestedResponse acknowledges a verify request.

type ReplicationVerifyResponse added in v0.9.0

type ReplicationVerifyResponse struct {
	StartedAt  time.Time  `json:"started_at"`
	FinishedAt *time.Time `json:"finished_at"`
	// Deep is true when the bytes of both copies were hashed.
	Deep bool `json:"deep"`
	// Listing is "list" when the primary store was enumerated and "database"
	// when it cannot list and the blobs table was walked.
	Listing string `json:"listing"`
	// ReplicaListed is false when the replica cannot enumerate its objects, so
	// blobs only it holds were not looked for.
	ReplicaListed bool `json:"replica_listed"`
	// Checked is the number of blobs examined.
	Checked int64 `json:"checked"`
	// MissingReplica blobs were missing from the replica (a copy was queued).
	MissingReplica int64 `json:"missing_replica"`
	// MissingPrimary blobs were missing from the primary store (restored from the replica).
	MissingPrimary int64 `json:"missing_primary"`
	// Mismatched blobs had different sizes (or contents, with a deep pass) on the two sides.
	Mismatched int64 `json:"mismatched"`
	// Repaired blobs were fixed or queued for copying.
	Repaired int64 `json:"repaired"`
	// Unreferenced blobs exist only on the replica and nothing needs them.
	Unreferenced int64 `json:"unreferenced"`
	// Lost blobs are referenced by the database but exist on neither side.
	Lost int64 `json:"lost"`
	// Errors is the number of blobs that could not be checked or repaired.
	Errors int64 `json:"errors"`
}

ReplicationVerifyResponse is the outcome (or the progress, while the pass runs) of a replication verify pass.

type RepoSecurityAIResponse added in v0.11.0

type RepoSecurityAIResponse struct {
	QuarantineRecommended int `json:"quarantine_recommended"`
	ReviewRequired        int `json:"review_required"`
}

RepoSecurityAIResponse counts the AI findings of a repository summary.

type RepoSecurityLicenseResponse added in v0.11.0

type RepoSecurityLicenseResponse struct {
	// Violations counts the license findings that are not suppressed.
	Violations int `json:"violations"`
}

RepoSecurityLicenseResponse counts the license findings of a repository summary.

type RepoSecuritySecretResponse added in v0.11.0

type RepoSecuritySecretResponse struct {
	Count int `json:"count"`
}

RepoSecuritySecretResponse counts the secret findings of a repository summary.

type RepoSecuritySummaryResponse added in v0.11.0

type RepoSecuritySummaryResponse struct {
	// ScannedAt is the latest completed scan; null when nothing was scanned.
	ScannedAt *string                     `json:"scanned_at"`
	Vuln      SecurityFindingCounts       `json:"vuln"`
	License   RepoSecurityLicenseResponse `json:"license"`
	Secret    RepoSecuritySecretResponse  `json:"secret"`
	AI        RepoSecurityAIResponse      `json:"ai"`
	// Quarantined is true when a result is quarantined.
	Quarantined bool `json:"quarantined"`
}

RepoSecuritySummaryResponse is the counts-only security state of a repository, a package or one version: no ids, titles or other finding details.

type RepositoryMemberResponse

type RepositoryMemberResponse struct {
	ID       string `json:"id"`
	Priority int    `json:"priority"`
}

RepositoryMemberResponse represents a repository member.

type RepositoryPermissions added in v0.5.0

type RepositoryPermissions struct {
	Write  bool `json:"write"`
	Delete bool `json:"delete"`
	Manage bool `json:"manage"`
	// Admin: the caller may configure and delete the repository and run its
	// cleanup policies, quota and trash: a global admin, or a maintainer or
	// owner of its project (a repository-scoped manage target does not count).
	Admin bool `json:"admin"`
}

RepositoryPermissions reports which actions the calling principal may perform on one repository.

type RepositoryQuota added in v0.11.0

type RepositoryQuota struct {
	// LimitBytes is the size quota; absent when unlimited.
	LimitBytes *int64 `json:"limit_bytes,omitempty"`
	UsedBytes  int64  `json:"used_bytes"`
}

RepositoryQuota is a repository's storage use against its quota.

type RepositoryResponse

type RepositoryResponse struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Format      string  `json:"format"`
	Description *string `json:"description"`
	Public      bool    `json:"public"`
	RepoType    string  `json:"repo_type"`
	// Project is the name of the project that owns the repository. Its
	// members get access to the repository (see docs/security/rbac.md).
	Project   string `json:"project,omitempty"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`

	// Permissions is the caller's effective repository-scoped permissions. It
	// is only set by the single-repository GET, so the UI can show the controls
	// the API would accept (the trash tab needs delete, emptying it manage).
	Permissions *RepositoryPermissions `json:"permissions,omitempty"`

	// Stats is the repository's catalog figures. It is only set by the
	// repository list.
	Stats *RepositoryStats `json:"stats,omitempty"`

	// PresignDownloads overrides the global storage.presignDownloads setting:
	// null inherits it, true redirects blob downloads to presigned URLs, false
	// always streams through the server.
	PresignDownloads *bool `json:"presign_downloads"`

	// TrashRetentionDays is how long deleted items stay restorable; null means
	// the server default, 0 deletes immediately. ImmutableReleases forbids
	// deleting or overwriting released versions (an admin can force).
	TrashRetentionDays *int `json:"trash_retention_days"`
	ImmutableReleases  bool `json:"immutable_releases"`

	// MergeProxyVersions (groups only): false means hosted members win a
	// package name and proxy members' versions of it are hidden; true merges
	// every member's versions.
	MergeProxyVersions bool `json:"merge_proxy_versions"`
	// DeployTarget (groups only) is the hosted member a write sent to the group
	// is served by; absent when the group has none (writes are refused).
	DeployTarget string `json:"deploy_target,omitempty"`
	// SignPackages (hosted rpm only): uploads are signed with the active GPG key.
	SignPackages bool `json:"sign_packages"`
	// HonourQuayExpiry (hosted docker only): images with quay.expires-after are deleted when due.
	HonourQuayExpiry bool `json:"honour_quay_expiry"`
	// Federated: the repository replicates with peer instances (hosted only).
	Federated bool `json:"federated"`

	// Proxy repositories only. The upstream password is never returned.
	UpstreamURL      string `json:"upstream_url,omitempty"`
	UpstreamUsername string `json:"upstream_username,omitempty"`
	// UpstreamPasswordSet says a password is stored for the upstream. The
	// password itself is write-only: no response ever carries it.
	UpstreamPasswordSet     bool `json:"upstream_password_set,omitempty"`
	CacheTTLSeconds         *int `json:"cache_ttl_seconds,omitempty"`
	NegativeCacheTTLSeconds *int `json:"negative_cache_ttl_seconds,omitempty"`
	MaxStaleSeconds         *int `json:"max_stale_seconds,omitempty"`
	MinAgeHours             *int `json:"min_age_hours,omitempty"`
	// CurationMode: "off", "denylist" or "allowlist" (see CurationRuleResponse).
	CurationMode *string `json:"curation_mode,omitempty"`
}

RepositoryResponse represents a repository in API responses.

type RepositorySecurity added in v0.11.0

type RepositorySecurity struct {
	Critical int64 `json:"critical"`
	High     int64 `json:"high"`
	Medium   int64 `json:"medium"`
	Low      int64 `json:"low"`
	Secrets  int64 `json:"secrets"`
	// LicenseViolations is the number of artifacts whose license scan is
	// quarantined; the server stores no other license violation count.
	LicenseViolations int64 `json:"license_violations"`
	// ScannedAt is the latest completed scan; absent when never scanned.
	ScannedAt *string `json:"scanned_at,omitempty"`
}

RepositorySecurity is the security state of a repository, from its artifacts' latest scans. Counts are raw: VEX statements do not suppress any.

type RepositoryStats added in v0.11.0

type RepositoryStats struct {
	// PackageCount is the number of distinct package names.
	PackageCount int64 `json:"package_count"`
	// SizeBytes is the stored size.
	SizeBytes int64 `json:"size_bytes"`
	// LastPublishedAt is the newest package; absent for an empty repository.
	LastPublishedAt *string            `json:"last_published_at,omitempty"`
	Security        RepositorySecurity `json:"security"`
	Quota           RepositoryQuota    `json:"quota"`
}

RepositoryStats are the catalog figures of a repository in the list.

type RepositoryUsageResponse added in v0.11.0

type RepositoryUsageResponse struct {
	PackageCount    int64     `json:"package_count"`
	VersionCount    int64     `json:"version_count"`
	SizeBytes       int64     `json:"size_bytes"`
	LastPublishedAt *string   `json:"last_published_at,omitempty"`
	Quota           QuotaLine `json:"quota"`
}

RepositoryUsageResponse is GET /api/v1/repositories/{name}/usage.

type SBOMReportResponse

type SBOMReportResponse struct {
	ID             string `json:"id"`
	RepositoryID   string `json:"repo_id"`
	ArtifactID     string `json:"artifact_id"`
	Format         string `json:"format"`
	SpecVersion    string `json:"spec_version"`
	ContentType    string `json:"content_type"`
	ComponentCount int    `json:"component_count"`
	GeneratedAt    string `json:"generated_at"`
	CreatedAt      string `json:"created_at"`
	UpdatedAt      string `json:"updated_at"`
	SBOMData       any    `json:"sbom_data,omitempty"`
}

SBOMReportResponse represents an SBOM report in API responses.

type SSOProviderPublicResponse

type SSOProviderPublicResponse struct {
	Slug        string `json:"slug"`
	Kind        string `json:"kind"`
	DisplayName string `json:"display_name"`
	Enabled     bool   `json:"enabled"`
}

SSOProviderPublicResponse represents a public SSO provider (no secrets).

type SSOProviderResponse

type SSOProviderResponse struct {
	ID          string `json:"id"`
	Slug        string `json:"slug"`
	Kind        string `json:"kind"`
	DisplayName string `json:"display_name"`
	// Icon is the key an admin chose; empty means automatic.
	Icon string `json:"icon"`
	// ResolvedIcon is the icon the login page shows: Icon when set, else the
	// one derived from the provider configuration.
	ResolvedIcon string `json:"resolved_icon"`
	// CallbackURL is the redirect URI (OIDC) or assertion consumer service URL
	// (SAML) to register with the identity provider.
	CallbackURL        string            `json:"callback_url"`
	Enabled            bool              `json:"enabled"`
	OIDCConfig         map[string]any    `json:"oidc_config,omitempty"`
	SAMLConfig         map[string]any    `json:"saml_config,omitempty"`
	ClaimMapping       map[string]any    `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          string            `json:"created_at"`
	UpdatedAt          string            `json:"updated_at"`
}

SSOProviderResponse represents an SSO provider in API responses.

type SecretFindingExport added in v0.7.0

type SecretFindingExport struct {
	Type        string `json:"type"`
	Description string `json:"description"`
	Severity    string `json:"severity"`
}

SecretFindingExport is a secret finding as exported: its type and severity only, never the (redacted) value or the text around it.

type SecretScanExportResponse added in v0.7.0

type SecretScanExportResponse struct {
	ID           string                `json:"id"`
	ArtifactID   string                `json:"artifact_id"`
	ScanStatus   string                `json:"scan_status"`
	Findings     []SecretFindingExport `json:"findings"`
	FindingCount int                   `json:"finding_count"`
	Quarantined  bool                  `json:"quarantined"`
	CreatedAt    string                `json:"created_at"`
	ScannedAt    *string               `json:"scanned_at"`
	ScanError    *string               `json:"scan_error"`
}

SecretScanExportResponse is a secret scan in the JSON export.

type SecretScanResultResponse

type SecretScanResultResponse struct {
	ID           string  `json:"id"`
	RepositoryID string  `json:"repo_id"`
	ArtifactID   string  `json:"artifact_id"`
	ScanStatus   string  `json:"scan_status"`
	Findings     any     `json:"findings"`
	FindingCount int     `json:"finding_count"`
	Quarantined  bool    `json:"quarantined"`
	CreatedAt    string  `json:"created_at"`
	UpdatedAt    string  `json:"updated_at"`
	ScannedAt    *string `json:"scanned_at"`
	ScanError    *string `json:"scan_error"`
}

SecretScanResultResponse represents a secret scan result.

type SecurityByTypeResponse added in v0.11.0

type SecurityByTypeResponse struct {
	Vuln    SecurityTypeSummaryResponse `json:"vuln"`
	License SecurityTypeSummaryResponse `json:"license"`
	Secret  SecurityTypeSummaryResponse `json:"secret"`
	AI      SecurityTypeSummaryResponse `json:"ai"`
}

SecurityByTypeResponse holds the summary of every finding type.

type SecurityFindingCounts added in v0.11.0

type SecurityFindingCounts struct {
	Critical int `json:"critical"`
	High     int `json:"high"`
	Medium   int `json:"medium"`
	Low      int `json:"low"`
}

SecurityFindingCounts counts what a finding holds per severity.

type SecurityFindingResponse added in v0.11.0

type SecurityFindingResponse struct {
	ID string `json:"id"`
	// Type is vuln, license, secret or ai.
	Type           string `json:"type"`
	Repository     string `json:"repository"`
	Format         string `json:"format"`
	PackageName    string `json:"package_name"`
	PackageVersion string `json:"package_version"`
	// ArtifactID is the artifact the result belongs to, "name@version".
	ArtifactID string `json:"artifact_id"`
	// Severity is the highest severity of the finding: critical, high, medium,
	// low, or none when it has none.
	Severity string                `json:"severity"`
	Counts   SecurityFindingCounts `json:"counts"`
	// Title is a one-line summary: the worst vulnerability id, the licenses,
	// the worst secret finding or the AI note.
	Title string `json:"title"`
	// Scanner is the scanner that produced the result; empty when the type has no named scanner.
	Scanner string `json:"scanner"`
	// Status is open, quarantined or suppressed.
	Status      string `json:"status"`
	Quarantined bool   `json:"quarantined"`
	// VEXStatus is the least resolved VEX decision of a vuln finding (affected,
	// under_investigation, fixed, not_affected); absent when none applies.
	VEXStatus string `json:"vex_status,omitempty"`
	// KEVCount is how many vulnerabilities of a vuln finding are in the CISA KEV
	// catalog; 0 for the other types.
	KEVCount int `json:"kev_count"`
	// MaxEPSS is the highest EPSS score of a vuln finding; null when none is scored.
	MaxEPSS *float64 `json:"max_epss"`
	// Priority is the remediation priority: kev, epss, or the severity (critical,
	// high, medium, low, none).
	Priority  string `json:"priority"`
	ScannedAt string `json:"scanned_at"`
}

SecurityFindingResponse is one finding of the cross-type findings list: one stored scan result (a package version of one type) that reports something.

type SecurityFindingsResponse added in v0.11.0

type SecurityFindingsResponse struct {
	Findings []SecurityFindingResponse `json:"findings"`
	HasMore  bool                      `json:"has_more"`
	// NextCursor is the opaque cursor of the next page, present when HasMore.
	NextCursor *string `json:"next_cursor,omitempty"`
}

SecurityFindingsResponse is one keyset page of findings.

type SecurityHealthAIResponse added in v0.11.0

type SecurityHealthAIResponse struct {
	Enabled bool `json:"enabled"`
}

SecurityHealthAIResponse is the state of the AI analysis.

type SecurityHealthDependencyTrackResponse added in v0.11.0

type SecurityHealthDependencyTrackResponse struct {
	Enabled bool `json:"enabled"`
	// LastPushOK is whether the latest finished push succeeded; absent when none finished.
	LastPushOK *bool `json:"last_push_ok,omitempty"`
	// LastPushAt is when that push finished; absent when none did.
	LastPushAt string `json:"last_push_at,omitempty"`
}

SecurityHealthDependencyTrackResponse is the state of the Dependency-Track integration.

type SecurityHealthResponse added in v0.11.0

type SecurityHealthResponse struct {
	Scanners []SecurityHealthScannerResponse `json:"scanners"`
	// LastScanAt is when the latest scan finished; null when none did.
	LastScanAt      *string                               `json:"last_scan_at"`
	ScansPending    int                                   `json:"scans_pending"`
	ScansFailed24h  int                                   `json:"scans_failed_24h"`
	DependencyTrack SecurityHealthDependencyTrackResponse `json:"dependency_track"`
	AI              SecurityHealthAIResponse              `json:"ai"`
	// UnscannedRepositories counts the repositories that hold artifacts and
	// have no completed scan of any type.
	UnscannedRepositories int `json:"unscanned_repositories"`
}

SecurityHealthResponse aggregates what the security pages need to tell an admin that scanning works.

type SecurityHealthScannerResponse added in v0.11.0

type SecurityHealthScannerResponse struct {
	Name  string `json:"name"`
	Ready bool   `json:"ready"`
	// Message tells an operator what to do; absent for a ready scanner.
	Message string `json:"message,omitempty"`
	// DocsURL points at the installation guide of a scanner that is not ready.
	DocsURL string `json:"docs_url,omitempty"`
}

SecurityHealthScannerResponse is the readiness of one vulnerability scanner.

type SecuritySummaryResponse added in v0.11.0

type SecuritySummaryResponse struct {
	ByType SecurityByTypeResponse `json:"by_type"`
	// ScannedRepositories of TotalRepositories (repositories that hold
	// artifacts) have a completed scan of any type.
	ScannedRepositories int `json:"scanned_repositories"`
	TotalRepositories   int `json:"total_repositories"`
	// LastScanAt is when the latest scan of the scope finished; null when none did.
	LastScanAt *string `json:"last_scan_at"`
}

SecuritySummaryResponse counts findings per type and the scan coverage of the scope.

type SecurityTypeSummaryResponse added in v0.11.0

type SecurityTypeSummaryResponse struct {
	Total       int `json:"total"`
	Critical    int `json:"critical"`
	High        int `json:"high"`
	Medium      int `json:"medium"`
	Low         int `json:"low"`
	Quarantined int `json:"quarantined"`
}

SecurityTypeSummaryResponse counts the findings of one type; the severities count by each finding's highest severity.

type StorageBackendResponse

type StorageBackendResponse struct {
	ID            string         `json:"id"`
	Name          string         `json:"name"`
	Kind          string         `json:"kind"`
	Config        map[string]any `json:"config"`
	Status        string         `json:"status"`
	StatusMessage *string        `json:"status_message"`
	LastCheckedAt *string        `json:"last_checked_at"`
	CreatedAt     string         `json:"created_at"`
	UpdatedAt     string         `json:"updated_at"`
	// Usage is what the backend holds. Present on the list and get endpoints.
	Usage *StorageBackendUsage `json:"usage,omitempty"`
}

StorageBackendResponse represents a storage backend in API responses.

type StorageBackendUsage added in v0.11.0

type StorageBackendUsage struct {
	BlobCount int64 `json:"blob_count"`
	SizeBytes int64 `json:"size_bytes"`
}

StorageBackendUsage is the blob count and byte total placed on one backend.

type StoragePolicyResponse added in v0.7.0

type StoragePolicyResponse struct {
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	Enabled        bool      `json:"enabled"`
	Position       int       `json:"position"`
	TargetTier     string    `json:"target_tier"`
	FromTier       *string   `json:"from_tier"`
	MinAgeSeconds  *int64    `json:"min_age_seconds"`
	MinIdleSeconds *int64    `json:"min_idle_seconds"`
	MinSizeBytes   *int64    `json:"min_size_bytes"`
	MaxSizeBytes   *int64    `json:"max_size_bytes"`
	RepoGlob       *string   `json:"repo_glob"`
	Formats        []string  `json:"formats"`
	PathGlob       *string   `json:"path_glob"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

StoragePolicyResponse is one lifecycle policy.

type StoragePrimaryResponse added in v0.13.0

type StoragePrimaryResponse struct {
	// Name is the reserved name "primary", usable in the /admin/storage/{name} paths.
	Name string `json:"name"`
	Kind string `json:"kind"`
	// Source is always "config": the store is set by the server configuration.
	Source string `json:"source"`
	// Location is where the blobs live (path, endpoint, bucket, region, ...); never a credential.
	Location      map[string]string `json:"location"`
	Status        string            `json:"status"`
	StatusMessage *string           `json:"status_message"`
	LastCheckedAt *string           `json:"last_checked_at"`
	// Usage is the blobs placed on the primary store (those not moved to a tier).
	Usage *StorageBackendUsage `json:"usage,omitempty"`
}

StoragePrimaryResponse is the primary blob store the server is configured with (storage.* settings). It is read-only and holds no credentials.

type StorageQuotaResponse

type StorageQuotaResponse struct {
	ID                   string `json:"id"`
	RepositoryID         string `json:"repo_id"`
	MaxSizeBytes         int64  `json:"max_size_bytes"`
	MaxArtifactCount     int    `json:"max_artifact_count"`
	WarnThresholdPercent int    `json:"warn_threshold_percent"`
	CurrentSizeBytes     int64  `json:"current_size_bytes"`
	CurrentArtifactCount int    `json:"current_artifact_count"`
	UsagePercent         int    `json:"usage_percent"`
	IsExceeded           bool   `json:"is_exceeded"`
	CreatedAt            string `json:"created_at"`
	UpdatedAt            string `json:"updated_at"`
}

StorageQuotaResponse represents a storage quota in API responses.

type StorageTierResponse added in v0.7.0

type StorageTierResponse struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Primary is true for the tier backed by the server's configured storage.
	Primary bool `json:"primary"`
	// Backend is the storage backend (by name) the tier maps to; null for the primary tier.
	Backend       *string `json:"backend"`
	BackendKind   string  `json:"backend_kind"`
	BackendStatus string  `json:"backend_status"`
	Rank          int     `json:"rank"`
	PromoteOnRead bool    `json:"promote_on_read"`
	// Available is false when this server could not open the tier's backend.
	Available  bool      `json:"available"`
	BlobCount  int64     `json:"blob_count"`
	TotalBytes int64     `json:"total_bytes"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

StorageTierResponse is a storage tier with its current placement.

type SystemInfoResponse

type SystemInfoResponse struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	BuildTime string `json:"build_time"`
	GoVersion string `json:"go_version"`
	OS        string `json:"os"`
	Arch      string `json:"arch"`
}

SystemInfoResponse represents system information.

type TestResultResponse

type TestResultResponse struct {
	OK      bool    `json:"ok"`
	Error   *string `json:"error,omitempty"`
	Message *string `json:"message,omitempty"`
}

TestResultResponse represents a test connection result.

type TierDryRunResponse added in v0.7.0

type TierDryRunResponse struct {
	Scanned   int                       `json:"scanned"`
	Truncated bool                      `json:"truncated"`
	WouldMove TierMoveTotalsResponse    `json:"would_move"`
	Routes    []TierRouteResponse       `json:"routes"`
	Policies  []TierPolicyTotalResponse `json:"policies"`
	Sample    []TierMoveSampleResponse  `json:"sample"`
}

TierDryRunResponse is the result of simulating policies without moving anything.

type TierMoveSampleResponse added in v0.7.0

type TierMoveSampleResponse struct {
	SHA256         string     `json:"sha256"`
	SizeBytes      int64      `json:"size_bytes"`
	From           string     `json:"from"`
	To             string     `json:"to"`
	Policy         string     `json:"policy"`
	CreatedAt      time.Time  `json:"created_at"`
	LastAccessedAt *time.Time `json:"last_accessed_at"`
}

TierMoveSampleResponse is one blob a dry run would move.

type TierMoveTotalsResponse added in v0.7.0

type TierMoveTotalsResponse struct {
	Count int64 `json:"count"`
	Bytes int64 `json:"bytes"`
}

TierMoveTotalsResponse is a count and byte total.

type TierMoverStatusResponse added in v0.7.0

type TierMoverStatusResponse struct {
	Enabled         bool                      `json:"enabled"`
	Running         bool                      `json:"running"`
	IntervalSeconds int64                     `json:"interval_seconds"`
	LastPass        *TierPassResponse         `json:"last_pass"`
	PendingTotal    int64                     `json:"pending_total"`
	Pending         []TierPendingMoveResponse `json:"pending"`
}

TierMoverStatusResponse is the state of the background mover.

type TierPassResponse added in v0.7.0

type TierPassResponse struct {
	StartedAt  time.Time `json:"started_at"`
	FinishedAt time.Time `json:"finished_at"`
	Recovered  int       `json:"recovered"`
	Promoted   int       `json:"promoted"`
	Moved      int       `json:"moved"`
	Skipped    int       `json:"skipped"`
	Failed     int       `json:"failed"`
	Bytes      int64     `json:"bytes"`
	Scanned    int       `json:"scanned"`
	Aborted    bool      `json:"aborted"`
}

TierPassResponse summarizes one mover pass.

type TierPendingMoveResponse added in v0.7.0

type TierPendingMoveResponse struct {
	SHA256    string    `json:"sha256"`
	SizeBytes int64     `json:"size_bytes"`
	From      string    `json:"from"`
	To        string    `json:"to"`
	State     string    `json:"state"`
	Reason    string    `json:"reason"`
	Attempts  int       `json:"attempts"`
	UpdatedAt time.Time `json:"updated_at"`
}

TierPendingMoveResponse is a journaled move that has not completed.

type TierPolicyTotalResponse added in v0.7.0

type TierPolicyTotalResponse struct {
	Policy string `json:"policy"`
	Count  int64  `json:"count"`
	Bytes  int64  `json:"bytes"`
}

TierPolicyTotalResponse totals the moves one policy causes.

type TierRouteResponse added in v0.7.0

type TierRouteResponse struct {
	From  string `json:"from"`
	To    string `json:"to"`
	Count int64  `json:"count"`
	Bytes int64  `json:"bytes"`
}

TierRouteResponse totals the moves between one pair of tiers.

type TokenCreateResponse

type TokenCreateResponse struct {
	TokenResponse

	Token string `json:"token"`
}

TokenCreateResponse includes the clear-text token on creation.

type TokenResponse

type TokenResponse struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	Kind       string   `json:"kind"`
	Scopes     []string `json:"scopes"`
	ExpiresAt  *string  `json:"expires_at"`
	LastUsedAt *string  `json:"last_used_at"`
	CreatedAt  string   `json:"created_at"`
}

TokenResponse represents an API token in responses.

type TrashEmptyResponse added in v0.5.0

type TrashEmptyResponse struct {
	// Purged is how many items this request destroyed.
	Purged int `json:"purged"`
	// Remaining is how many trashed items are left (the request purges a capped number).
	Remaining int `json:"remaining"`
}

TrashEmptyResponse is the result of emptying a repository's trash.

type TrashItemResponse added in v0.5.0

type TrashItemResponse struct {
	ID string `json:"id"`
	// Kind is the trash kind: "repository" or the kind of the deleted row
	// (maven_artifact, npm_version, docker_tag, ...).
	Kind         string `json:"kind"`
	RepositoryID string `json:"repository_id"`
	// Repository is the owning repository's name (the trashed repository
	// itself for kind "repository").
	Repository string `json:"repository"`
	Format     string `json:"format"`
	Name       string `json:"name"`
	Version    string `json:"version,omitempty"`
	SizeBytes  int64  `json:"size_bytes"`
	DeletedAt  string `json:"deleted_at"`
	DeletedBy  string `json:"deleted_by"`
	// DeletedByName is who deleted the item as a display name: the username,
	// or the policy or peer that did it (cleanup-policy, federation:<peer>).
	// Empty when the deleter was not recorded. DeletedBy holds the same value.
	DeletedByName string `json:"deleted_by_name"`
	// ExpiresAt is when the retention purge removes the item for good.
	ExpiresAt string `json:"expires_at"`
	// PurgeAt is ExpiresAt under its original name, kept for existing clients.
	PurgeAt string `json:"purge_at"`
}

TrashItemResponse is one soft-deleted package row or repository.

type TrashListResponse added in v0.5.0

type TrashListResponse struct {
	Items []TrashItemResponse `json:"items"`
	Total int                 `json:"total"`
	Page  int                 `json:"page"`
	Limit int                 `json:"limit"`
}

TrashListResponse is a page of trashed items.

type UnifiedTokenList added in v0.11.0

type UnifiedTokenList struct {
	Tokens []UnifiedTokenResponse `json:"tokens"`
	Total  int                    `json:"total"`
	Page   int                    `json:"page"`
	Limit  int                    `json:"limit"`
}

UnifiedTokenList is GET /api/v1/tokens.

type UnifiedTokenResponse added in v0.11.0

type UnifiedTokenResponse struct {
	ID         string   `json:"id"`
	Type       string   `json:"type"`
	Name       string   `json:"name"`
	Owner      string   `json:"owner"`
	Project    string   `json:"project,omitempty"`
	Repository string   `json:"repository,omitempty"`
	Role       string   `json:"role,omitempty"`
	Scopes     []string `json:"scopes,omitempty"`
	CreatedAt  string   `json:"created_at"`
	ExpiresAt  *string  `json:"expires_at,omitempty"`
	LastUsedAt *string  `json:"last_used_at,omitempty"`
	// Expired is true once ExpiresAt has passed; a token without an expiry never expires.
	Expired bool `json:"expired"`
}

UnifiedTokenResponse is one token of GET /api/v1/tokens, whatever its kind: personal (type "personal", Owner is the user), project (Project, Role, Owner is the creator) or federation (Repository, Project when the repository belongs to one). The secret is never returned.

type UserMeResponse

type UserMeResponse struct {
	ID                 string   `json:"id"`
	Username           string   `json:"username"`
	Email              *string  `json:"email"`
	FullName           *string  `json:"full_name"`
	Disabled           bool     `json:"disabled"`
	MustChangePassword bool     `json:"must_change_password"`
	IsAdmin            bool     `json:"is_admin"`
	Groups             []string `json:"groups"`
	// Projects are the caller's project roles (global admins are implicit
	// owners everywhere and are not listed unless they hold a role).
	Projects    []ProjectRoleResponse `json:"projects"`
	LastLoginAt *string               `json:"last_login_at"`
	CreatedAt   string                `json:"created_at"`
	UpdatedAt   string                `json:"updated_at"`
}

UserMeResponse extends UserResponse with admin status and groups (for /auth/me).

type UserResponse

type UserResponse struct {
	ID                 string  `json:"id"`
	Username           string  `json:"username"`
	Email              *string `json:"email"`
	FullName           *string `json:"full_name"`
	Disabled           bool    `json:"disabled"`
	MustChangePassword bool    `json:"must_change_password"`
	LastLoginAt        *string `json:"last_login_at"`
	CreatedAt          string  `json:"created_at"`
	UpdatedAt          string  `json:"updated_at"`
}

UserResponse represents a user in API responses.

type VEXFeedResponse added in v0.22.0

type VEXFeedResponse struct {
	ID               string  `json:"id"`
	Name             string  `json:"name"`
	URL              string  `json:"url"`
	Enabled          bool    `json:"enabled"`
	RequireSignature bool    `json:"require_signature"`
	PGPKeys          string  `json:"pgp_keys"`
	IntervalHours    int     `json:"interval_hours"`
	CursorAt         *string `json:"cursor_at"`
	LastAttemptAt    *string `json:"last_attempt_at"`
	LastSuccessAt    *string `json:"last_success_at"`
	LastError        string  `json:"last_error"`
	DocumentsTotal   int     `json:"documents_total"`
	RejectedTotal    int     `json:"rejected_total"`
	Statements       int     `json:"statements"`
	Applied          int     `json:"applied"`
	CreatedAt        string  `json:"created_at"`
	UpdatedAt        string  `json:"updated_at"`
}

VEXFeedResponse is a vendor CSAF VEX feed and its import state.

type VEXStatementResponse added in v0.7.0

type VEXStatementResponse struct {
	ID              string `json:"id"`
	ArtifactID      string `json:"artifact_id"`
	VulnID          string `json:"vuln_id"`
	Status          string `json:"status"`
	Justification   string `json:"justification"`
	ImpactStatement string `json:"impact_statement"`
	ActionStatement string `json:"action_statement"`
	// SourceKind is local (an operator decision), csaf (a vendor VEX feed) or
	// peer (a federated peer); SourceName names the feed or peer and SourceRef
	// is the CSAF document URL or the peer base URL.
	SourceKind string `json:"source_kind"`
	SourceName string `json:"source_name"`
	SourceRef  string `json:"source_ref"`
	CreatedBy  string `json:"created_by"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
}

VEXStatementResponse is an admin VEX decision in API responses.

type VEXSuggestionResponse added in v0.22.0

type VEXSuggestionResponse struct {
	ID              string  `json:"id"`
	ArtifactID      string  `json:"artifact_id"`
	VulnID          string  `json:"vuln_id"`
	Status          string  `json:"status"`
	Justification   string  `json:"justification"`
	ImpactStatement string  `json:"impact_statement"`
	ActionStatement string  `json:"action_statement"`
	PeerID          string  `json:"peer_id"`
	PeerName        string  `json:"peer_name"`
	PeerBaseURL     string  `json:"peer_base_url"`
	PeerUpdatedAt   *string `json:"peer_updated_at"`
	State           string  `json:"state"`
	DecidedBy       string  `json:"decided_by"`
	DecidedAt       *string `json:"decided_at"`
	LocalStatus     string  `json:"local_status"`
	LocalSourceKind string  `json:"local_source_kind"`
	CreatedAt       string  `json:"created_at"`
	UpdatedAt       string  `json:"updated_at"`
}

VEXSuggestionResponse is a federated peer's VEX decision offered to a repository.

type VulnGateCriteria added in v0.14.0

type VulnGateCriteria struct {
	KEV         bool     `json:"kev"`
	EPSSMin     *float64 `json:"epss_min"`
	MinPriority string   `json:"min_priority"`
}

VulnGateCriteria echoes the conditions a gate check applied.

type VulnGateFailure added in v0.14.0

type VulnGateFailure struct {
	ID string `json:"id"`
	// CVE is the CVE id the signals were looked up by; empty when the finding has none.
	CVE      string `json:"cve"`
	Priority string `json:"priority"`
	// Reasons names the conditions it meets ("kev", "epss>=0.5", "priority>=high").
	Reasons []string `json:"reasons"`
}

VulnGateFailure is one finding that trips the gate.

type VulnGateResponse added in v0.14.0

type VulnGateResponse struct {
	Pass           bool              `json:"pass"`
	Reason         string            `json:"reason,omitempty"`
	ScanStatus     string            `json:"scan_status"`
	FailedScanners []string          `json:"failed_scanners"`
	Criteria       VulnGateCriteria  `json:"criteria"`
	Checked        int               `json:"checked"`
	Failed         []VulnGateFailure `json:"failed"`
	// Checks lists what the gate looked at, one entry per check; Pass is true
	// only when every one passed.
	Checks []GateCheck `json:"checks"`
}

VulnGateResponse is the verdict of a gate check on one scan: Pass is true when the scan completed and no finding meets any condition. A scan that did not complete, or a kev/epss_min condition whose feed is not loaded, is not a pass: Reason says why.

type VulnScanExportResponse added in v0.7.0

type VulnScanExportResponse struct {
	VulnScanResultResponse

	RepositoryName string `json:"repository_name"`
}

VulnScanExportResponse is one scan of the cross-repository JSON export: the scan with its findings and the name of its repository.

type VulnScanOverviewResponse added in v0.7.0

type VulnScanOverviewResponse struct {
	Scans   []VulnScanOverviewRowResponse `json:"scans"`
	HasMore bool                          `json:"has_more"`
	// NextCursor is the opaque cursor of the next page, present when HasMore.
	NextCursor *string `json:"next_cursor,omitempty"`
}

VulnScanOverviewResponse is one keyset page of the overview.

type VulnScanOverviewRowResponse added in v0.7.0

type VulnScanOverviewRowResponse struct {
	ID               string  `json:"id"`
	RepositoryID     string  `json:"repo_id"`
	RepositoryName   string  `json:"repository_name"`
	RepositoryFormat string  `json:"repository_format"`
	ArtifactID       string  `json:"artifact_id"`
	PackageName      string  `json:"package_name"`
	PackageVersion   string  `json:"package_version"`
	Ecosystem        string  `json:"ecosystem"`
	Scanner          string  `json:"scanner"`
	ScanStatus       string  `json:"scan_status"`
	VulnCount        int     `json:"vuln_count"`
	CriticalCount    int     `json:"critical_count"`
	HighCount        int     `json:"high_count"`
	MediumCount      int     `json:"medium_count"`
	LowCount         int     `json:"low_count"`
	Quarantined      bool    `json:"quarantined"`
	CreatedAt        string  `json:"created_at"`
	UpdatedAt        string  `json:"updated_at"`
	ScannedAt        *string `json:"scanned_at"`
	// ScanError is a sanitized summary of the failing scanners.
	ScanError      *string  `json:"scan_error"`
	FailedScanners []string `json:"failed_scanners"`
	// KEVCount, MaxEPSS and Priority are as in VulnScanResultResponse.
	KEVCount int      `json:"kev_count"`
	MaxEPSS  *float64 `json:"max_epss"`
	Priority string   `json:"priority"`
}

VulnScanOverviewRowResponse is one scan of the cross-repository overview: a VulnScanResultResponse without its findings, with the repository's name and format.

type VulnScanResultResponse

type VulnScanResultResponse struct {
	ID              string  `json:"id"`
	RepositoryID    string  `json:"repo_id"`
	ArtifactID      string  `json:"artifact_id"`
	PackageName     string  `json:"package_name"`
	PackageVersion  string  `json:"package_version"`
	Ecosystem       string  `json:"ecosystem"`
	Scanner         string  `json:"scanner"`
	ScanStatus      string  `json:"scan_status"`
	Vulnerabilities any     `json:"vulnerabilities"`
	VulnCount       int     `json:"vuln_count"`
	CriticalCount   int     `json:"critical_count"`
	HighCount       int     `json:"high_count"`
	MediumCount     int     `json:"medium_count"`
	LowCount        int     `json:"low_count"`
	Quarantined     bool    `json:"quarantined"`
	CreatedAt       string  `json:"created_at"`
	UpdatedAt       string  `json:"updated_at"`
	ScannedAt       *string `json:"scanned_at"`
	// ScanError is a sanitized summary of the failing scanners; it never holds
	// raw scanner output or error text.
	ScanError *string `json:"scan_error"`
	// FailedScanners lists the scanners that produced no result (scan_status
	// "failed" or "partial").
	FailedScanners []string `json:"failed_scanners"`
	// KEVCount is the number of findings whose CVE is in the CISA KEV catalog.
	KEVCount int `json:"kev_count"`
	// MaxEPSS is the highest EPSS score among the findings; null when none is scored.
	MaxEPSS *float64 `json:"max_epss"`
	// Priority is the scan's priority: kev, epss, or its worst severity (critical
	// ... low, none).
	Priority string `json:"priority"`
}

VulnScanResultResponse represents a vulnerability scan result.

type VulnScanSeverityCounts added in v0.7.0

type VulnScanSeverityCounts struct {
	Critical int `json:"critical"`
	High     int `json:"high"`
	Medium   int `json:"medium"`
	Low      int `json:"low"`
}

VulnScanSeverityCounts counts scans by their worst finding: each field is the number of scans with at least one finding of that severity or worse.

type VulnScanSummaryResponse added in v0.7.0

type VulnScanSummaryResponse struct {
	Total           int                    `json:"total"`
	Completed       int                    `json:"completed"`
	Partial         int                    `json:"partial"`
	Failed          int                    `json:"failed"`
	Scanning        int                    `json:"scanning"`
	Quarantined     int                    `json:"quarantined"`
	SeverityAtLeast VulnScanSeverityCounts `json:"severity_at_least"`
}

VulnScanSummaryResponse counts the scans of the overview.

type VulnScannerResponse added in v0.7.0

type VulnScannerResponse struct {
	// Name is osv, trivy or grype.
	Name string `json:"name"`
	// Available is false when the scanner binary cannot be started.
	Available bool `json:"available"`
	// Ready is true when a scan with this scanner can run now (available and,
	// for trivy and grype, a vulnerability database is present).
	Ready bool `json:"ready"`
	// DBState is ready, updating, failed or missing for trivy and grype when
	// the binary is available; null otherwise.
	DBState *string `json:"db_state"`
	// DBUpdatedAt is when the vulnerability database was last refreshed; null
	// when there is none or the time is unknown.
	DBUpdatedAt *string `json:"db_updated_at"`
	// InstallState is installing, ready or failed for a scanner whose install
	// mode is auto and whose binary comes from the installer; null otherwise.
	InstallState *string `json:"install_state"`
	// Code is scanner_unavailable, scanner_installing, scanner_install_failed,
	// scanner_install_noexec or scanner_db_unavailable when the scanner is not
	// ready, else null.
	Code *string `json:"code"`
	// Message says what the operator must do when the scanner is not ready.
	Message *string `json:"message"`
	// DocsURL links the installation guide when the scanner is not ready.
	DocsURL *string `json:"docs_url"`
}

VulnScannerResponse reports whether one vulnerability scanner can run on the server. Fixed, client-safe text only: no paths, versions or scanner output.

type WebhookResponse

type WebhookResponse struct {
	ID             string   `json:"id"`
	RepositoryID   *string  `json:"repository_id"`
	Name           string   `json:"name"`
	URL            string   `json:"url"`
	Enabled        bool     `json:"enabled"`
	Events         []string `json:"events"`
	ContentType    string   `json:"content_type"`
	PayloadFormat  string   `json:"payload_format"`
	HasSecret      bool     `json:"has_secret"`
	SSLVerify      bool     `json:"ssl_verify"`
	TimeoutSeconds int      `json:"timeout_seconds"`
	MaxRetries     int      `json:"max_retries"`
	CreatedAt      string   `json:"created_at"`
	UpdatedAt      string   `json:"updated_at"`
}

WebhookResponse represents a webhook in API responses. The signing secret is write-only: it is never returned, only whether one is configured.

Jump to

Keyboard shortcuts

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