From e755822ee9d31ecedbd6c2bdd82fde46d8cf3009 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Thu, 30 Mar 2023 11:11:44 +0200 Subject: [PATCH] refactor/removed unused props defaultAuthProvider --- README.md | 11 +++++------ src/main/resources/props/sample.props.template | 3 --- src/main/scala/bootstrap/liftweb/Boot.scala | 4 ---- src/main/scala/code/lib/ObpAPI.scala | 2 -- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c7a6151a..f6435ca1 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Note: You may need to add the pluginGroup to the $HOME/.m2/settings.xml * Navigate to test/scala/RunWebApp. You may see a Setup Scala SDK link. Click this and check Scala 2.11.8 or so. -* In src/main/resources/props create a \.props (or default.props) for development. For localhost set api_hostname=http://127.0.0.1:8080, defaultAuthProvider=http://127.0.0.1:8080, base_url=http://localhost:8082, dev.port=8082 and oauth keys (i.e. obp_consumer_key and obp_consumer_secret) obtained from the api (at /consumer-registration) to run [OBP-API](https://github.com/OpenBankProject/OBP-API) in your local environment. +* In src/main/resources/props create a \.props (or default.props) for development. For localhost set api_hostname=http://127.0.0.1:8080, base_url=http://localhost:8082, dev.port=8082 and oauth keys (i.e. obp_consumer_key and obp_consumer_secret) obtained from the api (at /consumer-registration) to run [OBP-API](https://github.com/OpenBankProject/OBP-API) in your local environment. * Now **Rebuild** the project so everything is compiled. At this point you may need to select the SDK, see above. @@ -124,12 +124,11 @@ The keys are obtained by registering as a developer on the Open Bank Project API All in all, a props file could look something like: -api_hostname=https://api.openbankproject.com/api \ -defaultAuthProvider=https://api.openbankproject.com/api +api_hostname=https://api.openbankproject.com/api + ### OR -The base url of the api to use for local: \ -api_hostname=http://127.0.0.1:8080 \ -defaultAuthProvider=http://127.0.0.1:8080 +The base url of the api to use for local: +api_hostname=http://127.0.0.1:8080 obp_consumer_key=uodsifnodsfifdsliufdsliufdsfdsfsdfsx \ obp_secret_key=iuesbfiyvglxzgifg7eisgei7fglesfi \ diff --git a/src/main/resources/props/sample.props.template b/src/main/resources/props/sample.props.template index fe102c98..204faca7 100644 --- a/src/main/resources/props/sample.props.template +++ b/src/main/resources/props/sample.props.template @@ -8,9 +8,6 @@ # The base url of the api to use (e.g. https://apisandbox.openbankproject.com) api_hostname=FILL_ME_IN -# For now, this value should be identical to the value of api_hostname -defaultAuthProvider=FILL_ME_IN - # These are the oauth keys obtained from the api (at /consumer-registration) obp_consumer_key=FILL_ME_IN obp_secret_key=FILL_ME_IN diff --git a/src/main/scala/bootstrap/liftweb/Boot.scala b/src/main/scala/bootstrap/liftweb/Boot.scala index 9fc34e3d..2bda893c 100755 --- a/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/src/main/scala/bootstrap/liftweb/Boot.scala @@ -166,10 +166,6 @@ class Boot extends MdcLoggable{ firstChoicePropsDir.toList.flatten ::: secondChoicePropsDir.toList.flatten } - if(Helper.getPropsValue("defaultAuthProvider").isEmpty) { - throw new Exception("defaultAuthProvider must be specified in the props file!") - } - def check(bool: Boolean) : Box[LiftResponse] = { if(bool){ Empty diff --git a/src/main/scala/code/lib/ObpAPI.scala b/src/main/scala/code/lib/ObpAPI.scala index d4bcee2f..7da3f4a0 100644 --- a/src/main/scala/code/lib/ObpAPI.scala +++ b/src/main/scala/code/lib/ObpAPI.scala @@ -46,8 +46,6 @@ object ObpAPI extends Loggable { implicit val formats = DefaultFormats val dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - val defaultProvider = Helper.getPropsValue("defaultAuthProvider").getOrElse("") - val userNotFoundError = "user (\\S+) at provider (\\S+) not found".r final val AccountUrlPath = "/accounts/"