summaryrefslogtreecommitdiff
path: root/eaaf_core
diff options
context:
space:
mode:
authorThomas <>2022-01-08 19:12:53 +0100
committerThomas <>2022-01-08 19:12:53 +0100
commite7ee4d20559ee82104f2c7c1584aa34b7c8dbebe (patch)
treef66e396c7d9a34626795f94ed0a081885f57e1a9 /eaaf_core
parent999234a7e906b80c36f63127d753a8b37ac8e35e (diff)
downloadEAAF-Components-e7ee4d20559ee82104f2c7c1584aa34b7c8dbebe.tar.gz
EAAF-Components-e7ee4d20559ee82104f2c7c1584aa34b7c8dbebe.tar.bz2
EAAF-Components-e7ee4d20559ee82104f2c7c1584aa34b7c8dbebe.zip
[fix] solve circular dependencies between 'AuthenticationManager', 'ModuleRegistration', and 'AuthModule' implementations
Diffstat (limited to 'eaaf_core')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/AbstractAuthenticationManager.java35
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/ModuleRegistration.java4
2 files changed, 26 insertions, 13 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/AbstractAuthenticationManager.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/AbstractAuthenticationManager.java
index 2449340d..89977308 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/AbstractAuthenticationManager.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/AbstractAuthenticationManager.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
+import javax.annotation.PostConstruct;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -34,6 +35,7 @@ import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
import at.gv.egiz.eaaf.core.api.IRequest;
import at.gv.egiz.eaaf.core.api.IRequestStorage;
@@ -66,6 +68,9 @@ public abstract class AbstractAuthenticationManager implements IAuthenticationMa
public static final int SLOTIMEOUT = 30 * 1000; // 30 sec
+ @Autowired
+ private ApplicationContext ctx;
+
@Autowired(required = true)
protected IConfiguration authConfig;
@Autowired(required = true)
@@ -76,31 +81,35 @@ public abstract class AbstractAuthenticationManager implements IAuthenticationMa
protected IRevisionLogger revisionsLogger;
@Autowired(required = false)
protected ISsoManager ssoManager;
- @Autowired
+
ModuleRegistration moduleRegistration;
- /*
- * (non-Javadoc)
+ @PostConstruct
+ private void initializer() {
+ moduleRegistration = ctx.getBean(ModuleRegistration.class);
+
+ }
+
+ /**
+ * Add a request parameter to whitelist. All parameters that are part of the
+ * white list are added into {@link ExecutionContext}
*
- * @see at.gv.egiz.eaaf.core.impl.idp.auth.IAuthenticationManager#
- * addParameterNameToWhiteList(java.lang .String)
+ * @param httpReqParam http parameter name, but never null
*/
- @Override
- public final void addParameterNameToWhiteList(final String httpReqParam) {
+ public static final void addParameterNameToWhiteList(final String httpReqParam) {
if (StringUtils.isNotEmpty(httpReqParam)) {
reqParameterWhiteListeForModules.add(httpReqParam);
}
}
- /*
- * (non-Javadoc)
+ /**
+ * Add a request header to whitelist. All parameters that are part of the white
+ * list are added into {@link ExecutionContext}
*
- * @see at.gv.egiz.eaaf.core.impl.idp.auth.IAuthenticationManager#
- * addHeaderNameToWhiteList(java.lang. String)
+ * @param httpReqParam http header name, but never null
*/
- @Override
- public final void addHeaderNameToWhiteList(final String httpReqParam) {
+ public static final void addHeaderNameToWhiteList(final String httpReqParam) {
if (StringUtils.isNotEmpty(httpReqParam)) {
reqHeaderWhiteListeForModules.add(httpReqParam.toLowerCase());
}
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/ModuleRegistration.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/ModuleRegistration.java
index c4f1b505..cb14e1df 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/ModuleRegistration.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/ModuleRegistration.java
@@ -101,6 +101,10 @@ public class ModuleRegistration {
private void initSpringModules() {
log.debug("Discovering Spring modules.");
final Map<String, AuthModule> modules = ctx.getBeansOfType(AuthModule.class);
+
+ ctx.getBean("createBindingAuthModul");
+
+
for (final AuthModule module : modules.values()) {
registerModuleProcessDefinitions(module);
priorizedModules.add(module);