[java-opensaml] 01/03: OSJ-386: Update ConfigurationPropertiesSource to return a custom type
Brent Putman
putmanb at georgetown.edu
Fri Aug 25 03:15:31 UTC 2023
This is an automated email from the git hooks/post-receive script.
putmanb pushed a commit to branch main
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=c7afbb04d2f0bea9bdeef85da68237f649dce5e0
commit c7afbb04d2f0bea9bdeef85da68237f649dce5e0
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Wed Aug 23 21:47:37 2023 -0400
OSJ-386: Update ConfigurationPropertiesSource to return a custom type
---
.../core/config/ConfigurationProperties.java | 44 +++++++++++++++
.../core/config/ConfigurationPropertiesSource.java | 4 +-
.../opensaml/core/config/ConfigurationService.java | 20 +++----
...actFilesystemConfigurationPropertiesSource.java | 5 +-
.../ClasspathConfigurationPropertiesSource.java | 5 +-
.../core/config/provider/PropertiesAdapter.java | 62 ++++++++++++++++++++++
...ystemPropertyConfigurationPropertiesSource.java | 6 ++-
.../ThreadLocalConfigurationPropertiesSource.java | 6 ++-
.../core/xml/io/AbstractXMLObjectUnmarshaller.java | 4 +-
...ClasspathConfigurationPropertiesSourceTest.java | 11 ++--
...ilesystemConfigurationPropertiesSourceTest.java | 12 ++---
...readLocalConfigurationPropertiesSourceTest.java | 11 ++--
.../GlobalNamedCurveRegistryInitializer.java | 4 +-
.../config/impl/ApacheXMLSecurityInitializer.java | 5 +-
.../DefaultSecurityConfigurationBootstrap.java | 4 +-
.../impl/JavaCryptoValidationInitializer.java | 4 +-
.../impl/provider/ApacheSantuarioXMLParser.java | 4 +-
17 files changed, 158 insertions(+), 53 deletions(-)
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationProperties.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationProperties.java
new file mode 100644
index 000000000..0290123cd
--- /dev/null
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationProperties.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed 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 org.opensaml.core.config;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/**
+ * An interface for a property set.
+ */
+public interface ConfigurationProperties {
+
+ /**
+ * Return the property value with the specified key, or null.
+ *
+ * @param key the property key
+ *
+ * @return the property value, or null
+ */
+ @Nullable public String getProperty(@Nonnull final String key);
+
+ /**
+ * Return the property value with the specified key, or the specified default value if key does not exist.
+ *
+ * @param key the property key
+ * @param defaultValue the default value to return
+ *
+ * @return the property value, or the specified default value
+ */
+ @Nonnull String getProperty(@Nonnull final String key, @Nonnull final String defaultValue);
+
+}
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationPropertiesSource.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationPropertiesSource.java
index e713231af..b3409240a 100644
--- a/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationPropertiesSource.java
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationPropertiesSource.java
@@ -14,8 +14,6 @@
package org.opensaml.core.config;
-import java.util.Properties;
-
import javax.annotation.Nullable;
/**
@@ -28,6 +26,6 @@ public interface ConfigurationPropertiesSource {
*
* @return the properties set or null
*/
- @Nullable Properties getProperties();
+ @Nullable ConfigurationProperties getProperties();
}
\ No newline at end of file
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationService.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationService.java
index c33a5519f..6f5be68c6 100644
--- a/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationService.java
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/ConfigurationService.java
@@ -15,21 +15,19 @@
package org.opensaml.core.config;
import java.util.Iterator;
-import java.util.Properties;
import java.util.ServiceLoader;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import net.shibboleth.shared.annotation.constraint.Live;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.LoggerFactory;
-
import org.opensaml.core.config.provider.MapBasedConfiguration;
import org.opensaml.core.config.provider.SystemPropertyConfigurationPropertiesSource;
import org.slf4j.Logger;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.primitive.LoggerFactory;
+
/**
* A service which provides for the registration, retrieval and deregistration of objects
* related to library module configuration.
@@ -158,9 +156,8 @@ public class ConfigurationService {
*
* @return the set of configuration meta-properties
*/
- @Nullable @Live public static Properties getConfigurationProperties() {
- //TODO make these immutable?
- LOG.trace("Resolving configuration propreties source");
+ @Nullable public static ConfigurationProperties getConfigurationProperties() {
+ LOG.trace("Resolving configuration properties source");
final Iterator<ConfigurationPropertiesSource> iter = configPropertiesLoader.iterator();
if (!iter.hasNext()) {
@@ -171,7 +168,7 @@ public class ConfigurationService {
while (iter.hasNext()) {
final ConfigurationPropertiesSource source = iter.next();
LOG.trace("Evaluating configuration properties implementation: {}", source.getClass().getName());
- final Properties props = source.getProperties();
+ final ConfigurationProperties props = source.getProperties();
if (props != null) {
LOG.trace("Resolved non-null configuration properties using implementation: {}",
source.getClass().getName());
@@ -209,7 +206,7 @@ public class ConfigurationService {
* @return the partition name
*/
@Nonnull @NotEmpty protected static String getPartitionName() {
- final Properties configProperties = getConfigurationProperties();
+ final ConfigurationProperties configProperties = getConfigurationProperties();
String partitionName = null;
if (configProperties != null) {
partitionName = configProperties.getProperty(PROPERTY_PARTITION_NAME, DEFAULT_PARTITION_NAME);
@@ -217,7 +214,6 @@ public class ConfigurationService {
partitionName = DEFAULT_PARTITION_NAME;
}
LOG.trace("Resolved effective configuration partition name '{}'", partitionName);
- assert partitionName != null;
return partitionName;
}
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java
index 631b6cee4..bfbd48621 100644
--- a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/AbstractFilesystemConfigurationPropertiesSource.java
@@ -24,6 +24,7 @@ import java.util.Properties;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationPropertiesSource;
import org.slf4j.Logger;
@@ -48,7 +49,7 @@ public abstract class AbstractFilesystemConfigurationPropertiesSource implements
@Nullable private Properties cachedProperties;
/** {@inheritDoc} */
- @Nullable public Properties getProperties() {
+ @Nullable public ConfigurationProperties getProperties() {
final String fileName = StringSupport.trimOrNull(getFilename());
if (fileName == null) {
log.warn("No filename was supplied, unable to load properties");
@@ -74,7 +75,7 @@ public abstract class AbstractFilesystemConfigurationPropertiesSource implements
}
}
}
- return cachedProperties;
+ return cachedProperties != null ? new PropertiesAdapter(cachedProperties) : null;
}
}
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java
index 6c391fc04..c1dafa45b 100644
--- a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSource.java
@@ -21,6 +21,7 @@ import java.util.Properties;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationPropertiesSource;
import org.slf4j.Logger;
@@ -43,7 +44,7 @@ public class ClasspathConfigurationPropertiesSource implements ConfigurationProp
@Nullable private Properties cachedProperties;
/** {@inheritDoc} */
- @Nullable public Properties getProperties() {
+ @Nullable public ConfigurationProperties getProperties() {
synchronized (this) {
if (cachedProperties == null) {
try (final InputStream is =
@@ -61,7 +62,7 @@ public class ClasspathConfigurationPropertiesSource implements ConfigurationProp
+ RESOURCE_NAME + "' from classpath", e);
}
}
- return cachedProperties;
+ return cachedProperties != null ? new PropertiesAdapter(cachedProperties) : null;
}
}
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/PropertiesAdapter.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/PropertiesAdapter.java
new file mode 100644
index 000000000..54ee9a3e3
--- /dev/null
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/PropertiesAdapter.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed 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 org.opensaml.core.config.provider;
+
+import java.util.Properties;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.opensaml.core.config.ConfigurationProperties;
+
+import net.shibboleth.shared.logic.Constraint;
+
+/**
+ * An implementation of {@link ConfigurationProperties} which wraps an instance of Java {@link Properties}.
+ */
+public class PropertiesAdapter implements ConfigurationProperties {
+
+ /** The wrapped properties instance. */
+ @Nonnull private Properties properties;
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedProperties the wrapped properties instance
+ */
+ public PropertiesAdapter(@Nonnull final Properties wrappedProperties) {
+ properties = Constraint.isNotNull(wrappedProperties, "Wrapped Properties was null");
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @Nullable
+ public String getProperty(@Nonnull final String key) {
+ Constraint.isNotNull(key, "Key was null");
+ return properties.getProperty(key);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @Nonnull
+ public String getProperty(@Nonnull final String key, @Nonnull final String defaultValue) {
+ Constraint.isNotNull(key, "Key was null");
+ Constraint.isNotNull(defaultValue, "Default value was null");
+ final String value = properties.getProperty(key, defaultValue);
+ assert value != null;
+ return value;
+ }
+
+}
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/SystemPropertyConfigurationPropertiesSource.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/SystemPropertyConfigurationPropertiesSource.java
index fadb3b7b0..55981809a 100644
--- a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/SystemPropertyConfigurationPropertiesSource.java
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/SystemPropertyConfigurationPropertiesSource.java
@@ -18,6 +18,7 @@ import java.util.Properties;
import javax.annotation.Nullable;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationPropertiesSource;
/**
@@ -26,8 +27,9 @@ import org.opensaml.core.config.ConfigurationPropertiesSource;
public class SystemPropertyConfigurationPropertiesSource implements ConfigurationPropertiesSource {
/** {@inheritDoc} */
- @Nullable public Properties getProperties() {
- return System.getProperties();
+ @Nullable public ConfigurationProperties getProperties() {
+ final Properties props = System.getProperties();
+ return props != null ? new PropertiesAdapter(props) : null;
}
}
\ No newline at end of file
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSource.java b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSource.java
index 26d7c3aa7..7f9d4e1c2 100644
--- a/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSource.java
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSource.java
@@ -18,6 +18,7 @@ import java.util.Properties;
import javax.annotation.Nullable;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationPropertiesSource;
/**
@@ -47,8 +48,9 @@ import org.opensaml.core.config.ConfigurationPropertiesSource;
public class ThreadLocalConfigurationPropertiesSource implements ConfigurationPropertiesSource {
/** {@inheritDoc} */
- @Nullable public Properties getProperties() {
- return ThreadLocalConfigurationPropertiesHolder.getProperties();
+ @Nullable public ConfigurationProperties getProperties() {
+ final Properties props = ThreadLocalConfigurationPropertiesHolder.getProperties();
+ return props != null ? new PropertiesAdapter(props) : null;
}
}
\ No newline at end of file
diff --git a/opensaml-core-api/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java b/opensaml-core-api/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
index 3f086cf9d..2ce203f24 100644
--- a/opensaml-core-api/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
+++ b/opensaml-core-api/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
@@ -15,12 +15,12 @@
package org.opensaml.core.xml.io;
import java.util.Objects;
-import java.util.Properties;
import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.xml.AttributeExtensibleXMLObject;
import org.opensaml.core.xml.Namespace;
@@ -101,7 +101,7 @@ public abstract class AbstractXMLObjectUnmarshaller implements Unmarshaller {
xmlObjectBuilderFactory = XMLObjectProviderRegistrySupport.getBuilderFactory();
unmarshallerFactory = XMLObjectProviderRegistrySupport.getUnmarshallerFactory();
- final Properties props = ConfigurationService.getConfigurationProperties();
+ final ConfigurationProperties props = ConfigurationService.getConfigurationProperties();
strictMode = (props != null) ? Boolean.parseBoolean(props.getProperty(CONFIG_PROPERTY_XML_STRICT_MODE, "true"))
: true;
}
diff --git a/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSourceTest.java b/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSourceTest.java
index 2d16c8781..8546e52c0 100644
--- a/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSourceTest.java
+++ b/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ClasspathConfigurationPropertiesSourceTest.java
@@ -14,13 +14,12 @@
package org.opensaml.core.config.provider;
+import org.opensaml.core.config.ConfigurationProperties;
+import org.opensaml.core.config.ConfigurationPropertiesSource;
+import org.testng.Assert;
import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
-import org.testng.Assert;
-import java.util.Properties;
-
-import org.opensaml.core.config.ConfigurationPropertiesSource;
+import org.testng.annotations.Test;
/**
* Test {@link ClasspathConfigurationPropertiesSource}.
@@ -48,7 +47,7 @@ public class ClasspathConfigurationPropertiesSourceTest {
@Test
public void testSource() {
source = new ClasspathConfigurationPropertiesSource();
- final Properties props = source.getProperties();
+ final ConfigurationProperties props = source.getProperties();
assert props != null;
Assert.assertEquals(props.getProperty("opensaml.config.partitionName"), "myapp", "Incorrect property value");
diff --git a/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/FilesystemConfigurationPropertiesSourceTest.java b/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/FilesystemConfigurationPropertiesSourceTest.java
index dea5e66c5..dac7fbccb 100644
--- a/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/FilesystemConfigurationPropertiesSourceTest.java
+++ b/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/FilesystemConfigurationPropertiesSourceTest.java
@@ -14,15 +14,15 @@
package org.opensaml.core.config.provider;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import org.testng.Assert;
import java.io.File;
import java.io.IOException;
-import java.util.Properties;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationPropertiesSource;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import com.google.common.io.Files;
@@ -70,7 +70,7 @@ public class FilesystemConfigurationPropertiesSourceTest {
@Test
public void testSource() {
source = new TestFilesystemConfigurationPropertiesSource();
- final Properties props = source.getProperties();
+ final ConfigurationProperties props = source.getProperties();
assert props != null;
Assert.assertEquals(props.getProperty("opensaml.config.partitionName"), "myapp", "Incorrect property value");
diff --git a/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSourceTest.java b/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSourceTest.java
index fe30f3a0b..5d74cdcf6 100644
--- a/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSourceTest.java
+++ b/opensaml-core-api/src/test/java/org/opensaml/core/config/provider/ThreadLocalConfigurationPropertiesSourceTest.java
@@ -14,13 +14,14 @@
package org.opensaml.core.config.provider;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import org.testng.Assert;
import java.util.Properties;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationPropertiesSource;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
/**
* Test {@link ThreadLocalConfigurationPropertiesSource}.
@@ -51,7 +52,7 @@ public class ThreadLocalConfigurationPropertiesSourceTest {
@Test
public void testSource() {
source = new ThreadLocalConfigurationPropertiesSource();
- final Properties props = source.getProperties();
+ final ConfigurationProperties props = source.getProperties();
assert props != null;
Assert.assertEquals(props.getProperty("opensaml.config.partitionName"), "myapp-threadlocal", "Incorrect property value");
diff --git a/opensaml-security-api/src/main/java/org/opensaml/security/config/GlobalNamedCurveRegistryInitializer.java b/opensaml-security-api/src/main/java/org/opensaml/security/config/GlobalNamedCurveRegistryInitializer.java
index c7efa2bb3..d8ca68133 100644
--- a/opensaml-security-api/src/main/java/org/opensaml/security/config/GlobalNamedCurveRegistryInitializer.java
+++ b/opensaml-security-api/src/main/java/org/opensaml/security/config/GlobalNamedCurveRegistryInitializer.java
@@ -15,13 +15,13 @@
package org.opensaml.security.config;
import java.util.Iterator;
-import java.util.Properties;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.config.InitializationException;
import org.opensaml.core.config.Initializer;
@@ -69,7 +69,7 @@ public class GlobalNamedCurveRegistryInitializer implements Initializer {
registry.register(curve);
}
- final Properties props = ConfigurationService.getConfigurationProperties();
+ final ConfigurationProperties props = ConfigurationService.getConfigurationProperties();
final boolean registerBCCurves =
(props != null) ? Boolean.parseBoolean(props.getProperty(CONFIG_PROPERTY_REGISTER_BOUNCY_CASTLE_CURVES))
: false;
diff --git a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java
index de44b4170..b7f66dbc8 100644
--- a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java
+++ b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java
@@ -14,11 +14,10 @@
package org.opensaml.xmlsec.config.impl;
-import java.util.Properties;
-
import javax.annotation.Nonnull;
import org.apache.xml.security.Init;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.config.InitializationException;
import org.opensaml.core.config.Initializer;
@@ -48,7 +47,7 @@ public class ApacheXMLSecurityInitializer implements Initializer {
System.setProperty(lineBreakPropName, "true");
}
- final Properties props = ConfigurationService.getConfigurationProperties();
+ final ConfigurationProperties props = ConfigurationService.getConfigurationProperties();
final boolean enableXMLParser =
(props != null) ? Boolean.parseBoolean(props.getProperty(CONFIG_PROPERTY_XML_PARSER_ENABLE, "true"))
: true;
diff --git a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/DefaultSecurityConfigurationBootstrap.java b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/DefaultSecurityConfigurationBootstrap.java
index c87a026ec..576c95f2d 100644
--- a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/DefaultSecurityConfigurationBootstrap.java
+++ b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/DefaultSecurityConfigurationBootstrap.java
@@ -18,11 +18,11 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
import javax.annotation.Nonnull;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.security.crypto.JCAConstants;
import org.opensaml.xmlsec.agreement.impl.DigestMethod;
@@ -141,7 +141,7 @@ public class DefaultSecurityConfigurationBootstrap {
final Map<String, KeyAgreementEncryptionConfiguration> kaConfigs = new HashMap<>();
try {
- final Properties props = ConfigurationService.getConfigurationProperties();
+ final ConfigurationProperties props = ConfigurationService.getConfigurationProperties();
final KeyAgreementEncryptionConfiguration ecConfig = new KeyAgreementEncryptionConfiguration();
ecConfig.setAlgorithm(EncryptionConstants.ALGO_ID_KEYAGREEMENT_ECDH_ES);
diff --git a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/JavaCryptoValidationInitializer.java b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/JavaCryptoValidationInitializer.java
index 0fba61bbe..23cb92e06 100644
--- a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/JavaCryptoValidationInitializer.java
+++ b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/JavaCryptoValidationInitializer.java
@@ -15,12 +15,12 @@
package org.opensaml.xmlsec.config.impl;
import java.security.NoSuchAlgorithmException;
-import java.util.Properties;
import javax.annotation.Nonnull;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.config.InitializationException;
import org.opensaml.core.config.Initializer;
@@ -79,7 +79,7 @@ public class JavaCryptoValidationInitializer implements Initializer {
}
if (!valid) {
- final Properties props = ConfigurationService.getConfigurationProperties();
+ final ConfigurationProperties props = ConfigurationService.getConfigurationProperties();
final String isFatal =
(props != null) ? props.getProperty(CONFIG_PROPERTY_FAIL_IS_FATAL, "false") : "false";
if ("true".equalsIgnoreCase(isFatal) || "1".equals(isFatal)) {
diff --git a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParser.java b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParser.java
index bab19a531..ccbeb0138 100644
--- a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParser.java
+++ b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParser.java
@@ -15,13 +15,13 @@
package org.opensaml.xmlsec.impl.provider;
import java.io.InputStream;
-import java.util.Properties;
import javax.annotation.Nonnull;
import org.apache.xml.security.parser.XMLParser;
import org.apache.xml.security.parser.XMLParserException;
import org.apache.xml.security.utils.XMLUtils;
+import org.opensaml.core.config.ConfigurationProperties;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.config.InitializationException;
import org.opensaml.core.xml.config.XMLObjectProviderRegistry;
@@ -83,7 +83,7 @@ public class ApacheSantuarioXMLParser implements XMLParser {
log.trace("Configured parser pool as global ParserPool");
} else {
try {
- final Properties props = ConfigurationService.getConfigurationProperties();
+ final ConfigurationProperties props = ConfigurationService.getConfigurationProperties();
final int maxPoolSize =
(props != null) ? Integer.parseUnsignedInt(
props.getProperty(CONFIG_PROPERTY_MAX_POOL_SIZE, "50"))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list