[java-identity-provider] branch main updated: IDP-1888 - Add duplicate property detection to the context initializer
Scott Cantor
cantor.2 at osu.edu
Mon Apr 11 13:46:08 UTC 2022
This is an automated email from the git hooks/post-receive script.
scantor 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=a57c7dff4551e859e585ff6755f4ba85bcf5b366
The following commit(s) were added to refs/heads/main by this push:
new a57c7dff4 IDP-1888 - Add duplicate property detection to the context initializer
a57c7dff4 is described below
commit a57c7dff4551e859e585ff6755f4ba85bcf5b366
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Apr 11 09:46:03 2022 -0400
IDP-1888 - Add duplicate property detection to the context initializer
https://shibboleth.atlassian.net/browse/IDP-1888
Exclude the registry root from the property search.
---
.../idp/spring/IdPPropertiesApplicationContextInitializer.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/idp-core/src/main/java/net/shibboleth/idp/spring/IdPPropertiesApplicationContextInitializer.java b/idp-core/src/main/java/net/shibboleth/idp/spring/IdPPropertiesApplicationContextInitializer.java
index 41bc3f4be..7caa7718c 100644
--- a/idp-core/src/main/java/net/shibboleth/idp/spring/IdPPropertiesApplicationContextInitializer.java
+++ b/idp-core/src/main/java/net/shibboleth/idp/spring/IdPPropertiesApplicationContextInitializer.java
@@ -240,14 +240,17 @@ public class IdPPropertiesApplicationContextInitializer
if (autosearch) {
final Path searchRoot = Path.of(searchLocation).resolve("conf");
if (searchRoot.toFile().isDirectory()) {
+ final Path registryRoot = searchRoot.resolve("attributes");
+ final String idpPropertiesNative = Path.of(IDP_PROPERTIES).toString();
try (final Stream<Path> paths = Files.find(searchRoot, Integer.MAX_VALUE,
new BiPredicate<Path,BasicFileAttributes>() {
public boolean test(final Path path, final BasicFileAttributes u) {
final String pathAsString = path.toString();
// convert back and forth to handle different dir separators
- final String idpPropertiesNative = Path.of(IDP_PROPERTIES).toString();
- if (u.isRegularFile() && path.getFileName().toString().endsWith(".properties")
- && !pathAsString.endsWith(idpPropertiesNative)) {
+ if (u.isRegularFile()
+ && path.getFileName().toString().endsWith(".properties")
+ && !pathAsString.endsWith(idpPropertiesNative)
+ && !pathAsString.startsWith(registryRoot.toString())) {
LOG.info("Including auto-located properties in {}", path);
return true;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list