From 830971d250087469be146a867ff3b6df7c693689 Mon Sep 17 00:00:00 2001 From: Monobikash Das <43202165+MonobikashDas@users.noreply.github.com> Date: Mon, 14 Feb 2022 19:48:29 +0530 Subject: [PATCH] merged release -1.2.0 (#68) * Created 1.2.0-rc2 (#23) Co-authored-by: Monobikash Das * MOSIP-15420: Upgraded swagger2.0 to openapi3.0 for packet manager service (#31) Resolved merge conflict * Added logger and fixed test cases (#32) Co-authored-by: Monobikash Das * MOSIP-15420: Generated openapi.json for packet manager service (#34) * MOSIP-15420: Upgraded swagger2.0 to openapi3.0 for packet manager service Resolved merge conflict * MOSIP-15420: Generated openapi.json for packet manager service Resolved merge conflicts * MOSIP-18453 : improved usage of caching (#36) Co-authored-by: Monobikash Das * Added sonar_analysis * MOSIP-18450 : added exception for objects not available in minio (#37) * MOSIP-18450 : added exception for objects not available in minio * Added sonar_analysis * MOSIP-18910 : fixed refNumber issue in DocumentDto * MOSIP-18450 : added exception for objects not available in minio * MOSIP-18910 : fixed refNumber issue in DocumentDto * initial change * MOSIP-18450 : added exception for objects not available in minio * MOSIP-18910 : fixed refNumber issue in DocumentDto * initial change * MOSIP-18793 :Added afterburner + fixes Co-authored-by: Monobikash Das Co-authored-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Co-authored-by: Mandeep Dhiman <46880392+mandeepdhiman123@users.noreply.github.com> Co-authored-by: Admin * Mosip:15286 Changed openapi.json name. * updated the Sonar_analysis code and removed the Dskiptests * updated the Sonar_analysis code and removed the Dskiptests * added gpg keys * changes for real bio * Merged with 1.2.0-rc2 * changes for real bio * Auth role issue fixed (#46) * MOR-147 : multithreading issue for create packet api (#52) Co-authored-by: Admin * Added documentation * Update README.md * Update README.md * [MOSIP-19587] Cleanup. * Update configuration.md * Update configuration.md * Update configuration.md * Updated readme and sonar fix * Update README.md * [MOSIP-19883] updated worflows * [MOSIP-19883] updated worflows * Update push_trigger.yml * Updated Pom versions for release changes Co-authored-by: Monobikash Das Co-authored-by: kameshsr <47484458+kameshsr@users.noreply.github.com> Co-authored-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Co-authored-by: Mandeep Dhiman <46880392+mandeepdhiman123@users.noreply.github.com> Co-authored-by: Admin Co-authored-by: Rakshith650 Co-authored-by: Sasikumar Ganesan Co-authored-by: Puneet Joshi <48353425+pjoshi751@users.noreply.github.com> Co-authored-by: Puneet Joshi Co-authored-by: ckm007 Co-authored-by: ckm007 Signed-off-by: Sowmya Ujjappa Banakar --- .github/workflows/release_changes.yml | 56 +++++++++++++++++++ .../impl/OnlinePacketCryptoServiceImpl.java | 19 ++----- 2 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/release_changes.yml diff --git a/.github/workflows/release_changes.yml b/.github/workflows/release_changes.yml new file mode 100644 index 0000000000..cc9c2956d9 --- /dev/null +++ b/.github/workflows/release_changes.yml @@ -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: + token: ${{ secrets.ACTION_PAT }} + 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 }} diff --git a/commons-packet/commons-packet-manager/src/main/java/io/mosip/commons/packet/impl/OnlinePacketCryptoServiceImpl.java b/commons-packet/commons-packet-manager/src/main/java/io/mosip/commons/packet/impl/OnlinePacketCryptoServiceImpl.java index cbe3e3f733..71430b2048 100644 --- a/commons-packet/commons-packet-manager/src/main/java/io/mosip/commons/packet/impl/OnlinePacketCryptoServiceImpl.java +++ b/commons-packet/commons-packet-manager/src/main/java/io/mosip/commons/packet/impl/OnlinePacketCryptoServiceImpl.java @@ -21,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationContext; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; @@ -98,7 +97,7 @@ public byte[] sign(byte[] packet) { .parse(DateUtils.getUTCCurrentDateTimeString(DATETIME_PATTERN), format); request.setRequesttime(localdatetime); HttpEntity> httpEntity = new HttpEntity<>(request); - ResponseEntity response = getRestTemplate().exchange(keymanagerCsSignUrl, HttpMethod.POST, httpEntity, + ResponseEntity response = restTemplate.exchange(keymanagerCsSignUrl, HttpMethod.POST, httpEntity, String.class); LinkedHashMap responseMap = (LinkedHashMap) mapper.readValue(response.getBody(), LinkedHashMap.class).get("response"); if (responseMap != null && responseMap.size() > 0) @@ -144,7 +143,7 @@ public byte[] encrypt(String refId, byte[] packet) { request.setVersion(APPLICATION_VERSION); HttpEntity> httpEntity = new HttpEntity<>(request); - ResponseEntity response = getRestTemplate().exchange(cryptomanagerEncryptUrl, HttpMethod.POST, httpEntity, String.class); + ResponseEntity response = restTemplate.exchange(cryptomanagerEncryptUrl, HttpMethod.POST, httpEntity, String.class); CryptomanagerResponseDto responseObject = mapper.readValue(response.getBody(), CryptomanagerResponseDto.class); if (responseObject != null && responseObject.getErrors() != null && !responseObject.getErrors().isEmpty()) { @@ -214,7 +213,7 @@ public byte[] decrypt(String refId, byte[] packet) { request.setVersion(APPLICATION_VERSION); HttpEntity> httpEntity = new HttpEntity<>(request); - ResponseEntity response = getRestTemplate().exchange(cryptomanagerDecryptUrl, HttpMethod.POST, httpEntity, String.class); + ResponseEntity response = restTemplate.exchange(cryptomanagerDecryptUrl, HttpMethod.POST, httpEntity, String.class); CryptomanagerResponseDto responseObject = mapper.readValue(response.getBody(), CryptomanagerResponseDto.class); @@ -271,7 +270,7 @@ public boolean verify(String refId, byte[] packet, byte[] signature) { .parse(DateUtils.getUTCCurrentDateTimeString(DATETIME_PATTERN), format); request.setRequesttime(localdatetime); HttpEntity> httpEntity = new HttpEntity<>(request); - ResponseEntity response = getRestTemplate().exchange(keymanagerCsverifysignUrl, HttpMethod.POST, httpEntity, + ResponseEntity response = restTemplate.exchange(keymanagerCsverifysignUrl, HttpMethod.POST, httpEntity, String.class); LinkedHashMap responseMap = (LinkedHashMap) mapper.readValue(response.getBody(), LinkedHashMap.class).get("response");//.get("signature"); if (responseMap != null && responseMap.size() > 0) { @@ -298,7 +297,7 @@ public boolean verify(String refId, byte[] packet, byte[] signature) { private String getPublicKey(String refId) throws IOException { String machineId = refId.split("_")[1]; - ResponseEntity response = getRestTemplate().exchange(syncdataGetTpmKeyUrl+machineId, HttpMethod.GET, null, + ResponseEntity response = restTemplate.exchange(syncdataGetTpmKeyUrl+machineId, HttpMethod.GET, null, String.class); LinkedHashMap responseMap = (LinkedHashMap) mapper.readValue(response.getBody(), LinkedHashMap.class).get("response");//.get("signature"); if (responseMap != null && responseMap.size() > 0) @@ -309,12 +308,4 @@ private String getPublicKey(String refId) throws IOException { throw new SignatureException(); } } - - private RestTemplate getRestTemplate() { - if (this.restTemplate == null) { - this.restTemplate = (RestTemplate)this.applicationContext.getBean("selfTokenRestTemplate"); - } - - return this.restTemplate; - } }