diff --git a/doc/release_notes/Release_notes_12.0.adoc b/doc/release_notes/Release_notes_12.0.adoc new file mode 100644 index 00000000..ab83c6e1 --- /dev/null +++ b/doc/release_notes/Release_notes_12.0.adoc @@ -0,0 +1,16 @@ += Release notes v.12.0 + +== Table of Contents + +* Migrated onto new XS2A version + +* Added specific PSU Message to response in case of Decoupled SCA approach + +== Migrated onto new XS2A version + +From now on, Connector uses XS2A version 12.0. + +== Added specific PSU Message to response in case of Decoupled SCA approach + +From now on, specific PSU message "Please check your app to continue..." is sent after authorisation start +in case of `Decoupled` SCA approach diff --git a/doc/release_notes/Release_notes_13.0.adoc b/doc/release_notes/Release_notes_13.0.adoc new file mode 100644 index 00000000..1610c0e1 --- /dev/null +++ b/doc/release_notes/Release_notes_13.0.adoc @@ -0,0 +1,16 @@ += Release notes v.13.0 + +== Table of Contents + +* Migrated onto new XS2A version + +* Added specific PSU Message to response in case of Decoupled SCA approach + +== Migrated onto new XS2A version + +From now on, Connector uses XS2A version 13.0. + +== Added specific PSU Message to response in case of Decoupled SCA approach + +From now on, specific PSU message "Please check your app to continue..." is sent after authorisation start +in case of `Decoupled` SCA approach diff --git a/gateway-app-embedded/pom.xml b/gateway-app-embedded/pom.xml index 41ed8b69..1a870a46 100644 --- a/gateway-app-embedded/pom.xml +++ b/gateway-app-embedded/pom.xml @@ -21,7 +21,7 @@ xs2a-connector-examples de.adorsys.ledgers - 11.11 + 13.0 4.0.0 diff --git a/gateway-app/pom.xml b/gateway-app/pom.xml index d42d0126..6c70a9f4 100644 --- a/gateway-app/pom.xml +++ b/gateway-app/pom.xml @@ -5,7 +5,7 @@ de.adorsys.ledgers xs2a-connector-examples - 11.11 + 13.0 .. gateway-app diff --git a/ledgers-rest-client/pom.xml b/ledgers-rest-client/pom.xml index 9a992315..dfc0915a 100644 --- a/ledgers-rest-client/pom.xml +++ b/ledgers-rest-client/pom.xml @@ -5,7 +5,7 @@ de.adorsys.ledgers xs2a-connector-examples - 11.11 + 13.0 .. ledgers-rest-client diff --git a/pom.xml b/pom.xml index 7c7692ea..1146ca34 100755 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 4.0.0 de.adorsys.ledgers xs2a-connector-examples - 11.11 + 13.0 pom XS2A Connector Examples @@ -86,7 +86,7 @@ ${project.basedir} - 11.11 + 13.0 4.14 diff --git a/scripts/.release-scripts-hooks.sh b/scripts/.release-scripts-hooks.sh index 8d0b31e0..2a1df937 100644 --- a/scripts/.release-scripts-hooks.sh +++ b/scripts/.release-scripts-hooks.sh @@ -32,9 +32,9 @@ function get_remote_repo_name { # Hook method to define the develop branch name # Returns the develop branch name as text function get_develop_branch_name { - if [[ "$1" =~ ^8\..* ]] + if [[ "$1" =~ ^12\..* ]] then - echo "support-8.x" + echo "support-12.x" else echo "develop" fi @@ -43,9 +43,9 @@ function get_develop_branch_name { # Hook method to define the master branch name # Returns the master branch name as text function get_master_branch_name { - if [[ "$1" =~ ^8\..* ]] + if [[ "$1" =~ ^12\..* ]] then - echo "master-8.x" + echo "master-12.x" else echo "master" fi diff --git a/xs2a-connector-embedded/pom.xml b/xs2a-connector-embedded/pom.xml index b9064b8e..8b8b537b 100644 --- a/xs2a-connector-embedded/pom.xml +++ b/xs2a-connector-embedded/pom.xml @@ -21,7 +21,7 @@ xs2a-connector-examples de.adorsys.ledgers - 11.11 + 13.0 4.0.0 diff --git a/xs2a-connector-oauth-service/pom.xml b/xs2a-connector-oauth-service/pom.xml index a21b1aaf..aed711e7 100644 --- a/xs2a-connector-oauth-service/pom.xml +++ b/xs2a-connector-oauth-service/pom.xml @@ -21,7 +21,7 @@ xs2a-connector-examples de.adorsys.ledgers - 11.11 + 13.0 4.0.0 diff --git a/xs2a-connector-remote/pom.xml b/xs2a-connector-remote/pom.xml index f681063b..4b823aa9 100644 --- a/xs2a-connector-remote/pom.xml +++ b/xs2a-connector-remote/pom.xml @@ -5,7 +5,7 @@ de.adorsys.ledgers xs2a-connector-examples - 11.11 + 13.0 .. diff --git a/xs2a-connector/pom.xml b/xs2a-connector/pom.xml index 835ae6b1..a467a29f 100644 --- a/xs2a-connector/pom.xml +++ b/xs2a-connector/pom.xml @@ -5,7 +5,7 @@ de.adorsys.ledgers xs2a-connector-examples - 11.11 + 13.0 .. diff --git a/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/SpiMockData.java b/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/SpiMockData.java index c92a02f4..6835acc7 100644 --- a/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/SpiMockData.java +++ b/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/SpiMockData.java @@ -37,6 +37,7 @@ public class SpiMockData { public static final List SCA_METHODS = buildScaMethods(); public static final String PSU_MESSAGE = "mocked PSU message from the bank"; public static final String PSU_MESSAGE_START_AUTHORISATION = "Start authorisation mocked PSU message from the bank"; + public static final String DECOUPLED_PSU_MESSAGE = "Please check your app to continue..."; public static final boolean FUNDS_AVAILABLE = true; private static SpiLinks buildSpiLinks() { diff --git a/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/authorisation/AbstractAuthorisationSpi.java b/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/authorisation/AbstractAuthorisationSpi.java index 91fcdbad..0c720180 100644 --- a/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/authorisation/AbstractAuthorisationSpi.java +++ b/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/authorisation/AbstractAuthorisationSpi.java @@ -93,8 +93,11 @@ public SpiResponse startAuthorisation(@NotNull Sp @NotNull String authorisationId, T businessObject, @NotNull SpiAspspConsentDataProvider aspspConsentDataProvider) { + String psuMessage = (scaApproach == ScaApproach.DECOUPLED) + ? SpiMockData.DECOUPLED_PSU_MESSAGE + : SpiMockData.PSU_MESSAGE_START_AUTHORISATION; return SpiResponse.builder() - .payload(new SpiStartAuthorisationResponse(scaApproach, scaStatus, SpiMockData.PSU_MESSAGE_START_AUTHORISATION, SpiMockData.TPP_MESSAGES_START_AUTHORISATION)) + .payload(new SpiStartAuthorisationResponse(scaApproach, scaStatus, psuMessage, SpiMockData.TPP_MESSAGES_START_AUTHORISATION)) .build(); } diff --git a/xs2a-connector/src/test/java/de/adorsys/aspsp/xs2a/connector/spi/impl/authorisation/AbstractAuthorisationSpiTest.java b/xs2a-connector/src/test/java/de/adorsys/aspsp/xs2a/connector/spi/impl/authorisation/AbstractAuthorisationSpiTest.java new file mode 100644 index 00000000..d1ba6640 --- /dev/null +++ b/xs2a-connector/src/test/java/de/adorsys/aspsp/xs2a/connector/spi/impl/authorisation/AbstractAuthorisationSpiTest.java @@ -0,0 +1,97 @@ +/* + * Copyright 2018-2021 adorsys GmbH & Co KG + * + * 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 de.adorsys.aspsp.xs2a.connector.spi.impl.authorisation; + +import de.adorsys.aspsp.xs2a.connector.spi.impl.SpiMockData; +import de.adorsys.psd2.xs2a.core.profile.ScaApproach; +import de.adorsys.psd2.xs2a.core.sca.ScaStatus; +import de.adorsys.psd2.xs2a.core.tpp.TppInfo; +import de.adorsys.psd2.xs2a.spi.domain.SpiAspspConsentDataProvider; +import de.adorsys.psd2.xs2a.spi.domain.SpiContextData; +import de.adorsys.psd2.xs2a.spi.domain.authorisation.SpiStartAuthorisationResponse; +import de.adorsys.psd2.xs2a.spi.domain.psu.SpiPsuData; +import de.adorsys.psd2.xs2a.spi.domain.response.SpiResponse; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@ExtendWith(MockitoExtension.class) +class AbstractAuthorisationSpiTest { + private static final String PSU_ID = "anton.brueckner"; + private static final String AUTHORISATION_ID = "authorisation Id"; + private static final ScaApproach DECOUPLED_APPROACH = ScaApproach.DECOUPLED; + private static final ScaApproach NON_DECOUPLED_APPROACH = ScaApproach.EMBEDDED; + private static final ScaStatus SCA_STATUS = ScaStatus.PSUAUTHENTICATED; + private static final SpiPsuData PSU_ID_DATA_1 = SpiPsuData.builder() + .psuId(PSU_ID) + .psuIdType("2") + .psuCorporateId("3") + .psuCorporateIdType("4") + .psuIpAddress("5") + .psuIpPort("6") + .psuUserAgent("7") + .psuGeoLocation("8") + .psuAccept("9") + .psuAcceptCharset("10") + .psuAcceptEncoding("11") + .psuAcceptLanguage("12") + .psuHttpMethod("13") + .psuDeviceId(UUID.randomUUID()) + .build(); + private static final String ACCESS_TOKEN = "access_token"; + private static final SpiContextData SPI_CONTEXT_DATA = new SpiContextData(PSU_ID_DATA_1, new TppInfo(), UUID.randomUUID(), UUID.randomUUID(), ACCESS_TOKEN, null, null, null, null); + + private final AbstractAuthorisationSpi authorisationSpi = Mockito.mock(AbstractAuthorisationSpi.class, Mockito.CALLS_REAL_METHODS); + + @Mock + private SpiAspspConsentDataProvider spiAspspConsentDataProvider; + + @Test + void startAuthorisation_decoupledApproach() { + //Given + String expected = SpiMockData.DECOUPLED_PSU_MESSAGE; + + //When + SpiResponse actual = + authorisationSpi.startAuthorisation(SPI_CONTEXT_DATA, DECOUPLED_APPROACH, SCA_STATUS, AUTHORISATION_ID, null, spiAspspConsentDataProvider); + + //Then + assertNotNull(actual.getPayload()); + assertEquals(expected, actual.getPayload().getPsuMessage()); + } + + @Test + void startAuthorisation_nonDecoupledApproach() { + //Given + String expected = SpiMockData.PSU_MESSAGE_START_AUTHORISATION; + + //When + SpiResponse actual = + authorisationSpi.startAuthorisation(SPI_CONTEXT_DATA, NON_DECOUPLED_APPROACH, SCA_STATUS, AUTHORISATION_ID, null, spiAspspConsentDataProvider); + + //Then + assertNotNull(actual.getPayload()); + assertEquals(expected, actual.getPayload().getPsuMessage()); + } +}