Skip to content

fix(auth): authenticate after same-host HTTPS upgrades - #1667

Merged
TerryHowe merged 2 commits into
oras-project:v2from
TanvirTian:fix/https-upgrade-v2
Oct 22, 2026
Merged

TerryHowe merged 2 commits into
oras-project:v2from
TanvirTian:fix/https-upgrade-v2

Conversation

@TanvirTian

Copy link
Copy Markdown
Contributor

Description

This PR restores authentication after same-host HTTP-to-HTTPS redirects in the v2 branch.
fix #1666

  • Backport upstream commit 9f14282 to v2
  • Validate redirect chains before allowing authentication after a same-host HTTP-to-HTTPS upgrade.
  • Preserve the original request headers and method/body semantics when retrying over HTTPS.
  • Prevent cross-repository authentication and reject insecure HTTP token realms after an upgrade.
  • Disable auth-cache reuse for upgraded requests to avoid mixing HTTP and HTTPS authentication state.
  • Add regression tests for authentication behavior, redirect boundaries, and token realm validation.

@TanvirTian
TanvirTian changed the base branch from main to v2 October 22, 2026 15:34
@TanvirTian
TanvirTian force-pushed the fix/https-upgrade-v2 branch from 1964167 to 31ef52a Compare October 22, 2026 15:44
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.74%. Comparing base (75b7d96) to head (eefe467).

❗ There is a different number of reports uploaded between BASE (75b7d96) and HEAD (eefe467). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (75b7d96) HEAD (eefe467)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##               v2    #1667      +/-   ##
==========================================
- Coverage   89.15%   82.74%   -6.42%     
==========================================
  Files          65       65              
  Lines        5064     5093      +29     
==========================================
- Hits         4515     4214     -301     
+ Misses        540      534       -6     
- Partials        9      345     +336     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TerryHowe TerryHowe changed the title Fix/https upgrade v2 fix(auth): authenticate after same-host HTTPS upgrades Oct 22, 2026
Comment thread registry/remote/auth/client.go Resolved

@TerryHowe TerryHowe left a comment

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.

/lgtm

@TerryHowe
TerryHowe merged commit 0865307 into oras-project:v2 Oct 22, 2026
9 checks passed
@TerryHowe TerryHowe mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backport v2] fix(auth): authenticate after same-host HTTPS upgrades

2 participants