Skip to content

Commit

Permalink
feat(jans-lock): fix errorResponseFactory dependecy
Browse files Browse the repository at this point in the history
Signed-off-by: Yuriy Movchan <[email protected]>
  • Loading branch information
yurem committed Dec 24, 2024
1 parent 9b4825a commit d76b0f6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
5 changes: 4 additions & 1 deletion jans-lock/lock-server/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
<dependency>
<groupId>io.jans</groupId>
<artifactId>jans-auth-model</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -109,6 +108,10 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -80,6 +81,8 @@ public class ConfigurationFactory extends ApplicationConfigurationFactory {
@Inject
private Instance<Configuration> configurationInstance;

private ErrorResponseFactory errorResponseFactory;

public final static String PERSISTENCE_CONFIGUARION_RELOAD_EVENT_TYPE = "persistenceConfigurationReloadEvent";
public final static String BASE_CONFIGUARION_RELOAD_EVENT_TYPE = "baseConfigurationReloadEvent";

Expand Down Expand Up @@ -250,6 +253,12 @@ public StaticConfiguration getStaticConfiguration() {
return staticConf;
}

@Produces
@ApplicationScoped
public ErrorResponseFactory getFido2ErrorResponseFactory() {
return errorResponseFactory;
}

public BaseDnConfiguration getBaseDn() {
return getStaticConfiguration().getBaseDn();
}
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
}

0 comments on commit d76b0f6

Please sign in to comment.