Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication fails when trying to resolve a target platform over an authenticated mirror that is a composite repository #3501

Closed
kevloral opened this issue Feb 11, 2024 · 5 comments

Comments

@kevloral
Copy link
Contributor

Related to #2930, authentication still fails when the mirror that requires authentication is a composite repository . As a reminder, the mirror is declared like this in my Maven settings.xml file:

<mirror>
	<id>nexus-p2</id>			
	<name>Nexus P2</name>
	<url>https://servidor.jma:8443/nexus/content/groups/global-p2/</url>
	<mirrorOf>eclipse_2022-06,eclipse_2023-06,mylyn_3.25,swtbot_snapshots,tpd_nightly</mirrorOf>
	<layout>p2</layout>
    <mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>

And its credentials are declared like this :


<server>
	<id>nexus-p2</id>
	<username>jm.arnesto</username>
	<password>********</password>
</server>

After the fixes we implemented in #2930, authentication works for the mirror itself, but still fails for the child locations it declares:

<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='generated-composite-metadata-repository' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1'>
  <properties size='1'>
    <property name='p2.timestamp' value='1693774779425'/>
  </properties>
  <children size='7'>
    <child location='../../repositories/eclipse_2023-06'/>
    <child location='../../repositories/basis_23'/>
    <child location='../../repositories/eclipse_2022-06'/>
    <child location='../../repositories/basis_22'/>
    <child location='../../repositories/mylyn_3.25'/>
    <child location='../../repositories/swtbot_snapshots'/>
    <child location='../../repositories/tpd_nightly'/>
  </children>
</repository>

I will implement a test that reproduces the bug and propose a fix for it in a PR.

@laeubi
Copy link
Member

laeubi commented Feb 12, 2024

@kevloral yes composited that points to childs below the base dir are a bit tricky.

I will implement a test that reproduces the bug and propose a fix for it in a PR.

Thanks, I plan to make a new bugfix release soon, do you have an estimate so we can probably wait for your fix to be included?

@akurtakov
Copy link
Member

As thsi bugfix release is aimed for 4.31 Platform build to not use snapshot Tycho 4.x release would have to be out next Monday (Feb 19th) at the very latest in order to have couple of days to propagate things to the RC1 build.

kevloral added a commit to kevloral/tycho that referenced this issue Feb 20, 2024
- testTargetDefinitionAuthMirror: tries to resolve a target definition
from a composite p2 repository accessed over an authenticated composite
mirror.
- testTargetDefinitionEncrypted: tries to resolve a target definition
from an authenticated composite p2 repository whose password is
encrypted.

Several others have been created for completion,
@kevloral kevloral changed the title Authentication fails when trying to resolve a target platform over an authenticated mirror that is a composite repository Authentication fails when trying to resolve a target platform from an authenticated composite repository Feb 20, 2024
@kevloral
Copy link
Contributor Author

I have updated the title given that the problem occurs when trying to resolve a target platform using a p2 composite repository that requires authentication, no matter whether it is acting as a mirror (testTargetDefinitionAuthMirror) or not (testTargetDefinitionEncrypted).

kevloral added a commit to kevloral/tycho that referenced this issue Mar 3, 2024
- testTargetDefinitionAuthMirror: tries to resolve a target definition
from a composite p2 repository accessed over an authenticated composite
mirror.
- testTargetDefinitionEncrypted: tries to resolve a target definition
from an authenticated composite p2 repository whose password is
encrypted.

Several others have been created just for completion:

- testAuthMirror: tries to access a composite p2 repository over an
authenticated composite mirror.
- testMirror: tries to access a composite p2 repository over a composite
mirror with no authentication.
- testRepositoryEncrypted: tries to access an authenticated composite p2
repository whose password is encrypted.
- testTargetDefinition: tries to resolve a target platform from a
composite p2 repository.
- testTargetDefinitionMirror: tries to resolve a target definition from
a composite p2 repository accessed over a composite mirror with no
authentication.
@kevloral kevloral changed the title Authentication fails when trying to resolve a target platform from an authenticated composite repository Authentication fails when trying to resolve a target platform over an authenticated mirror that is a composite repository Mar 10, 2024
@kevloral
Copy link
Contributor Author

I have restored the previous title, given that test testTargetDefinitionEncrypted was failing for a completely different reason (that has already been fixed).

kevloral added a commit to kevloral/tycho that referenced this issue Mar 10, 2024
- testTargetDefinitionAuthMirror: tries to resolve a target definition
from a composite p2 repository accessed over an authenticated composite
mirror.

Several others have been created just for completion:

- testAuthMirror: tries to access a composite p2 repository over an
authenticated composite mirror.
- testMirror: tries to access a composite p2 repository over a composite
mirror with no authentication.
- testRepositoryEncrypted: tries to access an authenticated composite p2
repository whose password is encrypted.
- testTargetDefinition: tries to resolve a target platform from a
composite p2 repository.
- testTargetDefinitionEncrypted: tries to resolve a target definition
from an authenticated composite p2 repository whose password is
encrypted.
- testTargetDefinitionMirror: tries to resolve a target definition from
a composite p2 repository accessed over a composite mirror with no
authentication.
kevloral added a commit to kevloral/tycho that referenced this issue Mar 17, 2024
RemoteMetadataRepositoryManager now passes the effective URI to the
MavenAuthenticator instead of the original one. This fixes eclipse-tycho#3501.

This commit also includes the test that was used to reproduce the bug:

- testTargetDefinitionAuthMirror: tries to resolve a target definition
from a composite p2 repository accessed over an authenticated composite
mirror.

Also, several other tests have been created just for completion:

- testAuthMirror: tries to access a composite p2 repository over an
authenticated composite mirror.
- testMirror: tries to access a composite p2 repository over a composite
mirror with no authentication.
- testRepositoryEncrypted: tries to access an authenticated composite p2
repository whose password is encrypted.
- testTargetDefinition: tries to resolve a target platform from a
composite p2 repository.
- testTargetDefinitionEncrypted: tries to resolve a target definition
from an authenticated composite p2 repository whose password is
encrypted.
- testTargetDefinitionMirror: tries to resolve a target definition from
a composite p2 repository accessed over a composite mirror with no
authentication.
@kevloral
Copy link
Contributor Author

The PR that contains the fix for this issue is now ready to be reviewed: #3521

laeubi pushed a commit to kevloral/tycho that referenced this issue Mar 18, 2024
RemoteMetadataRepositoryManager now passes the effective URI to the
MavenAuthenticator instead of the original one. This fixes eclipse-tycho#3501.

This commit also includes the test that was used to reproduce the bug:

- testTargetDefinitionAuthMirror: tries to resolve a target definition
from a composite p2 repository accessed over an authenticated composite
mirror.

Also, several other tests have been created just for completion:

- testAuthMirror: tries to access a composite p2 repository over an
authenticated composite mirror.
- testMirror: tries to access a composite p2 repository over a composite
mirror with no authentication.
- testRepositoryEncrypted: tries to access an authenticated composite p2
repository whose password is encrypted.
- testTargetDefinition: tries to resolve a target platform from a
composite p2 repository.
- testTargetDefinitionEncrypted: tries to resolve a target definition
from an authenticated composite p2 repository whose password is
encrypted.
- testTargetDefinitionMirror: tries to resolve a target definition from
a composite p2 repository accessed over a composite mirror with no
authentication.
@laeubi laeubi closed this as completed in d6366ad Mar 18, 2024
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

No branches or pull requests

3 participants