Skip to content

Commit

Permalink
Merge pull request #156 from wultra/develop
Browse files Browse the repository at this point in the history
Prepare release 1.0.0
  • Loading branch information
romanstrobl authored Jan 18, 2021
2 parents 4d2f442 + 16479d1 commit a447cc1
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 66 deletions.
29 changes: 12 additions & 17 deletions powerauth-data-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<artifactId>powerauth-data-adapter</artifactId>
<groupId>io.getlime.security</groupId>
<version>0.24.0</version>
<version>1.0.0</version>
<packaging>war</packaging>

<name>powerauth-data-adapter</name>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<version>2.3.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -64,7 +64,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven-war-plugin.version>3.1.0</maven-war-plugin.version>
<maven-war-plugin.version>3.3.1</maven-war-plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -93,24 +93,24 @@
<dependency>
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-data-adapter-model</artifactId>
<version>0.24.0</version>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-java-crypto</artifactId>
<version>0.24.0</version>
<version>1.0.0</version>
</dependency>

<!-- Other Dependencies -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.10.3</version>
<version>2.11.3</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.65</version>
<version>1.67</version>
<scope>provided</scope>
</dependency>

Expand All @@ -123,25 +123,20 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version>
<version>2.3.3</version>
</dependency>

<!-- Documentation -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.0</version>
</dependency>
<!-- Force Guava upgrade due to CWE-502 -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.2-jre</version>
<version>30.0-jre</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 2017 Wultra s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.getlime.security.powerauth.app.dataadapter.configuration;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Contact;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.info.License;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* Configuration class used for setting up Open API documentation.
*
* @author Petr Dvorak, [email protected]
*/
@Configuration
@OpenAPIDefinition(
info = @Info(
title = "PowerAuth Data Adapter RESTful API Documentation",
version = "1.0",
license = @License(
name = "APL 2.0",
url = "https://www.apache.org/licenses/LICENSE-2.0"
),
description = "Documentation for the PowerAuth Data Adapter RESTful API published by the PowerAuth Data Adapter Server.",
contact = @Contact(
name = "Wultra s.r.o.",
url = "https://www.wultra.com"
)
)
)
public class OpenApiConfiguration {

@Bean
public GroupedOpenApi pushApiGroup() {
String[] packages = {"io.getlime.security.powerauth"};

return GroupedOpenApi.builder()
.group("dataadapter")
.packagesToScan(packages)
.build();
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ public class DataAdapterService implements DataAdapter {
private final DataAdapterI18NService dataAdapterI18NService;
private final SmsPersistenceService smsPersistenceService;
private final SmsDeliveryService smsDeliveryService;
private final OperationValueExtractionService operationValueExtractionService;

@Autowired
public DataAdapterService(DataAdapterI18NService dataAdapterI18NService, SmsPersistenceService smsPersistenceService, SmsDeliveryService smsDeliveryService) {
public DataAdapterService(DataAdapterI18NService dataAdapterI18NService, SmsPersistenceService smsPersistenceService, SmsDeliveryService smsDeliveryService, OperationValueExtractionService operationValueExtractionService) {
this.dataAdapterI18NService = dataAdapterI18NService;
this.smsPersistenceService = smsPersistenceService;
this.smsDeliveryService = smsDeliveryService;
this.operationValueExtractionService = operationValueExtractionService;
}

@Override
Expand Down Expand Up @@ -535,8 +537,8 @@ public AfsResponse executeAfsAction(String userId, String organizationId, Operat
case APPROVAL_INIT:
// Apply AFS response parameters on authentication form.
// This example performs step-down from 2FA to 1FA in case of payment in CZK with low amount.
AmountAttribute amountAttr = operationContext.getFormData().getAmount();
if (amountAttr.getCurrency().equals("CZK") && amountAttr.getAmount().intValue() < 500) {
AmountAttribute amountAttribute = operationValueExtractionService.getAmount(operationContext);
if (amountAttribute.getCurrency().equals("CZK") && amountAttribute.getAmount().intValue() < 500) {
// Disable password verification for low amounts
response.setAfsResponseApplied(true);
response.setAfsLabel("1FA");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ public AmountAttribute getAmount(OperationContext operationContext) throws Inval
if (formData == null || formData.getParameters() == null) {
throw new InvalidOperationContextException("Operation form data is invalid");
}
return formData.getAmount();
AmountAttribute amountAttribute = formData.getAmount();
if (amountAttribute == null) {
throw new InvalidOperationContextException("Amount attribute is missing");
}
return amountAttribute;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ powerauth.dataAdapter.service.applicationDisplayName=PowerAuth Data Adapter
powerauth.dataAdapter.service.applicationEnvironment=

# Disable open session in view to avoid startup warning of Spring boot
spring.jpa.open-in-view=false
spring.jpa.open-in-view=false

# Disable swagger-ui default petstore url
springdoc.swagger-ui.disable-swagger-default-url=true
9 changes: 9 additions & 0 deletions powerauth-data-adapter/src/main/webapp/WEB-INF/weblogic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<weblogic-web-app>
<container-descriptor>
<prefer-application-packages>
<package-name>javax.validation.*</package-name>
<package-name>org.hibernate.validator.*</package-name>
</prefer-application-packages>
</container-descriptor>
</weblogic-web-app>

0 comments on commit a447cc1

Please sign in to comment.