Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into issues/merge-ups…
Browse files Browse the repository at this point in the history
…tream
  • Loading branch information
banterCZ committed Oct 3, 2023
2 parents 0de3e10 + b1b248d commit efde095
Show file tree
Hide file tree
Showing 25 changed files with 117 additions and 60 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM ibm-semeru-runtimes:open-17.0.6_10-jre
FROM ibm-semeru-runtimes:open-17.0.8_7-jre
LABEL maintainer="[email protected]"

# Prepare environment variables
ENV JAVA_HOME=/opt/java/openjdk \
LB_HOME=/usr/local/liquibase \
LB_VERSION=4.21.1 \
LB_VERSION=4.23.2 \
PKG_RELEASE=1~jammy \
TOMCAT_HOME=/usr/local/tomcat \
TOMCAT_MAJOR=10 \
TOMCAT_VERSION=10.1.7 \
TOMCAT_VERSION=10.1.13 \
TZ=UTC

ENV PATH=$PATH:$LB_HOME:$TOMCAT_HOME/bin
Expand All @@ -20,7 +20,7 @@ RUN apt-get -y update \

# Install tomcat
RUN curl -jkSL -o /tmp/apache-tomcat.tar.gz http://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR}/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz \
&& [ "41997f90baf86af6dc0396cbf66941f801e0ae9ad1b57475661d10e648c55559491e85468af2df3ee457be3fcae12b74537ce19a9a28e34030b98e8bb38dbd35 /tmp/apache-tomcat.tar.gz" = "$(sha512sum /tmp/apache-tomcat.tar.gz)" ] \
&& [ "406c0c367ac6ad95bb724ecc3a3c340ad7ded8c62287d657811eeec496eaaca1f5add52d2f46111da1426ae67090c543f6deccfeb5fdf4bdae32f9b39e773265 /tmp/apache-tomcat.tar.gz" = "$(sha512sum /tmp/apache-tomcat.tar.gz)" ] \
&& gunzip /tmp/apache-tomcat.tar.gz \
&& tar -C /opt -xf /tmp/apache-tomcat.tar \
&& ln -s /opt/apache-tomcat-$TOMCAT_VERSION $TOMCAT_HOME
Expand All @@ -31,7 +31,7 @@ RUN rm -rf $TOMCAT_HOME/webapps/*
# This setup was inspired by https://github.com/mobtitude/liquibase/blob/master/Dockerfile
RUN set -x \
&& wget -q -O /tmp/liquibase.tar.gz "https://github.com/liquibase/liquibase/releases/download/v$LB_VERSION/liquibase-$LB_VERSION.tar.gz" \
&& [ "c04542865e5ece8b7b1ee9bd6beaefc5315e350620288d6ac1a2d32c3b1f7d8b /tmp/liquibase.tar.gz" = "$(sha256sum /tmp/liquibase.tar.gz)" ] \
&& [ "fc7d2a9fa97d91203d639b664715d40953c6c9155a5225a0ddc4c8079b9a3641 /tmp/liquibase.tar.gz" = "$(sha256sum /tmp/liquibase.tar.gz)" ] \
&& mkdir -p "$LB_HOME" \
&& tar -xzf /tmp/liquibase.tar.gz -C "$LB_HOME" \
&& rm -rf "$LB_HOME/sdk" \
Expand Down
4 changes: 2 additions & 2 deletions docs-private/Developer-How-To-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mvn clean package
### Build the docker image

```shell
docker build . -t enrollment-server:1.5.0-SNAPSHOT
docker build . -t enrollment-server:1.5.0
```


Expand All @@ -50,7 +50,7 @@ docker build . -t enrollment-server:1.5.0-SNAPSHOT
### Run the docker image

```shell
docker run -p 80:8080 -e ENROLLMENT_SERVER_DATASOURCE_URL='jdbc:postgresql://host.docker.internal:5432/powerauth' -e ENROLLMENT_SERVER_DATASOURCE_USERNAME='powerauth' -e ENROLLMENT_SERVER_DATASOURCE_PASSWORD='' enrollment-server:1.5.0-SNAPSHOT
docker run -p 80:8080 -e ENROLLMENT_SERVER_DATASOURCE_URL='jdbc:postgresql://host.docker.internal:5432/powerauth' -e ENROLLMENT_SERVER_DATASOURCE_USERNAME='powerauth' -e ENROLLMENT_SERVER_DATASOURCE_PASSWORD='' enrollment-server:1.5.0
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<changeSet id="1" logicalFilePath="enrollment-server/1.5.x/20230315-add-column-fds-data.xml" author="Lubos Racansky">
<changeSet id="1" logicalFilePath="enrollment-server-onboarding/1.5.x/20230315-add-column-fds-data.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="es_onboarding_process" columnName="fds_data"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<changeSet id="1" logicalFilePath="enrollment-server/1.5.x/20230530-add-column-total-attempts.xml" author="Jan Dusil">
<changeSet id="1" logicalFilePath="enrollment-server-onboarding/1.5.x/20230530-add-column-total-attempts.xml" author="Jan Dusil">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="es_onboarding_otp" columnName="total_attempts"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<!-- Create audit log table - https://github.com/wultra/lime-java-core#wultra-auditing-library -->
<changeSet id="1" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="1" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="audit_log"/>
Expand All @@ -21,9 +21,7 @@
<column name="audit_level" type="varchar(32)">
<constraints nullable="false" />
</column>
<column name="audit_type" type="varchar(256)">
<constraints nullable="false" />
</column>
<column name="audit_type" type="varchar(256)" />
<column name="timestamp_created" type="timestamp" defaultValueDate="${now}" />
<column name="message" type="text">
<constraints nullable="false" />
Expand All @@ -44,7 +42,7 @@
<rollback />
</changeSet>

<changeSet id="2" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="2" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="audit_param"/>
Expand All @@ -61,7 +59,7 @@
<rollback />
</changeSet>

<changeSet id="3" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="3" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_log" indexName="audit_log_timestamp" />
Expand All @@ -75,7 +73,7 @@
<rollback />
</changeSet>

<changeSet id="4" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="4" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_log" indexName="audit_log_application" />
Expand All @@ -89,7 +87,7 @@
<rollback />
</changeSet>

<changeSet id="5" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="5" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_log" indexName="audit_log_level" />
Expand All @@ -103,7 +101,7 @@
<rollback />
</changeSet>

<changeSet id="6" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="6" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_log" indexName="audit_log_type" />
Expand All @@ -117,7 +115,7 @@
<rollback />
</changeSet>

<changeSet id="7" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="7" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_param" indexName="audit_param_log" />
Expand All @@ -131,7 +129,7 @@
<rollback />
</changeSet>

<changeSet id="8" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="8" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_param" indexName="audit_param_timestamp" />
Expand All @@ -145,7 +143,7 @@
<rollback />
</changeSet>

<changeSet id="9" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="9" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_param" indexName="audit_param_key" />
Expand All @@ -159,7 +157,7 @@
<rollback />
</changeSet>

<changeSet id="10" logicalFilePath="enrollment-server-onboarding/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<changeSet id="10" logicalFilePath="enrollment-server/1.4.x/20230314-audit.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="audit_param" indexName="audit_param_value" />
Expand Down
2 changes: 1 addition & 1 deletion enrollment-server-api-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<parent>
<groupId>com.wultra.security</groupId>
<artifactId>enrollment-server-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion enrollment-server-onboarding-adapter-mock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.wultra.security</groupId>
<artifactId>enrollment-server-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<artifactId>enrollment-server-onboarding-adapter-mock</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion enrollment-server-onboarding-api-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.wultra.security</groupId>
<artifactId>enrollment-server-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<artifactId>enrollment-server-onboarding-api-model</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion enrollment-server-onboarding-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.wultra.security</groupId>
<artifactId>enrollment-server-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<artifactId>enrollment-server-onboarding-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion enrollment-server-onboarding-domain-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<parent>
<groupId>com.wultra.security</groupId>
<artifactId>enrollment-server-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion enrollment-server-onboarding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>com.wultra.security</groupId>
<artifactId>enrollment-server-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.wultra.app.onboardingserver.errorhandling.DocumentVerificationException;
import com.wultra.app.onboardingserver.provider.DocumentVerificationProvider;
import com.wultra.core.rest.client.base.RestClientException;
import jakarta.annotation.Nullable;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -46,7 +47,6 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

import javax.annotation.Nullable;
import java.util.*;

/**
Expand Down Expand Up @@ -569,7 +569,6 @@ private DocumentVerificationStatus toStatus(ZenidWebInvestigateResponse.StateEnu
case ERROR -> DocumentVerificationStatus.FAILED;
case NOTDONE, OPERATOR -> DocumentVerificationStatus.IN_PROGRESS;
case REJECTED -> DocumentVerificationStatus.REJECTED;
default -> throw new IllegalStateException("Unknown investigation status in ZenID: " + stateEnum);
};
}

Expand All @@ -590,7 +589,6 @@ private CardSide toCardSide(@Nullable ZenidSharedMineAllResult.PageCodeEnum page
return switch (pageCodeEnum) {
case F -> CardSide.FRONT;
case B -> CardSide.BACK;
default -> throw new IllegalStateException("Unexpected side page code value: " + pageCodeEnum);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.wultra.app.onboardingserver.docverify.zenid.model.api.*;
import com.wultra.core.rest.client.base.RestClient;
import com.wultra.core.rest.client.base.RestClientException;
import jakarta.annotation.Nullable;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand All @@ -40,7 +41,6 @@
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import javax.annotation.Nullable;
import java.util.List;

/**
Expand Down Expand Up @@ -284,7 +284,6 @@ private ZenidSharedMineAllResult.PageCodeEnum toPageCodeEnum(CardSide cardSide)
return switch (cardSide) {
case FRONT -> ZenidSharedMineAllResult.PageCodeEnum.F;
case BACK -> ZenidSharedMineAllResult.PageCodeEnum.B;
default -> throw new IllegalStateException("Unexpected card side value: " + cardSide);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthAuthenticationException;
import io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthEncryptionException;
import io.getlime.security.powerauth.rest.api.spring.exception.authentication.PowerAuthTokenInvalidException;
import jakarta.annotation.Nullable;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
Expand All @@ -58,7 +59,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Nullable;
import java.util.Map;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Nullable;

/**
* Service class used for JSON serialization.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,10 @@ private static OtpSendRequestDto convert(final SendOtpCodeRequest source) throws
return target;
}

private static OtpSendRequestDto.OtpTypeEnum convert(SendOtpCodeRequest.OtpType source) throws OnboardingProviderException {
private static OtpSendRequestDto.OtpTypeEnum convert(SendOtpCodeRequest.OtpType source) {
return switch (source) {
case ACTIVATION -> OtpSendRequestDto.OtpTypeEnum.ACTIVATION;
case USER_VERIFICATION -> OtpSendRequestDto.OtpTypeEnum.USER_VERIFICATION;
default -> throw new OnboardingProviderException("No mapping for " + source);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.wultra.app.onboardingserver.statemachine.enums.OnboardingEvent;
import com.wultra.app.onboardingserver.statemachine.enums.OnboardingState;
import com.wultra.app.onboardingserver.statemachine.interceptor.CustomStateMachineInterceptor;
import jakarta.annotation.Nullable;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.messaging.Message;
Expand All @@ -42,7 +43,6 @@
import org.springframework.transaction.support.TransactionTemplate;
import reactor.core.publisher.Mono;

import javax.annotation.Nullable;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
import com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationPhase;
import com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus;
import com.wultra.app.enrollmentserver.model.integration.OwnerId;
import com.wultra.app.onboardingserver.common.database.entity.OnboardingProcessEntity;
import com.wultra.app.onboardingserver.common.database.entity.IdentityVerificationEntity;
import com.wultra.app.onboardingserver.common.database.entity.OnboardingProcessEntity;
import com.wultra.app.onboardingserver.statemachine.enums.OnboardingEvent;
import com.wultra.app.onboardingserver.statemachine.enums.OnboardingState;
import com.wultra.app.onboardingserver.statemachine.service.StateMachineService;
import jakarta.annotation.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.statemachine.StateMachine;
import org.springframework.statemachine.test.StateMachineTestPlanBuilder;

import javax.annotation.Nullable;

/**
* @author Lukas Lukovsky, [email protected]
*/
Expand Down
2 changes: 1 addition & 1 deletion enrollment-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<parent>
<groupId>com.wultra.security</groupId>
<artifactId>enrollment-server-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ private void auditInitActivation(final InitActivationResponse response) {
.param("activationId", response.getActivationId())
.param("userId", userId)
.build();
audit.info("Init activation for user: {}", auditDetail);
audit.info("Init activation for user: {}", auditDetail, userId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ private static StringSubstitutor createStringSubstitutor(final Map<String, Strin
return null;
} else {
final Map<String, String> escapedParameters = parameters.entrySet().stream()
.filter(entry -> entry.getValue() != null)
.collect(toMap(Map.Entry::getKey, it -> StringEscapeUtils.escapeJson(it.getValue())));
return new StringSubstitutor(escapedParameters);
}
Expand Down
Loading

0 comments on commit efde095

Please sign in to comment.