cocoapodshttp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cocoapodshttp serves the current CocoaPods CDN protocol through /artifactory/api/pods/{repoKey}: the version document, the pod list, the sharded version lists and the podspecs that pod repo add-cdn and pod install read, and the archives those podspecs point at. The retired Git specs plugin is not a second protocol surface. Names, paths and archives are the format package's (artifacts/ecosystem/cocoapods); this package answers HTTP with them.

Role

artifacts module, ecosystem layer: the native CocoaPods CDN protocol of the CocoaPods slice. It is named cocoapodshttp so that it does not shadow net/http. Outside tests, only its own http subtree, the module's http adapters and app may import it (decision 0044, dependency rule 9).

Inputs

  • Driving: the server, which mounts Protocol through the router kit (pkgroute) for repositories of package type cocoapods: GET and HEAD for every CDN path of a local, remote, virtual or federated repository.
  • Driven: the router kit (pkgroute.Kit), whose store (pkgroute.Store) the handlers also reach through DB(), and which resolves the repository and the caller, checks permissions, reads items and remote sources and writes errors; the remote source service (Options.RemoteSources), which fetches upstream CDN metadata and pod source archives (over HTTP, or from Git) into the remote cache; and the format package, which checks names, versions and archives.

Outputs

  • Protocol and Options: the routes, the source of each repository class and the Artifactory error profile.
  • Answers: for a local or federated repository, CocoaPods-version.yml, all_pods.txt, the sharded version lists and the podspecs built from the package index, and the archives; for a remote repository, the upstream CDN metadata, checked whole, with each podspec's source pointed at this server, and the source archives; for a virtual repository, its members in priority order.

Invariants

  • A list, podspec or archive answers only what the caller may read: a version the caller may not read is left out of every list.
  • Upstream CDN metadata and source archives are checked whole before they are cached, and a source archive is fetched only from an origin the repository allows (externalDependenciesEnabled and its patterns).
  • The download policy (decision 0032) refuses a CDN document at .pod/cdn/<path>, where 7.x keeps it, with the policy's 404, after read permission: a blacked-out repository's, a remote's included, and one whose patterns reject that path. A pattern on one pod's archive leaves the pod listed and refuses only the archive, which a remote checks at its own path before it reads the spec. A virtual repository's own patterns refuse what they reject with "No repository found to serve the request"; it leaves out a member that would refuse a document, and passes an archive a member refuses on to the next member that holds it.
  • Statuses and error texts stay byte-identical: the pod client reads them.

References

Status

Implemented P9c, which delivered the plan's P31 group (issues #770 to #775). Moved here in P9d.

Testing

  • route_test.go: local, remote and virtual CDN routes, path and response boundaries, permissions, paging and corrupt metadata, with the access test kit (access/accesstest) for permissions.
  • remote_test.go: remote podspec and index checks, the redirect and origin guards and the source URL bounds.
  • git_source_test.go: Git-sourced pods cold, through a virtual repository and offline, failures not cached, and mutable tags.
  • metadata_failure_test.go and zip_source_test.go: metadata stream and read failures, the authority recheck before delivery and zip path traversal.
  • download_policy_test.go: the download policy on local, virtual and remote repositories.
  • served_copy_fault_test.go: a cached CDN podspec, shard index or the podspec of a source archive whose copy fails a read answers 500, logs the fault once and stays cached, on the remote and through a virtual repository.
  • The @cocoapods acceptance scenarios (test/acceptance/features/cocoapods.feature) drive the pod client through the whole server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Protocol

func Protocol(o Options) pkgroute.Protocol

Protocol returns the CocoaPods CDN protocol for the router kit: GET and HEAD of every path below /artifactory/api/pods/{repoKey} for repositories of package type cocoapods, with the Artifactory error profile. Local and federated repositories answer from their package index, a remote one through o.RemoteSources, and a virtual one from its members in priority order.

Types

type Options

type Options struct{ RemoteSources *source.Service }

Options configures Protocol. RemoteSources is the source service that fetches a remote repository's upstream CDN metadata and pod source archives into the remote cache; when it is nil, a remote repository is not served and answers 501, as any class without a source does.

Jump to

Keyboard shortcuts

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