Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hasithakn committed Nov 9, 2023
1 parent 4558f2d commit 62bb8c5
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@
{% else %}
<PropertyValueForSandbox>sandbox</PropertyValueForSandbox>
{% endif %}
{% if open_banking.dcr.registration.software_environment_identification.ssa_property_value_for_production is defined %}
<PropertyValueForProduction>{{open_banking.dcr.registration.software_environment_identification.ssa_property_value_for_production}}</PropertyValueForProduction>
{% else %}
<PropertyValueForProduction>production</PropertyValueForProduction>
{% endif %}
</SoftwareEnvironmentIdentification>
</RegistrationRequestParams>
</DCR>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ roles = "AISP"

[open_banking.dcr.registration.software_environment_identification]
ssa_property_name = "software_environment"
# If both below values doesnt match, Then software_environment is default to production.
ssa_property_value_for_sandbox = "sandbox"
ssa_property_value_for_production = "production"

#============executors=========================
[[open_banking.gateway.openbanking_gateway_executors.type]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ roles = "AISP"

[open_banking.dcr.registration.software_environment_identification]
ssa_property_name = "software_environment"
# If both below values doesnt match, Then software_environment is default to production.
ssa_property_value_for_sandbox = "sandbox"
ssa_property_value_for_production = "production"

#============executors=========================
[[open_banking.gateway.openbanking_gateway_executors.type]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ roles = "AISP"

[open_banking.dcr.registration.software_environment_identification]
ssa_property_name = "software_environment"
# If both below values doesnt match, Then software_environment is default to production.
ssa_property_value_for_sandbox = "sandbox"
ssa_property_value_for_production = "production"

#============executors=========================
[[open_banking.gateway.openbanking_gateway_executors.type]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@
{% else %}
<PropertyValueForSandbox>sandbox</PropertyValueForSandbox>
{% endif %}
{% if open_banking.dcr.registration.software_environment_identification.ssa_property_value_for_production is defined %}
<PropertyValueForProduction>{{open_banking.dcr.registration.software_environment_identification.ssa_property_value_for_production}}</PropertyValueForProduction>
{% else %}
<PropertyValueForProduction>production</PropertyValueForProduction>
{% endif %}
</SoftwareEnvironmentIdentification>
<GrantTypes>
{% if open_banking.dcr.registration.grant_types.required is defined %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ name = "OpenBanking Ltd"

[open_banking.dcr.registration.software_environment_identification]
ssa_property_name = "software_environment"
# If both below values doesnt match, Then software_environment is default to production.
ssa_property_value_for_sandbox = "sandbox"
ssa_property_value_for_production = "production"

#Signature algorithm types that are allowed
#[[open_banking.signature_validation.allowed_algorithms]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ name = "OpenBanking Ltd"

[open_banking.dcr.registration.software_environment_identification]
ssa_property_name = "software_environment"
# If both below values doesnt match, Then software_environment is default to production.
ssa_property_value_for_sandbox = "sandbox"
ssa_property_value_for_production = "production"

#Signature algorithm types that are allowed
#[[open_banking.signature_validation.allowed_algorithms]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ name = "OpenBanking Ltd"

[open_banking.dcr.registration.software_environment_identification]
ssa_property_name = "software_environment"
# If both below values doesnt match, Then software_environment is default to production.
ssa_property_value_for_sandbox = "sandbox"
ssa_property_value_for_production = "production"

#Signature algorithm types that are allowed
#[[open_banking.signature_validation.allowed_algorithms]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,18 @@ public String getSoftwareEnvIdentificationSSAPropertyValueForSandbox() {
OpenBankingConstants.DCR_SOFTWARE_ENV_IDENTIFICATION_VALUE_FOR_SANDBOX);
}

/**
* Method to get software environment identification value for production in SSA.
*
* @return String software environment identification value for production.
*/
public String getSoftwareEnvIdentificationSSAPropertyValueForProduction() {
return getConfigElementFromKey(
OpenBankingConstants.DCR_SOFTWARE_ENV_IDENTIFICATION_VALUE_FOR_PRODUCTION) == null ?
"production" : (String) getConfigElementFromKey(
OpenBankingConstants.DCR_SOFTWARE_ENV_IDENTIFICATION_VALUE_FOR_PRODUCTION);
}

/**
* Get config related for checking whether PSU is a federated user or not.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public class OpenBankingConstants {
"DCR.RegistrationRequestParams.SoftwareEnvironmentIdentification.PropertyName";
public static final String DCR_SOFTWARE_ENV_IDENTIFICATION_VALUE_FOR_SANDBOX =
"DCR.RegistrationRequestParams.SoftwareEnvironmentIdentification.PropertyValueForSandbox";
public static final String DCR_SOFTWARE_ENV_IDENTIFICATION_VALUE_FOR_PRODUCTION =
"DCR.RegistrationRequestParams.SoftwareEnvironmentIdentification.PropertyValueForProduction";

public static final String APIM_APPCREATION = "DCR.APIMRESTEndPoints.AppCreation";
public static final String APIM_KEYGENERATION = "DCR.APIMRESTEndPoints.KeyGeneration";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ public static String getSoftwareEnvironmentFromSSA(String softwareStatement) thr
.getSoftwareEnvIdentificationSSAPropertyName();
String sandboxEnvIdentificationValue = OpenBankingConfigParser.getInstance()
.getSoftwareEnvIdentificationSSAPropertyValueForSandbox();
String prodEnvIdentificationValue = OpenBankingConfigParser.getInstance()
.getSoftwareEnvIdentificationSSAPropertyValueForProduction();
String softwareEnvironment = IdentityConstants.PRODUCTION;
// decode software statement and get softwareEnvironment
JSONObject softwareStatementBody = JWTUtils.decodeRequestJWT(softwareStatement, "body");
Object softwareEnvironmentValue = softwareStatementBody.get(sandboxEnvIdentificationPropertyName);
if (softwareEnvironmentValue != null &&
softwareEnvironmentValue.toString().equalsIgnoreCase(sandboxEnvIdentificationValue)) {
softwareEnvironment = IdentityConstants.SANDBOX;
} else if (softwareEnvironmentValue != null &&
softwareEnvironmentValue.toString().equalsIgnoreCase(prodEnvIdentificationValue)) {
softwareEnvironment = IdentityConstants.PRODUCTION;
}
return softwareEnvironment;
}
Expand Down

0 comments on commit 62bb8c5

Please sign in to comment.