From 48f69048923bf5016c657c92c2ed79b43cbebb57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 08:11:14 +0000 Subject: [PATCH 1/4] Bump org.codehaus.plexus:plexus-sec-dispatcher from 2.0 to 3.0.0 Bumps [org.codehaus.plexus:plexus-sec-dispatcher](https://github.com/codehaus-plexus/plexus-sec-dispatcher) from 2.0 to 3.0.0. - [Release notes](https://github.com/codehaus-plexus/plexus-sec-dispatcher/releases) - [Commits](https://github.com/codehaus-plexus/plexus-sec-dispatcher/compare/plexus-sec-dispatcher-2.0...plexus-sec-dispatcher-3.0.0) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-sec-dispatcher dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0d1c8286..6ed711ef 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ org.codehaus.plexus plexus-sec-dispatcher - 2.0 + 3.0.0 From 8a66e5f678a5ae0a331ff71d1e15a66684f0b3d2 Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Mon, 30 Sep 2024 10:25:05 +0200 Subject: [PATCH 2/4] adapt sec-dispatcher:3.0.0 namespace changes --- .../java/ch/ivyteam/ivy/maven/deploy/DeployToEngineMojo.java | 2 +- .../ch/ivyteam/ivy/maven/engine/deploy/http/HttpDeployer.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/ch/ivyteam/ivy/maven/deploy/DeployToEngineMojo.java b/src/main/java/ch/ivyteam/ivy/maven/deploy/DeployToEngineMojo.java index 0a19f64e..aa67d5c2 100644 --- a/src/main/java/ch/ivyteam/ivy/maven/deploy/DeployToEngineMojo.java +++ b/src/main/java/ch/ivyteam/ivy/maven/deploy/DeployToEngineMojo.java @@ -28,7 +28,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.settings.Server; -import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; +import org.codehaus.plexus.components.secdispatcher.SecDispatcher; import ch.ivyteam.ivy.maven.engine.deploy.DeploymentOptionsFileFactory; import ch.ivyteam.ivy.maven.engine.deploy.http.HttpDeployer; diff --git a/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/http/HttpDeployer.java b/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/http/HttpDeployer.java index 44fcd5d8..122aca7f 100644 --- a/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/http/HttpDeployer.java +++ b/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/http/HttpDeployer.java @@ -28,8 +28,8 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.settings.Server; -import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; -import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException; +import org.codehaus.plexus.components.secdispatcher.SecDispatcher; +import org.codehaus.plexus.components.secdispatcher.SecDispatcherException; public class HttpDeployer { private static final String DEPLOY_URI = "/system/api/apps/"; From fa0f68e2c13dced5bb28be8b39e3655ac7b76257 Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Thu, 7 Nov 2024 15:15:59 +0100 Subject: [PATCH 3/4] hack: bind a dummy encrypter for plugin-harness tests --- .../ch/ivyteam/ivy/maven/ProjectMojoRule.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java b/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java index 7afbc8a5..9c3555c2 100644 --- a/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java +++ b/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java @@ -20,10 +20,18 @@ import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.plugin.testing.MojoRule; import org.apache.maven.project.MavenProject; +import org.apache.maven.settings.crypto.SettingsDecrypter; +import org.apache.maven.settings.crypto.SettingsDecryptionRequest; +import org.apache.maven.settings.crypto.SettingsDecryptionResult; + +import com.google.inject.Binder; +import com.google.inject.Module; import ch.ivyteam.ivy.maven.util.PathUtils; @@ -45,6 +53,30 @@ public class ProjectMojoRule extends MojoRule { public MavenProject project; public ProjectMojoRule(Path srcDir, String mojoName) { + + super(new AbstractMojoTestCase() { + + @Override + protected void addGuiceModules(List modules) { + // TODO Auto-generated method stub + modules.add(new Module() { + + @Override + public void configure(Binder binder) { + binder.bind(SettingsDecrypter.class).toInstance(new SettingsDecrypter() { + + @Override + public SettingsDecryptionResult decrypt(SettingsDecryptionRequest request) { + return null; + + } + }); + } + }); + } + + }); + this.templateProjectDir = srcDir; this.mojoName = mojoName; } From acb74fe6ccb0d60907b3b3a4f2d8218f412c1abe Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Thu, 7 Nov 2024 16:06:36 +0100 Subject: [PATCH 4/4] adapt to maven4 settings style --- .../ch/ivyteam/ivy/maven/deploy/TestDeployToRunningEngine.java | 1 + .../ch/ivyteam/ivy/maven/deploy/settings-security.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/ch/ivyteam/ivy/maven/deploy/TestDeployToRunningEngine.java b/src/test/java/ch/ivyteam/ivy/maven/deploy/TestDeployToRunningEngine.java index 962624ec..43be43af 100644 --- a/src/test/java/ch/ivyteam/ivy/maven/deploy/TestDeployToRunningEngine.java +++ b/src/test/java/ch/ivyteam/ivy/maven/deploy/TestDeployToRunningEngine.java @@ -96,6 +96,7 @@ public void canDeployRemoteIar_settingsPassword() throws Exception { @Test public void canDeployRemoteIar_encryptedSettingsPassword() throws Exception { + System.setProperty("mySecret", "{6WlTulMQMcoHxrDwOe2HsWLAK691wYqfu+BQdByC+SU=}"); addServerConnection("{VUpeDRRbfD4Hmk9WLKzhqLkLttTCsWfLtr75Nt9K/3k=}"); System.setProperty("settings.security", TestDeployToRunningEngine.class.getResource("settings-security.xml").getPath()); diff --git a/src/test/resources/ch/ivyteam/ivy/maven/deploy/settings-security.xml b/src/test/resources/ch/ivyteam/ivy/maven/deploy/settings-security.xml index 276ec87c..d4da414e 100644 --- a/src/test/resources/ch/ivyteam/ivy/maven/deploy/settings-security.xml +++ b/src/test/resources/ch/ivyteam/ivy/maven/deploy/settings-security.xml @@ -1,3 +1,4 @@ - {6WlTulMQMcoHxrDwOe2HsWLAK691wYqfu+BQdByC+SU=} + prop:mySecret + AES/GCM/NoPadding \ No newline at end of file