Skip to content

Sign pull-through package links - #1483

Closed
gerrod3 wants to merge 1 commit into
pulp:mainfrom
gerrod3:t3/split-url-token-fix
Closed

gerrod3 wants to merge 1 commit into
pulp:mainfrom
gerrod3:t3/split-url-token-fix

Conversation

@gerrod3

@gerrod3 gerrod3 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Note

Posted by an agent on behalf of @gerrod3.

Superseded by #1484, which includes the Python remote cast needed before signing links.

Require signed tokens for upstream pull-through downloads and bind
them to the remote's listing and package filename. Pass upstream
SHA-256 digests to the downloader when available and invalidate cached
simple pages when the remote's listing changes.

Extracted from pulp#1429 for backporting.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Assisted By: OpenAI Codex
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Pull-through package links now use signed tokens instead of unsigned redirect URLs. The tokens bind the filename and upstream URL to a remote’s configuration, and can include package and metadata SHA-256 digests. Remote requests validate tokens and apply available digests to downloads.

Changes: Signed pull-through downloads

Layer / File(s) Summary
Create and validate signed link tokens
pulp_python/app/utils.py, pulp_python/app/pypi/views.py, pulp_python/tests/unit/test_pull_through.py, pulp_python/tests/functional/api/test_full_mirror.py
Signing utilities bind tokens to a remote and its URL, includes, and excludes. Package index responses use signed paths with available package and metadata digests. Unit tests cover token validation, and functional checks expect signed links.
Resolve requests and apply digests
pulp_python/app/models.py, pulp_python/tests/functional/api/test_full_mirror.py, CHANGES/+pull-through-signed-urls.bugfix
Remote requests validate tokens, handle .metadata paths, and pass available SHA-256 digests to the downloader. Updates to remote URL, includes, or excludes schedule cache invalidation. Functional tests cover invalid tokens, metadata paths, digests, and remote configuration changes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant PackageIndexView
  participant sign_pull_through_path
  participant PackageFileRequest
  participant PythonRemote
  participant unsign_pull_through_token
  participant RemoteDownloader
  participant Upstream
  PackageIndexView->>sign_pull_through_path: Sign filename, upstream URL, and available digests
  sign_pull_through_path-->>PackageIndexView: Return signed package path
  PackageFileRequest->>PythonRemote: Request package path with token
  PythonRemote->>unsign_pull_through_token: Validate token for remote and filename
  unsign_pull_through_token-->>PythonRemote: Return upstream URL and applicable digest
  PythonRemote->>RemoteDownloader: Provide remote artifact and digest
  RemoteDownloader->>Upstream: Download package
Loading

Possibly related issues

Suggested reviewers: jobselko, dosas, dralley

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant