diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template
index f9416680e8..8bc5aa02c1 100644
--- a/obp-api/src/main/resources/props/sample.props.template
+++ b/obp-api/src/main/resources/props/sample.props.template
@@ -569,15 +569,16 @@ webui_oauth_1_documentation_url =
# Link to OAuth 2.0 glossary on api explorer
webui_oauth_2_documentation_url =
-# Link to Privacy Policy on signup page
-#webui_signup_form_submit_button_value=
-#webui_signup_form_title_text=Sign Up
-#webui_signup_body_password_repeat_text=Repeat
-#allow_pre_filled_password=true
-#webui_agree_terms_html=
- }
+ // Removed signup-related methods: agreeTermsDiv, legalNoticeDiv, agreePrivacyPolicy
+ // These were only used in signup forms which now redirect to OBP Portal
+ // Signup functionality removed - users are directed to OBP Portal for registration
override def localForm(user: TheUserType, ignorePassword: Boolean, fields: List[FieldPointerType]): NodeSeq = {
@@ -818,18 +713,11 @@ import net.liftweb.util.Helpers._
if field.show_? && (!ignorePassword || !pointer.isPasswordField_?)
form <- field.toForm.toList
} yield {
- if(field.uniqueFieldId.getOrElse("") == "authuser_password") {
-
-
- {form}
-
- } else {
-
-
- {form}
-
-
- }
+
+
+ {form}
+
+
}
}
@@ -1610,67 +1498,8 @@ def restoreSomeSessions(): Unit = {
val usernames: List[String] = this.getResourceUsersByEmail(email).map(_.user.name)
findAll(ByList(this.username, usernames))
}
- def signupSubmitButtonValue() = getWebUiPropsValue("webui_signup_form_submit_button_value", S.?("sign.up"))
-
- //overridden to allow redirect to loginRedirect after signup. This is mostly to allow
- // loginFirst menu items to work if the user doesn't have an account. Without this,
- // if a user tries to access a logged-in only page, and then signs up, they don't get redirected
- // back to the proper page.
- override def signup = {
- val theUser: TheUserType = mutateUserOnSignup(createNewUserInstance())
- val theName = signUpPath.mkString("")
-
- //Check the internal redirect, in case for open redirect issue.
- // variable redir is from loginRedirect, it is set-up in OAuthAuthorisation.scala as following code:
- // val currentUrl = ObpS.uriAndQueryString.getOrElse("/")
- // AuthUser.loginRedirect.set(Full(Helpers.appendParams(currentUrl, List((LogUserOutParam, "false")))))
- val loginRedirectSave = loginRedirect.is
-
- def testSignup() {
- validateSignup(theUser) match {
- case Nil =>
- //here we check loginRedirectSave (different from implementation in super class)
- val redir = loginRedirectSave match {
- case Full(url) =>
- loginRedirect(Empty)
- url
- case _ =>
- //if the register page url (user_mgt/sign_up?after-signup=link-to-customer) contains the parameter
- //after-signup=link-to-customer,then it will redirect to the on boarding customer page.
- ObpS.param("after-signup") match {
- case url if (url.equals("link-to-customer")) =>
- "/add-user-auth-context-update-request"
- case _ =>
- homePage
- }
- }
- if (Helper.isValidInternalRedirectUrl(redir.toString)) {
- actionsAfterSignup(theUser, () => {
- S.redirectTo(redir)
- })
- } else {
- S.error(S.?(ErrorMessages.InvalidInternalRedirectUrl))
- logger.info(ErrorMessages.InvalidInternalRedirectUrl + loginRedirect.get)
- }
- case xs =>
- xs.foreach{
- e => S.error(e.field.uniqueFieldId.openOrThrowException("There is no uniqueFieldId."), e.msg)
- }
- signupFunc(Full(innerSignup _))
- }
- }
- def innerSignup = {
- val bind = "type=submit" #> signupSubmitButton(signupSubmitButtonValue(), testSignup _)
- bind(signupXhtml(theUser))
- }
-
- if(APIUtil.getPropsAsBoolValue("user_invitation.mandatory", false))
- S.redirectTo("/user-invitation-info")
- else
- innerSignup
- }
def scrambleAuthUser(userPrimaryKey: UserPrimaryKey): Box[Boolean] = tryo {
AuthUser.find(By(AuthUser.user, userPrimaryKey.value)) match {
diff --git a/obp-api/src/main/scala/code/model/dataAccess/ResourceUser.scala b/obp-api/src/main/scala/code/model/dataAccess/ResourceUser.scala
index 5b0174c21d..810d1bc6c0 100644
--- a/obp-api/src/main/scala/code/model/dataAccess/ResourceUser.scala
+++ b/obp-api/src/main/scala/code/model/dataAccess/ResourceUser.scala
@@ -139,7 +139,7 @@ object ResourceUser extends ResourceUser with LongKeyedMetaMapper[ResourceUser]{
var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)
val cacheTTL = APIUtil.getPropsAsIntValue("getDistinctProviders.cache.ttl.seconds", 3600)
CacheKeyFromArguments.buildCacheKey {
- Caching.memoizeSyncWithProvider(Some(cacheKey.toString()))(cacheTTL seconds) {
+ Caching.memoizeSyncWithProvider(Some(cacheKey.toString()))(cacheTTL.seconds) {
val sql = "SELECT DISTINCT provider_ FROM resourceuser ORDER BY provider_"
val (_, rows) = DB.runQuery(sql, List())
rows.flatten
diff --git a/obp-api/src/main/scala/code/model/package.scala b/obp-api/src/main/scala/code/model/package.scala
index 2f79aed105..4f2626c131 100644
--- a/obp-api/src/main/scala/code/model/package.scala
+++ b/obp-api/src/main/scala/code/model/package.scala
@@ -1,5 +1,6 @@
package code
+import scala.language.implicitConversions
import code.metadata.comments.Comments
import code.metadata.counterparties.Counterparties
import code.metadata.narrative.Narrative
@@ -16,6 +17,7 @@ import com.openbankproject.commons.model._
* Bank -> Bank + BankEx
*/
package object model {
+ import scala.language.implicitConversions
implicit def toBankExtended(bank: Bank) = BankExtended(bank)
diff --git a/obp-api/src/main/scala/code/obp/grpc/Client.scala b/obp-api/src/main/scala/code/obp/grpc/Client.scala
index 9d81a57bd6..c8209f6c16 100644
--- a/obp-api/src/main/scala/code/obp/grpc/Client.scala
+++ b/obp-api/src/main/scala/code/obp/grpc/Client.scala
@@ -1,5 +1,6 @@
package code.obp.grpc
+import scala.language.existentials
import code.obp.grpc.api._
import com.google.protobuf.empty.Empty
import io.grpc.{ManagedChannel, ManagedChannelBuilder}
diff --git a/obp-api/src/main/scala/code/obp/grpc/HelloWorldServer.scala b/obp-api/src/main/scala/code/obp/grpc/HelloWorldServer.scala
index 773b60f60f..c77752fc56 100644
--- a/obp-api/src/main/scala/code/obp/grpc/HelloWorldServer.scala
+++ b/obp-api/src/main/scala/code/obp/grpc/HelloWorldServer.scala
@@ -1,5 +1,7 @@
package code.obp.grpc
+import scala.language.existentials
+import scala.language.reflectiveCalls
import code.api.util.newstyle.ViewNewStyle
import code.api.util.{APIUtil, CallContext, NewStyle}
import code.api.v3_0_0.{CoreTransactionsJsonV300, ModeratedTransactionCoreWithAttributes}
diff --git a/obp-api/src/main/scala/code/search/search.scala b/obp-api/src/main/scala/code/search/search.scala
index 5c37eeaa97..e99dddf3d7 100644
--- a/obp-api/src/main/scala/code/search/search.scala
+++ b/obp-api/src/main/scala/code/search/search.scala
@@ -185,13 +185,13 @@ class elasticsearch extends MdcLoggable {
}
private def getParameters(queryString: String): Map[String, String] = {
- val res = queryString.split('&') map { str =>
+ val res = queryString.split('&').map { str =>
val pair = str.split('=')
if (pair.length > 1)
(pair(0) -> pair(1))
else
(pair(0) -> "")
- } toMap
+ }.toMap
res
}
diff --git a/obp-api/src/main/scala/code/snippet/GetHtmlFromUrl.scala b/obp-api/src/main/scala/code/snippet/GetHtmlFromUrl.scala
index b1016ffa1f..2d4b82f5e4 100644
--- a/obp-api/src/main/scala/code/snippet/GetHtmlFromUrl.scala
+++ b/obp-api/src/main/scala/code/snippet/GetHtmlFromUrl.scala
@@ -55,7 +55,7 @@ object GetHtmlFromUrl extends MdcLoggable {
logger.debug("jsVendorSupportHtml: " + jsVendorSupportHtml)
// sleep for up to 5 seconds at development environment
- if (Props.mode == Props.RunModes.Development) Thread.sleep(randomLong(3 seconds))
+ if (Props.mode == Props.RunModes.Development) Thread.sleep(randomLong(3.seconds))
jsVendorSupportHtml
}
diff --git a/obp-api/src/main/scala/code/snippet/Login.scala b/obp-api/src/main/scala/code/snippet/Login.scala
index a7c6a36c34..1ae8ce83b3 100644
--- a/obp-api/src/main/scala/code/snippet/Login.scala
+++ b/obp-api/src/main/scala/code/snippet/Login.scala
@@ -70,8 +70,11 @@ class Login {
href getOrElse "#"
} & {
".signup [href]" #> {
- AuthUser.signUpPath.foldLeft("")(_ + "/" + _)
- }
+ val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
+ s"$portalUrl/register"
+ } &
+ ".signup [target]" #> "_blank" &
+ ".signup [rel]" #> "noopener"
}
}
}
diff --git a/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala b/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala
index 66a5986277..be038b035a 100644
--- a/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala
+++ b/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala
@@ -46,6 +46,7 @@ import net.liftweb.http.S
import net.liftweb.util.Helpers._
import net.liftweb.util.{CssSel, Helpers, Props}
import code.api.oauth1a.OauthParams._
+import code.webuiprops.MappedWebUiPropsProvider.getWebUiPropsValue
import scala.xml.NodeSeq
@@ -150,8 +151,12 @@ object OAuthAuthorisation {
href getOrElse "#"
} &
- ".signup [href]" #>
- AuthUser.signUpPath.foldLeft("")(_ + "/" + _)
+ ".signup [href]" #> {
+ val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
+ s"$portalUrl/register"
+ } &
+ ".signup [target]" #> "_blank" &
+ ".signup [rel]" #> "noopener"
}
}
case _ => error("Application not found")
diff --git a/obp-api/src/main/scala/code/snippet/WebUI.scala b/obp-api/src/main/scala/code/snippet/WebUI.scala
index 63214fa925..c8861688b4 100644
--- a/obp-api/src/main/scala/code/snippet/WebUI.scala
+++ b/obp-api/src/main/scala/code/snippet/WebUI.scala
@@ -312,11 +312,11 @@ class WebUI extends MdcLoggable{
// External Consumer Registration Link
// This replaces the internal Lift-based consumer registration functionality
// with a link to an external consumer registration service.
- // Uses webui_api_explorer_url + /consumers/register as default.
+ // Uses OBP-Portal (webui_obp_portal_url) for consumer registration by default.
// Configure webui_external_consumer_registration_url to override with a custom URL.
def externalConsumerRegistrationLink: CssSel = {
- val apiExplorerUrl = getWebUiPropsValue("webui_api_explorer_url", "http://localhost:5174")
- val defaultConsumerRegisterUrl = s"$apiExplorerUrl/consumers/register"
+ val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
+ val defaultConsumerRegisterUrl = s"$portalUrl/consumer-registration"
val externalUrl = getWebUiPropsValue("webui_external_consumer_registration_url", defaultConsumerRegisterUrl)
".get-api-key-link a [href]" #> scala.xml.Unparsed(externalUrl) &
".get-api-key-link a [target]" #> "_blank" &
@@ -550,8 +550,21 @@ class WebUI extends MdcLoggable{
def userIsLoggedIn: CssSel = {
if(AuthUser.loggedIn_?)
"#register-link [href]" #> scala.xml.Unparsed(s"/already-logged-in")
- else
- "#register-link [href]" #> scala.xml.Unparsed(s"/user_mgt/sign_up")
+ else {
+ val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
+ val registerUrl = s"$portalUrl/register"
+ "#register-link [href]" #> scala.xml.Unparsed(registerUrl) &
+ "#register-link [target]" #> "_blank" &
+ "#register-link [rel]" #> "noopener"
+ }
+ }
+
+ def portalRegisterLink: CssSel = {
+ val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
+ val registerUrl = s"$portalUrl/register"
+ "a [href]" #> scala.xml.Unparsed(registerUrl) &
+ "a [target]" #> "_blank" &
+ "a [rel]" #> "noopener"
}
def alreadyLoggedIn: CssSel = {
@@ -641,7 +654,7 @@ class WebUI extends MdcLoggable{
val html = XML.loadString(htmlString)
// Sleep if in development environment so can see the effects of content loading slowly
- if (Props.mode == Props.RunModes.Development) Thread.sleep(10 seconds)
+ if (Props.mode == Props.RunModes.Development) Thread.sleep(10.seconds)
// Return the HTML
html
diff --git a/obp-api/src/main/scala/code/util/AkkaHttpClient.scala b/obp-api/src/main/scala/code/util/AkkaHttpClient.scala
index 946c1a92bb..46d229784c 100644
--- a/obp-api/src/main/scala/code/util/AkkaHttpClient.scala
+++ b/obp-api/src/main/scala/code/util/AkkaHttpClient.scala
@@ -52,7 +52,7 @@ object AkkaHttpClient extends MdcLoggable with CustomJsonFormats {
private lazy val connectionPoolSettings: ConnectionPoolSettings = {
val systemConfig = ConnectionPoolSettings(system.settings.config)
//Note: get the timeout setting from here: https://github.com/akka/akka-http/issues/742
- val clientSettings = systemConfig.connectionSettings.withIdleTimeout(httpRequestTimeout seconds)
+ val clientSettings = systemConfig.connectionSettings.withIdleTimeout(httpRequestTimeout.seconds)
// reset some settings value
systemConfig.copy(
/*
diff --git a/obp-api/src/main/scala/code/util/Helper.scala b/obp-api/src/main/scala/code/util/Helper.scala
index e2dd615629..51802a0ac4 100644
--- a/obp-api/src/main/scala/code/util/Helper.scala
+++ b/obp-api/src/main/scala/code/util/Helper.scala
@@ -89,14 +89,14 @@ object Helper extends Loggable {
*/
def booleanToBox(statement: => Boolean, msg: String): Box[Unit] = {
if(statement)
- Full()
+ Full(())
else
Failure(msg)
}
def booleanToBox(statement: => Boolean): Box[Unit] = {
if(statement)
- Full()
+ Full(())
else
Empty
}
@@ -450,7 +450,7 @@ object Helper extends Loggable {
def getRequiredFieldInfo(tpe: Type): RequiredInfo = {
var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)
CacheKeyFromArguments.buildCacheKey {
- code.api.cache.Caching.memoizeSyncWithImMemory (Some(cacheKey.toString())) (100000 days) {
+ code.api.cache.Caching.memoizeSyncWithImMemory (Some(cacheKey.toString())) (100000.days) {
RequiredFieldValidation.getRequiredInfo(tpe)
diff --git a/obp-api/src/main/scala/code/validation/MappedJsonSchemaValidationProvider.scala b/obp-api/src/main/scala/code/validation/MappedJsonSchemaValidationProvider.scala
index 53538d1527..17f7a663e7 100644
--- a/obp-api/src/main/scala/code/validation/MappedJsonSchemaValidationProvider.scala
+++ b/obp-api/src/main/scala/code/validation/MappedJsonSchemaValidationProvider.scala
@@ -20,7 +20,7 @@ object MappedJsonSchemaValidationProvider extends JsonSchemaValidationProvider {
override def getByOperationId(operationId: String): Box[JsonValidation] = {
var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)
CacheKeyFromArguments.buildCacheKey {
- Caching.memoizeSyncWithProvider (Some(cacheKey.toString())) (getValidationByOperationIdTTL second) {
+ Caching.memoizeSyncWithProvider (Some(cacheKey.toString())) (getValidationByOperationIdTTL.second) {
JsonSchemaValidation.find(By(JsonSchemaValidation.OperationId, operationId))
.map(it => JsonValidation(it.operationId, it.jsonSchema))
}}
diff --git a/obp-api/src/main/scala/code/views/MapperViews.scala b/obp-api/src/main/scala/code/views/MapperViews.scala
index 19e7d1c4ec..01cacb7d69 100644
--- a/obp-api/src/main/scala/code/views/MapperViews.scala
+++ b/obp-api/src/main/scala/code/views/MapperViews.scala
@@ -469,7 +469,7 @@ object MapperViews extends Views with MdcLoggable {
viewId
).length > 0 match {
case true => Failure("Account Access record uses this View.") // We want to prevent account access orphans
- case false => Full()
+ case false => Full(())
}
} yield {
customView.deleteViewPermissions
@@ -481,7 +481,7 @@ object MapperViews extends Views with MdcLoggable {
view <- ViewDefinition.findSystemView(viewId.value)
_ <- AccountAccess.findAllBySystemViewId(viewId).length > 0 match {
case true => Failure("Account Access record uses this View.") // We want to prevent account access orphans
- case false => Full()
+ case false => Full(())
}
} yield {
view.deleteViewPermissions
diff --git a/obp-api/src/main/scala/code/webuiprops/MappedWebUiPropsProvider.scala b/obp-api/src/main/scala/code/webuiprops/MappedWebUiPropsProvider.scala
index cec35e7c0c..93b7516beb 100644
--- a/obp-api/src/main/scala/code/webuiprops/MappedWebUiPropsProvider.scala
+++ b/obp-api/src/main/scala/code/webuiprops/MappedWebUiPropsProvider.scala
@@ -42,7 +42,7 @@ object MappedWebUiPropsProvider extends WebUiPropsProvider {
import scala.concurrent.duration._
var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)
CacheKeyFromArguments.buildCacheKey {
- Caching.memoizeSyncWithImMemory(Some(cacheKey.toString()))(webUiPropsTTL second) {
+ Caching.memoizeSyncWithImMemory(Some(cacheKey.toString()))(webUiPropsTTL.second) {
// If we have an active brand, construct a target property name to look for.
val brandSpecificPropertyName = activeBrand() match {
case Some(brand) => s"${requestedPropertyName}_FOR_BRAND_${brand}"
diff --git a/obp-api/src/main/webapp/index-en.html b/obp-api/src/main/webapp/index-en.html
index a0dd0210ca..32075b8b4a 100644
--- a/obp-api/src/main/webapp/index-en.html
+++ b/obp-api/src/main/webapp/index-en.html
@@ -59,7 +59,7 @@
Get started
Create an account
-
First, create a free developer account on this sandbox and request a developer key. You will be asked to submit basic information about your app at this stage. Register for an account
+
First, create a free developer account on this sandbox and request a developer key. You will be asked to submit basic information about your app at this stage. Register for an account
+