Swift Package Registry configuration
OSA Proxy supports scanning Swift Package Registry release lists and ZIP archives.
OSA Proxy configuration
The scan-manifest parameter enables package release list scanning, while scan-package enables scanning the ZIP archive of a specific release before download.
Connecting SwiftPM
The following example assumes that the OSA Proxy route is available at https://osa-proxy.example.com/swift:
With --global, the setting applies to all projects for the user and is stored in ~/.swiftpm/configuration/registries.json. To keep the setting in the project and share it through Git, run the command without --global and commit .swiftpm/configuration/registries.json.
By default, SwiftPM uses a registry only for dependencies declared by package identity. Dependencies declared as .package(url: ...) continue to be downloaded from Git and bypass OSA Proxy. To replace available SCM dependencies with registry packages during resolution, use:
SwiftPM cannot replace a Git dependency when the package is absent from the upstream registry. To guarantee registry use, declare the dependency with .package(id: "scope.package-name", ...).
SwiftPM accepts an HTTPS URL in the setup command. For a local HTTP endpoint, use --allow-insecure-http; do not edit registries.json manually:
After configuration, use the regular SwiftPM commands to resolve or add dependencies.
remove-blocked-versions: false mode
With the default remove-blocked-versions: true, OSA Proxy removes a blocked version from the release list.
With false, the version remains in the list but receives a standard Swift Package Registry problem field with status 410. The problem description contains the blocking CodeScoring policy name. SwiftPM treats the release as unavailable, excludes it from resolution, and selects the next matching version. Unlike Hex, this does not require a separate client-side policy.
Release list changes affect a new resolution. To test selection of another version, make sure the blocked version is not pinned in Package.resolved, or use a clean project.
The Package.swift file for a selected version passes through OSA Proxy without a separate CodeScoring request. The release contents are checked when the ZIP archive is requested if scan-package is enabled.
Tuist
To connect directly to the public Tuist registry, use:
Connect SwiftPM to https://osa-proxy.example.com/swift-tuist as described above. OSA Proxy needs outbound access to tuist.dev, archive storage (such as t3.storage.dev), and raw.githubusercontent.com for the Swift Package Index catalog.
If the catalog is not yet loaded and loading fails, codescoring.block-on-codescoring-errors applies. For ZIP archives with scan-package: true, this applies in every work-mode.
License and publication date information may be missing when the index tag differs from the registry version (v1.2.3 versus 1.2.3).
Mapping packages through the catalog is automatic only for a direct registry on tuist.dev. Tuist behind an Artifactory or Nexus remote repository uses regular Swift handling without the catalog. When a package is absent from the catalog, path names are used.
