From 9f485ad7f00ffbeb9ee70c3a8f05113496a313a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:36:08 +0000 Subject: [PATCH 01/20] Bump spring-boot.version from 3.1.6 to 3.2.1 Bumps `spring-boot.version` from 3.1.6 to 3.2.1. Updates `org.springframework.boot:spring-boot-dependencies` from 3.1.6 to 3.2.1 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.1.6...v3.2.1) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.1.6 to 3.2.1 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.1.6...v3.2.1) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-dependencies dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e1c3aed9..1ebc9941 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.6.3 3.4.1 3.2.3 - 3.1.6 + 3.2.1 1.77 1.6.0 2.15.1 From 0a639dbc583f3e75060669d1316c2846cd0cd6b7 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Tue, 2 Jan 2024 12:50:50 +0100 Subject: [PATCH 02/20] Revert "Fix #388: Update logback" This reverts commit 68c6bab178e120ad0650d26f4797636cdad0d281. --- pom.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/pom.xml b/pom.xml index 1ebc9941..c225ffd6 100644 --- a/pom.xml +++ b/pom.xml @@ -87,8 +87,6 @@ 1.6.0 2.15.1 1.1.1 - - 1.4.14 1.6.0-SNAPSHOT @@ -106,18 +104,6 @@ import - - - ch.qos.logback - logback-classic - ${logback.version} - - - ch.qos.logback - logback-core - ${logback.version} - - io.getlime.security powerauth-java-cmd-lib From 656489b10f5a90d93741a2d52b3ef60c3fa488c5 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Mon, 8 Jan 2024 09:39:15 +0100 Subject: [PATCH 03/20] Fix #404: Set develop version to 1.7.0-SNAPSHOT --- pom.xml | 2 +- powerauth-java-cmd-lib/pom.xml | 2 +- powerauth-java-cmd/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f7825c57..792f6090 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ io.getlime.security powerauth-cmd-parent - 1.6.0 + 1.7.0-SNAPSHOT pom 2016 diff --git a/powerauth-java-cmd-lib/pom.xml b/powerauth-java-cmd-lib/pom.xml index 531b45c4..b74741a4 100644 --- a/powerauth-java-cmd-lib/pom.xml +++ b/powerauth-java-cmd-lib/pom.xml @@ -10,7 +10,7 @@ powerauth-cmd-parent io.getlime.security - 1.6.0 + 1.7.0-SNAPSHOT diff --git a/powerauth-java-cmd/pom.xml b/powerauth-java-cmd/pom.xml index 9003cbe6..d9a02ede 100644 --- a/powerauth-java-cmd/pom.xml +++ b/powerauth-java-cmd/pom.xml @@ -30,7 +30,7 @@ io.getlime.security powerauth-cmd-parent - 1.6.0 + 1.7.0-SNAPSHOT From b031c7d049224b6ae82535f4d35523d79f47392a Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Mon, 8 Jan 2024 09:40:54 +0100 Subject: [PATCH 04/20] Fix #405: Update Wultra dependencies to SNAPSHOT --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f7825c57..47ef4f1a 100644 --- a/pom.xml +++ b/pom.xml @@ -91,9 +91,9 @@ 1.4.14 - 1.6.0 - 1.6.0 - 1.8.0 + 1.7.0-SNAPSHOT + 1.7.0-SNAPSHOT + 1.9.0-SNAPSHOT From ebca262c76e61c50c6c3e77a7018ff47addb7425 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 4 Jan 2024 08:44:55 +0100 Subject: [PATCH 05/20] Fix #401: Remove Guava dependency --- pom.xml | 19 ++++++------------- .../lib/cmd/consts/PowerAuthVersion.java | 7 +++---- .../lib/cmd/steps/AbstractBaseStep.java | 9 ++------- .../lib/cmd/steps/v3/CreateTokenStep.java | 8 ++------ .../lib/cmd/steps/v3/StartUpgradeStep.java | 3 +-- 5 files changed, 14 insertions(+), 32 deletions(-) diff --git a/pom.xml b/pom.xml index d8a860be..fc727494 100644 --- a/pom.xml +++ b/pom.xml @@ -177,26 +177,19 @@ org.apache.maven.plugins maven-enforcer-plugin ${maven-enforcer-plugin.version} - - - de.skuzzle.enforcer - restrict-imports-enforcer-rule - 2.4.0 - - - enforce-banned-java-imports + enforce-banned-dependencies enforce - - - Guava depends on jsr305 but we prefer jakarta in our code - javax.annotation.** - + + + com.google.guava:guava*:*:*:compile + + diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/consts/PowerAuthVersion.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/consts/PowerAuthVersion.java index fbada7ca..6f8997fb 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/consts/PowerAuthVersion.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/consts/PowerAuthVersion.java @@ -16,9 +16,8 @@ */ package io.getlime.security.powerauth.lib.cmd.consts; -import com.google.common.collect.ImmutableList; - import java.util.Arrays; +import java.util.List; /** * PowerAuth protocol version enumeration @@ -45,7 +44,7 @@ public enum PowerAuthVersion { /** * All supported versions */ - public static final ImmutableList ALL_VERSIONS = ImmutableList.copyOf(values()); + public static final List ALL_VERSIONS = List.of(values()); /** * Default version @@ -55,7 +54,7 @@ public enum PowerAuthVersion { /** * All versions belonging to major version 3 */ - public static final ImmutableList VERSION_3 = ImmutableList.of(V3_0, V3_1, V3_2); + public static final List VERSION_3 = List.of(V3_0, V3_1, V3_2); /** * Major version value diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java index ec2fc039..f5fb4fe0 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java @@ -17,7 +17,6 @@ package io.getlime.security.powerauth.lib.cmd.steps; -import com.google.common.collect.ImmutableList; import com.wultra.core.rest.client.base.RestClient; import com.wultra.core.rest.client.base.RestClientException; import io.getlime.security.powerauth.crypto.lib.encryptor.ClientEncryptor; @@ -27,8 +26,6 @@ import io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptorId; import io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptorParameters; import io.getlime.security.powerauth.crypto.lib.encryptor.model.v3.ClientEncryptorSecrets; -import io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator; -import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor; import io.getlime.security.powerauth.lib.cmd.consts.PowerAuthStep; import io.getlime.security.powerauth.lib.cmd.consts.PowerAuthVersion; import io.getlime.security.powerauth.lib.cmd.logging.DisabledStepLogger; @@ -80,7 +77,7 @@ public abstract class AbstractBaseStep implements Bas * Supported versions of PowerAuth by this step */ @Getter - private final ImmutableList supportedVersions; + private final List supportedVersions; /** * Result status service @@ -93,8 +90,6 @@ public abstract class AbstractBaseStep implements Bas protected final StepLoggerFactory stepLoggerFactory; private static final EncryptorFactory ENCRYPTOR_FACTORY = new EncryptorFactory(); - private static final KeyGenerator KEY_GENERATOR = new KeyGenerator(); - private static final KeyConvertor KEY_CONVERTOR = new KeyConvertor(); /** * Constructor @@ -109,7 +104,7 @@ public AbstractBaseStep(PowerAuthStep step, ResultStatusService resultStatusService, StepLoggerFactory stepLoggerFactory) { this.step = step; - this.supportedVersions = ImmutableList.copyOf(supportedVersions); + this.supportedVersions = List.copyOf(supportedVersions); this.resultStatusService = resultStatusService; this.stepLoggerFactory = stepLoggerFactory; diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/CreateTokenStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/CreateTokenStep.java index 64409baa..662a670a 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/CreateTokenStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/CreateTokenStep.java @@ -16,7 +16,6 @@ */ package io.getlime.security.powerauth.lib.cmd.steps.v3; -import com.google.common.collect.ImmutableMap; import io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptorId; import io.getlime.security.powerauth.lib.cmd.consts.BackwardCompatibilityConst; import io.getlime.security.powerauth.lib.cmd.consts.PowerAuthConst; @@ -119,11 +118,8 @@ public void processResponse(StepContextbuilder() - .put("tokenId", tokenResponsePayload.getTokenId()) - .put("tokenSecret", tokenResponsePayload.getTokenSecret()) - .build() - + Map.of("tokenId", tokenResponsePayload.getTokenId(), + "tokenSecret",tokenResponsePayload.getTokenSecret()) ); } diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/StartUpgradeStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/StartUpgradeStep.java index 43840f1e..c6313051 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/StartUpgradeStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/StartUpgradeStep.java @@ -15,7 +15,6 @@ */ package io.getlime.security.powerauth.lib.cmd.steps.v3; -import com.google.common.collect.ImmutableMap; import io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptorId; import io.getlime.security.powerauth.lib.cmd.consts.BackwardCompatibilityConst; import io.getlime.security.powerauth.lib.cmd.consts.PowerAuthConst; @@ -119,7 +118,7 @@ public void processResponse(StepContext Date: Mon, 15 Jan 2024 17:09:26 +0000 Subject: [PATCH 06/20] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.3 to 3.2.5 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.3 to 3.2.5. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.3...surefire-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fc727494..da4550de 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 3.1.1 3.6.3 3.4.1 - 3.2.3 + 3.2.5 3.2.1 1.77 1.6.0 From 29d6ec3ffd2e795a46891190e8e71e5efe94ccd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:27:46 +0000 Subject: [PATCH 07/20] Bump spring-boot.version from 3.2.1 to 3.2.2 Bumps `spring-boot.version` from 3.2.1 to 3.2.2. Updates `org.springframework.boot:spring-boot-dependencies` from 3.2.1 to 3.2.2 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.2.1...v3.2.2) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.2.1 to 3.2.2 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.2.1...v3.2.2) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-dependencies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da4550de..b44a0a5a 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.6.3 3.4.1 3.2.5 - 3.2.1 + 3.2.2 1.77 1.6.0 2.15.1 From 6ddd3de669880bf54d036a7ca915a20598082812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dvo=C5=99=C3=A1k?= Date: Mon, 29 Jan 2024 23:49:29 +0100 Subject: [PATCH 08/20] Fix #411: Logging of steps create invalid JSON --- .../lib/cmd/service/StepExecutionService.java | 4 +-- .../lib/cmd/steps/AbstractBaseStep.java | 30 +++++-------------- .../powerauth/lib/cmd/steps/BaseStep.java | 4 ++- .../cmd/steps/pojo/ResultStatusObject.java | 15 ++++++++-- .../powerauth/lib/cmd/util/FileUtil.java | 2 +- .../powerauth/app/cmd/Application.java | 7 +---- 6 files changed, 26 insertions(+), 36 deletions(-) diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/service/StepExecutionService.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/service/StepExecutionService.java index 58fd7b5d..bee7f16e 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/service/StepExecutionService.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/service/StepExecutionService.java @@ -80,9 +80,9 @@ public ResultStatusObject execute(PowerAuthStep stepId, PowerAuthVersion version throw new PowerAuthCmdException(); } - BaseStep step = stepProvider.getStep(stepId, version); + final BaseStep step = stepProvider.getStep(stepId, version); - ResultStatusObject result = step.execute(model.toMap()); + final ResultStatusObject result = step.execute(stepLogger, model.toMap()); if (result == null) { throw new PowerAuthCmdException(); } diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java index f5fb4fe0..030a883a 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java @@ -125,26 +125,6 @@ public AbstractBaseStep(PowerAuthStep step, */ protected abstract ParameterizedTypeReference getResponseTypeReference(); - /** - * Executes this step with a given context - * - * @param context Provided context - * @return Result status object, null in case of failure. - * @throws Exception In case of any error. - */ - @Override - public ResultStatusObject execute(Map context) throws Exception { - StepLogger stepLogger = stepLoggerFactory.createStepLogger(); - stepLogger.start(); - JSONObject jsonObject = execute(stepLogger, context); - stepLogger.close(); - if (jsonObject == null) { - return null; - } else { - return ResultStatusObject.fromJsonObject(jsonObject); - } - } - /** * Execute this step with given logger and context objects. * @@ -155,7 +135,7 @@ public ResultStatusObject execute(Map context) throws Exception * @return Result status object (with current activation status), null in case of failure. * @throws Exception In case of a failure. */ - public final JSONObject execute(StepLogger stepLogger, Map context) throws Exception { + public final ResultStatusObject execute(StepLogger stepLogger, Map context) throws Exception { if (stepLogger == null) { stepLogger = DisabledStepLogger.INSTANCE; } @@ -187,7 +167,12 @@ public final JSONObject execute(StepLogger stepLogger, Map conte return null; } - return stepContext.getModel().getResultStatusObject(); + final JSONObject resultStatusObject = stepContext.getModel().getResultStatusObject(); + if (resultStatusObject == null) { + return null; + } else { + return ResultStatusObject.fromJsonObject(resultStatusObject); + } } /** @@ -231,7 +216,6 @@ public void addEncryptedRequest(StepContext stepContext, String applicatio * @throws Exception when an error during encryption of the request data occurred */ public void addEncryptedRequest(StepContext stepContext, ClientEncryptor encryptor, byte[] data) throws Exception { - M model = stepContext.getModel(); SimpleSecurityContext securityContext = (SimpleSecurityContext) stepContext.getSecurityContext(); if (securityContext == null) { stepContext.setSecurityContext( diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/BaseStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/BaseStep.java index c8fab8f1..fede5e1d 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/BaseStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/BaseStep.java @@ -18,6 +18,7 @@ import io.getlime.security.powerauth.lib.cmd.consts.PowerAuthStep; import io.getlime.security.powerauth.lib.cmd.consts.PowerAuthVersion; +import io.getlime.security.powerauth.lib.cmd.logging.StepLogger; import io.getlime.security.powerauth.lib.cmd.steps.pojo.ResultStatusObject; import java.util.List; @@ -34,11 +35,12 @@ public interface BaseStep { /** * Execute this step with given context objects. * + * @param stepLogger Step logger. * @param context Context objects. * @return Result status object (with current activation status), null in case of failure. * @throws Exception In case of a failure. */ - ResultStatusObject execute(Map context) throws Exception; + ResultStatusObject execute(StepLogger stepLogger, Map context) throws Exception; /** * @return Corresponding PowerAuth step diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/pojo/ResultStatusObject.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/pojo/ResultStatusObject.java index d01827e7..9b11ea3d 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/pojo/ResultStatusObject.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/pojo/ResultStatusObject.java @@ -188,7 +188,10 @@ public void setServerPublicKey(String serverPublicKey) { */ @JsonIgnore public SecretKey getSignatureBiometryKeyObject() { - String signatureBiometryKey = (String) jsonObject.get("signatureBiometryKey"); + final String signatureBiometryKey = (String) jsonObject.get("signatureBiometryKey"); + if (signatureBiometryKey == null) { + return null; + } return KEY_CONVERTOR.convertBytesToSharedSecretKey(Base64.getDecoder().decode(signatureBiometryKey)); } @@ -290,7 +293,10 @@ public void setSignatureKnowledgeKeySalt(String signatureKnowledgeKeySalt) { */ @JsonIgnore public SecretKey getSignaturePossessionKeyObject() { - String signaturePossessionKey = (String) jsonObject.get("signaturePossessionKey"); + final String signaturePossessionKey = (String) jsonObject.get("signaturePossessionKey"); + if (signaturePossessionKey == null) { + return null; + } return KEY_CONVERTOR.convertBytesToSharedSecretKey(Base64.getDecoder().decode(signaturePossessionKey)); } @@ -324,7 +330,10 @@ public void setSignaturePossessionKey(String signaturePossessionKey) { */ @JsonIgnore public SecretKey getTransportMasterKeyObject() { - String transportMasterKey = (String) jsonObject.get("transportMasterKey"); + final String transportMasterKey = (String) jsonObject.get("transportMasterKey"); + if (transportMasterKey == null) { + return null; + } return KEY_CONVERTOR.convertBytesToSharedSecretKey(Base64.getDecoder().decode(transportMasterKey)); } diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/util/FileUtil.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/util/FileUtil.java index 4c332134..8b5339f6 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/util/FileUtil.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/util/FileUtil.java @@ -54,7 +54,7 @@ public static byte[] readFileBytes(StepLogger stepLogger, "Empty " + fileDescription + " file", "File not provided, assuming empty data.", "WARNING", - filePath + null ); return new byte[0]; } diff --git a/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java b/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java index 089a160e..aa68455b 100755 --- a/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java +++ b/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java @@ -289,12 +289,7 @@ public static void main(String[] args) { stepExecutionService.execute(powerAuthStep, version, model); } - case ACTIVATION_CREATE, ACTIVATION_PREPARE -> { - if (powerAuthStep.equals(PowerAuthStep.ACTIVATION_PREPARE)) { - System.err.println("The 'prepare' step name is deprecated, use the 'create' step name instead"); - powerAuthStep = PowerAuthStep.ACTIVATION_CREATE; - } - + case ACTIVATION_CREATE -> { String customAttributesFileName = cmd.getOptionValue("C"); Map customAttributes = FileUtil.readDataFromFile(stepLogger, customAttributesFileName, HashMap.class, "custom-attributes", "custom attributes"); From 7d0f88879ed34edd294bec4f9bfbd0d0b3f47959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dvo=C5=99=C3=A1k?= Date: Tue, 30 Jan 2024 00:21:57 +0100 Subject: [PATCH 09/20] Fix #413: Make custom attributes file optional during activation create step --- .../powerauth/app/cmd/Application.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java b/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java index aa68455b..fc15dcfa 100755 --- a/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java +++ b/powerauth-java-cmd/src/main/java/io/getlime/security/powerauth/app/cmd/Application.java @@ -290,9 +290,7 @@ public static void main(String[] args) { stepExecutionService.execute(powerAuthStep, version, model); } case ACTIVATION_CREATE -> { - String customAttributesFileName = cmd.getOptionValue("C"); - Map customAttributes = - FileUtil.readDataFromFile(stepLogger, customAttributesFileName, HashMap.class, "custom-attributes", "custom attributes"); + final Map customAttributes = getCustomAttributes(cmd, stepLogger); PrepareActivationStepModel model = new PrepareActivationStepModel(); model.setActivationCode(cmd.getOptionValue("a")); @@ -382,9 +380,7 @@ public static void main(String[] args) { Map identityAttributes = FileUtil.readDataFromFile(stepLogger, identityAttributesFileName, HashMap.class, "identity-attributes", "identity attributes"); - String customAttributesFileName = cmd.getOptionValue("C"); - Map customAttributes = - FileUtil.readDataFromFile(stepLogger, customAttributesFileName, HashMap.class, "custom-attributes", "custom attributes"); + final Map customAttributes = getCustomAttributes(cmd, stepLogger); CreateActivationStepModel model = new CreateActivationStepModel(); model.setActivationName(ConfigurationUtil.getApplicationName(clientConfigObject)); @@ -494,9 +490,7 @@ public static void main(String[] args) { Map identityAttributes = FileUtil.readDataFromFile(stepLogger, identityAttributesFileName, HashMap.class, "identity-attributes", "identity attributes"); - String customAttributesFileName = cmd.getOptionValue("C"); - Map customAttributes = - FileUtil.readDataFromFile(stepLogger, customAttributesFileName, HashMap.class, "custom-attributes", "custom attributes"); + final Map customAttributes = getCustomAttributes(cmd, stepLogger); ActivationRecoveryStepModel model = new ActivationRecoveryStepModel(); model.setActivationName(ConfigurationUtil.getApplicationName(clientConfigObject)); @@ -564,6 +558,18 @@ public static void main(String[] args) { } + @SuppressWarnings("unchecked") + private static Map getCustomAttributes(CommandLine cmd, StepLogger stepLogger) throws Exception { + final String customAttributesFileName = cmd.getOptionValue("C"); + final Map customAttributes; + if (customAttributesFileName != null) { + customAttributes = FileUtil.readDataFromFile(stepLogger, customAttributesFileName, HashMap.class, "custom-attributes", "custom attributes"); + } else { + customAttributes = Collections.emptyMap(); + } + return customAttributes; + } + private static void printPowerAuthStepsHelp(StepProvider stepProvider) { System.out.println("Available PowerAuth steps and supported versions.\n"); System.out.printf("%-22s%s%n", "PowerAuth step", "Supported versions"); From 0bf8c1c9710f52ed4eb88a5f3bce8629ca0157a6 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 8 Feb 2024 07:23:23 +0100 Subject: [PATCH 10/20] Fix #415: Reflect changes of ConfirmRecoveryResponsePayload --- .../powerauth/lib/cmd/steps/v3/ConfirmRecoveryCodeStep.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/ConfirmRecoveryCodeStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/ConfirmRecoveryCodeStep.java index ddd59f24..264f67c0 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/ConfirmRecoveryCodeStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/ConfirmRecoveryCodeStep.java @@ -123,7 +123,7 @@ public StepContext prepare public void processResponse(StepContext stepContext) throws Exception { final ConfirmRecoveryResponsePayload confirmResponsePayload = decryptResponse(stepContext, ConfirmRecoveryResponsePayload.class); Map objectMap = new HashMap<>(); - objectMap.put("alreadyConfirmed", confirmResponsePayload.getAlreadyConfirmed()); + objectMap.put("alreadyConfirmed", confirmResponsePayload.isAlreadyConfirmed()); stepContext.getStepLogger().writeItem( getStep().id() + "-confirmation-done", From 2bbad2704a266601f6362b3b60565bc16fc93ef4 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 22 Feb 2024 13:31:04 +0100 Subject: [PATCH 11/20] Fix #418: Set release version to 1.7.0 --- pom.xml | 2 +- powerauth-java-cmd-lib/pom.xml | 2 +- powerauth-java-cmd/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b44a0a5a..b33e94b8 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ io.getlime.security powerauth-cmd-parent - 1.7.0-SNAPSHOT + 1.7.0 pom 2016 diff --git a/powerauth-java-cmd-lib/pom.xml b/powerauth-java-cmd-lib/pom.xml index b74741a4..cdcd98a5 100644 --- a/powerauth-java-cmd-lib/pom.xml +++ b/powerauth-java-cmd-lib/pom.xml @@ -10,7 +10,7 @@ powerauth-cmd-parent io.getlime.security - 1.7.0-SNAPSHOT + 1.7.0 diff --git a/powerauth-java-cmd/pom.xml b/powerauth-java-cmd/pom.xml index d9a02ede..62573e51 100644 --- a/powerauth-java-cmd/pom.xml +++ b/powerauth-java-cmd/pom.xml @@ -30,7 +30,7 @@ io.getlime.security powerauth-cmd-parent - 1.7.0-SNAPSHOT + 1.7.0 From 071a6b9e1d4116b32835de8a907c382e18ffa8c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 06:00:23 +0000 Subject: [PATCH 12/20] Bump spring-boot.version from 3.2.2 to 3.2.3 Bumps `spring-boot.version` from 3.2.2 to 3.2.3. Updates `org.springframework.boot:spring-boot-dependencies` from 3.2.2 to 3.2.3 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.2.2...v3.2.3) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.2.2 to 3.2.3 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.2.2...v3.2.3) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-dependencies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b44a0a5a..a2164e48 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.6.3 3.4.1 3.2.5 - 3.2.2 + 3.2.3 1.77 1.6.0 2.15.1 From 1a944b245ff1ba380b4c6146ab22731795aff80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Ra=C4=8Dansk=C3=BD?= Date: Mon, 26 Feb 2024 06:47:46 +0100 Subject: [PATCH 13/20] Fix #424: Coverity: Dereference null return value (#425) * Fix #424: Coverity: Dereference null return value --- .../powerauth/lib/cmd/steps/AbstractBaseStep.java | 4 ++-- .../powerauth/lib/cmd/steps/v3/GetStatusStep.java | 12 +++++++++++- .../powerauth/lib/cmd/steps/v3/VaultUnlockStep.java | 10 +++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java index 030a883a..02b5c662 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java @@ -285,8 +285,8 @@ public void processResponse(StepContext stepContext) throws Exception { } * @throws Exception when an error during response processing occurred */ public final void processResponse(StepContext stepContext, byte[] responseBody, Class responseObjectClass) throws Exception { - R responseBodyObject = HttpUtil.fromBytes(responseBody, responseObjectClass); - ResponseEntity responseEntity = ResponseEntity.of(Optional.of(responseBodyObject)); + final R responseBodyObject = HttpUtil.fromBytes(responseBody, responseObjectClass); + final ResponseEntity responseEntity = ResponseEntity.ofNullable(responseBodyObject); addResponseContext(stepContext, responseEntity); processResponse(stepContext); } diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/GetStatusStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/GetStatusStep.java index cecfdb51..081503a1 100755 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/GetStatusStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/GetStatusStep.java @@ -38,6 +38,7 @@ import org.springframework.core.ParameterizedTypeReference; import org.springframework.stereotype.Component; +import javax.crypto.SecretKey; import java.util.Base64; import java.util.HashMap; import java.util.Map; @@ -144,7 +145,16 @@ public void processResponse(StepContext customObject = responseObject.getCustomObject(); byte[] challenge = (byte[]) stepContext.getAttributes().get(ATTRIBUTE_CHALLENGE); - final ActivationStatusBlobInfo statusBlobRaw = ACTIVATION.getStatusFromEncryptedBlob(cStatusBlob, challenge, cStatusBlobNonce, resultStatusObject.getTransportMasterKeyObject()); + final SecretKey transportMasterKey = resultStatusObject.getTransportMasterKeyObject(); + if (transportMasterKey == null) { + stepContext.getStepLogger().writeError( + getStep().id() + "-failed", + "Get Status Failed", + "transportMasterKey is null"); + return; + } + + final ActivationStatusBlobInfo statusBlobRaw = ACTIVATION.getStatusFromEncryptedBlob(cStatusBlob, challenge, cStatusBlobNonce, transportMasterKey); final ExtendedActivationStatusBlobInfo statusBlob = ExtendedActivationStatusBlobInfo.copy(statusBlobRaw); final Map objectMap = new HashMap<>(); diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/VaultUnlockStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/VaultUnlockStep.java index a02695e8..6709157f 100755 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/VaultUnlockStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/VaultUnlockStep.java @@ -136,7 +136,15 @@ public void processResponse(StepContext Date: Thu, 7 Mar 2024 10:56:49 +0100 Subject: [PATCH 14/20] Update GitHub Actions to JDK 21 --- .github/workflows/codeql-analysis.yml | 3 ++- .github/workflows/coverity-scan.yml | 1 + .github/workflows/maven-deploy.yml | 2 ++ .github/workflows/maven-test.yml | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d750a715..b8391c93 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,4 +19,5 @@ jobs: # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Use only 'java' to analyze code written in Java, Kotlin or both # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support \ No newline at end of file + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + java_version: 21 \ No newline at end of file diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 8a887f33..e0652fb4 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -14,3 +14,4 @@ jobs: project-name: ${{ github.event.repository.name }} version: ${{ github.sha }} description: ${{ github.ref }} + java_version: 21 diff --git a/.github/workflows/maven-deploy.yml b/.github/workflows/maven-deploy.yml index 58607393..2235cefb 100644 --- a/.github/workflows/maven-deploy.yml +++ b/.github/workflows/maven-deploy.yml @@ -34,6 +34,7 @@ jobs: with: environment: internal-publish release_type: snapshot + java_version: 21 secrets: username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} @@ -45,6 +46,7 @@ jobs: with: environment: ${{ inputs.environment }} release_type: ${{ inputs.release_type }} + java_version: 21 secrets: username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} diff --git a/.github/workflows/maven-test.yml b/.github/workflows/maven-test.yml index 4bba5877..d7d33039 100644 --- a/.github/workflows/maven-test.yml +++ b/.github/workflows/maven-test.yml @@ -17,4 +17,6 @@ on: jobs: maven-tests: uses: wultra/wultra-infrastructure/.github/workflows/maven-test.yml@develop - secrets: inherit \ No newline at end of file + secrets: inherit + with: + java_version: 21 \ No newline at end of file From f724d593a326ce77d7eb3abb1857651864cb0924 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:06:58 +0000 Subject: [PATCH 15/20] Bump spring-boot.version from 3.2.3 to 3.2.4 Bumps `spring-boot.version` from 3.2.3 to 3.2.4. Updates `org.springframework.boot:spring-boot-dependencies` from 3.2.3 to 3.2.4 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.2.3...v3.2.4) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.2.3 to 3.2.4 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.2.3...v3.2.4) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-dependencies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2164e48..c5650c37 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.6.3 3.4.1 3.2.5 - 3.2.3 + 3.2.4 1.77 1.6.0 2.15.1 From 6ee043752b7a321be78dd1fac7a543df2edca9e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:07:08 +0000 Subject: [PATCH 16/20] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2164e48..330c7313 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 17 ${java.version} - 3.12.1 + 3.13.0 3.3.0 3.1.1 3.6.3 From 737a7e77a36827cf76bf3e01890efea85915e814 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 28 Mar 2024 07:37:56 +0100 Subject: [PATCH 17/20] Downgrade JDK for Coverity GHA to 17 --- .github/workflows/coverity-scan.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index e0652fb4..8a887f33 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -14,4 +14,3 @@ jobs: project-name: ${{ github.event.repository.name }} version: ${{ github.sha }} description: ${{ github.ref }} - java_version: 21 From 17ad4cc031083ac7d03bf121206ca8e8a95bdd34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:56:08 +0000 Subject: [PATCH 18/20] Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 to 3.3.1 Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.0 to 3.3.1. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.0...maven-source-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f50cf461..b888975c 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ ${java.version} 3.13.0 - 3.3.0 + 3.3.1 3.1.1 3.6.3 3.4.1 From 718c77979a5680169d61054f1d87b56af782e876 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:56:25 +0000 Subject: [PATCH 19/20] Bump commons-io:commons-io from 2.15.1 to 2.16.1 Bumps commons-io:commons-io from 2.15.1 to 2.16.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f50cf461..cc7c521f 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 3.2.4 1.77 1.6.0 - 2.15.1 + 2.16.1 1.1.1 From 16a9a8a1d35f36a9689fc473c47360b7dfed80a7 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 22 Feb 2024 13:29:25 +0100 Subject: [PATCH 20/20] Fix #420: Update Wultra dependencies --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4714f10e..ba083084 100644 --- a/pom.xml +++ b/pom.xml @@ -89,9 +89,9 @@ 1.1.1 - 1.7.0-SNAPSHOT - 1.7.0-SNAPSHOT - 1.9.0-SNAPSHOT + 1.7.0 + 1.7.0 + 1.9.0