[java-identity-provider] 06/09: IDP-2107 Misc V5 Installer tasks
Rod Widdowson
rdw at steadingsoftware.com
Tue May 23 08:23:14 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=149adf826d742d69d0094d4b40c0eaca4d81e86d
commit 149adf826d742d69d0094d4b40c0eaca4d81e86d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun May 21 14:54:21 2023 +0100
IDP-2107 Misc V5 Installer tasks
https://shibboleth.atlassian.net/browse/IDP-2107
We don't need to look at the previous install's properties any more
---
.../idp/installer/impl/CurrentInstallState.java | 46 ----------------------
.../shibboleth/idp/installer/impl/V5Install.java | 10 -----
2 files changed, 56 deletions(-)
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
index 091106e71..1415a2cdc 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
@@ -81,9 +81,6 @@ public final class CurrentInstallState extends AbstractInitializableComponent {
/** Old Version. */
private String oldVersion;
- /** Previous props. */
- private Properties props;
-
/** The files to delete after an upgrade. */
@NonnullAfterInit private List<Path> pathsToDelete;
@@ -131,43 +128,6 @@ public final class CurrentInstallState extends AbstractInitializableComponent {
}
}
- /** Populate {{@link #props} from idp.properties and other files pointed to by
- * {@value IdPPropertiesApplicationContextInitializer#IDP_ADDITIONAL_PROPERTY}.
- * @throws ComponentInitializationException on various IO issues
- */
- private void setupPreviousProps() throws ComponentInitializationException {
- if (!isIdPPropertiesPresent()) {
- return ;
- }
- final Properties localProps = props = new Properties();
- try {
- final File idpPropsFile = targetDir.resolve("conf").resolve("idp.properties").toFile();
- final InputStream idpPropsStream = new FileInputStream(idpPropsFile);
- localProps .load(idpPropsStream);
- } catch (final IOException e) {
- log.error("Error loading idp.properties", e);
- return;
- }
- final String targetDirString = targetDir.toString();
- assert targetDirString!=null;
- final Collection<String> additionalSources = IdPPropertiesApplicationContextInitializer.getAdditionalSources(targetDirString, localProps);
- for (final String source : additionalSources) {
- final Path path = Path.of(source);
- if (Files.exists(path)) {
- try {
- final InputStream stream = new FileInputStream(path.toFile());
- props.load(stream);
- } catch (final IOException e) {
- log.error("Error loading {}", path, e);
- throw new ComponentInitializationException(e);
- }
- } else {
- log.warn("Unable to find property resource '{}' (check {}?)", path,
- IdPPropertiesApplicationContextInitializer.IDP_ADDITIONAL_PROPERTY);
- }
- }
- }
-
/**
* Populate {{@link #enabledModules} from the current classpath and the new IdP home.
*/
@@ -208,7 +168,6 @@ public final class CurrentInstallState extends AbstractInitializableComponent {
throw new ComponentInitializationException("'systems folder exists");
}
findPreviousVersion();
- setupPreviousProps();
findEnabledModules();
if (null == getInstalledVersion()) {
@@ -245,11 +204,6 @@ public final class CurrentInstallState extends AbstractInitializableComponent {
return ldapPropertiesPresent;
}
- /** {@inheritDoc} */
- @Nullable public Properties getCurrentlyInstalledProperties() {
- return props;
- }
-
/** {@inheritDoc} */
public @Nonnull List<Path> getPathsToBeDeleted() {
assert pathsToDelete != null;
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
index f1e3d6fbc..96a179805 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
@@ -66,7 +66,6 @@ import net.shibboleth.shared.component.AbstractInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.shared.primitive.StringSupport;
import net.shibboleth.shared.security.impl.BasicKeystoreKeyStrategyTool;
import net.shibboleth.shared.security.impl.SelfSignedCertificateGenerator;
import net.shibboleth.shared.spring.context.DeferPlaceholderFileSystemXmlWebApplicationContext;
@@ -144,15 +143,6 @@ public class V5Install extends AbstractInitializableComponent {
* @throws BuildException if one is broken.
*/
protected void checkPreConditions() throws BuildException {
- final Properties props = currentState.getCurrentlyInstalledProperties();
- if (props != null) {
- final String value = StringSupport.trimOrNull(props.getProperty("idp.service.relyingparty.resources"));
- if ("shibboleth.LegacyRelyingPartyResolverResources".equals(value)) {
- log.error("Install failed: system will not work after V4 upgrade");
- log.error("idp.service.relyingparty.resources is set to shibboleth.RelyingPartyResolverResources");
- throw new BuildException("Install failed: system will not work after V4 upgrade");
- }
- }
final String versionAsString = Version.getVersion();
final PluginVersion idpVersion = new PluginVersion(versionAsString!=null?versionAsString:"5.0.0");
for (final IdPPlugin plugin: ServiceLoader.load(IdPPlugin.class, currentState.getInstalledPluginsLoader())) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list