From cec723a3a028946b4078c88449c27cec90c3723b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marlon=20G=C3=A4thje?= Date: Thu, 31 Oct 2024 13:33:23 +0100 Subject: [PATCH] ci-build fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marlon Gäthje --- pom.xml | 8 + .../model/ScheduledNotificationRule.java | 8 +- .../ScheduledNotificationTaskInitializer.java | 4 +- .../persistence/FindingsQueryManager.java | 2 + .../v1/NotificationPublisherResource.java | 25 +- .../v1/ScheduledNotificationRuleResource.java | 236 ++++++++++-------- .../tasks/SendScheduledNotificationTask.java | 6 +- .../util/NotificationUtil.java | 2 +- 8 files changed, 170 insertions(+), 121 deletions(-) diff --git a/pom.xml b/pom.xml index 6badf0d9bd..ed45be832d 100644 --- a/pom.xml +++ b/pom.xml @@ -100,6 +100,7 @@ 1.4.2 1.0.1 9.1.0 + 3.0.2 2.1.0 2.18.0 2.18.0 @@ -114,6 +115,7 @@ 3.2.2 4.28.3 2.2.0 + 2.2.25 2.1.22 1.19.0 1.20.3 @@ -218,6 +220,12 @@ provided + + jakarta.validation + jakarta.validation-api + ${lib.jakarta-validation.version} + + com.github.package-url packageurl-java diff --git a/src/main/java/org/dependencytrack/model/ScheduledNotificationRule.java b/src/main/java/org/dependencytrack/model/ScheduledNotificationRule.java index 4582f54b11..cca4238b20 100644 --- a/src/main/java/org/dependencytrack/model/ScheduledNotificationRule.java +++ b/src/main/java/org/dependencytrack/model/ScheduledNotificationRule.java @@ -40,10 +40,10 @@ import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import javax.jdo.annotations.Unique; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; import org.apache.commons.collections4.CollectionUtils; import org.dependencytrack.notification.NotificationGroup; diff --git a/src/main/java/org/dependencytrack/notification/ScheduledNotificationTaskInitializer.java b/src/main/java/org/dependencytrack/notification/ScheduledNotificationTaskInitializer.java index a3341bc9d3..75755dd570 100644 --- a/src/main/java/org/dependencytrack/notification/ScheduledNotificationTaskInitializer.java +++ b/src/main/java/org/dependencytrack/notification/ScheduledNotificationTaskInitializer.java @@ -18,8 +18,8 @@ */ package org.dependencytrack.notification; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; import org.dependencytrack.model.ScheduledNotificationRule; import org.dependencytrack.persistence.QueryManager; diff --git a/src/main/java/org/dependencytrack/persistence/FindingsQueryManager.java b/src/main/java/org/dependencytrack/persistence/FindingsQueryManager.java index 7474b8ce86..9b422fa016 100644 --- a/src/main/java/org/dependencytrack/persistence/FindingsQueryManager.java +++ b/src/main/java/org/dependencytrack/persistence/FindingsQueryManager.java @@ -28,6 +28,7 @@ import org.dependencytrack.model.Component; import org.dependencytrack.model.Finding; import org.dependencytrack.model.Project; +import org.dependencytrack.model.RepositoryMetaComponent; import org.dependencytrack.model.RepositoryType; import org.dependencytrack.model.VulnIdAndSource; import org.dependencytrack.model.Vulnerability; @@ -40,6 +41,7 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; diff --git a/src/main/java/org/dependencytrack/resources/v1/NotificationPublisherResource.java b/src/main/java/org/dependencytrack/resources/v1/NotificationPublisherResource.java index 356fab64ad..bb5cf38545 100644 --- a/src/main/java/org/dependencytrack/resources/v1/NotificationPublisherResource.java +++ b/src/main/java/org/dependencytrack/resources/v1/NotificationPublisherResource.java @@ -111,14 +111,12 @@ public Response getAllNotificationPublishers() { @GET @Path("/event") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Returns a list of all event-driven notification publishers", - response = NotificationPublisher.class, - responseContainer = "List", - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Returns a list of all event-driven notification publishers", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 401, message = "Unauthorized") + @ApiResponse(responseCode = "401", description = "Unauthorized") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response getAllEventNotificationPublishers() { @@ -131,14 +129,17 @@ public Response getAllEventNotificationPublishers() { @GET @Path("/scheduled") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Returns a list of all scheduled notification publishers", - response = NotificationPublisher.class, - responseContainer = "List", - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Returns a list of all scheduled notification publishers", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 401, message = "Unauthorized") + @ApiResponse( + responseCode = "200", + description = "A list of all notification publishers", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = NotificationPublisher.class))) + ), + @ApiResponse(responseCode = "401", description = "Unauthorized") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response getAllScheduledNotificationPublishers() { diff --git a/src/main/java/org/dependencytrack/resources/v1/ScheduledNotificationRuleResource.java b/src/main/java/org/dependencytrack/resources/v1/ScheduledNotificationRuleResource.java index 27ff9b616d..628f55c08d 100644 --- a/src/main/java/org/dependencytrack/resources/v1/ScheduledNotificationRuleResource.java +++ b/src/main/java/org/dependencytrack/resources/v1/ScheduledNotificationRuleResource.java @@ -18,18 +18,9 @@ */ package org.dependencytrack.resources.v1; -import alpine.common.logging.Logger; -import alpine.model.Team; -import alpine.persistence.PaginatedResult; -import alpine.server.auth.PermissionRequired; -import alpine.server.resources.AlpineResource; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Authorization; -import io.swagger.annotations.ResponseHeader; +import java.util.List; +import java.util.concurrent.TimeUnit; + import org.apache.commons.lang3.StringUtils; import org.dependencytrack.auth.Permissions; import org.dependencytrack.model.NotificationPublisher; @@ -41,45 +32,65 @@ import org.dependencytrack.notification.publisher.SendMailPublisher; import org.dependencytrack.persistence.QueryManager; import org.dependencytrack.resources.v1.openapi.PaginatedApi; + import com.asahaf.javacron.InvalidExpressionException; import com.asahaf.javacron.Schedule; -import javax.validation.Validator; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import java.util.List; -import java.util.concurrent.TimeUnit; +import alpine.common.logging.Logger; +import alpine.model.Team; +import alpine.persistence.PaginatedResult; +import alpine.server.auth.PermissionRequired; +import alpine.server.resources.AlpineResource; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.headers.Header; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityRequirements; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Validator; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; /** * JAX-RS resources for processing scheduled notification rules. */ @Path("/v1/schedulednotification/rule") -@Api(value = "schedulednotification", authorizations = @Authorization(value = "X-Api-Key")) +@Tag(name = "schedulednotification") +@SecurityRequirements({ + @SecurityRequirement(name = "ApiKeyAuth"), + @SecurityRequirement(name = "BearerAuth") +}) public class ScheduledNotificationRuleResource extends AlpineResource { private static final Logger LOGGER = Logger.getLogger(ScheduledNotificationRuleResource.class); @GET @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Returns a list of all scheduled notification rules", - response = ScheduledNotificationRule.class, - responseContainer = "List", - responseHeaders = @ResponseHeader(name = TOTAL_COUNT_HEADER, response = Long.class, description = "The total number of scheduled notification rules"), - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Returns a list of all scheduled notification rules", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @PaginatedApi @ApiResponses(value = { - @ApiResponse(code = 401, message = "Unauthorized") + @ApiResponse( + responseCode = "401", + description = "Unauthorized", + headers = @Header(name = TOTAL_COUNT_HEADER, description = "The total number of scheduled notification rules", schema = @Schema(format = "integer")), + content = @Content(array = @ArraySchema(schema = @Schema(implementation = ScheduledNotificationRule.class))) + ) }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response getAllScheduledNotificationRules() { @@ -92,15 +103,18 @@ public Response getAllScheduledNotificationRules() { @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Creates a new scheduled notification rule", - response = ScheduledNotificationRule.class, - code = 201, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Creates a new scheduled notification rule", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The UUID of the notification publisher could not be found") + @ApiResponse( + responseCode = "201", + description = "The created scheduled notification rule", + content = @Content(schema = @Schema(implementation = ScheduledNotificationRule.class)) + ), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The UUID of the scheduled notification rule could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response createScheduledNotificationRule(ScheduledNotificationRule jsonRule) { @@ -117,14 +131,14 @@ public Response createScheduledNotificationRule(ScheduledNotificationRule jsonRu publisher =qm.getObjectByUuid(NotificationPublisher.class, jsonRule.getPublisher().getUuid()); } if (publisher == null) { - return Response.status(Response.Status.NOT_FOUND).entity("The UUID of the notification publisher could not be found.").build(); + return Response.status(Response.Status.NOT_FOUND).entity("The UUID of the scheduled notification rule could not be found.").build(); } final ScheduledNotificationRule rule = qm.createScheduledNotificationRule( StringUtils.trimToNull(jsonRule.getName()), jsonRule.getScope(), publisher ); - + if(rule.isEnabled()) { Schedule schedule; try { @@ -143,14 +157,18 @@ public Response createScheduledNotificationRule(ScheduledNotificationRule jsonRu @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Updates a scheduled notification rule", - response = ScheduledNotificationRule.class, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Updates a scheduled notification rule", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The UUID of the scheduled notification rule could not be found") + @ApiResponse( + responseCode = "200", + description = "The updated scheduled notification rule", + content = @Content(schema = @Schema(implementation = ScheduledNotificationRule.class)) + ), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The UUID of the scheduled notification rule could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response updateScheduledNotificationRule(ScheduledNotificationRule jsonRule) { @@ -189,14 +207,14 @@ public Response updateScheduledNotificationRule(ScheduledNotificationRule jsonRu @DELETE @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Deletes a scheduled notification rule", - code = 204, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Deletes a scheduled notification rule", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The UUID of the scheduled notification rule could not be found") + @ApiResponse(responseCode = "204", description = "Scheduled notification rule removed successfully"), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The UUID of the scheduled notification rule could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response deleteScheduledNotificationRule(ScheduledNotificationRule jsonRule) { @@ -206,7 +224,7 @@ public Response deleteScheduledNotificationRule(ScheduledNotificationRule jsonRu qm.delete(rule); ScheduledNotificationTaskManager.cancelActiveRuleTask(jsonRule.getUuid()); - + return Response.status(Response.Status.NO_CONTENT).build(); } else { return Response.status(Response.Status.NOT_FOUND).entity("The UUID of the scheduled notification rule could not be found.").build(); @@ -218,21 +236,25 @@ public Response deleteScheduledNotificationRule(ScheduledNotificationRule jsonRu @Path("/{ruleUuid}/project/{projectUuid}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Adds a project to a scheduled notification rule", - response = ScheduledNotificationRule.class, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Adds a project to a scheduled notification rule", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 304, message = "The rule already has the specified project assigned"), - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The scheduled notification rule or project could not be found") + @ApiResponse( + responseCode = "200", + description = "The updated scheduled notification rule", + content = @Content(schema = @Schema(implementation = ScheduledNotificationRule.class)) + ), + @ApiResponse(responseCode = "304", description = "The rule already has the specified project assigned"), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The scheduled notification rule or project could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response addProjectToRule( - @ApiParam(value = "The UUID of the rule to add a project to", format = "uuid", required = true) + @Parameter(description = "The UUID of the rule to add a project to", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("ruleUuid") @ValidUuid String ruleUuid, - @ApiParam(value = "The UUID of the project to add to the rule", format = "uuid", required = true) + @Parameter(description = "The UUID of the project to add to the rule", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("projectUuid") @ValidUuid String projectUuid) { try (QueryManager qm = new QueryManager()) { final ScheduledNotificationRule rule = qm.getObjectByUuid(ScheduledNotificationRule.class, ruleUuid); @@ -260,21 +282,25 @@ public Response addProjectToRule( @Path("/{ruleUuid}/project/{projectUuid}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Removes a project from a scheduled notification rule", - response = ScheduledNotificationRule.class, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Removes a project from a scheduled notification rule", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 304, message = "The rule does not have the specified project assigned"), - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The scheduled notification rule or project could not be found") + @ApiResponse( + responseCode = "200", + description = "The deleted scheduled notification rule", + content = @Content(schema = @Schema(implementation = ScheduledNotificationRule.class)) + ), + @ApiResponse(responseCode = "304", description = "The rule does not have the specified project assigned"), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The scheduled notification rule or project could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response removeProjectFromRule( - @ApiParam(value = "The UUID of the rule to remove the project from", format = "uuid", required = true) + @Parameter(description = "The UUID of the rule to remove the project from", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("ruleUuid") @ValidUuid String ruleUuid, - @ApiParam(value = "The UUID of the project to remove from the rule", format = "uuid", required = true) + @Parameter(description = "The UUID of the project to remove from the rule", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("projectUuid") @ValidUuid String projectUuid) { try (QueryManager qm = new QueryManager()) { final ScheduledNotificationRule rule = qm.getObjectByUuid(ScheduledNotificationRule.class, ruleUuid); @@ -302,21 +328,25 @@ public Response removeProjectFromRule( @Path("/{ruleUuid}/team/{teamUuid}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Adds a team to a scheduled scheduled notification rule", - response = ScheduledNotificationRule.class, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Adds a team to a scheduled scheduled notification rule", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 304, message = "The rule already has the specified team assigned"), - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The scheduled notification rule or team could not be found") + @ApiResponse( + responseCode = "200", + description = "The updated scheduled notification rule", + content = @Content(schema = @Schema(implementation = ScheduledNotificationRule.class)) + ), + @ApiResponse(responseCode = "304", description = "The rule already has the specified team assigned"), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The scheduled notification rule or team could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response addTeamToRule( - @ApiParam(value = "The UUID of the rule to add a team to", format = "uuid", required = true) + @Parameter(description = "The UUID of the rule to add a team to", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("ruleUuid") @ValidUuid String ruleUuid, - @ApiParam(value = "The UUID of the team to add to the rule", format = "uuid", required = true) + @Parameter(description = "The UUID of the team to add to the rule", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("teamUuid") @ValidUuid String teamUuid) { try (QueryManager qm = new QueryManager()) { final ScheduledNotificationRule rule = qm.getObjectByUuid(ScheduledNotificationRule.class, ruleUuid); @@ -344,14 +374,18 @@ public Response addTeamToRule( @Path("/execute") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Executes a scheduled notification rule instantly ignoring the cron expression", - response = ScheduledNotificationRule.class, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Executes a scheduled notification rule instantly ignoring the cron expression", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The UUID of the scheduled notification rule could not be found") + @ApiResponse( + responseCode = "200", + description = "The updated scheduled notification rule", + content = @Content(schema = @Schema(implementation = ScheduledNotificationRule.class)) + ), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The UUID of the scheduled notification rule could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response executeScheduledNotificationRuleNow(ScheduledNotificationRule jsonRule) { @@ -383,21 +417,25 @@ public Response executeScheduledNotificationRuleNow(ScheduledNotificationRule js @Path("/{ruleUuid}/team/{teamUuid}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Removes a team from a scheduled notification rule", - response = ScheduledNotificationRule.class, - notes = "

Requires permission SYSTEM_CONFIGURATION

" + @Operation( + summary = "Removes a team from a scheduled notification rule", + description = "

Requires permission SYSTEM_CONFIGURATION

" ) @ApiResponses(value = { - @ApiResponse(code = 304, message = "The rule does not have the specified team assigned"), - @ApiResponse(code = 401, message = "Unauthorized"), - @ApiResponse(code = 404, message = "The scheduled notification rule or team could not be found") + @ApiResponse( + responseCode = "200", + description = "The deleted scheduled notification rule", + content = @Content(schema = @Schema(implementation = ScheduledNotificationRule.class)) + ), + @ApiResponse(responseCode = "304", description = "The rule does not have the specified team assigned"), + @ApiResponse(responseCode = "401", description = "Unauthorized"), + @ApiResponse(responseCode = "404", description = "The scheduled notification rule or team could not be found") }) @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION) public Response removeTeamFromRule( - @ApiParam(value = "The UUID of the rule to remove the project from", format = "uuid", required = true) + @Parameter(description = "The UUID of the rule to remove the project from", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("ruleUuid") @ValidUuid String ruleUuid, - @ApiParam(value = "The UUID of the project to remove from the rule", format = "uuid", required = true) + @Parameter(description = "The UUID of the project to remove from the rule", schema = @Schema(type = "string", format = "uuid"), required = true) @PathParam("teamUuid") @ValidUuid String teamUuid) { try (QueryManager qm = new QueryManager()) { final ScheduledNotificationRule rule = qm.getObjectByUuid(ScheduledNotificationRule.class, ruleUuid); @@ -420,4 +458,4 @@ public Response removeTeamFromRule( return Response.status(Response.Status.NOT_MODIFIED).build(); } } -} +} \ No newline at end of file diff --git a/src/main/java/org/dependencytrack/tasks/SendScheduledNotificationTask.java b/src/main/java/org/dependencytrack/tasks/SendScheduledNotificationTask.java index 89aa98197e..16d22dc5fb 100644 --- a/src/main/java/org/dependencytrack/tasks/SendScheduledNotificationTask.java +++ b/src/main/java/org/dependencytrack/tasks/SendScheduledNotificationTask.java @@ -24,9 +24,9 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.UUID; -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonReader; +import jakarta.json.Json; +import jakarta.json.JsonObject; +import jakarta.json.JsonReader; import org.dependencytrack.exception.PublisherException; import org.dependencytrack.model.NotificationPublisher; import org.dependencytrack.model.ScheduledNotificationRule; diff --git a/src/main/java/org/dependencytrack/util/NotificationUtil.java b/src/main/java/org/dependencytrack/util/NotificationUtil.java index 6393960cc1..6a6eb6ebc5 100644 --- a/src/main/java/org/dependencytrack/util/NotificationUtil.java +++ b/src/main/java/org/dependencytrack/util/NotificationUtil.java @@ -77,7 +77,7 @@ import jakarta.json.JsonObject; import jakarta.json.JsonObjectBuilder; import javax.jdo.FetchPlan; -import javax.json.JsonValue; +import jakarta.json.JsonValue; import java.io.File; import java.io.IOException;