Skip to content

Commit

Permalink
handling cds common api with elected resources
Browse files Browse the repository at this point in the history
  • Loading branch information
aka4rKO committed Oct 18, 2024
1 parent 4993fe3 commit c334acc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public List<OpenBankingGatewayExecutor> getExecutorsForRequest(OBAPIRequestConte
requestContext.addContextProperty(RequestRouterConstants.API_TYPE_CUSTOM_PROP,
RequestRouterConstants.API_TYPE_CDS_UNAUTHENTICATED);
return this.getExecutorMap().get(RequestRouterConstants.CDS_UNAUTHENTICATED);
} else if (GatewayConstants.COMMON_ENDPOINTS.contains(requestContext.getMsgInfo()
.getElectedResource())) {
requestContext.addContextProperty(RequestRouterConstants.API_TYPE_CUSTOM_PROP,
RequestRouterConstants.API_TYPE_COMMON);
return this.getExecutorMap().get(RequestRouterConstants.CDS_COMMON);
} else if (RequestRouterConstants.API_TYPE_CONSENT
.equals(requestContext.getOpenAPI().getExtensions().get(RequestRouterConstants.API_TYPE_CUSTOM_PROP))) {
// Add support for consent management portal APIs
Expand All @@ -67,10 +72,6 @@ public List<OpenBankingGatewayExecutor> getExecutorsForRequest(OBAPIRequestConte
requestContext.addContextProperty(RequestRouterConstants.API_TYPE_CUSTOM_PROP,
RequestRouterConstants.API_TYPE_CDS);
return this.getExecutorMap().get(RequestRouterConstants.CDS);
} else if (RequestRouterConstants.COMMON_API_NAME.equals(requestContext.getOpenAPI().getInfo().getTitle())) {
requestContext.addContextProperty(RequestRouterConstants.API_TYPE_CUSTOM_PROP,
RequestRouterConstants.API_TYPE_COMMON);
return this.getExecutorMap().get(RequestRouterConstants.CDS_COMMON);
} else if (RequestRouterConstants.ADMIN_API_NAME.equals(requestContext.getOpenAPI().getInfo().getTitle())) {
requestContext.addContextProperty(RequestRouterConstants.API_TYPE_CUSTOM_PROP,
RequestRouterConstants.API_TYPE_ADMIN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ private GatewayConstants() {
public static final String DISCOVERY_STATUS_ENDPOINT = "/discovery/status";
public static final String PRODUCTS_ENDPOINT = "/banking/products";
public static final String PRODUCT_DETAILS_ENDPOINT = "/banking/products/{productId}";
public static final String COMMON_CUSTOMER_ENDPOINT = "/common/customer";
public static final String COMMON_CUSTOMER_DETAIL_ENDPOINT = "/common/customer/detail";

public static final List<String> INFOSEC_ENDPOINTS = Collections.unmodifiableList(Arrays.asList(AUTHORIZE_ENDPOINT,
TOKEN_ENDPOINT, USERINFO_ENDPOINT, PAR_ENDPOINT, INTROSPECTION_ENDPOINT, JWKS_ENDPOINT, REVOKE_ENDPOINT,
Expand All @@ -115,6 +117,9 @@ private GatewayConstants() {
public static final List<String> UNAUTHENTICATED_ENDPOINTS = Collections.unmodifiableList(Arrays.asList(
PRODUCTS_ENDPOINT, PRODUCT_DETAILS_ENDPOINT, DISCOVERY_STATUS_ENDPOINT, DISCOVERY_OUTAGES_ENDPOINT));

public static final List<String> COMMON_ENDPOINTS = Collections.unmodifiableList(Arrays.asList(
COMMON_CUSTOMER_ENDPOINT, COMMON_CUSTOMER_DETAIL_ENDPOINT));

public static final String UNKNOWN = "Unknown";
public static final String CLIENT_USER_AGENT = "User-Agent";
public static final String USER_NAME = "api.ut.userName";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,26 +535,17 @@ priority = 1000
[[open_banking.gateway.openbanking_gateway_executors.type]]
name = "CDSUnauthenticated"
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "com.wso2.openbanking.accelerator.gateway.executor.impl.mtls.cert.validation.executor.CertRevocationValidationExecutor"
priority = 1
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "com.wso2.openbanking.accelerator.gateway.executor.impl.api.resource.access.validation.APIResourceAccessValidationExecutor"
priority = 2
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "org.wso2.openbanking.cds.gateway.executors.idpermanence.IDPermanenceExecutor"
priority = 3
priority = 1
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "org.wso2.openbanking.cds.gateway.executors.header.validation.CDSHeaderValidationExecutor"
priority = 4
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "com.wso2.openbanking.accelerator.gateway.executor.impl.consent.ConsentEnforcementExecutor"
priority = 5
priority = 2
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "com.wso2.openbanking.accelerator.gateway.executor.impl.common.reporting.data.executor.CommonReportingDataExecutor"
priority = 6
priority = 3
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "org.wso2.openbanking.cds.gateway.executors.reporting.CDSCommonDataReportingExecutor"
priority = 7
priority = 4
[[open_banking.gateway.openbanking_gateway_executors.type.executors]]
name = "org.wso2.openbanking.cds.gateway.executors.error.handler.CDSErrorHandler"
priority = 1000
Expand Down

0 comments on commit c334acc

Please sign in to comment.