Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into vrp-auth-flow-persistence-flow

# Conflicts:
#	open-banking-accelerator/components/consent-management/com.wso2.openbanking.accelerator.consent.extensions/src/main/java/com/wso2/openbanking/accelerator/consent/extensions/authorize/impl/handler/persist/AccountConsentPersistenceHandler.java
#	open-banking-accelerator/components/consent-management/com.wso2.openbanking.accelerator.consent.extensions/src/main/java/com/wso2/openbanking/accelerator/consent/extensions/authorize/impl/handler/persist/CofConsentPersistenceHandler.java
#	open-banking-accelerator/components/consent-management/com.wso2.openbanking.accelerator.consent.extensions/src/main/java/com/wso2/openbanking/accelerator/consent/extensions/authorize/impl/handler/persist/ConsentPersistenceHandler.java
#	open-banking-accelerator/components/consent-management/com.wso2.openbanking.accelerator.consent.extensions/src/main/java/com/wso2/openbanking/accelerator/consent/extensions/authorize/impl/handler/persist/PaymentConsentPersistenceHandler.java
  • Loading branch information
kalpanakanagasabai committed May 3, 2024
2 parents e6c1916 + e0d9b6d commit 48eb1b8
Show file tree
Hide file tree
Showing 91 changed files with 948 additions and 611 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>open-banking-accelerator</artifactId>
<groupId>com.wso2.openbanking.accelerator</groupId>
<version>3.2.0-SNAPSHOT</version>
<version>3.2.4-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@
~ under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>open-banking-accelerator</artifactId>
<groupId>com.wso2.openbanking.accelerator</groupId>
<version>3.2.0-SNAPSHOT</version>
<version>3.2.4-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
/**
* Abstract cache manager for Open Banking.
*
* @param <K>
* @param <V>
* @param <K> Extended Cache Key
* @param <V> Cache Value
*/
public abstract class OpenBankingBaseCache<K extends OpenBankingBaseCacheKey, V> {

Expand All @@ -54,7 +54,7 @@ public interface OnDemandRetriever {
/**
* Initialize With unique cache name.
*
* @param cacheName
* @param cacheName unique cache name.
*/
public OpenBankingBaseCache(String cacheName) {

Expand All @@ -68,10 +68,10 @@ public OpenBankingBaseCache(String cacheName) {
/**
* Get from cache or invoke ondemand retriever and store.
*
* @param key
* @param onDemandRetriever
* @return
* @throws OpenBankingException
* @param key cache key.
* @param onDemandRetriever on demand retriever.
* @return cached object.
* @throws OpenBankingException if an error occurs while retrieving the object
*/
public V getFromCacheOrRetrieve(K key, OnDemandRetriever onDemandRetriever) throws OpenBankingException {

Expand Down Expand Up @@ -132,8 +132,8 @@ public V getFromCache(K key) {
/**
* Add Object to cache.
*
* @param key
* @param value
* @param key cache key.
* @param value cache value.
*/
public void addToCache(K key, V value) {

Expand All @@ -149,7 +149,7 @@ public void addToCache(K key, V value) {
/**
* Remove Object from Cache.
*
* @param key
* @param key cache key.
*/
public void removeFromCache(K key) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static OpenBankingConfigParser getInstance() {
*
* @param filePath Custom file path
* @return OpenBankingConfigParser object
* @Deprecated use OpenBankingConfigParser.getInstance()
* &#064;Deprecated use OpenBankingConfigParser.getInstance()
*/
@Deprecated
public static OpenBankingConfigParser getInstance(String filePath) {
Expand Down Expand Up @@ -785,7 +785,7 @@ public int getConnectionVerificationTimeout() {

/**
* Returns the retention datasource name configured in open-banking.xml.
* @return
* @return retention datasource name or empty string if nothing is configured
*/
public String getRetentionDataSourceName() {

Expand Down Expand Up @@ -1142,7 +1142,7 @@ public String getOBIdnRetrieverSandboxCertificateKid() {
/**
* JWKS Retriever Size Limit for JWS Signature Handling.
*
* @return
* @return JWKS Retriever Size Limit
*/
public String getJwksRetrieverSizeLimit() {

Expand All @@ -1153,7 +1153,7 @@ public String getJwksRetrieverSizeLimit() {
/**
* JWKS Retriever Connection Timeout for JWS Signature Handling.
*
* @return
* @return JWKS Retriever Connection Timeout
*/
public String getJwksRetrieverConnectionTimeout() {

Expand All @@ -1164,7 +1164,7 @@ public String getJwksRetrieverConnectionTimeout() {
/**
* JWKS Retriever Read Timeout for JWS Signature Handling.
*
* @return
* @return JWKS Retriever Read Timeout
*/
public String getJwksRetrieverReadTimeout() {

Expand Down Expand Up @@ -1199,7 +1199,7 @@ public boolean isJwsResponseSigningEnabled() {
/**
* Jws Request Signing allowed algorithms.
*
* @return
* @return Jws Request Signing allowed algorithms
*/
public List<String> getJwsRequestSigningAlgorithms() {

Expand All @@ -1218,7 +1218,7 @@ public List<String> getJwsRequestSigningAlgorithms() {
/**
* Jws Response Signing allowed algorithm.
*
* @return
* @return Jws Response Signing allowed algorithm
*/
public String getJwsResponseSigningAlgorithm() {

Expand Down Expand Up @@ -1457,4 +1457,23 @@ public String getFederatedIDPName() {
((String) getConfigElementFromKey(OpenBankingConstants.PSU_FEDERATED_IDP_NAME)).trim();
}

/**
* Method to get the value Idempotency enable configuration.
* @return Whether Idempotency is enabled or not
*/
public boolean isIdempotencyValidationEnabled() {
return getConfigElementFromKey(OpenBankingConstants.IDEMPOTENCY_IS_ENABLED) != null &&
Boolean.parseBoolean(((String)
getConfigElementFromKey(OpenBankingConstants.IDEMPOTENCY_IS_ENABLED)).trim());
}

/**
* Method to get the value Idempotency allowed time configuration.
* @return Idempotency allowed time
*/
public String getIdempotencyAllowedTime() {
return getConfigElementFromKey(OpenBankingConstants.IDEMPOTENCY_ALLOWED_TIME) == null ? "1440" :
(String) getConfigElementFromKey(OpenBankingConstants.IDEMPOTENCY_ALLOWED_TIME);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,6 @@ public class OpenBankingConstants {
public static final String QUERY = "query";
public static final String IS_PSU_FEDERATED = "PSUFederatedAuthentication.Enabled";
public static final String PSU_FEDERATED_IDP_NAME = "PSUFederatedAuthentication.IDPName";
public static final String IDEMPOTENCY_IS_ENABLED = "Consent.Idempotency.Enabled";
public static final String IDEMPOTENCY_ALLOWED_TIME = "Consent.Idempotency.AllowedTimeDuration";
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ public class ApplicationIdentityService {
* Get JWKSet for application.
* First checks to get from cache, else retrieve the JWKSet from the URL by calling
* a method in JWKRetriever
* @param applicationName
* @param jwksUrl
* @param useCache
* @param applicationName Application Name
* @param jwksUrl URL of the JWKSet
* @param useCache Use cache or not
* @return JWKSet
* @throws OpenBankingException if an error occurs while retrieving the JWKSet
*/
public JWKSet getPublicJWKSet(String applicationName, URL jwksUrl,
boolean useCache) throws OpenBankingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

/**
* Cache definition to store objects in open banking iam component implementations.
* @param <K>
* @param <V>
* @param <K> Extended Cache key
* @param <V> Cache value
*/
public class OpenBankingIdentityBaseCache<K extends OpenBankingBaseCacheKey, V> extends OpenBankingBaseCache<K, V> {

Expand All @@ -37,6 +37,7 @@ public class OpenBankingIdentityBaseCache<K extends OpenBankingBaseCacheKey, V>

/**
* Initialize with unique cache name.
* @param cacheName Unique cache name
*/
public OpenBankingIdentityBaseCache(String cacheName) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public JWKRetriever getInstance() {
/**
* Get JWK Set from remote resource retriever.
*
* @param jwksURL
* @return
* @throws IOException
* @param jwksURL jwksURL in URL format
* @return JWKSet
* @throws OpenBankingException if an error occurs while retrieving resource
*/
public JWKSet updateJWKSetFromURL(URL jwksURL) throws OpenBankingException {

Expand All @@ -105,7 +105,7 @@ public JWKSet updateJWKSetFromURL(URL jwksURL) throws OpenBankingException {
* @param jwksURL jwksURL in URL format
* @param applicationName application name as a string
* @return jwkSet
* @throws OpenBankingException
* @throws OpenBankingException if an error occurs while getting JWK set
*/
public JWKSet getJWKSet(URL jwksURL , String applicationName) throws OpenBankingException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static Certificate getCertificate(String alias) throws KeyStoreException
* Returns Signing certificate alias at Production environment.
* @param certificateType Signing
* @return String Certificate alias
* @throws OpenBankingException
* @throws OpenBankingException when there is an exception while retrieving the alias
*/
public static Optional<String> getCertAlias(IdentityConstants.CertificateType certificateType)
throws OpenBankingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class CommonServiceProviderRetriever {
* @param clientId ClientId of the application
* @param property Property of the application
* @return the property value from SP metadata
* @throws OpenBankingException
* @throws OpenBankingException if an error occurs while retrieving the property
*/
@Generated(message = "Excluding from code coverage since it requires a service call")
public String getAppPropertyFromSPMetaData(String clientId, String property) throws OpenBankingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class AnalyticsLogsUtils {
* @param dataStream Name of the data stream to which the data belongs
* @param dataVersion Version of the data stream to which the data belongs
* @param analyticsData Data which belongs to the given data stream that needs to be logged via the given logger
* @throws OpenBankingException if an error occurs while processing the analytics data
*/
public static void addAnalyticsLogs(String logFile, String dataStream, String dataVersion, Map<String,
Object> analyticsData) throws OpenBankingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public class CertificateUtils {
/**
* Parse the certificate content.
*
* @param content the content to be pased
* @throws OpenBankingException
* @param content the content to be passed
* @return the parsed certificate
* @throws OpenBankingException if an error occurs while parsing the certificate
*/
public static X509Certificate parseCertificate(String content) throws OpenBankingException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class JWTUtils {
* @param jwtToken jwt sent by the tpp
* @param jwtPart expected jwt part (header, body)
* @return json object containing requested jwt part
* @throws ParseException if an error occurs while parsing the jwt
*/
public static JSONObject decodeRequestJWT(String jwtToken, String jwtPart) throws ParseException {

Expand All @@ -77,6 +78,10 @@ public static JSONObject decodeRequestJWT(String jwtToken, String jwtPart) throw
* @param jwksUri endpoint displaying the key set for the signing certificates
* @param algorithm the signing algorithm for jwt
* @return true if signature is valid
* @throws ParseException if an error occurs while parsing the jwt
* @throws BadJOSEException if the jwt is invalid
* @throws JOSEException if an error occurs while processing the jwt
* @throws MalformedURLException if an error occurs while creating the URL object
*/
@Generated(message = "Excluding from code coverage since can not call this method due to external https call")
public static boolean validateJWTSignature(String jwtString, String jwksUri, String algorithm)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static Object getClassInstanceFromFQN(String classpath) {
*
* @param softwareStatement software statement (jwt) extracted from request payload
* @return software_environment
* @throws ParseException
* @throws ParseException if an error occurs while parsing the software statement
*/
public static String getSoftwareEnvironmentFromSSA(String softwareStatement) throws ParseException {

Expand Down Expand Up @@ -105,8 +105,9 @@ public static boolean isPublishableDisputeData(int statusCode) {
/**
* Method to reduce string length.
*
* @param input and maxLength for dispute data
* @return String
* @param input Input for dispute data
* @param maxLength Max length for dispute data
* @return String with reduced length
*/
public static String reduceStringLength(String input, int maxLength) {
if (StringUtils.isEmpty(input) || input.length() <= maxLength) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ public class SPQueryExecutorUtil {
/**
* Executes the given query in SP.
*
* @param appName Name of the siddhi app.
* @param query Name of the query
* @param appName Name of the siddhi app.
* @param query Name of the query
* @param spUserName Username for SP
* @param spPassword Password for SP
* @param spApiHost Hostname of the SP
* @return JSON object with result
* @throws IOException IO Exception.
* @throws ParseException Parse Exception.
* @throws IOException IO Exception.
* @throws ParseException Parse Exception.
* @throws OpenBankingException OpenBanking Exception.
*/
public static JSONObject executeQueryOnStreamProcessor(String appName, String query, String spUserName,
String spPassword, String spApiHost)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ServiceProviderUtils {
* Get Tenant Domain String for the client id.
* @param clientId the client id of the application
* @return tenant domain of the client
* @throws OpenBankingException
* @throws OpenBankingException if an error occurs while retrieving the tenant domain
*/
@Generated(message = "Ignoring because OAuth2Util cannot be mocked with no constructors")
public static String getSpTenantDomain(String clientId) throws OpenBankingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public static OpenBankingValidator getInstance() {
/**
* Check for violations on request object. Stop at the first violation and return error.
* Validations are executed based on annotation in model of the class.
*
* @param object Object to be validated
* @return Error message if there is a violation, null otherwise
*/
public String getFirstViolation(Object object) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@
~ under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>com.wso2.openbanking.accelerator.data.publisher</artifactId>
<groupId>com.wso2.openbanking.accelerator</groupId>
<version>3.2.0-SNAPSHOT</version>
<version>3.2.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>open-banking-accelerator</artifactId>
<groupId>com.wso2.openbanking.accelerator</groupId>
<version>3.2.0-SNAPSHOT</version>
<version>3.2.4-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>open-banking-accelerator</artifactId>
<groupId>com.wso2.openbanking.accelerator</groupId>
<version>3.2.0-SNAPSHOT</version>
<version>3.2.4-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Loading

0 comments on commit 48eb1b8

Please sign in to comment.