GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-13383: Match implicit ports in Apache auth cache by efegokdemir · Pull Request #2185 · apache/maven-resolver

Conversation

@efegokdemir

@efegokdemir efegokdemir commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Normalize implicit HTTP and HTTPS ports in the Apache transport authentication cache so entries created from a repository URL match requests using the effective default port.
  • Preserve explicit ports and schemes, keeping authentication scoped to the same origin.

Fixes apache/maven#13383

Testing

  • mvn -pl maven-resolver-transport-apache -am -Dtest=ApacheTransporterTest#testConcurrentAuthCacheMatchesImplicitDefaultPort -Dsurefire.failIfNoSpecifiedTests=false test — passed.
  • mvn -pl maven-resolver-transport-apache -am test — passed (all selected reactor tests; Apache transport: 144 tests, 6 skipped).
  • mvn -pl maven-resolver-transport-apache -am spotless:check — passed.
  • git diff --check — passed.
  • The regression test failed on the original implementation for both HTTP/80 and HTTPS/443 (cache lookup returned null) and passed after the fix.

AI assistance: Codex assisted with analysis, implementation, and validation. The change was reviewed locally, and the commit includes DCO sign-off.


To make clear that you license your contribution under the
Apache License Version 2.0, January 2004
check one of the following:

  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
  • I hereby declare that I have filed an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@efegokdemir
GH-13383: Normalize default ports in Apache auth cache
4d61574
Signed-off-by: Efe Gökdemir <[email protected]>
gnodet-bot
gnodet-bot approved these changes Oct 8, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. The normalization approach is correct and well-placed — by canonicalizing the port at the cache boundary (put/get/remove), the fix handles the mismatch symmetrically without touching callers. effectivePort already existed with the same port < 0 → default-port logic, so normalize() reuses it correctly.

Pre-fix validation: Ran testConcurrentAuthCacheMatchesImplicitDefaultPort against master (without the fix): both parameterized cases (http/80, https/443) failed with expected: <BASIC [complete=false]> but was: <null>. With the fix applied: both pass. ✅ Test correctly validates the fix.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gnodet
gnodet approved these changes Oct 8, 2026
View reviewed changes
cstamas
cstamas approved these changes Oct 8, 2026
View reviewed changes
@cstamas cstamas added this to the 2.0.25 milestone Oct 12, 2026
@cstamas cstamas added the enhancement New feature or request label Oct 12, 2026
@cstamas
cstamas merged commit 60275d9 into apache:master Oct 12, 2026
20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned cstamas Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cstamas cstamas cstamas approved these changes
@gnodet gnodet gnodet approved these changes
+1 more reviewer
@gnodet-bot gnodet-bot gnodet-bot approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cstamas cstamas

Labels

enhancement New feature or request

Projects

None yet

Milestone

2.0.25

Development

Successfully merging this pull request may close these issues.

Preemptive auth does not resolve default port

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@efegokdemir @cstamas @gnodet @gnodet-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.