Skip to content

Commit

Permalink
Merge branch '1.1.5.3' into new-1.1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
balaji-alluru authored Feb 9, 2023
2 parents ff4abd6 + 1de2dc7 commit 916c531
Show file tree
Hide file tree
Showing 37 changed files with 1,489 additions and 2,721 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
mvn -B -U package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
- name: Publish the maven package
run: |
cd admin && mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml
cd admin && mvn deploy -DaltDeploymentRepository=ossrh::default::${{ secrets.RELEASE_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GPG_TTY: $(tty)
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/release_changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release/pre-release Preparation.

on:
workflow_dispatch:
inputs:
message:
description: 'Triggered for release or pe-release'
required: false
default: 'Release Preparation'
releaseTags:
description: 'tag to update'
required: true
snapshotTags:
description: 'tag to be replaced'
required: true
base:
description: 'base branch for PR'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Mannualy changing the pom versions
run: find . -type f -name "*pom.xml" -print0 | xargs -0 sed -i "s/${{ github.event.inputs.snapshotTags }}/${{ github.event.inputs.releaseTags }}/g"

- name: Updating the Release URL in POM
run: |
cd .github/workflows
sed -i 's/OSSRH_SNAPSHOT_URL/RELEASE_URL/g' push_trigger.yml
- name: Updating libs-snapshot-local to libs-release local for artifactory URL's.
run: find . -type f -name "*Dockerfile" -print0 | xargs -0 sed -i "s/libs-snapshot-local/libs-release-local/g"

- name: removing -DskipTests
run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-DskipTests"//g"

# - name: removing --Dgpg.skip
# run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-Dgpg.skip"//g"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Updated Pom versions for release changes
title: Release changes
body: Automated PR for ${{ github.event.inputs.releaseTags }} release.
branch: release-branch
delete-branch: true
base: ${{ github.event.inputs.base }}
token: ${{ secrets.ACTION_PAT }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://travis-ci.org/mosip/admin-services.svg?branch=1.0.9)](https://travis-ci.org/mosip/admin-services)

# mosip-platform
This repository contains the source code of the Modular Open Source Identity Platform. To know more about MOSIP, its architecture, external integrations, releases, etc., please check the [Platform Documentation](https://github.com/mosip/mosip-docs/wiki)
This repository contains the source code of the Modular Open Source Identity Platform. To know more about MOSIP, its architecture, external integrations, releases, etc., please check the [Platform Documentation](https://github.com/mosip/mosip-docs/wiki).

### Introduction
MOSIP consists of the following modules -
Expand Down
4 changes: 2 additions & 2 deletions admin/admin-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>io.mosip.admin</groupId>
<artifactId>admin-parent</artifactId>
<version>1.1.5.3-SNAPSHOT</version>
<version>1.1.5.3</version>
</parent>
<artifactId>admin-service</artifactId>
<name>admin-service</name>
<version>1.1.5.3-SNAPSHOT</version>
<version>1.1.5.3</version>
<url>http://maven.apache.org</url>
<packaging>jar</packaging>
<properties>
Expand Down
4 changes: 2 additions & 2 deletions admin/kernel-masterdata-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<name>kernel-masterdata-service</name>
<description>Mosip commons project </description>
<url>https://github.com/mosip/commons</url>
<version>1.1.5.3-SNAPSHOT</version>
<version>1.1.5.3-P1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Expand Down Expand Up @@ -473,4 +473,4 @@
</developer>
</developers>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.TrustStrategy;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -28,6 +30,7 @@
import io.mosip.kernel.masterdata.utils.AuditUtil;
import io.mosip.kernel.masterdata.utils.DefaultSort;


/**
* Config class with beans for modelmapper and request logging
*
Expand All @@ -39,6 +42,12 @@
@Configuration
@EnableAspectJAutoProxy
public class CommonConfig {

@Value("${admin.masterdata.common.httpclient.connections.max.per.host:20}")
private int maxConnectionPerRoute;

@Value("${admin.masterdata.common.httpclient.connections.max:100}")
private int totalMaxConnection;

/**
* Produce Request Logging bean
Expand Down Expand Up @@ -93,17 +102,11 @@ public AuditUtil auditUtil() {
public RestTemplate restTemplateConfig()
throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException {

TrustStrategy acceptingTrustStrategy = (X509Certificate[] chain, String authType) -> true;

SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy)
.build();

SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext);

CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(csf).build();
HttpClientBuilder httpClientBuilder = HttpClients.custom()
.setMaxConnPerRoute(maxConnectionPerRoute)
.setMaxConnTotal(totalMaxConnection).disableCookieManagement();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();

requestFactory.setHttpClient(httpClient);
requestFactory.setHttpClient(httpClientBuilder.build());
return new RestTemplate(requestFactory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,10 @@ public LocationPutResponseDto updateLocationDetails(LocationDto locationDto) {
throw new RequestException(LocationErrorCode.INVALID_HIERARCY_LEVEL.getErrorCode(),
LocationErrorCode.INVALID_HIERARCY_LEVEL.getErrorMessage());
}
List<Location> list = locationRepository.findByNameAndLevelLangCodeNotCode(locationDto.getName(),
locationDto.getHierarchyLevel(), locationDto.getLangCode(), locationDto.getCode());
List<Location> list = (null==locationDto.getParentLocCode() || locationDto.getParentLocCode().isEmpty())? locationRepository.findByNameAndLevelLangCodeNotCode(locationDto.getName(),
locationDto.getHierarchyLevel(), locationDto.getLangCode(), locationDto.getCode()):locationRepository.findByNameParentlocCodeAndLevelLangCodeNotCode(locationDto.getName(),
locationDto.getHierarchyLevel(), locationDto.getLangCode(), locationDto.getCode(),locationDto.getParentLocCode());

if (list != null && !list.isEmpty()) {
auditUtil.auditRequest(
String.format(MasterDataConstant.FAILURE_CREATE, LocationDto.class.getSimpleName()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public void updateLocationAlreadyExistsUnderHeirarchyExceptionTest() throws Exce
String requestJson = mapper.writeValueAsString(request);
when(repo.findLocationHierarchyByCodeAndLanguageCode(Mockito.any(), Mockito.any()))
.thenReturn(Arrays.asList(location1));
when(repo.findByNameParentlocCodeAndLevelLangCodeNotCode(Mockito.any(),Mockito.any(),Mockito.any(), Mockito.any(),Mockito.any())).thenReturn(Arrays.asList(location1));
when(repo.findByNameAndLevelLangCodeNotCode(Mockito.any(),Mockito.any(),Mockito.any(), Mockito.any())).thenReturn(Arrays.asList(location1));
mockMvc.perform(put("/locations").contentType(MediaType.APPLICATION_JSON).content(requestJson))
.andExpect(status().isOk());
Expand Down
25 changes: 15 additions & 10 deletions admin/kernel-syncdata-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<name>kernel-syncdata-service</name>
<description>Mosip commons project </description>
<url>https://github.com/mosip/commons</url>
<version>1.1.5.3-SNAPSHOT</version>
<version>1.1.5.3</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Expand Down Expand Up @@ -71,7 +71,7 @@
<!-- json -->
<jackson.version>2.9.5</jackson.version>
<jackson.datatype.version>2.9.8</jackson.datatype.version>
<jackson.databind>2.9.6</jackson.databind>
<jackson.databind>2.11.0</jackson.databind>
<json.utility.version>20180130</json.utility.version>
<json.schema.validator.version>2.2.10</json.schema.validator.version>
<json.version>20180813</json.version>
Expand Down Expand Up @@ -224,7 +224,7 @@
<kernel.auth.adaptor.version>1.1.5.2</kernel.auth.adaptor.version>
<kernel.logger.version>1.1.5.2</kernel.logger.version>
<kernel.crypto.version>1.1.5.2</kernel.crypto.version>
<kernel.keymanager.version>1.1.5.2</kernel.keymanager.version>
<kernel.keymanager.version>1.1.5.5-SNAPSHOT</kernel.keymanager.version>
<kernel-websubclient-api.version>1.1.5.5-SNAPSHOT</kernel-websubclient-api.version>
</properties>
<dependencies>
Expand Down Expand Up @@ -294,6 +294,18 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</exclusion>
</exclusions>
<classifier>lib</classifier>
</dependency>
Expand All @@ -310,13 +322,6 @@
<version>${spring.boot.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.module/jackson-module-afterburner -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-afterburner</artifactId>
<version>2.13.0</version>
</dependency>

</dependencies>

<distributionManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.mosip.kernel.syncdata.config;

import javax.annotation.PostConstruct;
import javax.servlet.Filter;

import io.mosip.kernel.websub.api.filter.MultipleReadRequestBodyFilter;
Expand All @@ -12,6 +13,7 @@
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

import io.mosip.kernel.syncdata.httpfilter.CorsFilter;
import org.springframework.security.core.context.SecurityContextHolder;

import java.util.concurrent.Executor;

Expand Down Expand Up @@ -81,4 +83,9 @@ public FilterRegistrationBean<MultipleReadRequestBodyFilter> registerMultipleRea
requestBodyReader.setOrder(1);
return requestBodyReader;
}

@PostConstruct
public void enableAuthCtxOnSpawnedThreads() {
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
public enum SyncAuthErrorCode {

INVALID_REQUEST("KER-SYN-AUTH-001", "Invalid Request"),
INVALID_REQUEST_TIME("KER-SYN-AUTH-002", "Invalid Request Time");
INVALID_REQUEST_TIME("KER-SYN-AUTH-002", "Invalid Request Time"),
ERROR_GETTING_TOKEN("KER-SYN-AUTH-003","Error while getting token");

private final String errorCode;
private final String errorMessage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public ResponseWrapper<String> getTokenWithUserIdPwd(@RequestBody @Valid Request
@ApiOperation(value = "API to send otp")
@PostMapping(value = "/authenticate/sendotp")
public ResponseWrapper<AuthNResponse> sendOTP(@RequestBody @Valid RequestWrapper<String> requestWrapper) {
ResponseWrapper<AuthNResponse> responseWrapper = new ResponseWrapper<>();
responseWrapper.setResponse(syncAuthTokenService.sendOTP(requestWrapper.getRequest()));
return responseWrapper;
return syncAuthTokenService.sendOTP(requestWrapper.getRequest());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import io.mosip.kernel.clientcrypto.constant.ClientType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -30,4 +31,13 @@ public class RegistrationCenterMachineDto extends BaseDto {
@NotNull
private String publicKey;

@NotNull
private String machineSpecId;

@NotNull
private String machineTypeId;

@NotNull
private ClientType clientType;

}
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ List<Machine> findAllLatestCreatedUpdatedDeleted(String regCenterId, LocalDateTi
@Query("From Machine m WHERE lower(m.signKeyIndex) = lower(?1) and (m.isDeleted is null or m.isDeleted =false)")
List<Machine> findBySignKeyIndex(String signKeyIndex);

@Query(value = "select distinct mm.regcntr_id , mm.id, mm.public_key from master.machine_master mm where lower(mm.key_index) = lower(?1)", nativeQuery = true)
List<Object[]> getRegistrationCenterMachineWithKeyIndexWithoutStatusCheck(String keyIndex);
Machine findOneByKeyIndexIgnoreCase(String keyIndex);

@Query("From Machine m WHERE lower(m.name) = lower(?1) and (m.isDeleted is null or m.isDeleted =false)")
List<Machine> findByMachineName(String machineName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ List<RegistrationCenter> findLatestRegistrationCenterByMachineId(String machinei
@Cacheable(cacheNames = "delta-sync", key = "'registration_center'")
@Query(value = "select new io.mosip.kernel.syncdata.dto.EntityDtimes(max(aam.createdDateTime), max(aam.updatedDateTime), max(aam.deletedDateTime)) from RegistrationCenter aam ")
EntityDtimes getMaxCreatedDateTimeMaxUpdatedDateTime();

@Query(value = "FROM RegistrationCenter WHERE id = ?1 AND ((createdDateTime BETWEEN ?2 AND ?3) OR (updatedDateTime BETWEEN ?2 AND ?3) OR (deletedDateTime BETWEEN ?2 AND ?3))")
List<RegistrationCenter> findRegistrationCentersById(String regCenterId, LocalDateTime lastUpdated, LocalDateTime currentTimeStamp);

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import io.mosip.kernel.syncdata.dto.SyncUserDetailDto;
import io.mosip.kernel.syncdata.dto.SyncUserDto;
import io.mosip.kernel.syncdata.dto.SyncUserSaltDto;
import io.mosip.kernel.syncdata.dto.response.UserDetailResponseDto;

import java.util.List;

/**
* This service class handles CRUD opertaion method signature
Expand Down Expand Up @@ -37,4 +40,6 @@ public interface SyncUserDetailsService {
* @return
*/
SyncUserDto getAllUserDetailsBasedOnKeyIndex(String keyIndex);

UserDetailResponseDto getUserDetailsFromAuthServer(List<String> userIds);
}

This file was deleted.

Loading

0 comments on commit 916c531

Please sign in to comment.