Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-31576 Fixed ida automation issue #1368

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ public class MasterDataCacheInitializer implements ApplicationListener<Applicati
// Invoking this in post construct does not work due to time-out issue happening
// with webclient while invoking from post constuct.
public void loadMasterData() throws IdAuthenticationBusinessException {
//https://mosip.atlassian.net/browse/MOSIP-35847 after closing this bug will uncomment and test fully
// masterDataCache.getMasterDataTitles();
// masterDataCache.getMasterDataTemplate(EnvUtil.getAuthEmailContentTemplate());
// masterDataCache.getMasterDataTemplate(EnvUtil.getAuthEmailSubjectTemplate());
// masterDataCache.getMasterDataTemplate(EnvUtil.getOtpSubjectTemplate());
// masterDataCache.getMasterDataTemplate(EnvUtil.getOtpContentTemplate());
// masterDataCache.getMasterDataTemplate(EnvUtil.getAuthSmsTemplate());
// masterDataCache.getMasterDataTemplate(EnvUtil.getOtpSmsTemplate());

masterDataCache.getMasterDataTitles();
masterDataCache.getMasterDataTemplate(EnvUtil.getAuthEmailContentTemplate());
masterDataCache.getMasterDataTemplate(EnvUtil.getAuthEmailSubjectTemplate());
masterDataCache.getMasterDataTemplate(EnvUtil.getOtpSubjectTemplate());
masterDataCache.getMasterDataTemplate(EnvUtil.getOtpContentTemplate());
masterDataCache.getMasterDataTemplate(EnvUtil.getAuthSmsTemplate());
masterDataCache.getMasterDataTemplate(EnvUtil.getOtpSmsTemplate());
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package io.mosip.authentication.internal.service.config;

import java.io.IOException;
package io.mosip.authentication.common.service.config;

import io.mosip.authentication.core.dto.ObjectWithMetadata;
import jakarta.servlet.Filter;
Expand All @@ -12,6 +10,8 @@
import jakarta.servlet.http.HttpServletRequestWrapper;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class TrailingSlashRedirectFilter implements Filter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public void sendSmsNotification(String notificationMobileNo, String message)
RestRequestDTO restRequestDTO = null;
restRequestDTO = restRequestFactory.buildRequest(RestServicesConstants.SMS_NOTIFICATION_SERVICE,
RestRequestFactory.createRequest(smsRequestDto), String.class);
restHelper.requestAsync(restRequestDTO);
} catch (IDDataValidationException e) {
restHelper.requestSync(restRequestDTO);
} catch (IDDataValidationException | RestServiceException e) {
logger.error(IdAuthCommonConstants.SESSION_ID, "Inside SMS Notification >>>>>", e.getErrorCode(), e.getErrorText());
throw new IdAuthenticationBusinessException(IdAuthenticationErrorConstants.DATA_VALIDATION_FAILED, e);
}
}
}

/**
* Send email notification.
Expand All @@ -82,11 +82,11 @@ public void sendEmailNotification(String emailId, String mailSubject, String mai
mailRequestDto.add("mailTo", emailId);
restRequestDTO = restRequestFactory.buildRequest(RestServicesConstants.MAIL_NOTIFICATION_SERVICE,
mailRequestDto, String.class);
restHelper.requestAsync(restRequestDTO);
} catch (IDDataValidationException e) {
restHelper.requestSync(restRequestDTO);
} catch (IDDataValidationException | RestServiceException e) {
// FIXME change error code
logger.error(IdAuthCommonConstants.SESSION_ID, "Inside Mail Notification >>>>>", e.getErrorCode(), e.getErrorText());
throw new IdAuthenticationBusinessException(IdAuthenticationErrorConstants.DATA_VALIDATION_FAILED, e);
}
}
}
}
10 changes: 1 addition & 9 deletions authentication/authentication-internal-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,7 @@ EXPOSE 9010

ENTRYPOINT [ "./configure_start.sh" ]

CMD if [ "$is_glowroot_env" = "present" ]; then \
wget -q "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \
unzip glowroot.zip ; \
rm -rf glowroot.zip ; \
sed -i "s/<service_name>/${current_module_env}/g" glowroot/glowroot.properties ; \
java -jar -javaagent:glowroot/glowroot.jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -XX:HeapDumpPath=/home/ ./authentication-internal-service.jar ; \
else \
java -jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED ./authentication-internal-service.jar ; \
fi
CMD wget -q "${iam_adapter_url_env}" -O "${loader_path_env}/kernel-auth-adapter.jar" && java -jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED ./authentication-internal-service.jar ; \

#Sample docker run command:
# sudo docker run --rm -it -e artifactory_url_env="http://artifactory" -e spring_config_label_env="1.0.9" -e active_profile_env="dev" -e spring_config_url_env="http://config-server/config" -e PKCS11_PROXY_SOCKET=tcp://softhsm-ida:5666 -p 8093:8093 authentication-internal-service:1.0.9
5 changes: 0 additions & 5 deletions authentication/authentication-internal-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,6 @@
<artifactId>biosdk-client</artifactId>
<version>${biosdk-client.version}</version>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel-auth-adapter.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.mosip.kernel.websub.api.client.SubscriberClientImpl;
import io.mosip.kernel.websub.api.config.WebSubClientConfig;
import io.mosip.kernel.websub.api.config.publisher.RestTemplateHelper;
import io.mosip.kernel.websub.api.config.publisher.WebSubPublisherClientConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down Expand Up @@ -94,7 +95,6 @@
import io.mosip.kernel.tokenidgenerator.generator.TokenIDGenerator;
import io.mosip.kernel.zkcryptoservice.service.impl.ZKCryptoManagerServiceImpl;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.client.RestTemplate;


/**
Expand Down Expand Up @@ -135,10 +135,10 @@
io.mosip.kernel.signature.dto.AuthorizedRolesDTO.class,
EnvUtil.class, KeyBindedTokenMatcherUtil.class, HSMHealthCheck.class, PrivateKeyDecryptorHelper.class,
PasswordAuthServiceImpl.class, PasswordComparator.class, PDFGeneratorImpl.class,
RestTemplateHelper.class, RestTemplate.class, LanguageUtil.class, TypeForIdNameHelper.class
RestTemplateHelper.class, LanguageUtil.class, TypeForIdNameHelper.class
, ValidateOtpHelper.class, RequireOtpNotFrozenHelper.class, MatchIdentityDataHelper.class, MatchTypeHelper.class
, SeparatorHelper.class, IdentityAttributesForMatchTypeHelper.class, WebSubClientConfig.class, SubscriberClientImpl.class
, ECKeyPairGenRequestValidator.class
, ECKeyPairGenRequestValidator.class, WebSubPublisherClientConfig.class
})
@ComponentScan(basePackages = { "io.mosip.authentication.internal.service.*",
"io.mosip.kernel.core.logger.config",
Expand Down
2 changes: 1 addition & 1 deletion authentication/authentication-otp-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ EXPOSE 9010

ENTRYPOINT [ "./configure_start.sh" ]

CMD java -jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED ./authentication-otp-service.jar ; \
CMD wget -q "${iam_adapter_url_env}" -O "${loader_path_env}/kernel-auth-adapter.jar" && java -jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED ./authentication-otp-service.jar

#Sample docker run command:
# sudo docker run --rm -it -e artifactory_url_env="http://artifactory" -e spring_config_label_env="1.0.9" -e active_profile_env="dev" -e spring_config_url_env="http://config-server/config" -e PKCS11_PROXY_SOCKET=tcp://softhsm-ida:5666 -p 8092:8092 authentication-otp-service:1.0.9
5 changes: 0 additions & 5 deletions authentication/authentication-otp-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel-auth-adapter.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.mosip.authentication.otp.service;

import io.mosip.authentication.common.service.config.*;
import io.mosip.kernel.keymanagerservice.validator.ECKeyPairGenRequestValidator;
import io.mosip.kernel.pdfgenerator.itext.impl.PDFGeneratorImpl;
import io.mosip.kernel.websub.api.client.PublisherClientImpl;
Expand All @@ -16,11 +17,6 @@
import io.mosip.authentication.common.service.builder.MatchInputBuilder;
import io.mosip.authentication.common.service.cache.MasterDataCache;
import io.mosip.authentication.common.service.cache.MasterDataCacheInitializer;
import io.mosip.authentication.common.service.config.IDAMappingConfig;
import io.mosip.authentication.common.service.config.KafkaProducerConfig;
import io.mosip.authentication.common.service.config.LangComparatorConfig;
import io.mosip.authentication.common.service.config.OpenApiProperties;
import io.mosip.authentication.common.service.config.SwaggerConfig;
import io.mosip.authentication.common.service.exception.IdAuthExceptionHandler;
import io.mosip.authentication.common.service.factory.AuditRequestFactory;
import io.mosip.authentication.common.service.factory.RestRequestFactory;
Expand Down Expand Up @@ -119,9 +115,8 @@
IdAuthWebSubInitializer.class, AuthAnonymousEventPublisher.class, EnvUtil.class, KeyBindedTokenMatcherUtil.class,
HSMHealthCheck.class, PrivateKeyDecryptorHelper.class,
PasswordAuthServiceImpl.class, PasswordComparator.class, AuthenticationErrorEventingPublisher.class, KafkaProducerConfig.class,
PasswordAuthServiceImpl.class, PasswordComparator.class, AuthenticationErrorEventingPublisher.class, KafkaProducerConfig.class
, PDFGeneratorImpl.class, PublisherClientImpl.class, RestTemplateHelper.class,
SubscriberClientImpl.class, RestTemplate.class, ECKeyPairGenRequestValidator.class})
PDFGeneratorImpl.class, PublisherClientImpl.class, RestTemplateHelper.class,
SubscriberClientImpl.class, RestTemplate.class, ECKeyPairGenRequestValidator.class, TrailingSlashRedirectFilter.class})
@ComponentScan(basePackages = { "io.mosip.authentication.otp.service.*",
"io.mosip.kernel.core.logger.config", "${mosip.auth.adapter.impl.basepackage}" }, excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
"io.mosip.idrepository.core.config.IdRepoDataSourceConfig.*" }))
Expand Down
2 changes: 1 addition & 1 deletion authentication/authentication-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ EXPOSE 9010

ENTRYPOINT [ "./configure_start.sh" ]

CMD java -jar -Djava.security.debug=sunpkcs11 -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dloader.path="${loader_path_env}" -Dfile.encoding="UTF-8" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED ${current_module_env}.jar ; \
CMD wget -q "${iam_adapter_url_env}" -O "${loader_path_env}/kernel-auth-adapter.jar" && java -jar -Djava.security.debug=sunpkcs11 -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dloader.path="${loader_path_env}" -Dfile.encoding="UTF-8" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED ${current_module_env}.jar ; \

#Sample docker run command:
# sudo docker run --rm -it -e artifactory_url_env="http://artifactory" -e spring_config_label_env="1.0.9" -e active_profile_env="dev" -e spring_config_url_env="http://config-server/config" -e PKCS11_PROXY_SOCKET=tcp://softhsm-ida:5666 -p 8090:8090 authentication-service:1.0.9
5 changes: 0 additions & 5 deletions authentication/authentication-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,6 @@
<artifactId>biosdk-client</artifactId>
<version>${biosdk-client.version}</version>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel-auth-adapter.version}</version>
</dependency>
<dependency>
<groupId>io.mosip.demosdk</groupId>
<artifactId>demosdk</artifactId>
Expand Down
Loading