Apply session authentication to descriptor repositories by provenance - #13008
Draft
slachiewicz wants to merge 2 commits into
Draft
Apply session authentication to descriptor repositories by provenance#13008slachiewicz wants to merge 2 commits into
slachiewicz wants to merge 2 commits into
Conversation
Repositories declared by a model that was resolved from a repository (a dependency POM, or a parent or import reached from one) are remotely supplied input, but they were aggregated with the same call as build-supplied repositories, so a settings server whose id matched a repository id in a downloaded POM had its credentials attached to it. maven-resolver 2.0.23 (apache/maven-resolver#2090) adds an aggregateRepositories overload with a provenance flag. Add the matching default-method overload to RepositoryFactory, pass the flag through DefaultRepositoryFactory, and set it from DefaultModelBuilder's externalOrigin and from the compat DefaultModelResolver, which only builds descriptor models. The project's own model and parents keep the existing call and keep receiving session authentication.
slachiewicz
force-pushed
the
repo-provenance-auth-master
branch
from
September 1, 2026 23:01
aaf4cb0 to
7a21be5
Compare
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.
Repositories declared by a model that was resolved from a repository (a dependency POM, or a parent or import reached from one) are remotely supplied input, but they were aggregated with the same
aggregatecall 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 2.0.23 (apache/maven-resolver#2090) 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 adds the matching five-argumentRepositoryFactory.aggregateas a default method (delegating to the existing one, so other implementations are unaffected), passes the flag throughDefaultRepositoryFactory, and sets it fromDefaultModelBuilder's existingexternalOriginand from the compatDefaultModelResolver, which only 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 2.0.23 release: the second commit bumps
resolverVersionto2.0.23-SNAPSHOTas a build aid and must be dropped, and the first commit does not compile against 2.0.22.Verified:
mvn -pl api/maven-api-core,impl/maven-impl,compat/maven-resolver-provider -am -Dmaven.test.skip installagainst 2.0.23-SNAPSHOT → compiles. The maven-impl test sources do not compile on current master independently of this change (DistributionManagementArtifactRelocationSourceTest.noRelocationReturnsNullcalls a method that has declaredArtifactDescriptorExceptionsince #12950), so the module tests could not be run here.This change was created with AI assistance.