-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port notification publisher fixes and tests
Ports the following PRs: * DependencyTrack/dependency-track#3198 Closes #1071 Further fixes: * Wrong base URL being set for `JiraPublisher` * Bearer token authentication with Jira not working (DependencyTrack/dependency-track#2642 was not ported for some reason) * Notification template using values that no longer exist * Observed differences between Hyades and DT v4.x have been documented here: #927 (comment) Signed-off-by: nscuro <nscuro@protonmail.com>
- Loading branch information
Showing
30 changed files
with
2,788 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...-publisher/src/main/java/org/dependencytrack/notification/config/PebbleConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.dependencytrack.notification.config; | ||
|
||
import io.pebbletemplates.pebble.PebbleEngine; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Named; | ||
import jakarta.ws.rs.Produces; | ||
import org.dependencytrack.notification.template.extension.CustomExtension; | ||
|
||
class PebbleConfiguration { | ||
|
||
@Produces | ||
@ApplicationScoped | ||
@Named("pebbleEngineJson") | ||
PebbleEngine pebbleEngineJson(final CustomExtension customExtension) { | ||
return new PebbleEngine.Builder() | ||
.extension(customExtension) | ||
.defaultEscapingStrategy("json") | ||
.build(); | ||
} | ||
|
||
@Produces | ||
@ApplicationScoped | ||
@Named("pebbleEnginePlainText") | ||
PebbleEngine pebbleEnginePlainText(final CustomExtension customExtension) { | ||
return new PebbleEngine.Builder() | ||
.extension(customExtension) | ||
.newLineTrimming(false) | ||
.build(); | ||
} | ||
|
||
@Produces | ||
@ApplicationScoped | ||
CustomExtension pebbleEngineExtension() { | ||
return new CustomExtension(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.