Skip to content

Commit

Permalink
refactor/Changed name of authenticationRequiredMessage to userAuthent…
Browse files Browse the repository at this point in the history
…icationMessage
  • Loading branch information
simonredfern committed Jan 6, 2025
1 parent 234a893 commit 6ae6be3
Show file tree
Hide file tree
Showing 14 changed files with 429 additions and 427 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object APIMethods_UKOpenBanking_200 extends RestHelper{
|Reads a list of bank accounts, with balances where required.
|It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system.
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This call is work in progress - Experimental!
|""",
Expand Down Expand Up @@ -73,7 +73,7 @@ object APIMethods_UKOpenBanking_200 extends RestHelper{
"UK Open Banking: Get Account Transactions",
s"""
|Reads account data from a given account addressed by “account-id”.
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This call is work in progress - Experimental!
|""",
Expand Down Expand Up @@ -123,7 +123,7 @@ object APIMethods_UKOpenBanking_200 extends RestHelper{
|Reads a bank account, with balances where required.
|It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system.
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This call is work in progress - Experimental!
|""",
Expand Down Expand Up @@ -161,7 +161,7 @@ object APIMethods_UKOpenBanking_200 extends RestHelper{
|An AISP may retrieve the account balance information resource for a specific AccountId
|(which is retrieved in the call to GET /accounts).
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This call is work in progress - Experimental!
|""",
Expand Down Expand Up @@ -206,7 +206,7 @@ object APIMethods_UKOpenBanking_200 extends RestHelper{
|an AISP may optionally retrieve the account information resources in bulk.
|This will retrieve the resources for all authorised accounts linked to the account-request.
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This call is work in progress - Experimental!
|""",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object APIMethods_BERLIN_GROUP_1 extends RestHelper{
|Reads a list of bank accounts, with balances where required.
|It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system.
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This endpoint is work in progress. Experimental!
|""",
Expand Down Expand Up @@ -98,7 +98,7 @@ object APIMethods_BERLIN_GROUP_1 extends RestHelper{
s"""
|Reads account data from a given account addressed by “account-id”.
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This endpoint is work in progress. Experimental!
|""",
Expand Down Expand Up @@ -138,7 +138,7 @@ object APIMethods_BERLIN_GROUP_1 extends RestHelper{
"Berlin Group Read Account Transactions",
s"""
|Reads account data from a given account addressed by “account-id”.
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|This endpoint is work in progress. Experimental!
|""",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package code.api.dynamic.entity.helper

import code.api.util.APIUtil.{EmptyBody, ResourceDoc, authenticationRequiredMessage}
import code.api.util.APIUtil.{EmptyBody, ResourceDoc, userAuthenticationMessage}
import code.api.util.ApiRole.getOrCreateDynamicApiRole
import code.api.util.ApiTag._
import code.api.util.ErrorMessages.{InvalidJsonFormat, UnknownError, UserHasMissingRoles, UserNotLoggedIn}
Expand Down Expand Up @@ -176,7 +176,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|Can do filter on the fields
|e.g: /${entityName}?name=James%20Brown&number=123.456&number=11.11
Expand Down Expand Up @@ -208,7 +208,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|""".stripMargin,
EmptyBody,
dynamicEntityInfo.getSingleExample,
Expand Down Expand Up @@ -236,7 +236,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|""",
dynamicEntityInfo.getSingleExampleWithoutId,
Expand Down Expand Up @@ -266,7 +266,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|""",
dynamicEntityInfo.getSingleExampleWithoutId,
Expand All @@ -293,7 +293,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|""",
dynamicEntityInfo.getSingleExampleWithoutId,
Expand Down Expand Up @@ -324,7 +324,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|Can do filter on the fields
|e.g: /${entityName}?name=James%20Brown&number=123.456&number=11.11
Expand Down Expand Up @@ -354,7 +354,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|""".stripMargin,
EmptyBody,
dynamicEntityInfo.getSingleExample,
Expand All @@ -380,7 +380,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|""",
dynamicEntityInfo.getSingleExampleWithoutId,
Expand Down Expand Up @@ -408,7 +408,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|""",
dynamicEntityInfo.getSingleExampleWithoutId,
Expand All @@ -434,7 +434,7 @@ object DynamicEntityHelper {
|
|${methodRoutingExample(entityName)}
|
|${authenticationRequiredMessage(true)}
|${userAuthenticationMessage(true)}
|
|""",
dynamicEntityInfo.getSingleExampleWithoutId,
Expand Down
12 changes: 6 additions & 6 deletions obp-api/src/main/scala/code/api/util/APIUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1569,8 +1569,8 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
) {
// this code block will be merged to constructor.
{
val authenticationIsRequired = authenticationRequiredMessage(true)
val authenticationIsOptional = authenticationRequiredMessage(false)
val authenticationIsRequired = userAuthenticationMessage(true)
val authenticationIsOptional = userAuthenticationMessage(false)

val rolesIsEmpty = roles.map(_.isEmpty).getOrElse(true)
// if required roles not empty, add UserHasMissingRoles to errorResponseBodies
Expand Down Expand Up @@ -2158,10 +2158,10 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{

}

def authenticationRequiredMessage(authRequired: Boolean) : String =
authRequired match {
case true => "Authentication is Mandatory"
case false => "Authentication is Optional"
def userAuthenticationMessage(userAuthRequired: Boolean) : String =
userAuthRequired match {
case true => "User Authentication is Mandatory"
case false => "User Authentication is Optional"
}


Expand Down
Loading

0 comments on commit 6ae6be3

Please sign in to comment.