Revert "feature/Tweak function addScopesToConsumer to accept and Berlin Group roles"

This reverts commit 39ba747716.
This commit is contained in:
Marko Milić 2025-01-14 11:13:20 +01:00
parent 38ed185012
commit ac446bccd0
2 changed files with 1 additions and 13 deletions

View File

@ -528,8 +528,7 @@ object OAuth2Login extends RestHelper with MdcLoggable {
val openBankRoles: List[String] =
// Sync Keycloak's roles
(json \ "resource_access" \ resourceAccessName \ "roles").extract[List[String]]
// Keep only the roles OBP-API can recognise
.filter(role => tryo(ApiRole.valueOf(role)).isDefined || ApiRole.isBerlinGroupRole(role))
.filter(role => tryo(ApiRole.valueOf(role)).isDefined) // Keep only the roles OBP-API can recognise
val scopes = Scope.scope.vend.getScopesByConsumerId(consumerPrimaryKey.toString).getOrElse(Nil)
val databaseState = scopes.map(_.roleName)
// Already exist at DB

View File

@ -1,6 +1,5 @@
package code.api.util
import code.api.Constant.{SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID}
import code.api.dynamic.endpoint.helper.DynamicEndpointHelper
import java.util.concurrent.ConcurrentHashMap
@ -1059,16 +1058,6 @@ object ApiRole extends MdcLoggable{
dynamicRoles ::: roles.map(_.toString)
}
def isBerlinGroupRole(value: String): Boolean = {
value match {
case SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID => true
case SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID => true
case SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID => true
case SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID => true
case _ => false
}
}
}
object Util {