From 87a038d4d387a63510eb1cc90959bcc483b997c3 Mon Sep 17 00:00:00 2001 From: Yuriy Movchan Date: Tue, 24 Dec 2024 20:34:03 +0300 Subject: [PATCH] feat(jans-lock): fix errorResponseFactory dependecy Signed-off-by: Yuriy Movchan --- jans-lock/lock-server/service/pom.xml | 5 ++++- .../service/config/ConfigurationFactory.java | 12 +++++++++++ .../ws/rs/stat/StatRestWebServiceImpl.java | 4 ++-- .../java/io/jans/lock/util/Constants.java | 20 +++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 jans-lock/lock-server/service/src/main/java/io/jans/lock/util/Constants.java diff --git a/jans-lock/lock-server/service/pom.xml b/jans-lock/lock-server/service/pom.xml index daae92a9cf2..5a35cea34df 100644 --- a/jans-lock/lock-server/service/pom.xml +++ b/jans-lock/lock-server/service/pom.xml @@ -67,7 +67,6 @@ io.jans jans-auth-model - ${project.version} @@ -109,6 +108,10 @@ commons-codec commons-codec + + commons-beanutils + commons-beanutils + commons-collections commons-collections diff --git a/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/config/ConfigurationFactory.java b/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/config/ConfigurationFactory.java index a3a1052764d..240abfcab4a 100644 --- a/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/config/ConfigurationFactory.java +++ b/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/config/ConfigurationFactory.java @@ -28,6 +28,7 @@ import io.jans.lock.model.config.Conf; import io.jans.lock.model.config.Configuration; import io.jans.lock.model.config.StaticConfiguration; +import io.jans.lock.model.error.ErrorResponseFactory; import io.jans.orm.PersistenceEntryManager; import io.jans.orm.exception.BasePersistenceException; import io.jans.orm.model.PersistenceConfiguration; @@ -80,6 +81,8 @@ public class ConfigurationFactory extends ApplicationConfigurationFactory { @Inject private Instance configurationInstance; + private ErrorResponseFactory errorResponseFactory; + public final static String PERSISTENCE_CONFIGUARION_RELOAD_EVENT_TYPE = "persistenceConfigurationReloadEvent"; public final static String BASE_CONFIGUARION_RELOAD_EVENT_TYPE = "baseConfigurationReloadEvent"; @@ -250,6 +253,12 @@ public StaticConfiguration getStaticConfiguration() { return staticConf; } + @Produces + @ApplicationScoped + public ErrorResponseFactory getFido2ErrorResponseFactory() { + return errorResponseFactory; + } + public BaseDnConfiguration getBaseDn() { return getStaticConfiguration().getBaseDn(); } @@ -327,6 +336,9 @@ private void initConfigurationConf(Conf conf) { if (conf.getStatics() != null) { staticConf = conf.getStatics(); } + if (conf.getErrors() != null) { + errorResponseFactory = new ErrorResponseFactory(conf.getErrors(), conf.getDynamic()); + } } private void loadBaseConfiguration() { diff --git a/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/ws/rs/stat/StatRestWebServiceImpl.java b/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/ws/rs/stat/StatRestWebServiceImpl.java index a6e156c2533..b581f34968a 100644 --- a/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/ws/rs/stat/StatRestWebServiceImpl.java +++ b/jans-lock/lock-server/service/src/main/java/io/jans/lock/service/ws/rs/stat/StatRestWebServiceImpl.java @@ -12,11 +12,11 @@ import org.slf4j.Logger; -import io.jans.as.model.config.Constants; -import io.jans.as.model.error.ErrorResponseFactory; import io.jans.lock.model.config.AppConfiguration; +import io.jans.lock.model.error.ErrorResponseFactory; import io.jans.lock.model.error.StatErrorResponseType; import io.jans.lock.service.stat.StatResponseService; +import io.jans.lock.util.Constants; import io.jans.lock.util.ServerUtil; import io.prometheus.client.CollectorRegistry; import io.prometheus.client.Counter; diff --git a/jans-lock/lock-server/service/src/main/java/io/jans/lock/util/Constants.java b/jans-lock/lock-server/service/src/main/java/io/jans/lock/util/Constants.java new file mode 100644 index 00000000000..d4eac1f29cc --- /dev/null +++ b/jans-lock/lock-server/service/src/main/java/io/jans/lock/util/Constants.java @@ -0,0 +1,20 @@ +/* + * Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. + * + * Copyright (c) 2020, Janssen Project + */ +package io.jans.lock.util; + +/** + * Provides server with basic statistic + * + * @author Yuriy Movchan Date: 12/24/2024 + */ +public class Constants { + + private Constants() { + } + + + public static final String MONTH = "month"; +}