Fedora Account System
Red Hat Associate
Red Hat Customer
PythonRemote.get_remote_artifact_url() in pulp_python/app/models.py returns the request's redirect query parameter as the download URL. It does not compare that value with the remote's URL or with the URL the upstream simple page listed for the file. pull_through_package_simple() in pulp_python/app/pypi/views.py builds the simple-page link as <filename>?redirect=<upstream file URL>. Handler._match_and_stream() in pulpcore/content/handler.py calls get_remote_artifact_url() when the distribution has a remote and the relative path is not already stored. It builds a RemoteArtifact with that URL and no digest, then downloads it through Remote.get_downloader(). DownloaderFactory._http_or_https() sets aiohttp basic auth from the remote's username and password whenever the username is set, and HttpDownloader passes that auth on the GET to the URL it was given. The response body is written to the client. The remote policy field defaults to immediate. For immediate and on_demand, the content type for a package file is PythonPackageContent, _save_artifact() stores the file, and PythonRepository.async_pull_through_add_content() adds it to the repository. PythonPackageContent.init_from_artifact_and_relative_path() takes the filename from the request path and the project name and version from the file's metadata. The package simple page builds its listing from the remote and then applies the repository's files with releases.update(local_releases), so a stored filename is the one later clients see. A streamed policy skips the save. The download, the returned body, and the basic-auth header still happen. A relative path that is already in the repository is served from the stored artifact. An anonymous client can read the response of a URL it chooses, from the content app's network position. When the remote has a username and password, those credentials are sent to the host in that URL. From pulp_python 3.14.0 onward the saved file is part of the repository and is served to later clients of the distribution. The caller needs no Pulp account. Distribution.content_guard is null by default, and Handler._permit() allows the request when no guard is set. The distribution must have a remote. That is the pull-through configuration. No extra plugin is required. The redirect return was introduced by Gerrod Ubben in commit 81b613388069487d50f9db19c5e3a3675c9d7bc7, committed 2021-11-30. pulp_python 3.6.0, released 2021-12-15, is the first release that contains it. Saving pull-through content into the repository was added in commit df8b5ad22dbac8537d427975815e05b4894ed492 on 2025-04-02, released in pulp_python 3.14.0 on 2025-04-10. The same function appends .metadata to the client-supplied URL when the requested path ends in .metadata. Remote.get_remote_artifact_url() joins the configured remote URL and the relative path.