-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/redirect before start (#1233)
* Fixed redirects before consent auth start * Set approach from init call * Use special redirection handler * Use special redirection handler * Fixes for payment redirection * Fixed typo * Refactored consent handling * Refactored consent handling * Remove object mapper * Remove object mapper * Remove unnecessary classes * Fixed wrong transaction listing bean * Separate support for skipping start consent authorization * Disable test profiles
- Loading branch information
Showing
22 changed files
with
28,673 additions
and
28,499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
opba-db/src/main/resources/migration/migrations/0004-add-skip-auth-for-deutsche-bank.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<databaseChangeLog logicalFilePath="db.changelog-1.0.xml" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
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-3.8.xsd"> | ||
|
||
<changeSet author="vbeex@adorsys.com.ua" id="2021-05-12-23"> | ||
<comment>Updates xs2a_skip_consent_authorization for DeutscheBank</comment> | ||
<update tableName="${table-prefix}bank_profile"> | ||
<column name="xs2a_skip_consent_authorization" value="true"/> | ||
<where> | ||
adapter_id = 'deutsche-bank-adapter' | ||
</where> | ||
</update> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
49,742 changes: 24,871 additions & 24,871 deletions
49,742
opba-db/src/main/resources/migration/migrations/bank_action_data.csv
Large diffs are not rendered by default.
Oops, something went wrong.
7,106 changes: 3,553 additions & 3,553 deletions
7,106
opba-db/src/main/resources/migration/migrations/bank_profile_data.csv
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ervice/xs2a/authenticate/redirect/Xs2aDoScaRedirectToAspspForScaChallengeAfterCreate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.adorsys.opba.protocol.xs2a.service.xs2a.authenticate.redirect; | ||
|
||
import de.adorsys.opba.protocol.xs2a.config.protocol.ProtocolUrlsConfiguration; | ||
import de.adorsys.opba.protocol.xs2a.context.Xs2aContext; | ||
import de.adorsys.opba.protocol.xs2a.service.xs2a.Xs2aRedirectExecutor; | ||
import org.flowable.engine.RuntimeService; | ||
import org.springframework.stereotype.Service; | ||
|
||
/** | ||
* Performs redirection to the ASPSP by sending him to the page with redirection button (to ASPSP) for the redirect approach. | ||
* But is specific as happens just after consent was created. | ||
*/ | ||
@Service("xs2aDoScaRedirectToAspspForScaChallengeAfterCreate") | ||
public class Xs2aDoScaRedirectToAspspForScaChallengeAfterCreate extends Xs2aDoScaRedirectToAspspForScaChallenge { | ||
|
||
public Xs2aDoScaRedirectToAspspForScaChallengeAfterCreate(ProtocolUrlsConfiguration urlsConfiguration, RuntimeService runtimeService, Xs2aRedirectExecutor redirectExecutor) { | ||
super(urlsConfiguration, runtimeService, redirectExecutor); | ||
} | ||
|
||
@Override | ||
protected String getRedirectToAspspUrl(Xs2aContext context) { | ||
return context.getConsentOrPaymentCreateLinks().get(SCA_REDIRECT).getHref(); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../java/de/adorsys/opba/protocol/xs2a/service/xs2a/consent/BaseCreateAisConsentService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package de.adorsys.opba.protocol.xs2a.service.xs2a.consent; | ||
|
||
import de.adorsys.opba.protocol.bpmnshared.service.exec.ValidatedExecution; | ||
import de.adorsys.opba.protocol.xs2a.context.Xs2aContext; | ||
import de.adorsys.opba.protocol.xs2a.util.logresolver.Xs2aLogResolver; | ||
import de.adorsys.xs2a.adapter.api.Response; | ||
import de.adorsys.xs2a.adapter.api.model.ConsentsResponse201; | ||
import org.apache.logging.log4j.util.Strings; | ||
import org.flowable.engine.delegate.DelegateExecution; | ||
|
||
import java.util.UUID; | ||
|
||
import static de.adorsys.opba.protocol.bpmnshared.GlobalConst.CONTEXT; | ||
import static de.adorsys.xs2a.adapter.api.ResponseHeaders.ASPSP_SCA_APPROACH; | ||
import static de.adorsys.xs2a.adapter.impl.link.bg.template.LinksTemplate.SCA_OAUTH; | ||
|
||
public abstract class BaseCreateAisConsentService<T extends Xs2aContext> extends ValidatedExecution<T> { | ||
|
||
protected final Xs2aLogResolver logResolver = new Xs2aLogResolver(getClass()); | ||
|
||
@Override | ||
protected void doMockedExecution(DelegateExecution execution, T context) { | ||
logResolver.log("doMockedExecution: execution ({}) with context ({})", execution, context); | ||
|
||
context.setConsentId("MOCK-" + UUID.randomUUID().toString()); | ||
execution.setVariable(CONTEXT, context); | ||
} | ||
|
||
protected void postHandleCreatedConsent(Response<ConsentsResponse201> consentInit, DelegateExecution execution, Xs2aContext context) { | ||
context.setWrongAuthCredentials(false); | ||
context.setConsentId(consentInit.getBody().getConsentId()); | ||
if (null != consentInit.getBody().getLinks() && consentInit.getBody().getLinks().containsKey(SCA_OAUTH)) { | ||
context.setOauth2IntegratedNeeded(true); | ||
context.setScaOauth2Link(consentInit.getBody().getLinks().get(SCA_OAUTH).getHref()); | ||
} | ||
|
||
if (null != consentInit.getHeaders() && Strings.isNotBlank(consentInit.getHeaders().getHeader(ASPSP_SCA_APPROACH))) { | ||
context.setAspspScaApproach(consentInit.getHeaders().getHeader(ASPSP_SCA_APPROACH)); | ||
if (null != consentInit.getBody()) { | ||
context.setConsentOrPaymentCreateLinks(consentInit.getBody().getLinks()); | ||
} | ||
} | ||
|
||
execution.setVariable(CONTEXT, context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.