Documentation
¶
Overview ¶
Package artifactshttp is the artifacts module's management REST: the ArtifactoryAPI partial of the artifactory spec's strict server (the repository, build, search, trash, storage summary and reindex operations) and the hand-written routes beside it (items, storage, trash, multipart uploads, transfer, the searches and AQL), with the item overlays and private paths of the formats whose files it serves, the package protocol list and the build actions' replay bindings. The router builds the partial from Deps with New and mounts its registrars in a fixed order.
Role ¶
artifacts module, HTTP adapter layer (management REST). The composition root mounts what this package exports beside the other partials. The package imports no server or router package: the router hands it what it needs as Deps. It embeds the item kit (itemkit), which the ecosystem partials share, and builds the ecosystem HTTP packages' protocols (Protocols). It reaches the access module only through access/api and the kernel's principal helpers, and the configuration module not at all: the descriptor's minimum redirect size reaches the kit as a function in its Deps.
Inputs ¶
- Driving: the router, which embeds ArtifactoryAPI in the generated strict server beside the other partials and the stubs, mounts the registrars, SmartStatus and Protocols, installs HelmPartialReindex as middleware, and hands KeyedBindings to the shared replay that wraps the strict server's keyed operations.
- Deps, from the composition root: the metadata store, through Store, which New gives the item kit too. It is the kit's store (itemkit.Store) and the protocols' (pkgroute.Store); the handlers read and write it and hand it to the search, build, trash, garbage collection, repository and usage code they call. Then the item kit's other dependencies (the blob store, the remote sources, the work queue, the formats and their settings, the access module's API, the redirect policy, the logger, the overlays and the private predicate) and the handlers' own: the remote connection pools, the remote status diagnostics, the garbage collector, the multipart upload service, the blob mirrors and location, the AQL and search limits, and the build, folder download, Hugging Face and npm settings.
- The request's principal and decider in its context, which the authentication middleware put there, and the raw query and body that the router's request details keep for the operations that read them (KeepsSearchQuery, KeepsRepositoryBody, KeepsBuildBody).
Outputs ¶
- Store, the store Deps.Store holds. It names no access or configuration-module store.
- ArtifactoryAPI, built by New: the strict operations of its slice of the artifactory spec; the registrars RegisterItemRoutes, RegisterTransferRoutes, RegisterStorageRoutes, RegisterTrashRoutes, RegisterMultipartRoutes and RegisterSearchRoutes; SmartStatus; HelmPartialReindex; and ProtocolOptions, the router kit's options for every protocol.
- The router's contributions: KeyedBindings (the replay bindings of build append, both build deletes and build promotion, which confirm a committed action and answer for it), SelfAuthenticated, SlashCollections, KeepsSearchQuery, KeepsRepositoryBody, KeepsBuildBody, PrivateItem, and the overlays TryCondaItem, TryMachineLearningItem and TryChefItem.
- Protocols: the package protocols with routers of their own.
- The configuration types AQLLimits, SearchLimits, Mirrors and MirrorStatus, which the router's Config and the application name.
Invariants ¶
- Registration order: the router mounts the item routes (with AQL) first, then transfer, storage, trash, multipart and the searches, all ahead of its hand-written stubs, so that each route claims the pattern the spec derives and replaces its 501 stub rather than sitting beside it (decision 0002). HelmPartialReindex is middleware that runs after authentication and ahead of routing, which cannot match its path.
- Private paths are never served through the generic routes: the overlays answer the paths PrivateItem names 404 on an item GET, a checksum deploy never reuses their content, and trash and transfer relocate or skip them by each format's own rule.
- Statuses, envelopes and error, log and metric text are what JFrog's clients and the operators' logs read, so they stay byte-identical.
- A complete list written from store pages (decision 0043, "Streaming complete lists"; #1409) answers the bytes it answered when it was collected whole. The storage API's file list merges its trees' walks in full path byte order, the order its uri sort gave, keeping the first readable tree's item at each path; the dependency search names each build once across its keyset pages; Get Repositories without limit reads windows after the last key. Folder information walks its trees' children in name order one tree after another, as it listed them, and a folder's last-modified view folds the merged walk, settling a tie as the collected read did. The trash can's views walk its tree in path order (trash.Walk).
References ¶
- Decision 0002: docs/research/decisions/0002-spec-first-flat-crud-handwritten-item-paths.md (hand-written item paths mounted ahead of the generated routes).
- Decision 0004: docs/research/decisions/0004-storage-sql-metadata-and-blobs.md (the item model and content-addressed blobs).
- Decision 0010: docs/research/decisions/0010-retention-trash-and-gc.md (the trash can and garbage collection).
- Decision 0012: docs/research/decisions/0012-search-and-aql.md (the searches and AQL).
- Decision 0014: docs/research/decisions/0014-build-info.md (build-info).
- Decision 0029: docs/research/decisions/0029-cdn-delivery-and-download-redirect.md (the download redirect).
- Decision 0043: docs/research/decisions/0043-api-reliability.md (retry safety, idempotency keys and bounded execution).
- Decision 0044: docs/research/decisions/0044-modular-monolith-migration.md ("Dependency rules": a module reaches another only through its api).
- Target layout: docs/research/architecture-options/5-modular-monolith.md, lines 238 to 246 (artifacts/adapters/http).
- https://github.com/weaveplatform/artifactweave/issues/1078 and https://github.com/weaveplatform/artifactweave/issues/1090
Status ¶
Implemented P1 to P9c as the server root's management handlers; P9d made them the ArtifactoryAPI partial (WEB-08), moved them here (WEB-12) and narrowed their store to Store (ART-22). The GET searches' logic, the upstream search's included, is in artifacts/core/search; the upstream search's route and disclosure policy stays here.
Testing ¶
The tests here call the partial and its helpers without the router, over in-memory stores and the access module of accesstest, which the package's test fixture binds as the router would: the storage summary and its formatting, the storage view's permissions, the streamed file list, folder information and last-modified view against the views collected whole, on the in-memory store, SQLite and PostgreSQL, and their store faults (storage_list_stream_test.go), the trash can's views likewise (trash_stream_test.go), the repository operations, the build actions' replay bindings and keyed appends, deletes and promotions through the shared replay, the transitive AQL peer rows and bounds, the AQL timeouts behind a router of the item routes alone, and the upstream search disclosures. The route suites under test/server/artifacts reach the rest through the router.
Index ¶
- func KeepsBuildBody(r *http.Request) bool
- func KeepsRepositoryBody(r *http.Request) bool
- func KeepsSearchQuery(r *http.Request) bool
- func PrivateItem(c repo.Config, p string) bool
- func Protocols(d Deps) []pkgroute.Protocol
- func SelfAuthenticated() map[string]bool
- func SlashCollections() map[string]string
- func TryChefItem(_ *itemkit.Kit, w http.ResponseWriter, r *http.Request, _ itemkit.Store, ...) bool
- func TryCondaItem(_ *itemkit.Kit, w http.ResponseWriter, r *http.Request, _ itemkit.Store, ...) bool
- func TryMachineLearningItem(_ *itemkit.Kit, w http.ResponseWriter, r *http.Request, _ itemkit.Store, ...) bool
- type AQLLimits
- type ArtifactoryAPI
- func (s ArtifactoryAPI) AppendBuild(ctx context.Context, req artgen.AppendBuildRequestObject) (artgen.AppendBuildResponseObject, error)
- func (s ArtifactoryAPI) CalculateAlpineRepositoryMetadata(ctx context.Context, req artgen.CalculateAlpineRepositoryMetadataRequestObject) (artgen.CalculateAlpineRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculateBowerIndex(ctx context.Context, req artgen.CalculateBowerIndexRequestObject) (artgen.CalculateBowerIndexResponseObject, error)
- func (s ArtifactoryAPI) CalculateCargoRepositoryMetadata(ctx context.Context, req artgen.CalculateCargoRepositoryMetadataRequestObject) (artgen.CalculateCargoRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculateCocoaPodsIndex(ctx context.Context, req artgen.CalculateCocoaPodsIndexRequestObject) (artgen.CalculateCocoaPodsIndexResponseObject, error)
- func (s ArtifactoryAPI) CalculateConanRepositoryMetadata(ctx context.Context, req artgen.CalculateConanRepositoryMetadataRequestObject) (artgen.CalculateConanRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculateCondaRepositoryMetadata(ctx context.Context, req artgen.CalculateCondaRepositoryMetadataRequestObject) (artgen.CalculateCondaRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculateCranRepositoryMetadata(ctx context.Context, req artgen.CalculateCranRepositoryMetadataRequestObject) (artgen.CalculateCranRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculateHelmChartIndex(ctx context.Context, req artgen.CalculateHelmChartIndexRequestObject) (artgen.CalculateHelmChartIndexResponseObject, error)
- func (s ArtifactoryAPI) CalculateNuGetRepositoryMetadata(ctx context.Context, req artgen.CalculateNuGetRepositoryMetadataRequestObject) (artgen.CalculateNuGetRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculateOpkgRepositoryMetadata(ctx context.Context, req artgen.CalculateOpkgRepositoryMetadataRequestObject) (artgen.CalculateOpkgRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculatePubRepositoryMetadata(ctx context.Context, req artgen.CalculatePubRepositoryMetadataRequestObject) (artgen.CalculatePubRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculatePypiRepositoryMetadata(ctx context.Context, req artgen.CalculatePypiRepositoryMetadataRequestObject) (artgen.CalculatePypiRepositoryMetadataResponseObject, error)
- func (s ArtifactoryAPI) CalculateRubyGemsIndex(ctx context.Context, req artgen.CalculateRubyGemsIndexRequestObject) (artgen.CalculateRubyGemsIndexResponseObject, error)
- func (s ArtifactoryAPI) CalculateSwiftIndex(ctx context.Context, req artgen.CalculateSwiftIndexRequestObject) (artgen.CalculateSwiftIndexResponseObject, error)
- func (s ArtifactoryAPI) CalculateTerraformIndex(ctx context.Context, req artgen.CalculateTerraformIndexRequestObject) (artgen.CalculateTerraformIndexResponseObject, error)
- func (s ArtifactoryAPI) CheckIfRepositoryExists(ctx context.Context, req artgen.CheckIfRepositoryExistsRequestObject) (artgen.CheckIfRepositoryExistsResponseObject, error)
- func (s ArtifactoryAPI) ControlBuildRetention(ctx context.Context, req artgen.ControlBuildRetentionRequestObject) (artgen.ControlBuildRetentionResponseObject, error)
- func (s ArtifactoryAPI) CreateMultipleRepositories(ctx context.Context, req artgen.CreateMultipleRepositoriesRequestObject) (artgen.CreateMultipleRepositoriesResponseObject, error)
- func (s ArtifactoryAPI) CreateRepository(ctx context.Context, req artgen.CreateRepositoryRequestObject) (artgen.CreateRepositoryResponseObject, error)
- func (s ArtifactoryAPI) DeleteBuilds(ctx context.Context, req artgen.DeleteBuildsRequestObject) (artgen.DeleteBuildsResponseObject, error)
- func (s ArtifactoryAPI) DeleteBuildsMultiple(ctx context.Context, req artgen.DeleteBuildsMultipleRequestObject) (artgen.DeleteBuildsMultipleResponseObject, error)
- func (s ArtifactoryAPI) DeleteItemFromTrashCan(ctx context.Context, req artgen.DeleteItemFromTrashCanRequestObject) (artgen.DeleteItemFromTrashCanResponseObject, error)
- func (s ArtifactoryAPI) DeleteRepositories(ctx context.Context, req artgen.DeleteRepositoriesRequestObject) (artgen.DeleteRepositoriesResponseObject, error)
- func (s ArtifactoryAPI) DeleteRepository(ctx context.Context, req artgen.DeleteRepositoryRequestObject) (artgen.DeleteRepositoryResponseObject, error)
- func (s ArtifactoryAPI) EmptyTrashCan(ctx context.Context, _ artgen.EmptyTrashCanRequestObject) (artgen.EmptyTrashCanResponseObject, error)
- func (s ArtifactoryAPI) GetAllBuilds(ctx context.Context, req artgen.GetAllBuildsRequestObject) (artgen.GetAllBuildsResponseObject, error)
- func (s ArtifactoryAPI) GetAllRepositoryConfigurations(ctx context.Context, req artgen.GetAllRepositoryConfigurationsRequestObject) (artgen.GetAllRepositoryConfigurationsResponseObject, error)
- func (s ArtifactoryAPI) GetBatchOfRepositoriesByName(ctx context.Context, req artgen.GetBatchOfRepositoriesByNameRequestObject) (artgen.GetBatchOfRepositoriesByNameResponseObject, error)
- func (s ArtifactoryAPI) GetBuildArtifacts(ctx context.Context, req artgen.GetBuildArtifactsRequestObject) (artgen.GetBuildArtifactsResponseObject, error)
- func (s ArtifactoryAPI) GetBuildInfo(ctx context.Context, req artgen.GetBuildInfoRequestObject) (artgen.GetBuildInfoResponseObject, error)
- func (s ArtifactoryAPI) GetBuildRuns(ctx context.Context, req artgen.GetBuildRunsRequestObject) (artgen.GetBuildRunsResponseObject, error)
- func (s ArtifactoryAPI) GetRemoteRepositoryConfiguration(ctx context.Context, req artgen.GetRemoteRepositoryConfigurationRequestObject) (artgen.GetRemoteRepositoryConfigurationResponseObject, error)
- func (s ArtifactoryAPI) GetRepositoriesByTypeAndProject(ctx context.Context, req artgen.GetRepositoriesByTypeAndProjectRequestObject) (artgen.GetRepositoriesByTypeAndProjectResponseObject, error)
- func (s ArtifactoryAPI) GetRepositoryConfiguration(ctx context.Context, req artgen.GetRepositoryConfigurationRequestObject) (artgen.GetRepositoryConfigurationResponseObject, error)
- func (s ArtifactoryAPI) GetRepositoryConfigurationV2(ctx context.Context, req artgen.GetRepositoryConfigurationV2RequestObject) (artgen.GetRepositoryConfigurationV2ResponseObject, error)
- func (s ArtifactoryAPI) GetStorageSummaryInfo(ctx context.Context, _ artgen.GetStorageSummaryInfoRequestObject) (artgen.GetStorageSummaryInfoResponseObject, error)
- func (s ArtifactoryAPI) GetUploadsConfig(context.Context, artgen.GetUploadsConfigRequestObject) (artgen.GetUploadsConfigResponseObject, error)
- func (s ArtifactoryAPI) HelmPartialReindex(next http.Handler) http.Handler
- func (s ArtifactoryAPI) KeyedBindings() map[string]idempotency.Binding
- func (s ArtifactoryAPI) OptimizeSystemStorage(ctx context.Context, _ artgen.OptimizeSystemStorageRequestObject) (artgen.OptimizeSystemStorageResponseObject, error)
- func (s ArtifactoryAPI) PromoteBuild(ctx context.Context, req artgen.PromoteBuildRequestObject) (artgen.PromoteBuildResponseObject, error)
- func (s ArtifactoryAPI) ProtocolOptions() pkgroute.Options
- func (ArtifactoryAPI) RefreshStorageSummaryInfo(ctx context.Context, _ artgen.RefreshStorageSummaryInfoRequestObject) (artgen.RefreshStorageSummaryInfoResponseObject, error)
- func (s ArtifactoryAPI) RegisterItemRoutes(r chi.Router)
- func (s ArtifactoryAPI) RegisterMultipartRoutes(r chi.Router)
- func (s ArtifactoryAPI) RegisterSearchRoutes(r chi.Router)
- func (s ArtifactoryAPI) RegisterStorageRoutes(r chi.Router)
- func (s ArtifactoryAPI) RegisterTransferRoutes(r chi.Router)
- func (s ArtifactoryAPI) RegisterTrashRoutes(r chi.Router)
- func (s ArtifactoryAPI) RenameBuild(ctx context.Context, req artgen.RenameBuildRequestObject) (artgen.RenameBuildResponseObject, error)
- func (s ArtifactoryAPI) RestoreItemFromTrashCan(ctx context.Context, req artgen.RestoreItemFromTrashCanRequestObject) (artgen.RestoreItemFromTrashCanResponseObject, error)
- func (s ArtifactoryAPI) RunGarbageCollection(ctx context.Context, _ artgen.RunGarbageCollectionRequestObject) (artgen.RunGarbageCollectionResponseObject, error)
- func (s ArtifactoryAPI) SearchArtifact(ctx context.Context, req artgen.SearchArtifactRequestObject) (artgen.SearchArtifactResponseObject, error)
- func (s ArtifactoryAPI) SearchBadChecksum(ctx context.Context, req artgen.SearchBadChecksumRequestObject) (artgen.SearchBadChecksumResponseObject, error)
- func (s ArtifactoryAPI) SearchBuildArtifacts(ctx context.Context, req artgen.SearchBuildArtifactsRequestObject) (artgen.SearchBuildArtifactsResponseObject, error)
- func (s ArtifactoryAPI) SearchChecksum(ctx context.Context, req artgen.SearchChecksumRequestObject) (artgen.SearchChecksumResponseObject, error)
- func (s ArtifactoryAPI) SearchCreation(ctx context.Context, req artgen.SearchCreationRequestObject) (artgen.SearchCreationResponseObject, error)
- func (s ArtifactoryAPI) SearchDates(ctx context.Context, req artgen.SearchDatesRequestObject) (artgen.SearchDatesResponseObject, error)
- func (s ArtifactoryAPI) SearchDependency(ctx context.Context, req artgen.SearchDependencyRequestObject) (artgen.SearchDependencyResponseObject, error)
- func (s ArtifactoryAPI) SearchGavc(ctx context.Context, req artgen.SearchGavcRequestObject) (artgen.SearchGavcResponseObject, error)
- func (s ArtifactoryAPI) SearchLatestVersion(ctx context.Context, req artgen.SearchLatestVersionRequestObject) (artgen.SearchLatestVersionResponseObject, error)
- func (s ArtifactoryAPI) SearchPattern(ctx context.Context, req artgen.SearchPatternRequestObject) (artgen.SearchPatternResponseObject, error)
- func (s ArtifactoryAPI) SearchProperty(ctx context.Context, req artgen.SearchPropertyRequestObject) (artgen.SearchPropertyResponseObject, error)
- func (s ArtifactoryAPI) SearchUsage(ctx context.Context, req artgen.SearchUsageRequestObject) (artgen.SearchUsageResponseObject, error)
- func (s ArtifactoryAPI) SearchVersions(ctx context.Context, req artgen.SearchVersionsRequestObject) (artgen.SearchVersionsResponseObject, error)
- func (s ArtifactoryAPI) SmartStatus(w http.ResponseWriter, r *http.Request)
- func (s ArtifactoryAPI) UpdateMultipleRepositories(ctx context.Context, req artgen.UpdateMultipleRepositoriesRequestObject) (artgen.UpdateMultipleRepositoriesResponseObject, error)
- func (s ArtifactoryAPI) UpdateRepositoryConfiguration(ctx context.Context, req artgen.UpdateRepositoryConfigurationRequestObject) (artgen.UpdateRepositoryConfigurationResponseObject, error)
- func (s ArtifactoryAPI) UploadBuild(ctx context.Context, req artgen.UploadBuildRequestObject) (artgen.UploadBuildResponseObject, error)
- type Deps
- type MirrorStatus
- type Mirrors
- type SearchLimits
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeepsBuildBody ¶
KeepsBuildBody reports a build-info publish or append, whose raw body the router's request details keep because the document is stored as published (decision 0014).
func KeepsRepositoryBody ¶
KeepsRepositoryBody reports a repository update, which keeps its raw body: repo.Config cannot tell a field left out (keep the stored value) from one sent as null (reset it to its default), and an update needs both.
func KeepsSearchQuery ¶
KeepsSearchQuery reports the requests whose raw query the router's request details keep: the property search, whose parameters are property keys, and the GAVC search, whose older callers send remote=0/1 (gavcRemote), which the generated binding drops; and Get Repositories, whose next link keeps every parameter as the client sent it.
func PrivateItem ¶
PrivateItem reports the paths that only a format's own protocol serves, which the router passes to the item kit (itemkit.Deps.Private): Hugging Face's Xet and Conda's shards, the machine learning formats' private files and Chef's metadata.
func Protocols ¶
Protocols returns the package protocols with routers of their own, which the router mounts through the router kit (decision 0032) in this order, ahead of any test-only protocol. A format with a protocol adds its constructor here.
func SelfAuthenticated ¶
SelfAuthenticated returns "METHOD path" of the routes that verify their own credential, which the authentication middleware passes untouched (accesshttp.AuthnOptions.SelfAuthenticated): the multipart upload calls carry the upload token as a Bearer token, which only the multipart service can verify until access tokens arrive (P4), and a part PUT carries a signed URL and no credentials at all, as the CLI sends it.
func SlashCollections ¶
SlashCollections returns the artifacts collection that the Terraform provider calls with a trailing slash, mapped to its path without one, for the router's rewrite of collection paths: the provider lists repositories at /api/repositories/ (research 08), which chi would otherwise read as a member with an empty key. Only these exact paths are rewritten, because a trailing slash elsewhere under /artifactory names a folder.
func TryChefItem ¶
func TryChefItem( _ *itemkit.Kit, w http.ResponseWriter, r *http.Request, _ itemkit.Store, c repo.Config, cached bool, req itemkit.ItemRequest, p kernel.Principal, acc itemkit.Access, ) bool
TryChefItem is the item overlay (itemkit.Overlay) that answers a Chef repository's metadata documents, which only the native API serves, as files the repository does not hold (itemkit.NotServed, #1599): cached metadata describes versions outside an individual caller's permission patterns, and only the native API filters and rewrites those documents. It writes nothing and returns false for every other path.
func TryCondaItem ¶
func TryCondaItem( _ *itemkit.Kit, w http.ResponseWriter, r *http.Request, _ itemkit.Store, c repo.Config, cached bool, req itemkit.ItemRequest, p kernel.Principal, acc itemkit.Access, ) bool
TryCondaItem is the item overlay (itemkit.Overlay) that answers the paths PrivateItem names as files the repository does not hold (itemkit.NotServed, #1599): stored shards and CAS containers can span several read grants, so only their native routes construct the representation the current caller is allowed to read. 7.x keeps a Conda repository's package shards under .jfrog/shards/<...>/package_shards/ (CondaShardsCleanupServiceImpl, 7.161.26), not at the path the protocol names, so the item route finds no file there [I for the shard index]. It writes nothing and returns false for every other path.
func TryMachineLearningItem ¶
func TryMachineLearningItem( _ *itemkit.Kit, w http.ResponseWriter, r *http.Request, _ itemkit.Store, c repo.Config, cached bool, req itemkit.ItemRequest, p kernel.Principal, acc itemkit.Access, ) bool
TryMachineLearningItem is the item overlay (itemkit.Overlay) that answers the Machine Learning formats' private records, which only their own protocol serves, as files the repository does not hold (itemkit.NotServed, #1599). It writes nothing and returns false for every other path.
Types ¶
type AQLLimits ¶
type AQLLimits struct {
// MaxResults caps the rows of every query, its own limit included; zero
// means no cap.
MaxResults int
// ScanFactor multiplies a non-admin query's limit, so that limit can
// still be met once rows the caller may not read are dropped. Below 1
// is 1. A request's scan-factor header above 1 overrides it.
ScanFactor int
// Timeout cancels a query's database work after this long, and
// StreamTimeout one sent with a stream: true header; zero means no
// timeout. The answer is then 408.
Timeout, StreamTimeout time.Duration
}
AQLLimits bounds POST /api/search/aql (decision 0012).
type ArtifactoryAPI ¶
type ArtifactoryAPI struct {
// Kit is the item kit every partial shares; New builds it, and a
// literal without one panics on its first kit call.
*itemkit.Kit
// contains filtered or unexported fields
}
ArtifactoryAPI is the artifacts module's partial strict server: the repository, build, search, trash, storage summary and reindex operations of the artifactory spec, and the handwritten item, transfer, storage and search routes that its registrars mount. The router's composite strict server adds the other partials and the generated stubs.
func New ¶
func New(d Deps) ArtifactoryAPI
New returns the artifacts partial over d with its own item kit, which the router hands to the ecosystem partials as well, so that the routes of the whole spec share one set of overlays and one redirect throttle. Every artifacts partial is built here: a literal without a kit compiles and then panics on its first kit call.
func (ArtifactoryAPI) AppendBuild ¶
func (s ArtifactoryAPI) AppendBuild( ctx context.Context, req artgen.AppendBuildRequestObject, ) (artgen.AppendBuildResponseObject, error)
AppendBuild adds modules to a run. Like the published document, the modules are read from the raw body, so their unlisted fields survive.
func (ArtifactoryAPI) CalculateAlpineRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculateAlpineRepositoryMetadata( ctx context.Context, req artgen.CalculateAlpineRepositoryMetadataRequestObject, ) (artgen.CalculateAlpineRepositoryMetadataResponseObject, error)
CalculateAlpineRepositoryMetadata queues the documented asynchronous APKINDEX rebuild from the current stored package tree.
func (ArtifactoryAPI) CalculateBowerIndex ¶
func (s ArtifactoryAPI) CalculateBowerIndex( ctx context.Context, req artgen.CalculateBowerIndexRequestObject, ) (artgen.CalculateBowerIndexResponseObject, error)
CalculateBowerIndex rebuilds the native Bower version index from manifests.
func (ArtifactoryAPI) CalculateCargoRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculateCargoRepositoryMetadata( ctx context.Context, req artgen.CalculateCargoRepositoryMetadataRequestObject, ) (artgen.CalculateCargoRepositoryMetadataResponseObject, error)
CalculateCargoRepositoryMetadata validates and rebuilds the hosted crate view, before it answers unless async is true: "The calculation can be synchronous (the default) or asynchronous" (calculatecargorepositorymetadata). On a remote repository it expires the cached upstream config.json instead (itemkit.ReindexOps).
func (ArtifactoryAPI) CalculateCocoaPodsIndex ¶
func (s ArtifactoryAPI) CalculateCocoaPodsIndex( ctx context.Context, req artgen.CalculateCocoaPodsIndexRequestObject, ) (artgen.CalculateCocoaPodsIndexResponseObject, error)
CalculateCocoaPodsIndex queues the rebuild of a CocoaPods repository's spec index and answers once it is queued.
func (ArtifactoryAPI) CalculateConanRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculateConanRepositoryMetadata( ctx context.Context, req artgen.CalculateConanRepositoryMetadataRequestObject, ) (artgen.CalculateConanRepositoryMetadataResponseObject, error)
CalculateConanRepositoryMetadata rebuilds the index from completed recipe/package revisions, before it answers unless async is true: "The calculation can be synchronous (the default) or asynchronous" (calculateconanrepositorymetadata). Conan manifests are the commit markers.
func (ArtifactoryAPI) CalculateCondaRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculateCondaRepositoryMetadata( ctx context.Context, req artgen.CalculateCondaRepositoryMetadataRequestObject, ) (artgen.CalculateCondaRepositoryMetadataResponseObject, error)
CalculateCondaRepositoryMetadata rebuilds hosted channel indexes from stored package archives. The documented async query controls whether the response waits for the persistent worker.
func (ArtifactoryAPI) CalculateCranRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculateCranRepositoryMetadata( ctx context.Context, req artgen.CalculateCranRepositoryMetadataRequestObject, ) (artgen.CalculateCranRepositoryMetadataResponseObject, error)
CalculateCranRepositoryMetadata rebuilds the hosted PACKAGES indexes. The documented default is synchronous; async=true only schedules the work.
func (ArtifactoryAPI) CalculateHelmChartIndex ¶
func (s ArtifactoryAPI) CalculateHelmChartIndex( ctx context.Context, req artgen.CalculateHelmChartIndexRequestObject, ) (artgen.CalculateHelmChartIndexResponseObject, error)
CalculateHelmChartIndex queues the rebuild of a Helm repository's index.yaml and answers once it is queued; HelmPartialReindex serves the reindex of one path.
func (ArtifactoryAPI) CalculateNuGetRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculateNuGetRepositoryMetadata( ctx context.Context, req artgen.CalculateNuGetRepositoryMetadataRequestObject, ) (artgen.CalculateNuGetRepositoryMetadataResponseObject, error)
CalculateNuGetRepositoryMetadata queues the rebuild of a NuGet repository's feed metadata and answers once it is queued.
func (ArtifactoryAPI) CalculateOpkgRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculateOpkgRepositoryMetadata( ctx context.Context, req artgen.CalculateOpkgRepositoryMetadataRequestObject, ) (artgen.CalculateOpkgRepositoryMetadataResponseObject, error)
CalculateOpkgRepositoryMetadata rebuilds Packages, Packages.gz and Release from the current IPKs in each feed. The documented endpoint is synchronous unless async=true is selected.
func (ArtifactoryAPI) CalculatePubRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculatePubRepositoryMetadata( ctx context.Context, req artgen.CalculatePubRepositoryMetadataRequestObject, ) (artgen.CalculatePubRepositoryMetadataResponseObject, error)
CalculatePubRepositoryMetadata queues the rebuild of a Pub repository's package index and answers once it is queued: "The calculation is asynchronous" (calculatepubrepositorymetadata). The same page declares async without saying what false does; it runs the rebuild before the answer, as before [I].
func (ArtifactoryAPI) CalculatePypiRepositoryMetadata ¶
func (s ArtifactoryAPI) CalculatePypiRepositoryMetadata( ctx context.Context, req artgen.CalculatePypiRepositoryMetadataRequestObject, ) (artgen.CalculatePypiRepositoryMetadataResponseObject, error)
CalculatePypiRepositoryMetadata runs the reindex before it answers unless async is true: "The calculation can be synchronous (the default) or asynchronous" (calculatepypirepositorymetadata), with async=1 or 0 in the archived reference, which the boolean binding reads too.
func (ArtifactoryAPI) CalculateRubyGemsIndex ¶
func (s ArtifactoryAPI) CalculateRubyGemsIndex( ctx context.Context, req artgen.CalculateRubyGemsIndexRequestObject, ) (artgen.CalculateRubyGemsIndexResponseObject, error)
CalculateRubyGemsIndex rebuilds a RubyGems repository's specs indexes from its stored gems before it answers. No 7.x reference states the timing, and the archived sample's OK fits a finished run [I].
func (ArtifactoryAPI) CalculateSwiftIndex ¶
func (s ArtifactoryAPI) CalculateSwiftIndex( ctx context.Context, req artgen.CalculateSwiftIndexRequestObject, ) (artgen.CalculateSwiftIndexResponseObject, error)
CalculateSwiftIndex queues the rebuild of a Swift repository's package index and answers once it is queued.
func (ArtifactoryAPI) CalculateTerraformIndex ¶
func (s ArtifactoryAPI) CalculateTerraformIndex( ctx context.Context, req artgen.CalculateTerraformIndexRequestObject, ) (artgen.CalculateTerraformIndexResponseObject, error)
CalculateTerraformIndex queues the rebuild of a Terraform repository's module and provider indexes and answers once it is queued.
func (ArtifactoryAPI) CheckIfRepositoryExists ¶
func (s ArtifactoryAPI) CheckIfRepositoryExists( ctx context.Context, req artgen.CheckIfRepositoryExistsRequestObject, ) (artgen.CheckIfRepositoryExistsResponseObject, error)
CheckIfRepositoryExists reports whether a repository of any asked class exists, of any class when none is asked, within the project when one is named. It is for administrators only.
func (ArtifactoryAPI) ControlBuildRetention ¶
func (s ArtifactoryAPI) ControlBuildRetention( ctx context.Context, req artgen.ControlBuildRetentionRequestObject, ) (artgen.ControlBuildRetentionResponseObject, error)
ControlBuildRetention discards the runs of a build its settings do not keep. With async it checks the request, answers, and discards in the background, logging what goes wrong there. The CLI accepts only 204 (decision 0014).
func (ArtifactoryAPI) CreateMultipleRepositories ¶
func (s ArtifactoryAPI) CreateMultipleRepositories( ctx context.Context, req artgen.CreateMultipleRepositoriesRequestObject, ) (artgen.CreateMultipleRepositoriesResponseObject, error)
CreateMultipleRepositories creates a batch of up to repoBatchLimit repositories, all or none, for administrators only. A key already taken answers 409, where CreateRepository answers 400. The P2 remote repositories a P2 virtual repository's p2Urls need are created with the batch, as CreateRepository creates them, and the answer names only the repositories the batch asked for [I].
func (ArtifactoryAPI) CreateRepository ¶
func (s ArtifactoryAPI) CreateRepository( ctx context.Context, req artgen.CreateRepositoryRequestObject, ) (artgen.CreateRepositoryResponseObject, error)
CreateRepository creates one repository, for administrators only. Its configuration gets its defaults and is checked, together with the members, signing key pairs and environments it names, before anything is stored; a key already taken answers 400. A P2 virtual repository also gets the members its p2Urls need, and the P2 remote repositories it needs are created with it (repos.PlanP2Virtual).
func (ArtifactoryAPI) DeleteBuilds ¶
func (s ArtifactoryAPI) DeleteBuilds( ctx context.Context, req artgen.DeleteBuildsRequestObject, ) (artgen.DeleteBuildsResponseObject, error)
DeleteBuilds deletes runs of a build named in the path. buildNumbers is comma-separated, and a number listed twice deletes two runs.
func (ArtifactoryAPI) DeleteBuildsMultiple ¶
func (s ArtifactoryAPI) DeleteBuildsMultiple( ctx context.Context, req artgen.DeleteBuildsMultipleRequestObject, ) (artgen.DeleteBuildsMultipleResponseObject, error)
DeleteBuildsMultiple is the body form of DeleteBuilds, which jf rt bp --overwrite sends with a number once per existing run.
func (ArtifactoryAPI) DeleteItemFromTrashCan ¶
func (s ArtifactoryAPI) DeleteItemFromTrashCan( ctx context.Context, req artgen.DeleteItemFromTrashCanRequestObject, ) (artgen.DeleteItemFromTrashCanResponseObject, error)
DeleteItemFromTrashCan is the one-segment form of the clean route.
func (ArtifactoryAPI) DeleteRepositories ¶
func (s ArtifactoryAPI) DeleteRepositories( ctx context.Context, req artgen.DeleteRepositoriesRequestObject, ) (artgen.DeleteRepositoriesResponseObject, error)
DeleteRepositories deletes a list of repositories, for administrators only, and answers with a report per key: 200 when every key was removed (a missing key counts as removed), 207 when some failed and 500 when all did. A refused key refuses the whole list before anything is deleted.
func (ArtifactoryAPI) DeleteRepository ¶
func (s ArtifactoryAPI) DeleteRepository( ctx context.Context, req artgen.DeleteRepositoryRequestObject, ) (artgen.DeleteRepositoryResponseObject, error)
DeleteRepository deletes a repository and everything in it, for administrators only, and answers with JFrog's removal report even when it refuses: 403 for a signed-in user without the right and for the build-info repository, 400 for a protected key and 404 for a missing one. Only an anonymous caller gets the ordinary 401.
func (ArtifactoryAPI) EmptyTrashCan ¶
func (s ArtifactoryAPI) EmptyTrashCan( ctx context.Context, _ artgen.EmptyTrashCanRequestObject, ) (artgen.EmptyTrashCanResponseObject, error)
EmptyTrashCan purges every trashed item. Admin only; the blobs are reclaimed by the next garbage collection.
func (ArtifactoryAPI) GetAllBuilds ¶
func (s ArtifactoryAPI) GetAllBuilds( ctx context.Context, req artgen.GetAllBuildsRequestObject, ) (artgen.GetAllBuildsResponseObject, error)
GetAllBuilds lists the build names the caller may read. It answers 200 with an empty list when there are none (decision 0014). The uri of each entry is the name as it is, not escaped, as the JFrog CLI reads it.
func (ArtifactoryAPI) GetAllRepositoryConfigurations ¶
func (s ArtifactoryAPI) GetAllRepositoryConfigurations( ctx context.Context, req artgen.GetAllRepositoryConfigurationsRequestObject, ) (artgen.GetAllRepositoryConfigurationsResponseObject, error)
GetAllRepositoryConfigurations returns every repository's configuration, secrets masked, grouped by class and narrowed by the comma-separated package type and class filters. It is for administrators only.
func (ArtifactoryAPI) GetBatchOfRepositoriesByName ¶
func (s ArtifactoryAPI) GetBatchOfRepositoriesByName( ctx context.Context, req artgen.GetBatchOfRepositoriesByNameRequestObject, ) (artgen.GetBatchOfRepositoriesByNameResponseObject, error)
GetBatchOfRepositoriesByName returns, keyed by name, the configurations of up to repoBatchLimit named repositories as the caller may see them. A name that does not exist or that the caller may not see is left out rather than refused.
func (ArtifactoryAPI) GetBuildArtifacts ¶
func (s ArtifactoryAPI) GetBuildArtifacts( ctx context.Context, req artgen.GetBuildArtifactsRequestObject, ) (artgen.GetBuildArtifactsResponseObject, error)
GetBuildArtifacts lists where the artifacts of a number's latest run are. The JFrog CLI calls it before its AQL fallback, and reads only repo, path and name (research 22 §3.1).
func (ArtifactoryAPI) GetBuildInfo ¶
func (s ArtifactoryAPI) GetBuildInfo( ctx context.Context, req artgen.GetBuildInfoRequestObject, ) (artgen.GetBuildInfoResponseObject, error)
GetBuildInfo returns a run's document. A diff asks for the Builds Diff against an older run, which is not served (DV-088): the request is checked as Artifactory 6.20's BuildResource.getBuildInfo checks it, and one that passes answers 501 rather than the run, which a client would take for the comparison.
func (ArtifactoryAPI) GetBuildRuns ¶
func (s ArtifactoryAPI) GetBuildRuns( ctx context.Context, req artgen.GetBuildRunsRequestObject, ) (artgen.GetBuildRunsResponseObject, error)
GetBuildRuns lists a build's runs, a number once per run, newest first. The uri of each is the number as it is: jf rt bp --overwrite counts the runs of a number by comparing it with the uri less its slash.
func (ArtifactoryAPI) GetRemoteRepositoryConfiguration ¶
func (s ArtifactoryAPI) GetRemoteRepositoryConfiguration( ctx context.Context, req artgen.GetRemoteRepositoryConfigurationRequestObject, ) (artgen.GetRemoteRepositoryConfigurationResponseObject, error)
GetRemoteRepositoryConfiguration returns the shared configuration of a remote repository, its masked remote descriptor (repo.Descriptor), to any caller, anonymous included while anonymous access is on. 7.161.26's RepositoriesResource admits ROLE_ADMIN and ROLE_USER alike, and its RestAuthenticationFilter gives an unauthenticated request ROLE_USER while anonymous access is on; RepoConfigurationResource.getRemoteDescriptor checks nothing more, so anonymous and every user get the same descriptor (#1509). While anonymous access is off the authentication middleware answers a request without credentials 401 before it gets here, as 7.161.26's AccessFilter does through its authentication entry point. A key that names no remote, or a remote whose shareConfiguration is off, answers 404 to every caller, administrators included, as getRemoteDescriptor's Response.status(SC_NOT_FOUND) does. That response has no entity, so 7.x's RestResponseFilter, registered for every REST resource (JerseyApplication), gives it the error envelope with the reason phrase as its message: {"errors":[{"status":404,"message": "Not Found"}]}.
func (ArtifactoryAPI) GetRepositoriesByTypeAndProject ¶
func (s ArtifactoryAPI) GetRepositoriesByTypeAndProject( ctx context.Context, req artgen.GetRepositoriesByTypeAndProjectRequestObject, ) (artgen.GetRepositoriesByTypeAndProjectResponseObject, error)
GetRepositoriesByTypeAndProject lists the repositories the caller may see, narrowed by class, package type and project, and paged by limit and offset. The store applies the filters, the caller's visibility and the window, and counts what the caller sees only when the list is paged. The distribution class lists nothing, because no distribution repository is served here, and the list takes the details-list vendor media type when the client asks for it.
func (ArtifactoryAPI) GetRepositoryConfiguration ¶
func (s ArtifactoryAPI) GetRepositoryConfiguration( ctx context.Context, req artgen.GetRepositoryConfigurationRequestObject, ) (artgen.GetRepositoryConfigurationResponseObject, error)
GetRepositoryConfiguration returns a repository's configuration as the caller may see it (itemkit.View), in the class's vendor media type when the client asks for it. A missing key answers 404, and a key the caller may not see is refused as httpkit.Denied refuses a read.
func (ArtifactoryAPI) GetRepositoryConfigurationV2 ¶
func (s ArtifactoryAPI) GetRepositoryConfigurationV2( ctx context.Context, req artgen.GetRepositoryConfigurationV2RequestObject, ) (artgen.GetRepositoryConfigurationV2ResponseObject, error)
GetRepositoryConfigurationV2 is the v2 form of GetRepositoryConfiguration, which leaves out the fields the repository's class and package type do not use (repo.Relevant).
func (ArtifactoryAPI) GetStorageSummaryInfo ¶
func (s ArtifactoryAPI) GetStorageSummaryInfo( ctx context.Context, _ artgen.GetStorageSummaryInfoRequestObject, ) (artgen.GetStorageSummaryInfoResponseObject, error)
GetStorageSummaryInfo answers the storage summary to an administrator or to a token scoped system:info/storage:r, as 7.x's getstoragesummaryinfo page allows. It is computed on every request, so it never lags writes.
func (ArtifactoryAPI) GetUploadsConfig ¶
func (s ArtifactoryAPI) GetUploadsConfig( context.Context, artgen.GetUploadsConfigRequestObject, ) (artgen.GetUploadsConfigResponseObject, error)
GetUploadsConfig tells the JFrog CLI whether to upload large files in parts (internal/artifacts/core/multipart) or in one request (research 09).
func (ArtifactoryAPI) HelmPartialReindex ¶
func (s ArtifactoryAPI) HelmPartialReindex(next http.Handler) http.Handler
HelmPartialReindex serves Helm's partial reindex, POST /artifactory/api/helm/{repoKey}/{pathForPartialReindex}/reindex, whose path may span several segments: "a path containing multiple charts ... as well as ... a specific chart archive" (kubernetes-helm-chart-repositories). chi routes no parameter across segments and no literal after a catch-all, and a catch-all below the repository key would take requests from the Helm protocol's router, which the router kit mounts there (decision 0032), so the operation is matched before routing. It queues the reindex of the path, with the Helm reindex's permission, classes and answer [I]: no source states them for the partial one (#216).
func (ArtifactoryAPI) KeyedBindings ¶
func (s ArtifactoryAPI) KeyedBindings() map[string]idempotency.Binding
KeyedBindings returns the replay bindings of the artifactory spec's operations that this partial serves and that accept Idempotency-Key, by operation ID. The router gives them to the shared replay (idempotency.Strict), which runs the handler as the effect.
func (ArtifactoryAPI) OptimizeSystemStorage ¶
func (s ArtifactoryAPI) OptimizeSystemStorage( ctx context.Context, _ artgen.OptimizeSystemStorageRequestObject, ) (artgen.OptimizeSystemStorageResponseObject, error)
OptimizeSystemStorage starts a repair pass on every blob mirror at once, as Artifactory's optimize starts its sharding repair (7.104.5). Admin only. The acknowledgement texts are artifactweave's: the spec documents only a plain-text body.
func (ArtifactoryAPI) PromoteBuild ¶
func (s ArtifactoryAPI) PromoteBuild( ctx context.Context, req artgen.PromoteBuildRequestObject, ) (artgen.PromoteBuildResponseObject, error)
PromoteBuild promotes the latest run of a build number. A fail-fast promotion that met an error or a warning answers 400 with its report, as Artifactory does; otherwise the report answers 200, even when files failed.
func (ArtifactoryAPI) ProtocolOptions ¶
func (s ArtifactoryAPI) ProtocolOptions() pkgroute.Options
ProtocolOptions gives the router kit the item routes' download, deploy and error mapping, so a protocol's files are redirected, counted, hooked and refused as theirs are.
func (ArtifactoryAPI) RefreshStorageSummaryInfo ¶
func (ArtifactoryAPI) RefreshStorageSummaryInfo( ctx context.Context, _ artgen.RefreshStorageSummaryInfoRequestObject, ) (artgen.RefreshStorageSummaryInfoResponseObject, error)
RefreshStorageSummaryInfo acknowledges a recalculation. The summary is computed on every request, so there is nothing to wait for.
func (ArtifactoryAPI) RegisterItemRoutes ¶
func (s ArtifactoryAPI) RegisterItemRoutes(r chi.Router)
RegisterItemRoutes serves the item paths (decision 0002) and the AQL search on r. Like every registrar here, it must run before the router stubs the spec's hand-written operations: the routes take exactly the methods and patterns the spec derives (httpkit.ChiPatterns), and a stub is registered only where no handler claimed one, so each route replaces its 501 stub rather than sitting beside it. HEAD is not in the spec; it shares the GET handler. Item routes are outside the management body limit: an upload is streamed, however large.
func (ArtifactoryAPI) RegisterMultipartRoutes ¶
func (s ArtifactoryAPI) RegisterMultipartRoutes(r chi.Router)
RegisterMultipartRoutes serves the JFrog CLI's multipart upload protocol on r. Its routes are the spec's, so, registered before the router's stubs of the hand-written operations, they replace the 501 stubs; and the authentication middleware must pass the calls SelfAuthenticated names to them untouched. Every call but a part PUT, which carries up to 5 GiB, is under the management body limit.
func (ArtifactoryAPI) RegisterSearchRoutes ¶
func (s ArtifactoryAPI) RegisterSearchRoutes(r chi.Router)
RegisterSearchRoutes serves the latest version by properties search, GET /api/versions/{repo}/{path}, whose path spans segments, which a generated route cannot take. Registered before the router's stubs of the hand-written operations, it replaces the 501 stub.
func (ArtifactoryAPI) RegisterStorageRoutes ¶
func (s ArtifactoryAPI) RegisterStorageRoutes(r chi.Router)
RegisterStorageRoutes serves the storage API (/api/storage) and the partial property update (/api/metadata) under the patterns httpkit.ChiPatterns derives from the spec, so, registered before the router's stubs of the hand-written operations, they replace their 501 stubs. The bare /{repoKey} form adds the repository root, which the spec addresses with an empty item path.
func (ArtifactoryAPI) RegisterTransferRoutes ¶
func (s ArtifactoryAPI) RegisterTransferRoutes(r chi.Router)
RegisterTransferRoutes serves copy, move, folder archive download and archive entries, all hand-written in the spec, under the patterns httpkit.ChiPatterns derives, so, registered before the router's stubs of the hand-written operations, they replace the 501 stubs. An archive entry in a nested folder does not fit the entry pattern (a chi parameter is one segment) and reaches GetItem through the plain item route instead.
func (ArtifactoryAPI) RegisterTrashRoutes ¶
func (s ArtifactoryAPI) RegisterTrashRoutes(r chi.Router)
RegisterTrashRoutes serves what the generated routes cannot: trash paths that span segments (the generated clean and restore routes match one segment, and answer that case with the same functions), the trash can's storage listing under its auto-trashcan key, and zap. The patterns are the ones the spec derives, so, registered before the router's stubs of the hand-written operations, they replace them.
func (ArtifactoryAPI) RenameBuild ¶
func (s ArtifactoryAPI) RenameBuild( ctx context.Context, req artgen.RenameBuildRequestObject, ) (artgen.RenameBuildResponseObject, error)
RenameBuild moves every run of a build to another name.
func (ArtifactoryAPI) RestoreItemFromTrashCan ¶
func (s ArtifactoryAPI) RestoreItemFromTrashCan( ctx context.Context, req artgen.RestoreItemFromTrashCanRequestObject, ) (artgen.RestoreItemFromTrashCanResponseObject, error)
RestoreItemFromTrashCan is the one-segment form of the restore route.
func (ArtifactoryAPI) RunGarbageCollection ¶
func (s ArtifactoryAPI) RunGarbageCollection( ctx context.Context, _ artgen.RunGarbageCollectionRequestObject, ) (artgen.RunGarbageCollectionResponseObject, error)
RunGarbageCollection runs a pass and answers when it is done. Admin only. A pass another instance is running counts as done: it collects the same store.
func (ArtifactoryAPI) SearchArtifact ¶
func (s ArtifactoryAPI) SearchArtifact( ctx context.Context, req artgen.SearchArtifactRequestObject, ) (artgen.SearchArtifactResponseObject, error)
SearchArtifact answers the quick search: files whose name contains name, in local repositories and remote caches. Like AQL's $match, which it compiles to, the match is case-sensitive.
func (ArtifactoryAPI) SearchBadChecksum ¶
func (s ArtifactoryAPI) SearchBadChecksum( ctx context.Context, req artgen.SearchBadChecksumRequestObject, ) (artgen.SearchBadChecksumResponseObject, error)
SearchBadChecksum answers the bad checksum search: files whose checksum of the type asked for was not declared by the uploading client, or was declared and differs from the computed one. AQL cannot compare two fields, so the files in scope are read and compared here.
func (ArtifactoryAPI) SearchBuildArtifacts ¶
func (s ArtifactoryAPI) SearchBuildArtifacts( ctx context.Context, req artgen.SearchBuildArtifactsRequestObject, ) (artgen.SearchBuildArtifactsResponseObject, error)
SearchBuildArtifacts answers the build artifacts search: the download URLs of the files a run of the default project produced, the run chosen by number (or LATEST) or else by the status of its latest promotion, as build.Service.Find chooses it, and the files as a promotion finds them (build.Service.SearchArtifacts), in the repositories in repos, narrowed to the paths any mapping matches in full. It checks the body before the caller, needs a named user, and answers 404 whenever it finds no file, as Artifactory's BuildArtifactsSearchResource does.
func (ArtifactoryAPI) SearchChecksum ¶
func (s ArtifactoryAPI) SearchChecksum( ctx context.Context, req artgen.SearchChecksumRequestObject, ) (artgen.SearchChecksumResponseObject, error)
SearchChecksum answers the checksum search: files whose content has every checksum given, in local repositories, remote caches and virtual repositories' members.
func (ArtifactoryAPI) SearchCreation ¶
func (s ArtifactoryAPI) SearchCreation( ctx context.Context, req artgen.SearchCreationRequestObject, ) (artgen.SearchCreationResponseObject, error)
SearchCreation answers the creation search: files created in [from, to], in local repositories and remote caches. A repos key naming no repository the caller may see is the documented 404.
func (ArtifactoryAPI) SearchDates ¶
func (s ArtifactoryAPI) SearchDates( ctx context.Context, req artgen.SearchDatesRequestObject, ) (artgen.SearchDatesResponseObject, error)
SearchDates answers the dates search: files for which any of the named date fields lies in [from, to], in local repositories and remote caches, each with the named fields it has.
func (ArtifactoryAPI) SearchDependency ¶
func (s ArtifactoryAPI) SearchDependency( ctx context.Context, req artgen.SearchDependencyRequestObject, ) (artgen.SearchDependencyResponseObject, error)
SearchDependency answers the dependency search: the build numbers with a run the caller may read that lists a dependency with the SHA-1, each once, in the order their runs were published.
func (ArtifactoryAPI) SearchGavc ¶
func (s ArtifactoryAPI) SearchGavc( ctx context.Context, req artgen.SearchGavcRequestObject, ) (artgen.SearchGavcResponseObject, error)
SearchGavc answers the GAVC search: the files whose layout coordinates match each of g, a, v and c given. With specific, a virtual key in repos searches its members, and each result names the download URL under the key the search named, with the extension, version and classifier.
func (ArtifactoryAPI) SearchLatestVersion ¶
func (s ArtifactoryAPI) SearchLatestVersion( ctx context.Context, req artgen.SearchLatestVersionRequestObject, ) (artgen.SearchLatestVersionResponseObject, error)
SearchLatestVersion answers the latest version search, in plain text, the first of the module's versions as the versions search lists them, by file version: without v the first release; with a v that has wildcards the first version of either kind it matches; with any other v the first integration version of that module version. Each way of finding nothing has Artifactory's own 404.
func (ArtifactoryAPI) SearchPattern ¶
func (s ArtifactoryAPI) SearchPattern( ctx context.Context, req artgen.SearchPatternRequestObject, ) (artgen.SearchPatternResponseObject, error)
SearchPattern answers the pattern search: the files of one local repository or remote cache whose path matches an Ant pattern, given as repo-key:pattern, whose * and ? stay within a segment. ** is refused to keep the search bounded, and so is a trailing /, which Ant reads as **. A key that names no such repository the caller may see finds nothing, as an unknown repos key does in the other searches.
func (ArtifactoryAPI) SearchProperty ¶
func (s ArtifactoryAPI) SearchProperty( ctx context.Context, req artgen.SearchPropertyRequestObject, ) (artgen.SearchPropertyResponseObject, error)
SearchProperty answers the property search: items, folders included, carrying every property the query names, with any of its comma-separated values or with any value at all when it has none. A value with * or ? matches as a wildcard pattern.
func (ArtifactoryAPI) SearchUsage ¶
func (s ArtifactoryAPI) SearchUsage( ctx context.Context, req artgen.SearchUsageRequestObject, ) (artgen.SearchUsageResponseObject, error)
SearchUsage answers the usage search: files created before createdBefore (notUsedSince by default) and not downloaded since notUsedSince, never downloaded included, in local repositories and remote caches.
func (ArtifactoryAPI) SearchVersions ¶
func (s ArtifactoryAPI) SearchVersions( ctx context.Context, req artgen.SearchVersionsRequestObject, ) (artgen.SearchVersionsResponseObject, error)
SearchVersions answers the versions search: the module versions of the files whose organisation and module match g and a, with whether each is an integration version, newest first in Mercury order. A v with wildcards keeps the versions it matches; any other v lists the integration versions of that module version. Nothing to list is a 404.
func (ArtifactoryAPI) SmartStatus ¶
func (s ArtifactoryAPI) SmartStatus(w http.ResponseWriter, r *http.Request)
SmartStatus serves GET /artifactory/api/artifactweave/remote-status/{repoKey}?path=, the artifactweave-only Smart Remote diagnostics of one canonical path of a remote repository, to administrators: 400 for any other query, 501 without Deps.RemoteStatus, 404 for a repository that is no remote one. It is no spec operation, so the router mounts it as a plain route.
func (ArtifactoryAPI) UpdateMultipleRepositories ¶
func (s ArtifactoryAPI) UpdateMultipleRepositories( ctx context.Context, req artgen.UpdateMultipleRepositoriesRequestObject, ) (artgen.UpdateMultipleRepositoriesResponseObject, error)
UpdateMultipleRepositories applies UpdateRepositoryConfiguration's merge to a batch of up to repoBatchLimit repositories, each named by its key field, all in one transaction, for administrators only. An entry without a key or naming a missing repository refuses the whole batch.
func (ArtifactoryAPI) UpdateRepositoryConfiguration ¶
func (s ArtifactoryAPI) UpdateRepositoryConfiguration( ctx context.Context, req artgen.UpdateRepositoryConfigurationRequestObject, ) (artgen.UpdateRepositoryConfigurationResponseObject, error)
UpdateRepositoryConfiguration merges a partial configuration into a stored repository (repos.Merge), for administrators only: a field left out keeps its stored value and one sent as null returns to its default. The reindex an update owes the repository (repos.OwesReindex) is queued in the same transaction. An update that sends a P2 virtual repository's p2Urls adds the members they need and creates the P2 remote repositories they need, as CreateRepository does.
func (ArtifactoryAPI) UploadBuild ¶
func (s ArtifactoryAPI) UploadBuild( ctx context.Context, req artgen.UploadBuildRequestObject, ) (artgen.UploadBuildResponseObject, error)
UploadBuild publishes a build-info document and answers 204 with the stored document's SHA-256 in X-Checksum-Sha256. JFrog's uploadbuild page documents 200 and no header, but no 7.x release note or Jira issue records a move from the 204 that Artifactory 6.20's BuildResource.addBuild answers (RTFACT-20291 reports it too), so the 204 stays until P19 compares it with 7.x. The JFrog CLI accepts 200, 201 and 204, and reads the header for --detailed-summary (jfrog-client-go PublishBuildInfo). The handler reads the raw body the router's request details kept rather than the decoded one, which would drop the fields the spec does not list.
type Deps ¶
type Deps struct {
// Deps are the item kit's: the access module's API, the remote sources,
// the formats, and the overlays and private predicate the router
// passes. New sets their Store to this Deps' Store.
itemkit.Deps
// Store is the metadata store the handlers read and write, which New
// gives the kit as its store too; nil answers every route like an
// unimplemented operation, as the kit's Content does.
Store Store
// RemoteHTTP drops the connection pool of a repository that is
// deleted. Assign it only a pool that exists, or leave it nil: a nil
// *upstream.Pool stored in it is a non-nil interface, so a delete would
// call Remove on the nil pool, which panics on the pool's lock.
RemoteHTTP interface{ Remove(key string) }
// RemoteStatus serves artifactweave-only, administrator-only
// diagnostics; nil answers them 501.
RemoteStatus func(context.Context, string, string) (smart.SmartStatus, error)
// GC is the garbage collector the runtime schedules; POST
// /api/system/storage/gc runs the same one. Nil builds one per request,
// for tests.
GC *gc.Collector
// Multipart serves the JFrog CLI's multipart upload protocol; nil
// reports it unsupported, so the CLI uploads in one request.
Multipart *multipart.Service
// Mirrors administers the blob mirrors; nil when no tier is a mirror.
Mirrors Mirrors
// BlobLocation describes the hot blob store in the storage summary.
BlobLocation usage.Location
// AQL bounds AQL searches; the zero value has no cap. Its MaxResults
// caps the GET searches too.
AQL AQLLimits
// Search limits what the GET searches return; the zero value limits
// nothing.
Search SearchLimits
// AllowDuplicateBuildEntries accepts a build-info publish whose module
// lists one file twice (build.block_duplicate_entries false); the zero
// value refuses it, as Artifactory 7.x does by default.
AllowDuplicateBuildEntries bool
// FolderDownloadMaxConcurrent is how many folder archive downloads run
// at once (download.folder.max_concurrent_requests); zero means
// Artifactory's 10.
FolderDownloadMaxConcurrent int
// HuggingFaceXetEnabled turns on Xet in the Hugging Face protocol
// (huggingface.xet_enabled); the zero value answers its token routes
// 501 and keeps Git LFS.
HuggingFaceXetEnabled bool
// NPMLoginTokenExpiry is how long a token from npm login lasts
// (npm.login_token_expiry); zero means decision 0034's default.
NPMLoginTokenExpiry time.Duration
// NPMMaxPublishSize caps an npm publish request (npm.max_publish_size);
// zero means decision 0034's default.
NPMMaxPublishSize int64
}
Deps is what the artifacts handlers need: the item kit's dependencies, over which New builds the kit, and the handlers' own.
type MirrorStatus ¶
MirrorStatus is one tier's mirror: "blob" or "cold_blob".
type Mirrors ¶
type Mirrors interface {
// Optimize asks every mirror for an immediate repair pass.
Optimize()
// Status returns each mirror's status.
Status(ctx context.Context) ([]MirrorStatus, error)
}
Mirrors is what the storage endpoints need from the runtime's blob mirrors (#18).
type SearchLimits ¶
type SearchLimits struct {
// UserQueryLimit caps the results anonymous callers get, and every
// non-admin's when LimitInternalUsers is set; zero means no cap.
UserQueryLimit int
// LimitInternalUsers applies UserQueryLimit to signed-in non-admins too.
LimitInternalUsers bool
}
SearchLimits bounds the GET searches, as Artifactory's artifactory.search.userQueryLimit and limitAnonymousUsersOnly do.
type Store ¶
Store is what the artifacts handlers read and write, and what they hand on: the item kit's store (itemkit.Store) and the protocols' (pkgroute.Store, through ProtocolOptions), so that one value serves the kit, the handlers, the searches and the build, trash, repository and usage services they build. It names no access or configuration-module store: the handlers reach the access module through Deps.Access. The receipts of keyed operations belong to the shared replay, which the router builds over its own store. Each composite store in app is a Store.
Source Files
¶
- aql.go
- aql_actions.go
- aql_builds.go
- aql_transitive.go
- aql_transitive_peer.go
- builds.go
- chef_item.go
- conda_item.go
- doc.go
- huggingface_item.go
- idempotency.go
- items.go
- machinelearning_item.go
- metadata_stats.go
- multipart.go
- protocols.go
- reindex.go
- repositories.go
- searches.go
- searches_builds.go
- searches_layout.go
- searches_upstream_routes.go
- searches_versions.go
- smart_status.go
- storage.go
- storageinfo.go
- streamed.go
- strict.go
- transfer.go
- trash.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package itemkit is the item kit: the item helpers that the artifacts management handlers and the ecosystem HTTP handlers both call, in one package that both can import.
|
Package itemkit is the item kit: the item helpers that the artifacts management handlers and the ecosystem HTTP handlers both call, in one package that both can import. |
|
kittest
Package kittest builds the item kit over a seeded world, for unit tests of the kit and of the handlers that embed it, without a router or the access module.
|
Package kittest builds the item kit over a seeded world, for unit tests of the kit and of the handlers that embed it, without a router or the access module. |
|
Package pkgroute is the router kit for package formats with a protocol of their own: npm and Go in P7, then PyPI, NuGet, Helm and Terraform (decision 0032).
|
Package pkgroute is the router kit for package formats with a protocol of their own: npm and Go in P7, then PyPI, NuGet, Helm and Terraform (decision 0032). |