From 0a5e75bd1c3e36855418319f54b8b1a25c1a4ea2 Mon Sep 17 00:00:00 2001 From: hongwei Date: Mon, 2 Mar 2026 13:51:07 +0100 Subject: [PATCH 1/3] docfix/remove emojis --- flushall_fast_build_and_run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flushall_fast_build_and_run.sh b/flushall_fast_build_and_run.sh index 89a83658bd..0ad7da5ed6 100755 --- a/flushall_fast_build_and_run.sh +++ b/flushall_fast_build_and_run.sh @@ -207,7 +207,7 @@ if [ $BUILD_EXIT_CODE -ne 0 ] && [ -z "$DO_CLEAN" ]; then # Check if error is related to missing classes/packages (common cache issue) if grep -q "is not a member of package\|cannot find symbol\|not found: type\|not found: value" fast_build.log; then - echo "🔄 Detected incremental compilation cache issue. Retrying with clean build..." + echo "Detected incremental compilation cache issue. Retrying with clean build..." echo "" # Backup the failed incremental build log @@ -284,7 +284,7 @@ fi # Final error check if [ $BUILD_EXIT_CODE -ne 0 ]; then echo "" - echo "❌ Build failed! Please check fast_build.log for details." + echo "Build failed! Please check fast_build.log for details." echo "Last 30 lines of build log:" tail -30 fast_build.log exit 1 From 631081fb767cc7d7fe8d8845349f71fdc6a58f67 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 3 Mar 2026 14:31:31 +0100 Subject: [PATCH 2/3] refactor/add provider parameter to getResourceUserId with default value for backward compatibility --- obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala | 2 +- obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala b/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala index e41be365e3..e63125facf 100644 --- a/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala +++ b/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala @@ -8719,7 +8719,7 @@ trait APIMethods600 { } // Validate credentials using the existing AuthUser mechanism resourceUserIdBox = //we first try to get the userId from local, if not find, we try to get it from external - code.model.dataAccess.AuthUser.getResourceUserId(postedData.username, postedData.password) + code.model.dataAccess.AuthUser.getResourceUserId(postedData.username, postedData.password, postedData.provider) .or(code.model.dataAccess.AuthUser.externalUserHelper(postedData.username, postedData.password).map(_.user.get)) // Check if account is locked _ <- Helper.booleanToFuture(UsernameHasBeenLocked, 401, callContext) { diff --git a/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala b/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala index ee811e9ff1..799769faf1 100644 --- a/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala +++ b/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala @@ -783,8 +783,8 @@ import net.liftweb.util.Helpers._ - def getResourceUserId(username: String, password: String): Box[Long] = { - findAuthUserByUsernameLocallyLegacy(username) match { + def getResourceUserId(username: String, password: String, provider: String = Constant.localIdentityProvider): Box[Long] = { + findAuthUserByUsernameAndProvider(username, provider) match { // We have a user from the local provider. case Full(user) if (user.getProvider() == Constant.localIdentityProvider) => if ( From 54b9e835873cdde8ea82a6e63502a62318862c0a Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 3 Mar 2026 15:12:14 +0100 Subject: [PATCH 3/3] test/remove the `empty provider` case from VerifyUserCredentialsTest --- .../v6_0_0/VerifyUserCredentialsTest.scala | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/obp-api/src/test/scala/code/api/v6_0_0/VerifyUserCredentialsTest.scala b/obp-api/src/test/scala/code/api/v6_0_0/VerifyUserCredentialsTest.scala index 3d712b9244..2b77b2fb73 100644 --- a/obp-api/src/test/scala/code/api/v6_0_0/VerifyUserCredentialsTest.scala +++ b/obp-api/src/test/scala/code/api/v6_0_0/VerifyUserCredentialsTest.scala @@ -178,31 +178,6 @@ class VerifyUserCredentialsTest extends V600ServerSetup with DefaultUsers { response.body.extract[ErrorMessage].message should include("OBP-20004") } - scenario("Successfully verify with empty provider (provider check is optional)", ApiEndpoint, VersionOfApi) { - // Add the required entitlement - val addedEntitlement = Entitlement.entitlement.vend.addEntitlement("", resourceUser1.userId, CanVerifyUserCredentials.toString) - - When("We verify valid credentials with empty provider") - val postJson = Map( - "username" -> testUsername, - "password" -> testPassword, - "provider" -> "" - ) - val request = (v6_0_0_Request / "users" / "verify-credentials").POST <@ (user1) - val response = try { - makePostRequest(request, write(postJson)) - } finally { - // Clean up entitlement - Entitlement.entitlement.vend.deleteEntitlement(addedEntitlement) - } - - Then("We should get a 200 (provider check is skipped when empty)") - response.code should equal(200) - - And("The response should contain user details") - (response.body \ "username").extract[String] should equal(testUsername) - } - scenario("Fail to verify with mismatched provider", ApiEndpoint, VersionOfApi) { // Add the required entitlement val addedEntitlement = Entitlement.entitlement.vend.addEntitlement("", resourceUser1.userId, CanVerifyUserCredentials.toString)