[java-identity-provider] 02/03: IDP-2073 Consider enabling the installer to download new versions
Rod Widdowson
rdw at steadingsoftware.com
Sat Jun 3 15:49:17 UTC 2023
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=8d024a9facce7a65a8aa5718d82ec21218677771
commit 8d024a9facce7a65a8aa5718d82ec21218677771
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Jun 3 16:16:17 2023 +0100
IDP-2073 Consider enabling the installer to download new versions
https://shibboleth.atlassian.net/browse/IDP-2073
First commit of code to do the check. Still pending
The bat and sh files, and adding them to the requisite module
More refactoring of the support classes to stop using the Plugin
work here.
Use the final URLs for update
---
.../net/shibboleth/idp/plugin/PluginSupport.java | 4 +-
.../idp/installer/impl/UpdateIdPArguments.java | 235 ++++++++++++++
.../idp/installer/impl/UpdateIdPCLI.java | 352 +++++++++++++++++++++
.../shibboleth/idp/installer/TestInstallerCLI.java | 14 +-
4 files changed, 596 insertions(+), 9 deletions(-)
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginSupport.java b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginSupport.java
index b9ef229a5..aed999de8 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginSupport.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/PluginSupport.java
@@ -129,10 +129,10 @@ public final class PluginSupport {
continue;
}
if (!pluginInfo.isSupportedWithIdPVersion(version, installIntoVersion)) {
- log.debug("Version {} is not supported with idpVersion {}", version, installIntoVersion);
+ log.debug("Version {} is not supported with Application Version {}", version, installIntoVersion);
continue;
}
- log.debug("Version {} is supported with idpVersion {}", version, installIntoVersion);
+ log.debug("Version {} is supported with Application Version {}", version, installIntoVersion);
if (pluginInfo.getUpdateURL(version) == null || pluginInfo.getUpdateBaseName(version) == null) {
log.debug("Version {} is does not have update information", version);
continue;
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPArguments.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPArguments.java
new file mode 100644
index 000000000..1e5819305
--- /dev/null
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPArguments.java
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.installer.impl;
+
+import java.io.PrintStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.slf4j.Logger;
+
+import com.beust.jcommander.Parameter;
+
+import net.shibboleth.idp.Version;
+import net.shibboleth.idp.cli.AbstractIdPHomeAwareCommandLineArguments;
+import net.shibboleth.idp.plugin.InstallableComponentVersion;
+import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
+import net.shibboleth.shared.collection.CollectionSupport;
+import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.shared.primitive.StringSupport;
+
+/**
+ * Arguments for IdP "Updater" CLI.
+ */
+public class UpdateIdPArguments extends AbstractIdPHomeAwareCommandLineArguments {
+
+ /** Logger. */
+ @Nullable private Logger log;
+
+ /** Brief info about available versions. */
+ @Parameter(names= {"-l", "--list"})
+ private boolean list;
+
+ /** Where to download. */
+ @Parameter(names= {"-d", "--dowloadDir"})
+ @Nullable private String downloadDir;
+
+ /** Truststore to use for signing. */
+ @Parameter(names= {"--truststore"})
+ @Nullable private String truststore;
+
+ /** Force download version. */
+ @Parameter(names= {"-fd", "--force-download"})
+ @Nullable private String forceDownloadVersion;
+
+ /** location to override the default update location. */
+ @Parameter(names= {"--updateURL"})
+ @Nullable private String updateURL;
+
+ /** For tests "pretend to be that version. */
+ @Parameter(names= {"--pretendVersion"})
+ @Nullable private String pretendVersion;
+
+ /** {@link #forceDownloadVersion} as a {@link InstallableComponentVersion}. */
+ @Nullable private InstallableComponentVersion updateVersion;
+
+ /** The version to upgrade from as a {@link InstallableComponentVersion}. */
+ @NonnullBeforeExec private InstallableComponentVersion fromVersion;
+
+ /** The path variant of {@link #downloadDir}, non null if this is a {@link OperationType#DOWLOAD}. */
+ @Nullable private Path downloadDirPath;
+
+ /** Operation enum. */
+ public enum OperationType {
+ /** Dowload a version. */
+ DOWLOAD,
+ /** List all versions. */
+ LIST,
+ /** Check Installed version. */
+ CHECK,
+ /** Unknown. */
+ UNKNOWN
+ };
+
+ /** What to do. */
+ @Nonnull private OperationType operation = OperationType.UNKNOWN;
+
+ /** {@inheritDoc} */
+ public @Nonnull Logger getLog() {
+ if (log == null) {
+ log = LoggerFactory.getLogger(UpdateIdPArguments.class);
+ }
+ assert log != null;
+ return log;
+ }
+
+ /** get TrustStore (if specified).
+ *
+ * @return the trust store
+ */
+ @Nullable public String getTruststore() {
+ return truststore;
+ }
+
+ /** Get the download Directory.
+ *
+ * Only valid for {@link OperationType#DOWLOAD}
+ *
+ * @return Returns the download directory
+ */
+ @Nonnull public Path getDownloadLocation() {
+ Constraint.isTrue(operation == OperationType.DOWLOAD,
+ "Can only call getInputFileName on a ");
+ assert downloadDirPath != null;
+ return downloadDirPath;
+ }
+
+ /** Are we doing a List?
+ *
+ * @return whether we're doing a list
+ */
+ public boolean isList() {
+ return list;
+ }
+
+ /** Are we checking the version or not?
+ * @return if we are just checking
+ */
+ public boolean isCheck() {
+ return !isList() && downloadDir == null;
+ }
+
+ /** Return the version to update to or null.
+ * @return the version or null
+ */
+ @Nullable public InstallableComponentVersion getUpdateToVersion() {
+ return updateVersion;
+ }
+
+ /** Return the version to update from.
+ * @return the version
+ */
+ @Nonnull public InstallableComponentVersion getUpdateFromVersion() {
+ assert fromVersion!=null;
+ return fromVersion;
+ }
+
+
+ /** return the update URL or null.
+ * @return null or the calue supplied
+ */
+ @Nonnull public List<String> getUpdateURLs() {
+ final String u = updateURL;
+ if (u != null) {
+ return CollectionSupport.singletonList(u);
+ }
+ return CollectionSupport.emptyList();
+ }
+
+ /**
+ * Get operation to perform.
+ * @return operation
+ */
+ @Nonnull public OperationType getOperation() {
+ return operation;
+ }
+
+ /** {@inheritDoc} */
+ public void validate() throws IllegalArgumentException {
+ super.validate();
+
+ if (StringSupport.trimOrNull(pretendVersion) != null) {
+ fromVersion = new InstallableComponentVersion(pretendVersion);
+ } else {
+ final String currentVersion = Version.getVersion();
+ if (currentVersion == null) {
+ getLog().error("Could not determine current version.");
+ throw new IllegalArgumentException("Could not determine current version.");
+ }
+ fromVersion = new InstallableComponentVersion(currentVersion);
+ }
+
+ if (list) {
+ operation = OperationType.LIST;
+ if (downloadDir != null) {
+ getLog().error("Cannot List and Dowload in the same operation.");
+ throw new IllegalArgumentException("Cannot List and Download in the same operation.");
+ }
+ } else if (downloadDir != null) {
+ operation = OperationType.DOWLOAD;
+ downloadDirPath = Path.of(downloadDir);
+ if (!Files.exists(downloadDirPath)) {
+ getLog().error("Download directory {}, does not exist", downloadDir);
+ throw new IllegalArgumentException("Download directory does not exist");
+ }
+ if (!Files.isDirectory(downloadDirPath)) {
+ getLog().error("Download location {}, exists, but is not a directory", downloadDir);
+ throw new IllegalArgumentException("Download locaition is not a directory");
+ }
+ } else {
+ operation = OperationType.CHECK;
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void printHelp(final @Nonnull PrintStream out) {
+ out.println("Update");
+ out.println("Provides a way of enquiring whether updates are available for the IdP");
+ out.println();
+ out.println(" update [options]");
+ out.println();
+ super.printHelp(out);
+ out.println();
+ out.println("With no options displays the update status of the IdP");
+ out.println();
+ out.println(String.format(" %-22s %s", "-d, --download <file>", "Download the distribution for an available update"));
+ out.println(String.format(" %-22s %s", "-fd, --force=download <file>", "Specify the version to be downloaded by -d"));
+ out.println();
+ out.println(String.format(" %-22s %s", "-l, --list", "list all available versions"));
+ out.println();
+ out.println(String.format(" %-22s %s", "--updateURL <URL>",
+ "Explicit location to look for update information (overrides the default)"));
+ out.println();
+ }
+
+}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPCLI.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPCLI.java
new file mode 100644
index 000000000..7666cb096
--- /dev/null
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPCLI.java
@@ -0,0 +1,352 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.installer.impl;
+
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.security.Security;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.apache.commons.lang3.SystemUtils;
+import org.apache.hc.client5.http.classic.HttpClient;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.opensaml.security.httpclient.HttpClientSecurityContextHandler;
+import org.slf4j.Logger;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+import net.shibboleth.idp.Version;
+import net.shibboleth.idp.cli.AbstractIdPHomeAwareCommandLine;
+import net.shibboleth.idp.installer.InstallerSupport;
+import net.shibboleth.idp.installer.impl.UpdateIdPArguments.OperationType;
+import net.shibboleth.idp.installer.plugin.impl.TrustStore;
+import net.shibboleth.idp.installer.plugin.impl.TrustStore.Signature;
+import net.shibboleth.idp.plugin.InstallableComponentInfo;
+import net.shibboleth.idp.plugin.InstallableComponentVersion;
+import net.shibboleth.idp.plugin.PluginSupport;
+import net.shibboleth.shared.cli.AbstractCommandLine;
+import net.shibboleth.shared.collection.CollectionSupport;
+import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.shared.spring.httpclient.resource.HTTPResource;
+
+/**
+ * Command line update cheker.
+ */
+public class UpdateIdPCLI extends AbstractIdPHomeAwareCommandLine<UpdateIdPArguments> {
+
+ /** The "plugin Id" to look up idp versions with. */
+ @Nonnull public static String IDP_PLUGIN_ID = "net.shibboleth.idp";
+
+ /** The place we publish our keys. */
+ @Nonnull public static String SHIBBOLETH_SIGNING_KEYS = "http://shibboleth.net/downloads/PGP_KEYS";
+
+ /** Logger. */
+ @Nullable private Logger log;
+
+ /** {@inheritDoc} */
+ @Override
+ @Nonnull
+ protected Class<UpdateIdPArguments> getArgumentClass() {
+ return UpdateIdPArguments.class;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @Nonnull
+ protected String getVersion() {
+ final String result = Version.getVersion();
+ assert result != null;
+ return result;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @Nonnull
+ protected Logger getLogger() {
+ Logger localLog = log;
+ if (localLog == null) {
+ localLog = log = LoggerFactory.getLogger(UpdateIdPCLI.class);
+ }
+ return localLog;
+ }
+
+ /** {@inheritDoc} */
+ @Nonnull protected List<Resource> getAdditionalSpringResources() {
+ return CollectionSupport.singletonList(
+ new ClassPathResource("net/shibboleth/idp/conf/http-client.xml"));
+ }
+
+ /** {@inheritDoc} */
+ protected int doRun(@Nonnull final UpdateIdPArguments args) {
+
+ if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
+ Security.addProvider(new BouncyCastleProvider());
+ }
+
+ if (args.getHttpClientName() == null) {
+ args.setHttpClientName("shibboleth.InternalHttpClient");
+ }
+ super.doRun(args);
+ if (getHttpClient() == null) {
+ getLogger().error("Could not not locate http client {}", args.getHttpClientName());
+ return RC_INIT;
+ }
+
+ final List<URL> urls = new ArrayList<>(args.getUpdateURLs().size());
+ try {
+ for (final String s:args.getUpdateURLs()) {
+ urls.add(new URL(s));
+ }
+ } catch (MalformedURLException e) {
+ getLogger().error("Internal error", e);
+ return RC_IO;
+ }
+ final HttpClient client = getHttpClient();
+ assert client != null;
+ final Properties properties = PluginSupport.loadPluginInfo(urls, client, getHttpClientSecurityParameters());
+ if (properties == null) {
+ return RC_IO;
+ }
+ final InstallableComponentInfo info = new IdPInfo(properties);
+
+ final OperationType operation = args.getOperation();
+ if (operation == OperationType.LIST) {
+ return list(args, info);
+ } else {
+ return checkUpdate(args, info, operation == OperationType.DOWLOAD);
+ }
+ }
+
+ /** Check for a potential upgrade, then download if that was requested
+ * @param args The command line
+ * @param info information about the IdP update states, digested from "plugin.properties"
+ * @param doDownload whether to download the distribution
+ * @return a "return status"
+ */
+ private int checkUpdate(@Nonnull UpdateIdPArguments args, @Nonnull final InstallableComponentInfo info, boolean doDownload) {
+
+ final InstallableComponentVersion from = args.getUpdateFromVersion();
+ final InstallableComponentVersion newIdPVersion =
+ PluginSupport.getBestVersion(from, from, info);
+ if (newIdPVersion == null) {
+ getLogger().info("No Upgrade available from {}", from);
+ return RC_OK;
+ }
+ getLogger().info("Version {} can be upgraded to {}", from, newIdPVersion);
+ if (!doDownload) {
+ return RC_OK;
+ }
+ final InstallableComponentInfo.VersionInfo verInfo = info.getAvailableVersions().get(newIdPVersion);
+ assert verInfo != null;
+ return download(args, newIdPVersion, info);
+ }
+
+ /** List all available versions.
+ * @param args The command line
+ * @param info information about the IdP update states, digested from "plugin.properties"
+ * @return a "return status"
+ */
+ private int list(@Nonnull final UpdateIdPArguments args, @Nonnull final InstallableComponentInfo info) {
+
+ final Map<InstallableComponentVersion, InstallableComponentInfo.VersionInfo> versionMap = info.getAvailableVersions();
+ final List<InstallableComponentVersion> versionList = new ArrayList<>(versionMap.keySet());
+ versionList.sort(null);
+ final InstallableComponentVersion us = args.getUpdateFromVersion();
+ for (final InstallableComponentVersion ver:versionList) {
+ final InstallableComponentInfo.VersionInfo inf = versionMap.get(ver);
+ getLogger().info("Version {}{} Supported Status: {}, Upgrade Candidate: {}", ver, ver.equals(us) ? " (current);" : ";",
+ inf.getSupportLevel(),
+ info.isSupportedWithIdPVersion(ver, us)?"yes": "no");
+ }
+
+ return RC_OK;
+ }
+
+ /** Download the provided or inferred version
+ * @param args the command line
+ * @param version the idp version to download
+ * @param info version about all IdP release
+ * @return a "return status"
+ */
+ private int download(@Nonnull final UpdateIdPArguments args,
+ @Nonnull final InstallableComponentVersion version, @Nonnull final InstallableComponentInfo info) {
+
+ final String baseName = info.getUpdateBaseName(version);
+ if (baseName == null) {
+ getLogger().error("Could not get file name for idp update version {}", version);
+ return RC_IO;
+ }
+ final String fileName = baseName + (SystemUtils.IS_OS_WINDOWS? ".zip" : ".tgz");
+
+ final URL baseUrl = info.getUpdateURL(version);
+ if (baseUrl == null) {
+ getLogger().error("Could not get base URL for idp update version {}", version);
+ return RC_IO;
+ }
+
+ getLogger().info("Downloading version {} to {} from {}/{}", version, args.getDownloadLocation(), baseUrl, fileName);
+ try {
+ final HttpClient client = getHttpClient();
+ assert client != null;
+ final HTTPResource baseResource = new HTTPResource(client, baseUrl);
+
+ final HttpClientSecurityContextHandler handler = new HttpClientSecurityContextHandler();
+ handler.setHttpClientSecurityParameters(getHttpClientSecurityParameters());
+ handler.initialize();
+ baseResource.setHttpClientContextHandler(handler);
+
+ InstallerSupport.download(baseResource, handler, args.getDownloadLocation(), fileName + ".asc");
+ InstallerSupport.download(baseResource, handler, args.getDownloadLocation(), fileName);
+
+ } catch (final IOException | ComponentInitializationException e) {
+ getLogger().error("Could not download idp version {} from {}", version, baseUrl, e);
+ return RC_IO;
+ }
+ getLogger().debug("Checking signature");
+ int result = checkSignature(args, fileName);
+ if (result != RC_OK) {
+ getLogger().info("Deleting downloaded files");
+ try {
+ Files.delete(args.getDownloadLocation().resolve(fileName));
+ Files.delete(args.getDownloadLocation().resolve(fileName + ".asc"));
+ } catch (IOException e) {
+ getLogger().error("Could not delete {}[.asc]", fileName, e);
+ args.getDownloadLocation().resolve(fileName).toFile().deleteOnExit();
+ args.getDownloadLocation().resolve(fileName + ".asc").toFile().deleteOnExit();
+ }
+ }
+ return result;
+ }
+
+ /** Check the signature of the downloaded distribution.
+ * @param args the command line
+ * @param fileName the name.
+ * @return "status" from the operation
+ */
+ private int checkSignature(@Nonnull final UpdateIdPArguments args, @Nonnull final String fileName) {
+ try (final InputStream sigStream = new BufferedInputStream(
+ new FileInputStream(args.getDownloadLocation().resolve(fileName + ".asc").toFile()))) {
+ final TrustStore trust = new TrustStore();
+ final Path idpHome = Path.of(args.getIdPHome());
+ assert idpHome != null;
+ trust.setIdpHome(idpHome);
+ trust.setTrustStore(args.getTruststore());
+ trust.setPluginId(IDP_PLUGIN_ID);
+ trust.initialize();
+ final Signature sig = TrustStore.signatureOf(sigStream);
+ if (!trust.contains(sig)) {
+ getLogger().info("TrustStore does not contain signature {}", sig);
+ getLogger().info("Downloading {}", SHIBBOLETH_SIGNING_KEYS);
+
+ final HttpClient client = getHttpClient();
+ assert client != null;
+ final HTTPResource baseResource = new HTTPResource(client, SHIBBOLETH_SIGNING_KEYS);
+
+ final HttpClientSecurityContextHandler handler = new HttpClientSecurityContextHandler();
+ handler.setHttpClientSecurityParameters(getHttpClientSecurityParameters());
+ handler.initialize();
+ baseResource.setHttpClientContextHandler(handler);
+
+ try (final InputStream keysStream = new BufferedInputStream(baseResource.getInputStream())) {
+ trust.importKeyFromStream(sig, keysStream, new InstallerSupport.InstallerQuery("Accept this key"));
+ }
+ if (!trust.contains(sig)) {
+ getLogger().info("Key not added to Trust Store");
+ return RC_IO;
+ }
+ }
+
+ try (final InputStream distroStream = new BufferedInputStream(
+ new FileInputStream(args.getDownloadLocation().resolve(fileName).toFile()))) {
+ if (!trust.checkSignature(distroStream, sig)) {
+ getLogger().info("Signature checked for {} failed", fileName);
+ return RC_IO; }
+ }
+
+ } catch (final ComponentInitializationException | IOException e) {
+ getLogger().error("Could not manage truststore for [{}, {}] ", args.getIdPHome(), IDP_PLUGIN_ID, e);
+ return RC_IO;
+ }
+ return RC_OK;
+ }
+
+
+ /** Shim for CLI entry point: Allows the code to be run from a test.
+ *
+ * @return one of the predefines {@link AbstractCommandLine#RC_INIT},
+ * {@link AbstractCommandLine#RC_IO}, {@link AbstractCommandLine#RC_OK}
+ * or {@link AbstractCommandLine#RC_UNKNOWN}
+ *
+ * @param args arguments
+ */
+ public static int runMain(@Nonnull final String[] args) {
+ final UpdateIdPCLI cli = new UpdateIdPCLI();
+
+ return cli.run(args);
+ }
+
+ /**
+ * CLI entry point.
+ * @param args arguments
+ */
+ public static void main(@Nonnull final String[] args) {
+ System.exit(runMain(args));
+ }
+
+ /** Local implementaion of {@link InstallableComponentInfo} for an IdP Version. */
+ private static class IdPInfo extends InstallableComponentInfo {
+
+ /**
+ * Constructor.
+ * @param props The property file to populate from
+ */
+ public IdPInfo(@Nonnull Properties props) {
+ super(IDP_PLUGIN_ID, props);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @Nullable
+ protected InstallableComponentVersion getMaxVersion(@Nonnull Properties props, @Nonnull String version) {
+ // The maximum version that version "us" can be installed in is "us" (a re-intall).
+ return new InstallableComponentVersion(version);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @Nullable
+ protected InstallableComponentVersion getMinVersion(@Nonnull Properties props, @Nonnull String version) {
+ // We can always be on anything from V4.0.0
+ return new InstallableComponentVersion(4,0,0);
+ }
+
+ }
+}
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
index 1848a2216..6800f8234 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
@@ -21,6 +21,7 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.installer.impl.IdPInstallerCLI;
import net.shibboleth.idp.installer.impl.InstallerProperties;
+import net.shibboleth.idp.installer.impl.UpdateIdPCLI;
//import net.shibboleth.idp.installer.impl.UpdateIdPCLI;
/**
*
@@ -58,13 +59,12 @@ public class TestInstallerCLI {
}
-/*
@Test(enabled = false)
public void updateList430() {
UpdateIdPCLI.runMain(new String[] {
"-l",
"--pretendVersion","4.3.0",
- "--updateURL", "file:C:\\Users\\rdw\\Desktop\\logs\\plugins.properties",
+ "--updateURL", "file:H:\\Perforce\\juno\\Plugins\\java-idp-plugin-mgmt\\idp-versions.properties",
"--home", "H:\\Downloads\\idp"});
}
@@ -73,7 +73,7 @@ public class TestInstallerCLI {
UpdateIdPCLI.runMain(new String[] {
"-l",
"--pretendVersion","4.3.1",
- "--updateURL", "file:C:\\Users\\rdw\\Desktop\\logs\\plugins.properties",
+ "--updateURL", "file:H:\\Perforce\\juno\\Plugins\\java-idp-plugin-mgmt\\idp-versions.properties",
"--home", "H:\\Downloads\\idp"});
}
@@ -81,7 +81,7 @@ public class TestInstallerCLI {
public void check430() {
UpdateIdPCLI.runMain(new String[] {
"--pretendVersion","4.3.0",
- "--updateURL", "file:C:\\Users\\rdw\\Desktop\\logs\\plugins.properties",
+ "--updateURL", "file:H:\\Perforce\\juno\\Plugins\\java-idp-plugin-mgmt\\idp-versions.properties",
"--home", "H:\\Downloads\\idp"});
}
@@ -89,7 +89,7 @@ public class TestInstallerCLI {
public void check431() {
UpdateIdPCLI.runMain(new String[] {
"--pretendVersion","4.3.1",
- "--updateURL", "file:C:\\Users\\rdw\\Desktop\\logs\\plugins.properties",
+ "--updateURL", "file:H:\\Perforce\\juno\\Plugins\\java-idp-plugin-mgmt\\idp-versions.properties",
"--home", "H:\\Downloads\\idp"});
}
@@ -98,7 +98,7 @@ public class TestInstallerCLI {
UpdateIdPCLI.runMain(new String[] {
"-d", "H:\\downloads\\idp",
"--pretendVersion","4.3.0",
- "--updateURL", "file:C:\\Users\\rdw\\Desktop\\logs\\plugins.properties",
+ "--updateURL", "file:H:\\Perforce\\juno\\Plugins\\java-idp-plugin-mgmt\\idp-versions.properties",
"--home", "H:\\Downloads\\idp"});
- }*/
+ }
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list