From dd5985a9894af00efb7c6f25eb9b7a9e1875ae3a Mon Sep 17 00:00:00 2001 From: Deepak Dixit Date: Mon, 6 Nov 2023 14:44:43 +0530 Subject: [PATCH] Master (#9) * Fix regression with partitioned tables in PostgreSQL PostgreSQL JDBC Driver introduced separating type for partitioned table from 40.2.12 pgjdbc/pgjdbc#1708 * Add subscreensItem.menuInclude to menu data (#600) * Fixed the problem that moqui cannot be deployed as non-root webapp in Tomcat * Fixed a runtime error if Currency is BTC * Fixed a runtime error if Currency is BTC * Fixed the retries of Elastic Client * Add subscreensItem.menuInclude to menu data * Docker-Image-Pull Feature (#553) * Improvement: In Moqui-Multi-Instance added a Async-Pull-Image-Feature which pulls the image by Using Docker-Engine-Api from multiple registry like AWS, Azure, Docker-Hub * Update AUTHORS * Added: added the generic way to process cmd , by adding an extra field(authTokenPass) inside the entity InstanceImage , now user has separate field for cmd and password so all types of registries is easily configurable * Update ServerEntities.xml by adding description * Library updates, including Jetty 10.0.13 to 10.015 which had reported vulnerabilities; there are lots of dependencies updated in this set, see diff for full details * In ScreenRenderImpl change addFormFieldValue() and related methods to handle first, second, and last rows, for qvt and other client rendered output that needs full data for a form in a map/object * In root build.gradle change gitStatusAll task to be more tolerant of repos with no master branch * Add text-area.@autogrow attribute, supported only in qvt for now * Update various libraries including Groovy to 3.0.19 (which has some minor non-backward compatible changes single 3.0.10 with odd boolean behavior in rare cases, adjusted for in the framework long ago but should be watched for in custom code), Jetty to 10.0.16, H2 database, SLF4J, SnakeYAML, Apache Commons Lang3 * In build.gradle gitStatusAll task also handle upstream remotes with no master branch * Currency (#614) * Use moqui.basic.Uom entity to determine currency formatting and rounding details * Add currency-hide-symbol attribute as a complement to currency-unit-field, displaying the value without the currency symbol * Update authors file * Add and Handle Hmac Sha256 with timestamp * A couple of minor bug fixes in the EntityAutoServiceRunner and ContextJavaUtil (#618) * In EntityAutoServiceRunner, remove unwanted break statement to ensure support for multiple PK fields with wildcard (*). * In ContextJavaUtil, add missing future keyword. * Updated authors file. * Allow for 10 second threshold in nowTimestamp * In L10nFacadeImpl.formatCurrency() use disableAuthz() for entity find on Uom; small change to currency formatting test to pass with current OOTB settings * In addons.xml, added new moqui-sso component. --------- Co-authored-by: Yao Chunlin Co-authored-by: David E. Jones Co-authored-by: Wei Zhang Co-authored-by: Rohit pawar <72196393+rohitpawar2811@users.noreply.github.com> Co-authored-by: Jens Hardings Co-authored-by: acetousk Co-authored-by: Ayman Abi Abdallah --- AUTHORS | 10 +- addons.xml | 1 + build.gradle | 25 +++-- framework/build.gradle | 84 ++++++++-------- framework/entity/BasicEntities.xml | 4 +- framework/entity/ServerEntities.xml | 3 + framework/entity/ServiceEntities.xml | 1 + .../org/moqui/impl/InstanceServices.xml | 60 +++++++++++- .../moqui/impl/context/ContextJavaUtil.java | 3 +- .../impl/context/ElasticFacadeImpl.groovy | 2 +- .../moqui/impl/context/L10nFacadeImpl.java | 97 ++++++++++++++----- .../moqui/impl/context/WebFacadeImpl.groovy | 66 +++++++++++++ .../org/moqui/impl/entity/EntityDbMeta.groovy | 4 +- .../moqui/impl/screen/ScreenRenderImpl.groovy | 52 +++++++--- .../runner/EntityAutoServiceRunner.groovy | 1 - .../java/org/moqui/context/L10nFacade.java | 7 +- .../src/test/groovy/L10nFacadeTests.groovy | 2 +- framework/xsd/xml-form-3.xsd | 8 ++ 18 files changed, 328 insertions(+), 102 deletions(-) diff --git a/AUTHORS b/AUTHORS index 27dbd1a34..28e89ca3e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -46,7 +46,7 @@ Written in 2015 by Sam Hamilton - samhamilton Written in 2015 by Leonardo Carvalho - CarvalhoLeonardo Written in 2015 by Swapnil M Mane - swapnilmmane Written in 2015 by Anton Akhiar - akhiar -Written in 2015-2018 by Jens Hardings - jenshp +Written in 2015-2023 by Jens Hardings - jenshp Written in 2016 by Shifeng Zhang - zhangshifeng Written in 2016 by Scott Gray - lektran Written in 2016 by Mark Haney - mphaney @@ -54,13 +54,14 @@ Written in 2016 by Qiushi Yan - yanqiushi Written in 2017 by Oleg Andrieiev - oandreyev Written in 2018 by Zhang Wei - zhangwei1979 Written in 2018 by Nirendra Singh - nirendra10695 -Written in 2018-2021 by Ayman Abi Abdallah - aabiabdallah +Written in 2018-2023 by Ayman Abi Abdallah - aabiabdallah Written in 2019 by Daniel Taylor - danieltaylor-nz Written in 2020 by Jacob Barnes - Tellan Written in 2020 by Amir Anjomshoaa - amiranjom Written in 2021 by Deepak Dixit - dixitdeepak Written in 2021 by Taher Alkhateeb - pythys Written in 2022 by Zhang Wei - hellozhangwei +Written in 2023 by Rohit Pawar - rohitpawar2811 =========================================================================== @@ -93,7 +94,7 @@ Written in 2015 by Jimmy Shen - shendepu Written in 2015-2016 by Sam Hamilton - samhamilton Written in 2015 by Leonardo Carvalho - CarvalhoLeonardo Written in 2015 by Anton Akhiar - akhiar -Written in 2015-2016 by Jens Hardings - jenshp +Written in 2015-2023 by Jens Hardings - jenshp Written in 2016 by Shifeng Zhang - zhangshifeng Written in 2016 by Scott Gray - lektran Written in 2016 by Mark Haney - mphaney @@ -101,12 +102,13 @@ Written in 2016 by Qiushi Yan - yanqiushi Written in 2017 by Oleg Andrieiev - oandreyev Written in 2018 by Zhang Wei - zhangwei1979 Written in 2018 by Nirendra Singh - nirendra10695 -Written in 2018-2020 by Ayman Abi Abdallah - aabiabdallah +Written in 2018-2023 by Ayman Abi Abdallah - aabiabdallah Written in 2019 by Daniel Taylor - danieltaylor-nz Written in 2020 by Jacob Barnes - Tellan Written in 2020 by Amir Anjomshoaa - amiranjom Written in 2021 by Deepak Dixit - dixitdeepak Written in 2021 by Taher Alkhateeb - pythys Written in 2022 by Zhang Wei - hellozhangwei +Written in 2023 by Rohit Pawar - rohitpawar2811 =========================================================================== diff --git a/addons.xml b/addons.xml index d449211e1..f5d4f2aac 100644 --- a/addons.xml +++ b/addons.xml @@ -52,6 +52,7 @@ + diff --git a/build.gradle b/build.gradle index 3b591d4c6..3fc65c0e6 100644 --- a/build.gradle +++ b/build.gradle @@ -417,13 +417,26 @@ task gitStatusAll { def curGrgit = Grgit.open(dir: gitDir) logger.lifecycle("\nGit status for ${gitDir} (branch:${curGrgit.branch.current()?.name}, tracking:${curGrgit.branch.current()?.trackingBranch?.name})") - if (curGrgit.remote.list().find({ it.name == 'upstream'})) { - def upstreamAhead = curGrgit.log { range curGrgit.resolve.toCommit('refs/remotes/upstream/master'), curGrgit.resolve.toCommit('refs/remotes/origin/master') } - if (upstreamAhead) logger.lifecycle("- origin/master ${upstreamAhead.size()} commits ahead of upstream/master") + try { + if (curGrgit.remote.list().find({ it.name == 'upstream'})) { + def upstreamAhead = curGrgit.log { range curGrgit.resolve.toCommit('refs/remotes/upstream/master'), curGrgit.resolve.toCommit('refs/remotes/origin/master') } + if (upstreamAhead) logger.lifecycle("- origin/master ${upstreamAhead.size()} commits ahead of upstream/master") + } + } catch (Exception e) { + logger.error("Error finding commits ahead of upstream", e) + } + try { + def masterLatest = curGrgit.resolve.toCommit('refs/remotes/origin/master') + if (masterLatest == null) { + logger.error("No origin/master branch exists, can't determine unpushed commits") + } else { + def unpushed = curGrgit.log { range masterLatest, curGrgit.resolve.toCommit('HEAD') } + if (unpushed) logger.lifecycle("--- ${unpushed.size()} commits unpushed (ahead of origin/master)") + for (Commit commit in unpushed) logger.lifecycle(" - ${commit.getAbbreviatedId(8)} - ${commit.shortMessage}") + } + } catch (Exception e) { + logger.error("Error finding unpushed commits", e) } - def unpushed = curGrgit.log { range curGrgit.resolve.toCommit('refs/remotes/origin/master'), curGrgit.resolve.toCommit('HEAD') } - if (unpushed) logger.lifecycle("--- ${unpushed.size()} commits unpushed (ahead of origin/master)") - for (Commit commit in unpushed) logger.lifecycle(" - ${commit.getAbbreviatedId(8)} - ${commit.shortMessage}") def curStatus = curGrgit.status() if (curStatus.isClean()) logger.lifecycle("* nothing to commit, working directory clean") if (curStatus.staged.added || curStatus.staged.modified || curStatus.staged.removed) logger.lifecycle("--- Changes to be committed::") diff --git a/framework/build.gradle b/framework/build.gradle index 8bc029de6..65137c15c 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -12,7 +12,7 @@ * . */ -version = '3.1.0-rc1' +version = '3.1.0-rc2' apply plugin: 'java-library' apply plugin: 'groovy' @@ -27,7 +27,7 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.github.ben-manes:gradle-versions-plugin:0.45.0' + classpath 'com.github.ben-manes:gradle-versions-plugin:0.47.0' // uncomment to add the Error Prone compiler: classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8' } } @@ -68,17 +68,17 @@ tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" } // NOTE: for dependency types and 'api' definition see: https://docs.gradle.org/current/userguide/java_library_plugin.html dependencies { // Groovy - // NOTE: Groovy 3.0.10-3.0.12 has a bug that somehow causes EntityDefinition.isViewEntity (public final boolean) to switch + // NOTE: Groovy 3.0.10-3.0.18 has a bug that somehow causes EntityDefinition.isViewEntity (public final boolean) to switch // from true during constructor to false later on; see EntityFindBuilder.java:112-114 and EntityDefinition.groovy:50-53,94-95; // for now using Boolean instead of boolean to resolve, but staying at 3.0.9 to avoid risk with other code - api 'org.codehaus.groovy:groovy:3.0.9' // Apache 2.0 - api 'org.codehaus.groovy:groovy-dateutil:3.0.9' // Apache 2.0 - api 'org.codehaus.groovy:groovy-groovysh:3.0.9' // Apache 2.0 + api 'org.codehaus.groovy:groovy:3.0.19' // Apache 2.0 + api 'org.codehaus.groovy:groovy-dateutil:3.0.19' // Apache 2.0 + api 'org.codehaus.groovy:groovy-groovysh:3.0.19' // Apache 2.0 // jline, an older version, is required by groovy-groovysh but not in its dependencies implementation 'jline:jline:2.14.6' // BSD - api 'org.codehaus.groovy:groovy-json:3.0.9' // Apache 2.0 - api 'org.codehaus.groovy:groovy-templates:3.0.9' // Apache 2.0 - api 'org.codehaus.groovy:groovy-xml:3.0.9' // Apache 2.0 + api 'org.codehaus.groovy:groovy-json:3.0.19' // Apache 2.0 + api 'org.codehaus.groovy:groovy-templates:3.0.19' // Apache 2.0 + api 'org.codehaus.groovy:groovy-xml:3.0.19' // Apache 2.0 // jansi is needed for groovydoc only, so in compileOnly (not included in war) - don't update to version 2, keep at version 1 for compatibility compileOnly 'org.fusesource.jansi:jansi:1.18' // Findbugs need only during compile (used by freemarker and various moqui classes) @@ -93,33 +93,33 @@ dependencies { // ========== General Libraries from Maven Central ========== // Apache Commons - api 'org.apache.commons:commons-csv:1.9.0' // Apache 2.0 + api 'org.apache.commons:commons-csv:1.10.0' // Apache 2.0 // NOTE: commons-email depends on com.sun.mail:javax.mail, included below, so use module() here to not get dependencies api module('org.apache.commons:commons-email:1.5') // Apache 2.0 - api 'org.apache.commons:commons-lang3:3.12.0' // Apache 2.0; used by cron-utils + api 'org.apache.commons:commons-lang3:3.13.0' // Apache 2.0; used by cron-utils api 'commons-beanutils:commons-beanutils:1.9.4' // Apache 2.0 - api 'commons-codec:commons-codec:1.15' // Apache 2.0 + api 'commons-codec:commons-codec:1.16.0' // Apache 2.0 api 'commons-collections:commons-collections:3.2.2' // Apache 2.0 api 'commons-digester:commons-digester:2.1' // Apache 2.0 - api 'commons-fileupload:commons-fileupload:1.4' // Apache 2.0 - api 'commons-io:commons-io:2.11.0' // Apache 2.0 + api 'commons-fileupload:commons-fileupload:1.5' // Apache 2.0 + api 'commons-io:commons-io:2.13.0' // Apache 2.0 api 'commons-logging:commons-logging:1.2' // Apache 2.0 api 'commons-validator:commons-validator:1.7' // Apache 2.0 // Cron Utils - api 'com.cronutils:cron-utils:9.2.0' // Apache 2.0 + api 'com.cronutils:cron-utils:9.2.1' // Apache 2.0 // Flexmark (markdown) - api 'com.vladsch.flexmark:flexmark:0.64.0' - api 'com.vladsch.flexmark:flexmark-ext-tables:0.64.0' - api 'com.vladsch.flexmark:flexmark-ext-toc:0.64.0' + api 'com.vladsch.flexmark:flexmark:0.64.8' + api 'com.vladsch.flexmark:flexmark-ext-tables:0.64.8' + api 'com.vladsch.flexmark:flexmark-ext-toc:0.64.8' // Freemarker // Remember to change the version number in FtlTemplateRenderer and MNode class when upgrading api 'org.freemarker:freemarker:2.3.32' // Apache 2.0 // H2 Database - api 'com.h2database:h2:2.1.214' // MPL 2.0, EPL 1.0 + api 'com.h2database:h2:2.2.222' // MPL 2.0, EPL 1.0 // Java Specifications api 'javax.transaction:jta:1.1' @@ -144,38 +144,38 @@ dependencies { api 'com.beust:jcommander:1.82' // Jackson Databind (JSON, etc) - api 'com.fasterxml.jackson.core:jackson-databind:2.14.2' + api 'com.fasterxml.jackson.core:jackson-databind:2.15.2' // Jetty HTTP Client and Proxy Servlet - api 'org.eclipse.jetty:jetty-client:10.0.13' // Apache 2.0 - api 'org.eclipse.jetty:jetty-proxy:10.0.13' // Apache 2.0 + api 'org.eclipse.jetty:jetty-client:10.0.16' // Apache 2.0 + api 'org.eclipse.jetty:jetty-proxy:10.0.16' // Apache 2.0 // javax.mail // NOTE: javax.mail depends on 'javax.activation:activation' which is the old package for 'javax.activation:javax.activation-api' used by jaxb-api api module('com.sun.mail:javax.mail:1.6.2') // CDDL // Joda Time (used by elasticsearch, aws) - api 'joda-time:joda-time:2.12.2' // Apache 2.0 + api 'joda-time:joda-time:2.12.5' // Apache 2.0 // JSoup (HTML parser, cleaner) - api 'org.jsoup:jsoup:1.15.3' // MIT + api 'org.jsoup:jsoup:1.16.1' // MIT // Apache Shiro - api module('org.apache.shiro:shiro-core:1.11.0') // Apache 2.0 - api module('org.apache.shiro:shiro-web:1.11.0') // Apache 2.0 + api module('org.apache.shiro:shiro-core:1.12.0') // Apache 2.0 + api module('org.apache.shiro:shiro-web:1.12.0') // Apache 2.0 // SLF4J, Log4j 2 (note Log4j 2 is used by various libraries, best not to replace it even if mostly possible with SLF4J) - api 'org.slf4j:slf4j-api:2.0.6' - implementation 'org.apache.logging.log4j:log4j-core:2.19.0' - implementation 'org.apache.logging.log4j:log4j-api:2.19.0' - runtimeOnly 'org.apache.logging.log4j:log4j-jcl:2.19.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl:2.19.0' + api 'org.slf4j:slf4j-api:2.0.9' + implementation 'org.apache.logging.log4j:log4j-core:2.20.0' + implementation 'org.apache.logging.log4j:log4j-api:2.20.0' + runtimeOnly 'org.apache.logging.log4j:log4j-jcl:2.20.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl:2.20.0' // SubEtha SMTP (module as depends on old javax.mail location; also uses SLF4J, activation included elsewhere) api module('org.subethamail:subethasmtp:3.1.7') // Snake YAML - api 'org.yaml:snakeyaml:1.33' // Apache 2.0 + api 'org.yaml:snakeyaml:2.2' // Apache 2.0 // Apache Jackrabbit - uncomment here or include elsewhere when Jackrabbit repository configurations are used // api 'org.apache.jackrabbit:jackrabbit-jcr-rmi:2.12.1' // Apache 2.0 @@ -190,11 +190,11 @@ dependencies { // ========== test dependencies ========== // junit-platform-launcher is a dependency from spock-core, included explicitly to get more recent version as needed - testImplementation 'org.junit.platform:junit-platform-launcher:1.9.2' + testImplementation 'org.junit.platform:junit-platform-launcher:1.10.0' // junit-platform-suite required for test suites to specify test class order, etc - testImplementation 'org.junit.platform:junit-platform-suite:1.9.2' + testImplementation 'org.junit.platform:junit-platform-suite:1.10.0' // junit-jupiter-api for using JUnit directly, not generally needed for Spock based tests - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' // Spock Framework testImplementation platform("org.spockframework:spock-bom:2.1-groovy-3.0") // Apache 2.0 testImplementation 'org.spockframework:spock-core:2.1-groovy-3.0' // Apache 2.0 @@ -203,16 +203,16 @@ dependencies { // ========== executable war dependencies ========== // Jetty - execWarRuntimeOnly 'org.eclipse.jetty:jetty-server:10.0.13' // Apache 2.0 - execWarRuntimeOnly 'org.eclipse.jetty:jetty-webapp:10.0.13' // Apache 2.0 - execWarRuntimeOnly 'org.eclipse.jetty:jetty-jndi:10.0.13' // Apache 2.0 - execWarRuntimeOnly 'org.eclipse.jetty.websocket:websocket-javax-server:10.0.13' // Apache 2.0 - execWarRuntimeOnly ('org.eclipse.jetty.websocket:websocket-javax-client:10.0.13') { // Apache 2.0 + execWarRuntimeOnly 'org.eclipse.jetty:jetty-server:10.0.16' // Apache 2.0 + execWarRuntimeOnly 'org.eclipse.jetty:jetty-webapp:10.0.16' // Apache 2.0 + execWarRuntimeOnly 'org.eclipse.jetty:jetty-jndi:10.0.16' // Apache 2.0 + execWarRuntimeOnly 'org.eclipse.jetty.websocket:websocket-javax-server:10.0.16' // Apache 2.0 + execWarRuntimeOnly ('org.eclipse.jetty.websocket:websocket-javax-client:10.0.16') { // Apache 2.0 exclude group: 'javax.websocket' } // we have the full websocket API, including the client one causes problems execWarRuntimeOnly 'javax.websocket:javax.websocket-api:1.1' - execWarRuntimeOnly ('org.eclipse.jetty.websocket:websocket-jetty-server:10.0.13') // Apache 2.0 + execWarRuntimeOnly ('org.eclipse.jetty.websocket:websocket-jetty-server:10.0.16') // Apache 2.0 // only include this if using Endpoint and MessageHandler annotations: - // execWarRuntime ('org.eclipse.jetty:jetty-annotations:10.0.13') // Apache 2.0 + // execWarRuntime ('org.eclipse.jetty:jetty-annotations:10.0.16') // Apache 2.0 execWarRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.18.0' } diff --git a/framework/entity/BasicEntities.xml b/framework/entity/BasicEntities.xml index 3ca7a10e4..d71b77fc5 100644 --- a/framework/entity/BasicEntities.xml +++ b/framework/entity/BasicEntities.xml @@ -389,7 +389,9 @@ along with this software (see the LICENSE.md file). If not, see - + + + diff --git a/framework/entity/ServerEntities.xml b/framework/entity/ServerEntities.xml index 17ec6556d..e9b63af25 100644 --- a/framework/entity/ServerEntities.xml +++ b/framework/entity/ServerEntities.xml @@ -196,6 +196,9 @@ along with this software (see the LICENSE.md file). If not, see + + + diff --git a/framework/entity/ServiceEntities.xml b/framework/entity/ServiceEntities.xml index 81696e90f..7b51a3ab3 100644 --- a/framework/entity/ServiceEntities.xml +++ b/framework/entity/ServiceEntities.xml @@ -383,6 +383,7 @@ along with this software (see the LICENSE.md file). If not, see + diff --git a/framework/service/org/moqui/impl/InstanceServices.xml b/framework/service/org/moqui/impl/InstanceServices.xml index 7071d77fa..dacbd18ca 100644 --- a/framework/service/org/moqui/impl/InstanceServices.xml +++ b/framework/service/org/moqui/impl/InstanceServices.xml @@ -214,8 +214,13 @@ along with this software (see the LICENSE.md file). If not, see - - + + + @@ -281,8 +286,9 @@ along with this software (see the LICENSE.md file). If not, see - https://docs.docker.com/engine/security/https/ --> - + +