[3.9.x] Apply session authentication to descriptor repositories by provenance - #13007
Closed
slachiewicz wants to merge 2 commits into
Closed
[3.9.x] Apply session authentication to descriptor repositories by provenance#13007slachiewicz wants to merge 2 commits into
slachiewicz wants to merge 2 commits into
Conversation
DefaultModelResolver builds the models of artifact descriptors resolved from repositories, so the repositories those models declare are remotely supplied input. Pass them to the resolver's aggregateRepositories overload (maven-resolver 1.9.28, apache/maven-resolver#2092) flagged as descriptor-declared, so session authentication matched by repository id is applied to them only when an operator-defined mirror captures them. Repositories supplied by the build itself are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DefaultModelResolverinmaven-resolver-providerbuilds the models of artifact descriptors resolved from repositories (dependency POMs and their parents and imports). The repositories those models declare are remotely supplied input, but they were aggregated with the same call as build-supplied repositories, so a<server>insettings.xmlwhose id matched a repository id in a downloaded POM had its credentials attached to that repository.maven-resolver 1.9.28 (apache/maven-resolver#2092) adds an
aggregateRepositoriesoverload with a provenance flag: descriptor-declared repositories receive session authentication only when an operator-defined mirror captures them, andaether.remoteRepositoryManager.authToDescriptorRepositories=truerestores the previous behaviour. This passes that flag from the one call site that builds descriptor models.ProjectModelResolverbuilds the project's own model and parents, which are operator-chosen, and keeps the four-argument call.Blocked on the maven-resolver 1.9.28 release: the second commit bumps
resolverVersionto1.9.28-SNAPSHOTas a build aid and must be dropped, and the first commit does not compile against 1.9.27.Verified:
mvn -pl maven-resolver-provider,maven-core -am verifyagainst 1.9.28-SNAPSHOT → 363 tests, 0 failures.This change was created with AI assistance.