diff --git a/README.md b/README.md index fd26a67..7c8c547 100644 --- a/README.md +++ b/README.md @@ -182,4 +182,9 @@ Multiple datasets are currently contained in this repo for development and testi - see the [datasets page](./DATASETS.md#htsjdk) for a list of `DRS IDs` for `DrsObjects` in the htsjdk dataset * Open dataset of 384 Phenopackets: [Paper](https://pubmed.ncbi.nlm.nih.gov/32755546/), [Dataset homepage](https://zenodo.org/record/3905420#.YArkBzpKhPZ) - - see the [datasets page](./DATASETS.md#Phenopackets) for a list of `DRS IDs` for `DrsObjects` in the Phenopackets dataset \ No newline at end of file + - see the [datasets page](./DATASETS.md#Phenopackets) for a list of `DRS IDs` for `DrsObjects` in the Phenopackets dataset + +## Changelog + +### v0.2.2 +* patched log4j dependencies to v2.16.0 to avoid [Log4j Vulnerability](https://www.cisa.gov/uscert/apache-log4j-vulnerability-guidance) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 6a5db9b..50c0c02 100644 --- a/build.gradle +++ b/build.gradle @@ -26,9 +26,17 @@ plugins { id 'io.codearte.nexus-staging' version '0.30.0' } +configurations.all { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + if (details.requested.group == 'org.apache.logging.log4j') { + details.useVersion '2.16.0' + } + } +} + archivesBaseName = 'ga4gh-starter-kit-drs' group 'org.ga4gh' -version '0.2.1' +version '0.2.2' repositories { // Use jcenter for resolving dependencies. @@ -54,7 +62,7 @@ dependencies { implementation 'javax.xml.bind:jaxb-api:2.2.8' implementation 'org.springdoc:springdoc-openapi-ui:1.2.33' implementation 'org.xerial:sqlite-jdbc:3.8.11.2' - implementation 'org.ga4gh:ga4gh-starter-kit-common:0.5.4' + implementation 'org.ga4gh:ga4gh-starter-kit-common:0.5.6' testImplementation 'org.testng:testng:7.0.0' testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.0' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f3d88b1..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0f80bbf..d2880ba 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 2fe81a7..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -129,6 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 9618d8d..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,28 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/java/org/ga4gh/starterkit/drs/app/DrsServer.java b/src/main/java/org/ga4gh/starterkit/drs/app/DrsServer.java index ed33925..66e63a8 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/app/DrsServer.java +++ b/src/main/java/org/ga4gh/starterkit/drs/app/DrsServer.java @@ -29,6 +29,7 @@ public static void main(String[] args) { private static boolean setup(String[] args) { Options options = new DrsServerSpringConfig().getCommandLineOptions(); - return ServerPropertySetter.setServerProperties(DrsServerYamlConfigContainer.class, args, options, "config"); + ServerPropertySetter setter = new ServerPropertySetter(); + return setter.setServerProperties(DrsServerYamlConfigContainer.class, args, options, "config"); } } diff --git a/src/main/java/org/ga4gh/starterkit/drs/app/DrsServerSpringConfig.java b/src/main/java/org/ga4gh/starterkit/drs/app/DrsServerSpringConfig.java index dc02207..48f54d9 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/app/DrsServerSpringConfig.java +++ b/src/main/java/org/ga4gh/starterkit/drs/app/DrsServerSpringConfig.java @@ -153,7 +153,8 @@ public DrsServerYamlConfigContainer mergedDrsConfigContainer( @Qualifier(DrsServerConstants.DEFAULT_DRS_CONFIG_CONTAINER) DrsServerYamlConfigContainer defaultContainer, @Qualifier(DrsServerConstants.USER_DRS_CONFIG_CONTAINER) DrsServerYamlConfigContainer userContainer ) { - DeepObjectMerger.merge(userContainer, defaultContainer); + DeepObjectMerger merger = new DeepObjectMerger(); + merger.merge(userContainer, defaultContainer); return defaultContainer; } diff --git a/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java b/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java index 34ec61a..a1af528 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java +++ b/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java @@ -54,7 +54,7 @@ public class DrsServiceInfoDefaults { /** * Default service version */ - public static final String VERSION = "0.2.1"; + public static final String VERSION = "0.2.2"; /** * Default service organization name diff --git a/src/main/java/org/ga4gh/starterkit/drs/model/DrsServiceInfo.java b/src/main/java/org/ga4gh/starterkit/drs/model/DrsServiceInfo.java index ab511ec..240fee0 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/model/DrsServiceInfo.java +++ b/src/main/java/org/ga4gh/starterkit/drs/model/DrsServiceInfo.java @@ -10,16 +10,14 @@ import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.UPDATED_AT; import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.ENVIRONMENT; import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.VERSION; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.PropertyNamingStrategies; -import com.fasterxml.jackson.databind.annotation.JsonNaming; - import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.ORGANIZATION_NAME; import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.ORGANIZATION_URL; import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.SERVICE_TYPE_GROUP; import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.SERVICE_TYPE_ARTIFACT; import static org.ga4gh.starterkit.drs.constant.DrsServiceInfoDefaults.SERVICE_TYPE_VERSION; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; /** * Extension of the GA4GH base service info specification to include DRS-specific diff --git a/src/test/resources/responses/service-info/show/00.json b/src/test/resources/responses/service-info/show/00.json index fa01d2f..515a7a5 100644 --- a/src/test/resources/responses/service-info/show/00.json +++ b/src/test/resources/responses/service-info/show/00.json @@ -1 +1 @@ -{"id":"org.ga4gh.starterkit.drs","name":"GA4GH Starter Kit DRS Service","description":"An open source, community-driven implementation of the GA4GH Data Repository Service (DRS) API specification.","contactUrl":"mailto:info@ga4gh.org","documentationUrl":"https://github.com/ga4gh/ga4gh-starter-kit-drs","createdAt":"2020-01-15T12:00:00Z","updatedAt":"2020-01-15T12:00:00Z","environment":"test","version":"0.2.1","type":{"group":"org.ga4gh","artifact":"drs","version":"1.1.0"},"organization":{"name":"Global Alliance for Genomics and Health","url":"https://ga4gh.org"}} \ No newline at end of file +{"id":"org.ga4gh.starterkit.drs","name":"GA4GH Starter Kit DRS Service","description":"An open source, community-driven implementation of the GA4GH Data Repository Service (DRS) API specification.","contactUrl":"mailto:info@ga4gh.org","documentationUrl":"https://github.com/ga4gh/ga4gh-starter-kit-drs","createdAt":"2020-01-15T12:00:00Z","updatedAt":"2020-01-15T12:00:00Z","environment":"test","version":"0.2.2","type":{"group":"org.ga4gh","artifact":"drs","version":"1.1.0"},"organization":{"name":"Global Alliance for Genomics and Health","url":"https://ga4gh.org"}} \ No newline at end of file