Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohandey committed Oct 29, 2024
2 parents 7ac5d5d + 9058ee6 commit cb1e353
Show file tree
Hide file tree
Showing 39 changed files with 767 additions and 413 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,27 @@ The project requires JDK 1.21.
## Configuration
Refer to the [configuration guide](docs/configuration.md).

## Deploy
To deploy PMS on Kubernetes cluster using Dockers refer to [Sandbox Deployment](https://docs.mosip.io/1.2.0/deployment/sandbox-deployment).
## Deployment in K8 cluster with other MOSIP services:
### Pre-requisites
* Set KUBECONFIG variable to point to existing K8 cluster kubeconfig file:
```
export KUBECONFIG=~/.kube/<k8s-cluster.config>
```
### Install
```
$ cd deploy
$ ./install.sh
```
### Delete
```
$ cd deploy
$ ./delete.sh
```
### Restart
```
$ cd deploy
$ ./restart.sh
```

## Test
Automated functional tests available in [Functional Tests repo](https://github.com/mosip/mosip-functional-tests).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<generateGitPropertiesFilename>git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
Expand Down
29 changes: 29 additions & 0 deletions authentication/authentication-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,33 @@
<artifactId>spring-batch-infrastructure</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<!-- <format>json</format> -->
</configuration>
</plugin>
</plugins>
</build>
</project>
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);
}
}
}
}
29 changes: 29 additions & 0 deletions authentication/authentication-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,33 @@
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<!-- <format>json</format> -->
</configuration>
</plugin>
</plugins>
</build>
</project>
3 changes: 1 addition & 2 deletions authentication/authentication-filter-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<generateGitPropertiesFilename>git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
Expand Down Expand Up @@ -443,5 +443,4 @@
<organizationUrl>https://github.com/mosip/commons</organizationUrl>
</developer>
</developers>

</project>
3 changes: 1 addition & 2 deletions authentication/authentication-hotlistfilter-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<generateGitPropertiesFilename>git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
Expand Down Expand Up @@ -523,5 +523,4 @@
<organizationUrl>https://github.com/mosip/commons</organizationUrl>
</developer>
</developers>

</project>
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
30 changes: 25 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 Expand Up @@ -279,6 +274,31 @@
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/service-git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<!-- <format>json</format> -->
</configuration>
</plugin>
</plugins>
</build>
<profiles>
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
Loading

0 comments on commit cb1e353

Please sign in to comment.