From 584fa9e11365c101b64e74888330cbf13170a7ac Mon Sep 17 00:00:00 2001 From: hongwei Date: Mon, 18 Dec 2023 11:34:09 +0100 Subject: [PATCH 01/17] bugfix/use the example logback files and removed the default ones --- .gitignore | 1 - README.md | 6 +++--- obp-api/src/main/resources/logback-test.xml | 12 ------------ .../{test.logback.xml => logback-test.xml.example} | 0 .../{default.logback.xml => logback.xml.example} | 0 5 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 obp-api/src/main/resources/logback-test.xml rename obp-api/src/main/resources/{test.logback.xml => logback-test.xml.example} (100%) rename obp-api/src/main/resources/{default.logback.xml => logback.xml.example} (100%) diff --git a/.gitignore b/.gitignore index eeb1c2624d..85cb4bc55d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ .project .cache target -obp-api/src/main/resources/ obp-api/src/test/resources/** !obp-api/src/test/resources/frozen_type_meta_data *.iml diff --git a/README.md b/README.md index 5beb3d69e9..683684bc19 100644 --- a/README.md +++ b/README.md @@ -190,9 +190,9 @@ Note: Your Java environment may need to be setup correctly to use SSL Restart OBP-API, if you get an error, check your Java environment can connect to the host over SSL. -Note you can change the log level in: - - /obp-api/src/main/resources/default.logback.xml (try TRACE or DEBUG) - - /obp-api/src/main/resources/logback-test.xml (try TRACE or DEBUG) +Note you can copy the following example files to prepare your own configurations: + - /obp-api/src/main/resources/logback.xml.example -> /obp-api/src/main/resources/logback.xml (try TRACE or DEBUG) + - /obp-api/src/main/resources/logback-test.xml.example -> /obp-api/src/main/resources/logback-test.xml (try TRACE or DEBUG) There is a gist / tool which is useful for this. Search the web for SSLPoke. Note this is an external repository. diff --git a/obp-api/src/main/resources/logback-test.xml b/obp-api/src/main/resources/logback-test.xml deleted file mode 100644 index 871aea062a..0000000000 --- a/obp-api/src/main/resources/logback-test.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - %d{yyyy-MM-dd HH:mm:ss} %t %c{0} [%p] %m%n - - - - - - - \ No newline at end of file diff --git a/obp-api/src/main/resources/test.logback.xml b/obp-api/src/main/resources/logback-test.xml.example similarity index 100% rename from obp-api/src/main/resources/test.logback.xml rename to obp-api/src/main/resources/logback-test.xml.example diff --git a/obp-api/src/main/resources/default.logback.xml b/obp-api/src/main/resources/logback.xml.example similarity index 100% rename from obp-api/src/main/resources/default.logback.xml rename to obp-api/src/main/resources/logback.xml.example From 410e56b0507b4e8f509f5c4395c00ab01fc9898e Mon Sep 17 00:00:00 2001 From: hongwei Date: Mon, 18 Dec 2023 11:35:00 +0100 Subject: [PATCH 02/17] refactor/revoke the .gitignore change --- .gitignore | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 85cb4bc55d..eeb1c2624d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ .project .cache target +obp-api/src/main/resources/ obp-api/src/test/resources/** !obp-api/src/test/resources/frozen_type_meta_data *.iml diff --git a/README.md b/README.md index 683684bc19..ec91bfc5cf 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ Note: Your Java environment may need to be setup correctly to use SSL Restart OBP-API, if you get an error, check your Java environment can connect to the host over SSL. -Note you can copy the following example files to prepare your own configurations: +Note: You can copy the following example files to prepare your own configurations - /obp-api/src/main/resources/logback.xml.example -> /obp-api/src/main/resources/logback.xml (try TRACE or DEBUG) - /obp-api/src/main/resources/logback-test.xml.example -> /obp-api/src/main/resources/logback-test.xml (try TRACE or DEBUG) From a82705419bd0cfca09dac684994651b387e80252 Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Thu, 4 Jan 2024 16:44:43 +0100 Subject: [PATCH 03/17] Create jetty-logging.properties --- .github/jetty-logging.properties | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/jetty-logging.properties diff --git a/.github/jetty-logging.properties b/.github/jetty-logging.properties new file mode 100644 index 0000000000..d4922ad195 --- /dev/null +++ b/.github/jetty-logging.properties @@ -0,0 +1,2 @@ +org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +org.eclipse.jetty.LEVEL=INFO From 7816f252a6b24a8c5197630b35f46e22bdf863aa Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Thu, 4 Jan 2024 16:46:00 +0100 Subject: [PATCH 04/17] Update Dockerfile_PreBuild_OC --- .github/Dockerfile_PreBuild_OC | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/Dockerfile_PreBuild_OC b/.github/Dockerfile_PreBuild_OC index 668203152c..f6591b9b7b 100644 --- a/.github/Dockerfile_PreBuild_OC +++ b/.github/Dockerfile_PreBuild_OC @@ -1,8 +1,9 @@ FROM jetty:9.4-jdk11-alpine # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war +COPY .github/jetty-logging.properties /var/lib/jetty/resources/jetty-logging.properties USER root RUN chgrp -R 0 /tmp/jetty && chmod -R g+rwX /tmp/jetty RUN chgrp -R 0 /var/lib/jetty && chmod -R g+rwX /var/lib/jetty RUN chgrp -R 0 /usr/local/jetty && chmod -R g+rwX /usr/local/jetty -USER jetty \ No newline at end of file +USER jetty From edc9ed88f3c72aca1d68dbf379a4f0452dce01ef Mon Sep 17 00:00:00 2001 From: Simon Redfern Date: Fri, 5 Jan 2024 14:27:18 +0100 Subject: [PATCH 05/17] Adding more debug around UserLockedChecker --- obp-api/src/main/scala/bootstrap/liftweb/Boot.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala index 286662e310..b4d0725bec 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala @@ -756,14 +756,17 @@ class Boot extends MdcLoggable { def onBeginServicing(session: LiftSession, req: Req): Unit = { logger.debug(s"Hello from UsernameLockedChecker.onBeginServicing") checkIsLocked() + logger.debug(s"Bye from UsernameLockedChecker.onBeginServicing") } def onSessionActivate(session: LiftSession): Unit = { logger.debug(s"Hello from UsernameLockedChecker.onSessionActivate") checkIsLocked() + logger.debug(s"Bye from UsernameLockedChecker.onSessionActivate") } def onSessionPassivate(session: LiftSession): Unit = { logger.debug(s"Hello from UsernameLockedChecker.onSessionPassivate") checkIsLocked() + logger.debug(s"Bye from UsernameLockedChecker.onSessionPassivate") } private def checkIsLocked(): Unit = { AuthUser.currentUser match { @@ -771,10 +774,12 @@ class Boot extends MdcLoggable { LoginAttempt.userIsLocked(localIdentityProvider, user.username.get) match { case true => AuthUser.logoutCurrentUser - logger.warn(s"User ${user.username.get} has been logged out due to it has been locked.") + logger.warn(s"checkIsLocked says: User ${user.username.get} has been logged out because it is locked.") case false => // Do nothing + logger.debug(s"checkIsLocked says: User ${user.username.get} is not locked.") } - case _ => // Do nothing + case _ => // No user found + logger.debug(s"checkIsLocked says: No User Found.") } } } From de9e4efc722e2305357e0afce8d2edab709952d1 Mon Sep 17 00:00:00 2001 From: Simon Redfern Date: Fri, 5 Jan 2024 16:10:17 +0100 Subject: [PATCH 06/17] Adding a note about web.xml in sample.props.template --- obp-api/src/main/resources/props/sample.props.template | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template index 1468010a14..1a8952ea31 100644 --- a/obp-api/src/main/resources/props/sample.props.template +++ b/obp-api/src/main/resources/props/sample.props.template @@ -1290,4 +1290,7 @@ validate_iban=false # This returns Regulated Entities # sample props regulated_entities = [{"certificate_authority_ca_owner_id":"CY_CBC","entity_certificate_public_key":"-----BEGIN CERTIFICATE-----MIICsjCCAZqgAwIBAgIGAYwQ62R0MA0GCSqGSIb3DQEBCwUAMBoxGDAWBgNVBAMMD2FwcC5leGFtcGxlLmNvbTAeFw0yMzExMjcxMzE1MTFaFw0yNTExMjYxMzE1MTFaMBoxGDAWBgNVBAMMD2FwcC5leGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK9WIodZHWzKyCcf9YfWEhPURbfO6zKuMqzHN27GdqHsVVEGxP4F/J4mso+0ENcRr6ur4u81iREaVdCc40rHDHVJNEtniD8Icbz7tcsqAewIVhc/q6WXGqImJpCq7hA0m247dDsaZT0lb/MVBiMoJxDEmAE/GYYnWTEn84R35WhJsMvuQ7QmLvNg6RkChY6POCT/YKe9NKwa1NqI1U+oA5RFzAaFtytvZCE3jtp+aR0brL7qaGfgxm6B7dEpGyhg0NcVCV7xMQNq2JxZTVdAr6lcsRGaAFulakmW3aNnmK+L35Wu8uW+OxNxwUuC6f3b4FVBa276FMuUTRfu7gc+k6kCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAAU5CjEyAoyTn7PgFpQD48ZNPuUsEQ19gzYgJvHMzFIoZ7jKBodjO5mCzWBcR7A4mpeAsdyiNBl2sTiZscSnNqxk61jVzP5Ba1D7XtOjjr7+3iqowrThj6BY40QqhYh/6BSY9fDzVZQiHnvlo6ZUM5kUK6OavZOovKlp5DIl5sGqoP0qAJnpQ4nhB2WVVsKfPlOXc+2KSsbJ23g9l8zaTMr+X0umlvfEKqyEl1Fa2L1dO0y/KFQ+ILmxcZLpRdq1hRAjd0quq9qGC8ucXhRWDgM4hslVpau0da68g0aItWNez3mc5lB82b3dcZpFMzO41bgw7gvw10AvvTfQDqEYIuQ==-----END CERTIFICATE-----","entity_code":"PSD_PICY_CBC!12345","entity_type":"PSD_PI","entity_address":"EXAMPLE COMPANY LTD, 5 SOME STREET","entity_town_city":"SOME CITY","entity_post_code":"1060","entity_country":"CY","entity_web_site":"www.example.com","services":[{"CY":["PS_010","PS_020","PS_03C","PS_04C"]}]}] -regulated_entities = [] \ No newline at end of file +regulated_entities = [] + + +# Note: For secure and http only settings for cookies see resources/web.xml which is mentioned in the README.md \ No newline at end of file From f385a8a71eca4e875e3262f37f8584035d609236 Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Mon, 8 Jan 2024 18:03:26 +0100 Subject: [PATCH 07/17] add logback.xml to Dockerfile --- .github/Dockerfile_PreBuild_OC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Dockerfile_PreBuild_OC b/.github/Dockerfile_PreBuild_OC index f6591b9b7b..918d3c2942 100644 --- a/.github/Dockerfile_PreBuild_OC +++ b/.github/Dockerfile_PreBuild_OC @@ -1,7 +1,7 @@ FROM jetty:9.4-jdk11-alpine # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war -COPY .github/jetty-logging.properties /var/lib/jetty/resources/jetty-logging.properties +RUN cd .github && jar uvf root.war WEB-INF/classes/logback.xml USER root RUN chgrp -R 0 /tmp/jetty && chmod -R g+rwX /tmp/jetty RUN chgrp -R 0 /var/lib/jetty && chmod -R g+rwX /var/lib/jetty From a9ef4b1e7156fbd0238ce0328d5b3cc70e1b2c3a Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Mon, 8 Jan 2024 18:04:25 +0100 Subject: [PATCH 08/17] Create logback.xml --- .github/WEB-INF/classes/logback.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/WEB-INF/classes/logback.xml diff --git a/.github/WEB-INF/classes/logback.xml b/.github/WEB-INF/classes/logback.xml new file mode 100644 index 0000000000..e544582425 --- /dev/null +++ b/.github/WEB-INF/classes/logback.xml @@ -0,0 +1,12 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss} %t %c{0} [%p] %m%n + + + + + + + From 76b96b7ec2f5b7bc60b509df1892d2f22e541468 Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Mon, 8 Jan 2024 18:05:20 +0100 Subject: [PATCH 09/17] Delete .github/WEB-INF/classes directory --- .github/WEB-INF/classes/logback.xml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .github/WEB-INF/classes/logback.xml diff --git a/.github/WEB-INF/classes/logback.xml b/.github/WEB-INF/classes/logback.xml deleted file mode 100644 index e544582425..0000000000 --- a/.github/WEB-INF/classes/logback.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - %d{yyyy-MM-dd HH:mm:ss} %t %c{0} [%p] %m%n - - - - - - - From 27d9f646f5d7c4bb8a38b63e62a393972fe9b182 Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Mon, 8 Jan 2024 18:05:37 +0100 Subject: [PATCH 10/17] Create WEB-INF --- .github/WEB-INF | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/WEB-INF diff --git a/.github/WEB-INF b/.github/WEB-INF new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/.github/WEB-INF @@ -0,0 +1 @@ + From 7eb41e999f832a2d9c105fea01f838e25070488b Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Mon, 8 Jan 2024 18:06:18 +0100 Subject: [PATCH 11/17] Delete .github/WEB-INF --- .github/WEB-INF | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/WEB-INF diff --git a/.github/WEB-INF b/.github/WEB-INF deleted file mode 100644 index 8b13789179..0000000000 --- a/.github/WEB-INF +++ /dev/null @@ -1 +0,0 @@ - From 423bc86cd5f4586dcd100eaab648150659bfb9fd Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 8 Jan 2024 19:47:59 +0100 Subject: [PATCH 12/17] add logback.xml --- .github/WEB-INF/classes/logback.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/WEB-INF/classes/logback.xml diff --git a/.github/WEB-INF/classes/logback.xml b/.github/WEB-INF/classes/logback.xml new file mode 100644 index 0000000000..804a03633e --- /dev/null +++ b/.github/WEB-INF/classes/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss} %t %c{0} [%p] %m%n + + + + + + + + From a62e980c923a9c34bef9c30deaf7b9ff4378a912 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 8 Jan 2024 19:55:02 +0100 Subject: [PATCH 13/17] wip --- .github/Dockerfile_PreBuild_OC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Dockerfile_PreBuild_OC b/.github/Dockerfile_PreBuild_OC index 918d3c2942..52ac0a2287 100644 --- a/.github/Dockerfile_PreBuild_OC +++ b/.github/Dockerfile_PreBuild_OC @@ -1,7 +1,7 @@ FROM jetty:9.4-jdk11-alpine # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war -RUN cd .github && jar uvf root.war WEB-INF/classes/logback.xml +RUN cd ../../../.github && jar uvf root.war WEB-INF/classes/logback.xml USER root RUN chgrp -R 0 /tmp/jetty && chmod -R g+rwX /tmp/jetty RUN chgrp -R 0 /var/lib/jetty && chmod -R g+rwX /var/lib/jetty From 156fa6ecdd1a5c259a6169fe57f4ba245d300e60 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 8 Jan 2024 20:50:12 +0100 Subject: [PATCH 14/17] wip (testing Docker create image) --- .github/Dockerfile_PreBuild_OC | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/Dockerfile_PreBuild_OC b/.github/Dockerfile_PreBuild_OC index 52ac0a2287..bcec3e591a 100644 --- a/.github/Dockerfile_PreBuild_OC +++ b/.github/Dockerfile_PreBuild_OC @@ -1,7 +1,8 @@ FROM jetty:9.4-jdk11-alpine # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war -RUN cd ../../../.github && jar uvf root.war WEB-INF/classes/logback.xml +RUN echo $(pwd) +RUN cd ../../.github && jar uvf root.war WEB-INF/classes/logback.xml USER root RUN chgrp -R 0 /tmp/jetty && chmod -R g+rwX /tmp/jetty RUN chgrp -R 0 /var/lib/jetty && chmod -R g+rwX /var/lib/jetty From 89ad270731235c1f47bed10048e10d372c2e757a Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 8 Jan 2024 21:47:59 +0100 Subject: [PATCH 15/17] github action dockerfile wip --- .github/Dockerfile_PreBuild_OC | 5 +++-- .github/{WEB-INF/classes => }/logback.xml | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename .github/{WEB-INF/classes => }/logback.xml (100%) diff --git a/.github/Dockerfile_PreBuild_OC b/.github/Dockerfile_PreBuild_OC index bcec3e591a..0dc7ee691f 100644 --- a/.github/Dockerfile_PreBuild_OC +++ b/.github/Dockerfile_PreBuild_OC @@ -1,8 +1,9 @@ FROM jetty:9.4-jdk11-alpine # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war -RUN echo $(pwd) -RUN cd ../../.github && jar uvf root.war WEB-INF/classes/logback.xml +RUN mkdir -p /WEB-INF/classes +COPY .github/logback.xml /WEB-INF/classes/ +RUN cd / && jar uvf /var/lib/jetty/webapps/ROOT.war WEB-INF/classes/logback.xml USER root RUN chgrp -R 0 /tmp/jetty && chmod -R g+rwX /tmp/jetty RUN chgrp -R 0 /var/lib/jetty && chmod -R g+rwX /var/lib/jetty diff --git a/.github/WEB-INF/classes/logback.xml b/.github/logback.xml similarity index 100% rename from .github/WEB-INF/classes/logback.xml rename to .github/logback.xml From cb635c9cc94578dd711e71884978d5886ad2ed18 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 8 Jan 2024 22:40:01 +0100 Subject: [PATCH 16/17] wip --- .github/Dockerfile_PreBuild_OC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Dockerfile_PreBuild_OC b/.github/Dockerfile_PreBuild_OC index 0dc7ee691f..c8cf7ad5cc 100644 --- a/.github/Dockerfile_PreBuild_OC +++ b/.github/Dockerfile_PreBuild_OC @@ -1,10 +1,10 @@ FROM jetty:9.4-jdk11-alpine # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war +USER root RUN mkdir -p /WEB-INF/classes COPY .github/logback.xml /WEB-INF/classes/ RUN cd / && jar uvf /var/lib/jetty/webapps/ROOT.war WEB-INF/classes/logback.xml -USER root RUN chgrp -R 0 /tmp/jetty && chmod -R g+rwX /tmp/jetty RUN chgrp -R 0 /var/lib/jetty && chmod -R g+rwX /var/lib/jetty RUN chgrp -R 0 /usr/local/jetty && chmod -R g+rwX /usr/local/jetty From 003ebb888b5957c07d69388d33e410507a069d10 Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Tue, 9 Jan 2024 11:35:51 +0100 Subject: [PATCH 17/17] Delete .github/jetty-logging.properties --- .github/jetty-logging.properties | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .github/jetty-logging.properties diff --git a/.github/jetty-logging.properties b/.github/jetty-logging.properties deleted file mode 100644 index d4922ad195..0000000000 --- a/.github/jetty-logging.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -org.eclipse.jetty.LEVEL=INFO