Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7bd8b52
chore(deps-dev): Bump io.swagger.parser.v3:swagger-parser
dependabot[bot] Jul 8, 2025
a4c0b60
chore(deps): Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0
dependabot[bot] Jul 10, 2025
cf20d4c
chore(deps): Bump lib.liquibase.version from 4.32.0 to 4.33.0
dependabot[bot] Jul 10, 2025
5dc0d02
Merge pull request #1315 from DependencyTrack/dependabot/maven/lib.li…
nscuro Jul 12, 2025
aecea73
Merge pull request #1314 from DependencyTrack/dependabot/maven/org.ap…
nscuro Jul 12, 2025
ba27a17
Merge pull request #1313 from DependencyTrack/dependabot/maven/io.swa…
nscuro Jul 12, 2025
7516852
chore(deps): Bump com.github.ben-manes.caffeine:caffeine
dependabot[bot] Jul 14, 2025
64a12ab
chore(deps): Bump lib.micrometer.version from 1.15.1 to 1.15.2
dependabot[bot] Jul 14, 2025
d92cc12
Merge pull request #1317 from DependencyTrack/dependabot/maven/com.gi…
nscuro Jul 14, 2025
ce56a1f
Merge pull request #1318 from DependencyTrack/dependabot/maven/lib.mi…
nscuro Jul 14, 2025
56bdca5
Restrict portfolio metrics to only include projects a user has access to
nscuro Jul 10, 2025
491b69f
Remove redundant `DISTINCT`
nscuro Jul 15, 2025
859f2c2
chore(deps): Bump com.google.cloud.sql:postgres-socket-factory
dependabot[bot] Jul 15, 2025
60b4774
Merge pull request #1316 from DependencyTrack/issue-1680-
nscuro Jul 15, 2025
af1d513
Merge pull request #1319 from DependencyTrack/dependabot/maven/com.go…
nscuro Jul 15, 2025
a3b16ef
Add REST API v2 foundation (#1245)
nscuro Jul 16, 2025
98880ce
Add version filter to concise project endpoints
sahibamittal Jul 16, 2025
b3dcff7
Various REST API v2 fixes (#1320)
nscuro Jul 16, 2025
a9ac1bc
Merge pull request #1321 from DependencyTrack/add-project-version-fil…
nscuro Jul 16, 2025
a7dd5bf
chore(deps): Bump org.openapitools:openapi-generator-maven-plugin
dependabot[bot] Jul 16, 2025
d151f6d
chore(deps): Bump org.apache.maven:maven-artifact from 3.9.10 to 3.9.11
dependabot[bot] Jul 16, 2025
8dc8b4e
Merge pull request #1322 from DependencyTrack/dependabot/maven/org.op…
nscuro Jul 16, 2025
1580354
Remove recursive parent ref from workflow states response (#1326)
nscuro Jul 17, 2025
208de8c
Bump Kafka to 3.9.1 (#1324)
nscuro Jul 17, 2025
9241068
Merge pull request #1323 from DependencyTrack/dependabot/maven/org.ap…
nscuro Jul 17, 2025
61bcd4a
Enable OpenAPI breaking change detection workflow (#1327)
nscuro Jul 18, 2025
d8090b0
Fix BOM upload race condition
nscuro Jul 21, 2025
1e0fda2
Merge pull request #1329 from DependencyTrack/fix-bom-upload-rc
nscuro Jul 21, 2025
6088a82
chore(deps): Bump io.github.ascopes:protobuf-maven-plugin
dependabot[bot] Jul 21, 2025
195166f
chore(deps): Bump com.fasterxml.jackson:jackson-bom
dependabot[bot] Jul 21, 2025
b2567a4
chore(deps): Bump com.zaxxer:HikariCP from 6.3.0 to 6.3.1
dependabot[bot] Jul 21, 2025
26bd30c
chore(deps): Bump org.junit:junit-bom from 5.13.3 to 5.13.4
dependabot[bot] Jul 21, 2025
8e50fd7
chore(deps): Bump commons-io:commons-io from 2.19.0 to 2.20.0
dependabot[bot] Jul 21, 2025
c773d74
Merge pull request #1332 from DependencyTrack/dependabot/maven/com.za…
nscuro Jul 21, 2025
5e45f6e
Merge pull request #1330 from DependencyTrack/dependabot/maven/io.git…
nscuro Jul 21, 2025
648fcc1
Merge pull request #1335 from DependencyTrack/dependabot/maven/common…
nscuro Jul 21, 2025
18c3092
Merge pull request #1331 from DependencyTrack/dependabot/maven/com.fa…
nscuro Jul 21, 2025
60f056e
Fix `/api/v1/project/concise` performance regression (#1333)
nscuro Jul 21, 2025
7fb46f7
chore(deps): Bump stoplightio/spectral-action from 0.8.12 to 0.8.13
dependabot[bot] Jul 21, 2025
c05c2ad
Merge pull request #1334 from DependencyTrack/dependabot/maven/org.ju…
nscuro Jul 21, 2025
846e194
Merge pull request #1336 from DependencyTrack/dependabot/github_actio…
nscuro Jul 21, 2025
73cc24d
Implement generic init task mechanism
nscuro Jun 28, 2025
43a1293
Fix `next` page URL generation (#1328)
nscuro Jul 22, 2025
aba3f80
Fix HikariCP failure to create meter registry (#1337)
nscuro Jul 22, 2025
b08d3da
Fix flaky `testCreateMetricsPartitions` test (#1338)
nscuro Jul 22, 2025
c7ae41c
chore(deps): Bump com.nimbusds:oauth2-oidc-sdk from 11.26 to 11.26.1
dependabot[bot] Jul 24, 2025
ed2050f
chore(deps): Bump com.zaxxer:HikariCP from 6.3.1 to 6.3.2
dependabot[bot] Jul 24, 2025
c06b427
Merge pull request #1296 from DependencyTrack/init-task-abstraction
nscuro Jul 25, 2025
00e379c
Merge pull request #1341 from DependencyTrack/dependabot/maven/com.za…
nscuro Jul 25, 2025
6490c38
Merge pull request #1340 from DependencyTrack/dependabot/maven/com.ni…
nscuro Jul 25, 2025
db00ad6
Use `project.version` to refer to submodules (#1339)
nscuro Jul 25, 2025
318432a
Merge branch 'main' of github.com:DependencyTrack/hyades-apiserver in…
nscuro Jul 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/_meta-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,20 @@ jobs:
mvn -B -Pquick -Dservices.bom.merge.skip=false package

- name: Upload Artifacts
uses: actions/[email protected]
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
with:
name: assembled-wars
path: |-
apiserver/target/*.jar
apiserver/target/bom.json

- name: Upload OpenAPI Spec
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
with:
name: openapi-spec
path: |-
api/target/classes/**/openapi.yaml

build-container:
runs-on: ubuntu-latest
timeout-minutes: 5
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/ci-openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This file is part of Dependency-Track.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
name: OpenAPI

on:
pull_request:
paths:
- api/src/main/openapi/**
- api/src/main/spectral/**

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions: { }

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
checks: write
timeout-minutes: 5
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
- name: Lint OpenAPI Spec
uses: stoplightio/spectral-action@6416fd018ae38e60136775066eb3e98172143141 # tag=v0.8.13
with:
spectral_ruleset: "api/src/main/spectral/ruleset.yaml"
file_glob: "api/src/main/openapi/openapi.yaml"

breaking-changes:
name: Breaking Changes
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
- name: Detect Breaking Changes
uses: oasdiff/oasdiff-action/breaking@1c611ffb1253a72924624aa4fb662e302b3565d3 # tag=v0.0.21
with:
base: https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/api/src/main/openapi/openapi.yaml
revision: api/src/main/openapi/openapi.yaml
fail-on: ERR
2 changes: 1 addition & 1 deletion .mvn/maven-build-cache-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</configuration>
<input>
<global>
<glob>{*.java,*.properties,*.proto,*.sql,*.xml}</glob>
<glob>{*.java,*.properties,*.proto,*.sql,*.xml,*.yaml}</glob>
<includes>
<include>src/</include>
</includes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

/**
* The primary class that starts an embedded Jetty server
*
* @author Steve Springett
* @since 1.0.0
*/
Expand Down Expand Up @@ -73,7 +74,7 @@ public static void main(final String[] args) throws Exception {

final Server server = new Server();
final HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.addCustomizer( new org.eclipse.jetty.server.ForwardedRequestCustomizer() ); // Add support for X-Forwarded headers
httpConfig.addCustomizer(new org.eclipse.jetty.server.ForwardedRequestCustomizer()); // Add support for X-Forwarded headers

// Enable legacy (mimicking Jetty 9) URI compliance.
// This is required to allow URL encoding in path segments, e.g. "/foo/bar%2Fbaz".
Expand All @@ -89,7 +90,7 @@ public static void main(final String[] args) throws Exception {
// here, the only viable long-term solution is to adapt REST APIs to follow Servlet API 6 spec.
httpConfig.setUriCompliance(UriCompliance.LEGACY);

final HttpConnectionFactory connectionFactory = new HttpConnectionFactory( httpConfig );
final HttpConnectionFactory connectionFactory = new HttpConnectionFactory(httpConfig);
final ServerConnector connector = new ServerConnector(server, connectionFactory);
connector.setHost(host);
connector.setPort(port);
Expand All @@ -102,6 +103,7 @@ public static void main(final String[] args) throws Exception {
context.setErrorHandler(new ErrorHandler());
context.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*/[^/]*taglibs.*\\.jar$");
context.setThrowUnavailableOnStartupException(true);

// Prevent loading of logging classes
context.getProtectedClassMatcher().add("org.apache.log4j.");
Expand Down
2 changes: 2 additions & 0 deletions alpine/alpine-infra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@
<dependency>
<groupId>org.dependencytrack</groupId>
<artifactId>alpine-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.dependencytrack</groupId>
<artifactId>alpine-model</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
1 change: 1 addition & 0 deletions alpine/alpine-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<dependency>
<groupId>org.dependencytrack</groupId>
<artifactId>alpine-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
3 changes: 3 additions & 0 deletions alpine/alpine-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@
<dependency>
<groupId>org.dependencytrack</groupId>
<artifactId>alpine-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.dependencytrack</groupId>
<artifactId>alpine-infra</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.dependencytrack</groupId>
<artifactId>alpine-model</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Misc helper libraries -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@

import alpine.common.logging.Logger;
import alpine.model.ApiKey;
import alpine.server.auth.ApiKeyAuthenticationService;
import alpine.server.auth.AllowApiKeyInQueryParameter;
import alpine.server.auth.ApiKeyAuthenticationService;
import alpine.server.auth.JwtAuthenticationService;
import org.glassfish.jersey.server.ContainerRequest;
import org.owasp.security.logging.SecurityMarkers;
import org.slf4j.MDC;

import jakarta.annotation.Priority;
import jakarta.ws.rs.HttpMethod;
import jakarta.ws.rs.NotAuthorizedException;
import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ContainerRequestFilter;
import jakarta.ws.rs.container.ContainerResponseContext;
import jakarta.ws.rs.container.ContainerResponseFilter;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.container.ResourceInfo;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.Response;
import javax.naming.AuthenticationException;
import java.io.IOException;
import java.security.Principal;
Expand Down Expand Up @@ -79,8 +80,7 @@ public void filter(ContainerRequestContext requestContext) {
}
} catch (AuthenticationException e) {
LOGGER.info(SecurityMarkers.SECURITY_FAILURE, "Invalid API key asserted");
requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED).build());
return;
throw new NotAuthorizedException(Response.status(Response.Status.UNAUTHORIZED).build());
}
}

Expand All @@ -90,13 +90,12 @@ public void filter(ContainerRequestContext requestContext) {
principal = jwtAuthService.authenticate();
} catch (AuthenticationException e) {
LOGGER.info(SecurityMarkers.SECURITY_FAILURE, "Invalid JWT asserted");
requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED).build());
return;
throw new NotAuthorizedException(Response.status(Response.Status.UNAUTHORIZED).build());
}
}

if (principal == null) {
requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED).build());
throw new NotAuthorizedException(Response.status(Response.Status.UNAUTHORIZED).build());
} else {
requestContext.setProperty("Principal", principal);
MDC.put("principal", principal.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.owasp.security.logging.SecurityMarkers;

import jakarta.annotation.Priority;
import jakarta.ws.rs.ForbiddenException;
import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ContainerRequestFilter;
Expand Down Expand Up @@ -62,8 +63,7 @@ public void filter(ContainerRequestContext requestContext) {
final Principal principal = (Principal) requestContext.getProperty("Principal");
if (principal == null) {
LOGGER.info(SecurityMarkers.SECURITY_FAILURE, "A request was made without the assertion of a valid user principal");
requestContext.abortWith(Response.status(Response.Status.FORBIDDEN).build());
return;
throw new ForbiddenException(Response.status(Response.Status.FORBIDDEN).build());
}

final Set<String> effectivePermissions;
Expand Down Expand Up @@ -97,7 +97,7 @@ public void filter(ContainerRequestContext requestContext) {
LOGGER.info(SecurityMarkers.SECURITY_FAILURE, "Unauthorized access attempt made by %s to %s"
.formatted(requestPrincipal, requestUri));

requestContext.abortWith(Response.status(Response.Status.FORBIDDEN).build());
throw new ForbiddenException(Response.status(Response.Status.FORBIDDEN).build());
} else {
requestContext.setProperty(EFFECTIVE_PERMISSIONS_PROPERTY, effectivePermissions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import alpine.persistence.JdoProperties;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import com.zaxxer.hikari.metrics.micrometer.MicrometerMetricsTrackerFactory;
import io.micrometer.core.instrument.FunctionCounter;
import io.micrometer.core.instrument.Gauge;
import org.datanucleus.PropertyNames;
Expand Down Expand Up @@ -347,7 +348,7 @@ private HikariConfig createBaseHikariConfig(final String poolName) {
hikariConfig.setPassword(Config.getInstance().getPropertyOrFile(Config.AlpineKey.DATABASE_PASSWORD));

if (Config.getInstance().getPropertyAsBoolean(Config.AlpineKey.METRICS_ENABLED)) {
hikariConfig.setMetricRegistry(Metrics.getRegistry());
hikariConfig.setMetricsTrackerFactory(new MicrometerMetricsTrackerFactory(Metrics.getRegistry()));
}

return hikariConfig;
Expand Down
12 changes: 6 additions & 6 deletions alpine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
<!-- Dependency Versions -->
<lib.angus-mail.version>2.0.3</lib.angus-mail.version>
<lib.bcrypt.version>0.4</lib.bcrypt.version>
<lib.caffeine.version>3.2.1</lib.caffeine.version>
<lib.caffeine.version>3.2.2</lib.caffeine.version>
<lib.commons.collections4.version>4.5.0</lib.commons.collections4.version>
<lib.commons.io.version>2.19.0</lib.commons.io.version>
<lib.commons.lang3.version>3.17.0</lib.commons.lang3.version>
<lib.commons.io.version>2.20.0</lib.commons.io.version>
<lib.commons.lang3.version>3.18.0</lib.commons.lang3.version>
<lib.h2.version>2.3.232</lib.h2.version>
<lib.hikaricp.version>6.3.0</lib.hikaricp.version>
<lib.hikaricp.version>6.3.2</lib.hikaricp.version>
<lib.javassist.version>3.30.2-GA</lib.javassist.version>
<lib.jaxb-runtime.version>4.0.5</lib.jaxb-runtime.version>
<lib.jdo.api.version>3.2.1</lib.jdo.api.version>
Expand All @@ -90,9 +90,9 @@
<lib.jsr305.version>3.0.2</lib.jsr305.version>
<lib.logback.version>1.5.18</lib.logback.version>
<lib.logstash-logback-encoder.version>8.1</lib.logstash-logback-encoder.version>
<lib.micrometer.version>1.15.1</lib.micrometer.version>
<lib.micrometer.version>1.15.2</lib.micrometer.version>
<lib.microprofile-health-api.version>4.0.1</lib.microprofile-health-api.version>
<lib.nimbus-oauth2-oidc-sdk.version>11.26</lib.nimbus-oauth2-oidc-sdk.version>
<lib.nimbus-oauth2-oidc-sdk.version>11.26.1</lib.nimbus-oauth2-oidc-sdk.version>
<lib.owasp.encoder.version>1.3.1</lib.owasp.encoder.version>
<lib.owasp.security-logging.version>1.1.7</lib.owasp.security-logging.version>
<lib.parsson.version>1.1.7</lib.parsson.version>
Expand Down
15 changes: 15 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# api

Definition of Dependency-Track's REST API, in [OpenAPI v3.0] format.

The API draws inspiration from [Zalando's RESTful API Guidelines].

Conformance to API guidelines is enforced with [spectral] in CI.
Validation may be performed locally using [`openapi-lint.sh`](../dev/scripts/openapi-lint.sh).

Interfaces and model classes are generated as part of the build using [openapi-generator].

[OpenAPI v3.0]: https://spec.openapis.org/oas/v3.0.3.html
[Zalando's RESTful API Guidelines]: https://opensource.zalando.com/restful-api-guidelines/
[openapi-generator]: https://github.com/OpenAPITools/openapi-generator
[spectral]: https://github.com/stoplightio/spectral
Loading