[java-shib-shared] branch main updated: Revert "JSSH-33 - Spring converters run before property replacement"

Scott Cantor cantor.2 at osu.edu
Tue Jun 13 20:13:39 UTC 2023


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=0e7fd4d5f63dd26f5af0702149d2a9dba7d5c561

The following commit(s) were added to refs/heads/main by this push:
     new 0e7fd4d5 Revert "JSSH-33 - Spring converters run before property replacement"
0e7fd4d5 is described below

commit 0e7fd4d5f63dd26f5af0702149d2a9dba7d5c561
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Jun 13 16:13:27 2023 -0400

    Revert "JSSH-33 - Spring converters run before property replacement"
    
    This reverts commit 52260fcb50d5b6ed230a9eec74360bc9ecc04a67.
---
 .../shared/spring/config/StringToResourceConverter.java  | 16 ++++------------
 .../shared/spring/util/ApplicationContextBuilder.java    |  8 +++-----
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/shib-spring/src/main/java/net/shibboleth/shared/spring/config/StringToResourceConverter.java b/shib-spring/src/main/java/net/shibboleth/shared/spring/config/StringToResourceConverter.java
index 7a90f569..69373869 100644
--- a/shib-spring/src/main/java/net/shibboleth/shared/spring/config/StringToResourceConverter.java
+++ b/shib-spring/src/main/java/net/shibboleth/shared/spring/config/StringToResourceConverter.java
@@ -52,23 +52,15 @@ public class StringToResourceConverter implements Converter<String, Resource>, A
         if (loader == null) {
             loader = new PreferFileSystemResourceLoader();
         }
-
-        final String replaced;
-        if (applicationContext != null) {
-            replaced = applicationContext.getEnvironment().resolveRequiredPlaceholders(source);
-        } else {
-            replaced = source;
-        }
-        
-        final Resource result = ResourceHelper.of(loader.getResource(replaced));
+        final Resource result = ResourceHelper.of(loader.getResource(source));
         
-        if (replaced.endsWith(" ") || log.isDebugEnabled()) {
+        if (source.endsWith(" ") || log.isDebugEnabled()) {
             if (!result.exists()) {
                 if (log.isDebugEnabled()) {
-                    log.debug("Resource at '{}' does not exist", replaced);
+                    log.debug("Resource at '{}' does not exist", source);
                 }
                 if (source.endsWith(" ")) {
-                    log.warn("Missing path '{}' ends with a space, check for stray characters", replaced);
+                    log.warn("Missing path '{}' ends with a space, check for stray characters", source);
                 }
             }
         }
diff --git a/shib-spring/src/main/java/net/shibboleth/shared/spring/util/ApplicationContextBuilder.java b/shib-spring/src/main/java/net/shibboleth/shared/spring/util/ApplicationContextBuilder.java
index dfa10e6f..05045b97 100644
--- a/shib-spring/src/main/java/net/shibboleth/shared/spring/util/ApplicationContextBuilder.java
+++ b/shib-spring/src/main/java/net/shibboleth/shared/spring/util/ApplicationContextBuilder.java
@@ -344,15 +344,13 @@ public class ApplicationContextBuilder {
         if (conversionService != null) {
             context.getBeanFactory().setConversionService(conversionService);
         } else {
-            final var resourceConverter = new StringToResourceConverter();
-            resourceConverter.setApplicationContext(context);
             final ConversionServiceFactoryBean service = new ConversionServiceFactoryBean();
-            service.setConverters(CollectionSupport.setOf(
-                    resourceConverter,
+            service.setConverters(new HashSet<>(Arrays.asList(
                     new StringToIPRangeConverter(),
                     new BooleanToPredicateConverter(),
                     new StringBooleanToPredicateConverter(),
-                    new StringToDurationConverter()));
+                    new StringToResourceConverter(),
+                    new StringToDurationConverter())));
             service.afterPropertiesSet();
             context.getBeanFactory().setConversionService(service.getObject());
         }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list