Skip to content

Commit

Permalink
Merge pull request #975 from DependencyTrack/bump-dependenciesx
Browse files Browse the repository at this point in the history
  • Loading branch information
nscuro authored Nov 22, 2024
2 parents 2334dca + 1a9edfd commit 0ab3cb0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 38 deletions.
4 changes: 3 additions & 1 deletion dev/scripts/dbschema-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ username=dtrack
password=dtrack
EOF

mvn liquibase:update -Dliquibase.propertyFile="$(basename "${TMP_LIQUIBASE_CONFIG_FILE}")"; \
mvn liquibase:update \
-Dliquibase.analytics.enabled=false \
-Dliquibase.propertyFile="$(basename "${TMP_LIQUIBASE_CONFIG_FILE}")"; \
docker exec "${CONTAINER_ID}" pg_dump -Udtrack --schema-only --no-owner --no-privileges dtrack | sed -e '/^--/d' | cat -s > "${ROOT_DIR}/schema.sql"; \
docker stop "${CONTAINER_ID}"; \
rm "${TMP_LIQUIBASE_CONFIG_FILE}"
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,34 @@
<lib.alpine.version>${project.parent.version}</lib.alpine.version>
<lib.awaitility.version>4.2.2</lib.awaitility.version>
<lib.cel-tools.version>0.5.1</lib.cel-tools.version>
<lib.checkstyle.version>10.17.0</lib.checkstyle.version>
<lib.cloud-sql-postgres-socket-factory.version>1.20.0</lib.cloud-sql-postgres-socket-factory.version>
<lib.checkstyle.version>10.20.1</lib.checkstyle.version>
<lib.cloud-sql-postgres-socket-factory.version>1.21.0</lib.cloud-sql-postgres-socket-factory.version>
<lib.commons-compress.version>1.27.1</lib.commons-compress.version>
<lib.cpe-parser.version>2.1.0</lib.cpe-parser.version>
<lib.cvss-calculator.version>1.4.3</lib.cvss-calculator.version>
<lib.owasp-rr-calculator.version>1.0.1</lib.owasp-rr-calculator.version>
<lib.cyclonedx-java.version>9.0.5</lib.cyclonedx-java.version>
<lib.datanucleus-postgresql.version>0.2.0</lib.datanucleus-postgresql.version>
<lib.jaxb.runtime.version>4.0.5</lib.jaxb.runtime.version>
<lib.jdbi.version>3.45.4</lib.jdbi.version>
<lib.jdbi.version>3.47.0</lib.jdbi.version>
<lib.json-unit.version>4.0.0</lib.json-unit.version>
<lib.junit.version>4.13.2</lib.junit.version>
<lib.kafka.version>3.8.0</lib.kafka.version>
<lib.liquibase.version>4.29.2</lib.liquibase.version>
<lib.liquibase.version>4.30.0</lib.liquibase.version>
<lib.micrometer-jvm-extras.version>0.2.2</lib.micrometer-jvm-extras.version>
<lib.minio.version>8.5.13</lib.minio.version>
<lib.kotlin-stdlib.version>2.0.0</lib.kotlin-stdlib.version>
<lib.wiremock.version>3.9.2</lib.wiremock.version>
<lib.packageurl.version>1.5.0</lib.packageurl.version>
<lib.parallel-consumer.version>0.5.3.1</lib.parallel-consumer.version>
<lib.parallel-consumer.version>0.5.3.2</lib.parallel-consumer.version>
<lib.pebble.version>3.2.2</lib.pebble.version>
<lib.protobuf-java.version>4.28.3</lib.protobuf-java.version>
<lib.testcontainers.version>1.20.4</lib.testcontainers.version>
<lib.resilience4j.version>2.2.0</lib.resilience4j.version>
<lib.swagger-parser.version>2.1.22</lib.swagger-parser.version>
<lib.swagger-parser.version>2.1.23</lib.swagger-parser.version>
<lib.system-rules.version>1.19.0</lib.system-rules.version>
<lib.versatile.version>0.7.0</lib.versatile.version>
<lib.woodstox.version>7.0.0</lib.woodstox.version>
<lib.woodstox.version>7.1.0</lib.woodstox.version>
<lib.junit-params.version>1.1.1</lib.junit-params.version>
<lib.log4j-over-slf4j.version>2.0.16</lib.log4j-over-slf4j.version>
<lib.httpclient.version>4.5.14</lib.httpclient.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
import alpine.common.logging.Logger;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import liquibase.Liquibase;
import liquibase.Scope;
import liquibase.UpdateSummaryOutputEnum;
import liquibase.analytics.configuration.AnalyticsArgs;
import liquibase.command.CommandScope;
import liquibase.command.core.UpdateCommandStep;
import liquibase.command.core.helpers.DbUrlConnectionArgumentsCommandStep;
Expand All @@ -38,6 +37,8 @@
import liquibase.ui.LoggerUIService;
import org.dependencytrack.common.ConfigKey;

import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Optional;
Expand Down Expand Up @@ -97,6 +98,7 @@ public static void runMigration(final DataSource dataSource) throws Exception {

public static void runMigration(final DataSource dataSource, final String changelogResourcePath) throws Exception {
final var scopeAttributes = new HashMap<String, Object>();
scopeAttributes.put(AnalyticsArgs.ENABLED.getKey(), false);
scopeAttributes.put(Scope.Attr.logService.name(), new LiquibaseLogger.LogService());
scopeAttributes.put(Scope.Attr.ui.name(), new LoggerUIService());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ public void testWithoutAlpineRequest() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand All @@ -98,8 +97,7 @@ public void testWithAlpineRequestFilter() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE AND 'foo' = :apiFilter
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{apiFilter:foo}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{named:{apiFilter:foo}}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand All @@ -123,8 +121,7 @@ public void testWithAlpineRequestPagination() {
OFFSET :paginationOffset FETCH NEXT :paginationLimit ROWS ONLY
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{paginationOffset:0,paginationLimit:100}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{named:{paginationOffset:0,paginationLimit:100}}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -187,8 +184,7 @@ public void testWithAlpineRequestOrderingWithAllowedColumns() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE ORDER BY "valueA" DESC
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -259,8 +255,7 @@ public void testWithAlpineRequestOrderingWithAlwaysByMatchingOrderBy() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE ORDER BY "valueA" DESC
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand All @@ -287,8 +282,7 @@ public void testWithAlpineRequestOrderingWithAlwaysBy() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE ORDER BY "valueA" DESC, "valueB"
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand All @@ -315,8 +309,7 @@ public void testWithAlpineRequestOrderingWithAlwaysByAndDirection() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE ORDER BY "valueA" DESC, "valueB" asc
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -349,8 +342,7 @@ public void testWithPortfolioAclDisabled() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -383,8 +375,7 @@ public void testWithPortfolioAclEnabledWithNoTeams() {
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE AND FALSE
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -423,8 +414,7 @@ public void testWithPortfolioAclEnabledWithApiKeyHavingAccessManagementPermissio
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -463,8 +453,7 @@ public void testWithPortfolioAclEnabledWithManagedUserHavingAccessManagementPerm
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -503,8 +492,7 @@ public void testWithPortfolioAclEnabledWithLdapUserHavingAccessManagementPermiss
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -543,8 +531,7 @@ public void testWithPortfolioAclEnabledWithOidcUserHavingAccessManagementPermiss
SELECT 1 AS "valueA", 2 AS "valueB" FROM "PROJECT" WHERE TRUE
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{}, finder:[]}""");
assertThat(ctx.getBinding()).hasToString("{}");
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down Expand Up @@ -586,8 +573,7 @@ AND EXISTS (SELECT 1
)
""");

assertThat(ctx.getBinding()).hasToString("""
{positional:{}, named:{projectAclTeamIds:[%s]}, finder:[]}""".formatted(team.getId()));
assertThat(ctx.getBinding()).hasToString("{named:{projectAclTeamIds:[%s]}}".formatted(team.getId()));
}))
.createQuery(TEST_QUERY_TEMPLATE)
.mapTo(Integer.class)
Expand Down

0 comments on commit 0ab3cb0

Please sign in to comment.