Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRP authorization flow #38

Merged
merged 23 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a4c3ece
Implementation of VRP Authorization flow -Retrieval flow
kalpanakanagasabai Feb 14, 2024
1d39a87
Unit test for authorize flow
kalpanakanagasabai Feb 16, 2024
1caf000
Merge remote-tracking branch 'upstream/main' into vrp-auth-flow
kalpanakanagasabai Feb 16, 2024
a6d2b0b
Resolving the comments for the last update of retrieval flow
kalpanakanagasabai Feb 21, 2024
cf5221f
Unit test for VRP Retrieval Flow
kalpanakanagasabai Feb 21, 2024
7207d30
Fixing the comments for the last update of Retrieval flow
kalpanakanagasabai Feb 28, 2024
fa29ae7
Fixing the changes after the code review
kalpanakanagasabai Mar 12, 2024
60a3cf3
Resolving the comments for Retrieval flow
kalpanakanagasabai Mar 12, 2024
5f6d81b
Resolving the comments for Retrieval flow
kalpanakanagasabai Mar 13, 2024
4800926
Removal of Retrieval handler classes present in the Retrieval Flow
kalpanakanagasabai Mar 13, 2024
01f2f08
Resolving the comments
kalpanakanagasabai Mar 14, 2024
02c291d
Resolving the comments
kalpanakanagasabai Mar 14, 2024
4e69857
Resolving the comments
kalpanakanagasabai Mar 14, 2024
7782781
Resolving the comments for the unit test
kalpanakanagasabai Mar 15, 2024
460b4c0
Resolving the comments for the unit test
kalpanakanagasabai Mar 18, 2024
20e0817
Resolving the comments for the unit test
kalpanakanagasabai Mar 19, 2024
f8affec
Resolving the comments for the unit test
kalpanakanagasabai Mar 20, 2024
5fc68ee
Merge branch 'main' of https://github.com/wso2/financial-open-banking…
kalpanakanagasabai Mar 20, 2024
ef5d7a6
Merge branch 'main' into vrp-auth-flow
kalpanakanagasabai Mar 20, 2024
ce8d5a3
Merge branch 'vrp-auth-flow' of https://github.com/kalpanakanagasabai…
kalpanakanagasabai Mar 20, 2024
38efb6c
Resolving the comments
kalpanakanagasabai Mar 20, 2024
e3d9f0c
Committing the testng file
kalpanakanagasabai Mar 20, 2024
013455d
commit
kalpanakanagasabai Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,5 +290,14 @@ public class ErrorConstants {
public static final String PATH_PERIOD_TYPE = "Data.ControlParameters.PeriodicLimits.PeriodType";
public static final String PATH_PERIOD_ALIGNMENT = "Data.ControlParameters.PeriodicLimits.PeriodAlignment";

// VRP Authorization flow
public static final String CONTROL_PARAMETERS_MISSING_ERROR = "Missing mandatory parameter the ControlParameters";
public static final String DATA_OBJECT_MISSING_ERROR = "Missing mandatory parameter the Data";
public static final String MAX_AMOUNT_NOT_JSON_OBJECT_ERROR = "Parameter Maximum Individual Amount is" +
"not of type JSONObject";
public static final String NOT_JSON_ARRAY_ERROR = "Parameter PeriodicLimits is not a JSON Array";
public static final String PERIOD_ALIGNMENT_NOT_STRING_ERROR = "Parameter Period Alignment is not a String";
public static final String PERIOD_TYPE_NOT_STRING_ERROR = "Parameter Period Type is not a String";
public static final String NOT_STRING_ERROR = "Parameter amount or currency is not a String";
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@
* under the License.
*/


package com.wso2.openbanking.accelerator.consent.extensions.authorize.impl;

import com.wso2.openbanking.accelerator.common.exception.ConsentManagementException;
import com.wso2.openbanking.accelerator.consent.extensions.authorize.impl.handler.retrieval.ConsentRetrievalHandler;
import com.wso2.openbanking.accelerator.consent.extensions.authorize.model.ConsentData;
import com.wso2.openbanking.accelerator.consent.extensions.authorize.model.ConsentRetrievalStep;
import com.wso2.openbanking.accelerator.consent.extensions.authorize.utils.ConsentRetrievalUtil;
import com.wso2.openbanking.accelerator.consent.extensions.common.ConsentException;
import com.wso2.openbanking.accelerator.consent.extensions.common.ConsentExtensionConstants;
import com.wso2.openbanking.accelerator.consent.extensions.common.ConsentServiceUtil;
import com.wso2.openbanking.accelerator.consent.extensions.common.ResponseStatus;
import com.wso2.openbanking.accelerator.consent.extensions.common.factory.AcceleratorConsentExtensionFactory;
import com.wso2.openbanking.accelerator.consent.extensions.internal.ConsentExtensionsDataHolder;
import com.wso2.openbanking.accelerator.consent.mgt.dao.models.AuthorizationResource;
import com.wso2.openbanking.accelerator.consent.mgt.dao.models.ConsentResource;
Expand All @@ -44,7 +41,6 @@
public class DefaultConsentRetrievalStep implements ConsentRetrievalStep {

private static final Log log = LogFactory.getLog(DefaultConsentRetrievalStep.class);
ConsentRetrievalHandler consentRetrievalHandler;

@Override
public void execute(ConsentData consentData, JSONObject jsonObject) throws ConsentException {
Expand All @@ -66,7 +62,7 @@ public void execute(ConsentData consentData, JSONObject jsonObject) throws Conse
"executed successfully before default consent persist step");
}
String requestObject = ConsentRetrievalUtil.extractRequestObject(consentData.getSpQueryParams());
consentId = ConsentRetrievalUtil.extractConsentId(requestObject);
consentId = ConsentRetrievalUtil.extractConsentId(requestObject);
consentData.setConsentId(consentId);
}
ConsentResource consentResource = consentCoreService.getConsent(consentId, false);
Expand Down Expand Up @@ -101,7 +97,6 @@ public void execute(ConsentData consentData, JSONObject jsonObject) throws Conse
JSONArray accountsJSON = ConsentRetrievalUtil.appendDummyAccountID();
jsonObject.appendField(ConsentExtensionConstants.ACCOUNTS, accountsJSON);


} catch (ConsentException e) {
JSONObject errorObj = (JSONObject) e.getPayload();
JSONArray errorList = (JSONArray) errorObj.get("Errors");
Expand All @@ -113,18 +108,16 @@ public void execute(ConsentData consentData, JSONObject jsonObject) throws Conse
"Exception occurred while getting consent data");
}
}

/**
* Method to retrieve consent related data from the initiation payload.
* @param consentResource
* @return
* @return consent
* @throws ConsentException
*/
public JSONArray getConsentDataSet(ConsentResource consentResource)
throws ConsentException {
public JSONArray getConsentDataSet(ConsentResource consentResource) {

String type = consentResource.getConsentType();
consentRetrievalHandler = AcceleratorConsentExtensionFactory.getConsentRetrievalHandler(type);
return consentRetrievalHandler.getConsentDataSet(consentResource);
kalpanakanagasabai marked this conversation as resolved.
Show resolved Hide resolved
return ConsentRetrievalUtil.getConsentData(consentResource);
}

}

This file was deleted.

This file was deleted.

Loading
Loading