Skip to content

Sign pull-through package links - #1484

Merged
gerrod3 merged 1 commit into
pulp:mainfrom
gerrod3:t3/signed-pull-through-links
Nov 23, 2026
Merged

gerrod3 merged 1 commit into
pulp:mainfrom
gerrod3:t3/signed-pull-through-links

Conversation

@gerrod3

@gerrod3 gerrod3 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Note

Posted by an agent on behalf of @gerrod3.

Sign pull-through package links on simple index pages. Each token binds the upstream URL to the package filename and the remote's listing settings. The content app rejects invalid tokens and passes upstream SHA-256 digests to the downloader when available.

Refresh cached simple index pages to replace old unsigned links after upgrading. This fix is split out of #1429 for backporting.

Checklist

  • Single commit with a meaningful message
  • Changelog entry
  • AI assistance disclosed in the commit message
  • Unit and functional regression tests

Summary by CodeRabbit

  • Bug Fixes
    • Pull-through package downloads now use signed links, and unsigned or invalid links are rejected.
    • Package downloads use the upstream SHA-256 digest when available. Cached package index pages are refreshed to replace outdated unsigned links.
    • Metadata downloads support both pip and uv URL formats.

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

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ff2811b9-43aa-4be4-966f-a74c2cd41d89
Commits

Reviewing files that changed from the base of the PR and between a982997 and 6cd4941.

Files selected for processing: 6

  • CHANGES/+pull-through-signed-urls.bugfix
  • pulp_python/app/models.py
  • pulp_python/app/pypi/views.py
  • pulp_python/app/utils.py
  • pulp_python/tests/functional/api/test_full_mirror.py
  • pulp_python/tests/unit/test_pull_through.py
  • 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

release_package.filename,
stripped_url,
sha256=release_package.digests.get("sha256"),
metadata_sha256=(release_package.metadata_digests or {}).get("sha256"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FTR - metadata files were introduced in 3.23.0, so any older branch will need adjustments.

@gerrod3
gerrod3 merged commit 8807ad9 into pulp:main Nov 23, 2026
15 checks passed
@patchback

patchback Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport to 3.38: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.38/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484

Backported as #1485

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback

patchback Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport to 3.36: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.36/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484

Backported as #1486

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback

patchback Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport to 3.27: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.27/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484

Backported as #1487

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback

patchback Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport to 3.19: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 8807ad9 on top of patchback/backports/3.19/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484

Backporting merged PR #1484 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    git remote add upstream https://github.com/pulp/pulp_python.git
    
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    git fetch upstream
    git checkout -b patchback/backports/3.19/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484 upstream/3.19
    
  4. Now, cherry-pick PR Sign pull-through package links #1484 contents into that branch:
    git cherry-pick -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
    If it'll yell at you with something like fatal: Commit 8807ad9d56ac01efe4aebf882eec9e7939fef783 is a merge but no -m option was given., add -m 1 as follows instead:
    git cherry-pick -m1 -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
  5. At this point, you'll encounter some merge conflicts. You must
    resolve them in order to preserve the patch from PR Sign pull-through package links #1484 as close to the
    original as possible.
  6. Once conflicts are resolved and git added, run:
    git cherry-pick --continue
    
  7. Push this branch to your fork on GitHub:
    git push origin patchback/backports/3.19/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484
    
  8. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback

patchback Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport to 3.13: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 8807ad9 on top of patchback/backports/3.13/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484

Backporting merged PR #1484 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    git remote add upstream https://github.com/pulp/pulp_python.git
    
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    git fetch upstream
    git checkout -b patchback/backports/3.13/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484 upstream/3.13
    
  4. Now, cherry-pick PR Sign pull-through package links #1484 contents into that branch:
    git cherry-pick -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
    If it'll yell at you with something like fatal: Commit 8807ad9d56ac01efe4aebf882eec9e7939fef783 is a merge but no -m option was given., add -m 1 as follows instead:
    git cherry-pick -m1 -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
  5. At this point, you'll encounter some merge conflicts. You must
    resolve them in order to preserve the patch from PR Sign pull-through package links #1484 as close to the
    original as possible.
  6. Once conflicts are resolved and git added, run:
    git cherry-pick --continue
    
  7. Push this branch to your fork on GitHub:
    git push origin patchback/backports/3.13/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484
    
  8. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback

patchback Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport to 3.12: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 8807ad9 on top of patchback/backports/3.12/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484

Backporting merged PR #1484 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    git remote add upstream https://github.com/pulp/pulp_python.git
    
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    git fetch upstream
    git checkout -b patchback/backports/3.12/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484 upstream/3.12
    
  4. Now, cherry-pick PR Sign pull-through package links #1484 contents into that branch:
    git cherry-pick -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
    If it'll yell at you with something like fatal: Commit 8807ad9d56ac01efe4aebf882eec9e7939fef783 is a merge but no -m option was given., add -m 1 as follows instead:
    git cherry-pick -m1 -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
  5. At this point, you'll encounter some merge conflicts. You must
    resolve them in order to preserve the patch from PR Sign pull-through package links #1484 as close to the
    original as possible.
  6. Once conflicts are resolved and git added, run:
    git cherry-pick --continue
    
  7. Push this branch to your fork on GitHub:
    git push origin patchback/backports/3.12/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484
    
  8. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback

patchback Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport to 3.11: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 8807ad9 on top of patchback/backports/3.11/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484

Backporting merged PR #1484 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    git remote add upstream https://github.com/pulp/pulp_python.git
    
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    git fetch upstream
    git checkout -b patchback/backports/3.11/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484 upstream/3.11
    
  4. Now, cherry-pick PR Sign pull-through package links #1484 contents into that branch:
    git cherry-pick -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
    If it'll yell at you with something like fatal: Commit 8807ad9d56ac01efe4aebf882eec9e7939fef783 is a merge but no -m option was given., add -m 1 as follows instead:
    git cherry-pick -m1 -x 8807ad9d56ac01efe4aebf882eec9e7939fef783
    
  5. At this point, you'll encounter some merge conflicts. You must
    resolve them in order to preserve the patch from PR Sign pull-through package links #1484 as close to the
    original as possible.
  6. Once conflicts are resolved and git added, run:
    git cherry-pick --continue
    
  7. Push this branch to your fork on GitHub:
    git push origin patchback/backports/3.11/8807ad9d56ac01efe4aebf882eec9e7939fef783/pr-1484
    
  8. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

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.

2 participants