-
Notifications
You must be signed in to change notification settings - Fork 66
Kristinas main #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kristinas main #28
Changes from all commits
c493fda
6339165
7fb92bf
9f42de1
ee282bc
7c3c55f
91eec52
de73c88
c1f8a98
3a9ae4b
6335070
82c8532
e590c73
b26c5df
1a24158
b5d314a
18f28d8
e2558cf
3931c2e
a6bb555
4217c6f
a141882
5cefb29
1c93451
3fef7c6
1fd57e7
2f41422
3345609
8baec6d
cd91c96
beae9fb
2de1a9b
63d7972
cf4b429
bbc3dbc
94baca9
397844a
c6cf7dd
ca17434
2d07a09
8751797
7dfca3c
9ad6190
f0d6359
61f4652
2bc0ee1
7066cb0
84303a1
8b698a3
6f86c1f
1ea4a9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| NTFY_BASE_URL=https://ntfy.fungover.org | ||
| NTFY_TOPIC=mytopic | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,12 @@ | ||||||||||||||||||||||||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||||||||||||||||||||||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||||||||||||||||||||||||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||||||||||||||||||||||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||||||||||||||||||||||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | ||||||||||||||||||||||||||
| http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||||||||||||||||||||||
| <modelVersion>4.0.0</modelVersion> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <groupId>com.example</groupId> | ||||||||||||||||||||||||||
| <artifactId>javafx</artifactId> | ||||||||||||||||||||||||||
| <artifactId>javafx-chat</artifactId> | ||||||||||||||||||||||||||
| <version>1.0-SNAPSHOT</version> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <properties> | ||||||||||||||||||||||||||
|
|
@@ -16,6 +17,7 @@ | |||||||||||||||||||||||||
| <mockito.version>5.20.0</mockito.version> | ||||||||||||||||||||||||||
| <javafx.version>25</javafx.version> | ||||||||||||||||||||||||||
| </properties> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <dependencies> | ||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>org.junit.jupiter</groupId> | ||||||||||||||||||||||||||
|
|
@@ -35,6 +37,7 @@ | |||||||||||||||||||||||||
| <version>${mockito.version}</version> | ||||||||||||||||||||||||||
| <scope>test</scope> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>org.openjfx</groupId> | ||||||||||||||||||||||||||
| <artifactId>javafx-controls</artifactId> | ||||||||||||||||||||||||||
|
|
@@ -45,7 +48,41 @@ | |||||||||||||||||||||||||
| <artifactId>javafx-fxml</artifactId> | ||||||||||||||||||||||||||
| <version>${javafx.version}</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>org.openjfx</groupId> | ||||||||||||||||||||||||||
| <artifactId>javafx-swing</artifactId> | ||||||||||||||||||||||||||
| <version>${javafx.version}</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>com.fasterxml.jackson.core</groupId> | ||||||||||||||||||||||||||
| <artifactId>jackson-databind</artifactId> | ||||||||||||||||||||||||||
| <version>2.17.2</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>com.fasterxml.jackson.core</groupId> | ||||||||||||||||||||||||||
| <artifactId>jackson-core</artifactId> | ||||||||||||||||||||||||||
| <version>2.17.2</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>com.fasterxml.jackson.core</groupId> | ||||||||||||||||||||||||||
| <artifactId>jackson-annotations</artifactId> | ||||||||||||||||||||||||||
| <version>2.17.2</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
|
Comment on lines
+57
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify Jackson version for security and currency. Ensure that Jackson 2.17.2 is the latest stable version and is free from known security vulnerabilities. 🌐 Web query: 💡 Result: Short answer
About jackson-databind 2.17.2
Recommendation
Sources
Upgrade Jackson dependencies to latest supported version. Jackson 2.17.2 was released July 5, 2024, and is significantly outdated. The latest 2.x line is 2.20.0 (Aug 28, 2025), and 3.0.0 is the latest overall (GA Oct 3, 2025). While no specific CVE names 2.17.2, jackson-databind has a long history of deserialization-related vulnerabilities across various 2.x ranges, with fixes applied in later 2.13–2.20 and 3.0 patches. Update all three Jackson dependencies in pom.xml (lines 57–71) to 2.20.0 or 3.0.0 to ensure you receive security patches and stay within a supported release. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>io.github.cdimascio</groupId> | ||||||||||||||||||||||||||
| <artifactId>dotenv-java</artifactId> | ||||||||||||||||||||||||||
| <version>3.2.0</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>org.wiremock</groupId> | ||||||||||||||||||||||||||
| <artifactId>wiremock</artifactId> | ||||||||||||||||||||||||||
| <version>4.0.0-beta.15</version> | ||||||||||||||||||||||||||
| <scope>test</scope> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
|
Comment on lines
+78
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ Verification inconclusiveReplace WireMock beta with stable release. WireMock currently has two releases available: the 3.x release and the new 4.x beta releases. Using a beta version (4.0.0-beta.15) in production or even for tests introduces unnecessary stability risk. Downgrade to the stable 3.13.1 (latest, published June 11, 2025). Apply this diff: <dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
- <version>4.0.0-beta.15</version>
+ <version>3.13.1</version>
<scope>test</scope>
</dependency>I'll verify the WireMock release information to validate the review comment. Downgrade WireMock to stable version 3.13.1. WireMock 3.13.1 is the latest version, last published June 11, 2025. The 4.x release of WireMock is currently in beta and under active development. Version 3.x of WireMock is entering maintenance mode as the team focuses on the first non-beta release of WireMock version 4. For a test dependency, using the stable 3.13.1 release is the appropriate choice. <dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
- <version>4.0.0-beta.15</version>
+ <version>3.13.1</version>
<scope>test</scope>
</dependency>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| </dependencies> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <build> | ||||||||||||||||||||||||||
| <plugins> | ||||||||||||||||||||||||||
| <plugin> | ||||||||||||||||||||||||||
|
|
@@ -55,7 +92,7 @@ | |||||||||||||||||||||||||
| <configuration> | ||||||||||||||||||||||||||
| <mainClass>com.example.HelloFX</mainClass> | ||||||||||||||||||||||||||
| <options> | ||||||||||||||||||||||||||
| <option>--enable-native-access=javafx.graphics</option> | ||||||||||||||||||||||||||
| <option>--enable-native-access=javafx.graphics</option> | ||||||||||||||||||||||||||
| </options> | ||||||||||||||||||||||||||
| <launcher>javafx</launcher> | ||||||||||||||||||||||||||
| <stripDebug>true</stripDebug> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| package com.example; | ||
|
|
||
| import java.io.File; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
| import java.util.function.Consumer; | ||
|
|
||
| /** | ||
| * A fake implementation of {@link NtfyConnection} for testing purposes. | ||
| * Stores sent messages and files in memory and simulates incoming messages. | ||
| */ | ||
| public class FakeNtfyConnection implements NtfyConnection { | ||
|
|
||
| private final List<String> sentMessages = new ArrayList<>(); | ||
| private final List<File> sentFiles = new ArrayList<>(); | ||
| private Consumer<NtfyMessageDto> messageHandler; | ||
| private boolean shouldSucceed = true; | ||
|
|
||
| /** | ||
| * Sends a text message. | ||
| * Stores the message in memory and returns success based on {@link #shouldSucceed}. | ||
| * | ||
| * @param message the message to send | ||
| * @return true if operation succeeds, false otherwise | ||
| */ | ||
| @Override | ||
| public boolean send(String message) { | ||
| sentMessages.add(Objects.requireNonNull(message)); | ||
| return shouldSucceed; | ||
| } | ||
|
|
||
| /** | ||
| * Sends a file. | ||
| * Stores the file in memory if it exists and returns success based on {@link #shouldSucceed}. | ||
| * | ||
| * @param file the file to send | ||
| * @return true if file exists and operation succeeds, false otherwise | ||
| */ | ||
| @Override | ||
| public boolean sendFile(File file) { | ||
| if (file != null && file.exists()) { | ||
| sentFiles.add(file); | ||
| return shouldSucceed; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * Registers a message handler to receive incoming messages. | ||
| * Only the last registered handler will be active. | ||
| * | ||
| * @param handler the consumer that handles incoming messages | ||
| */ | ||
| @Override | ||
| public void receive(Consumer<NtfyMessageDto> handler) { | ||
| this.messageHandler = Objects.requireNonNull(handler); | ||
| } | ||
|
|
||
| /** | ||
| * Simulates an incoming message. | ||
| * Calls the registered handler if present. | ||
| * | ||
| * @param message the message to simulate | ||
| */ | ||
| public void simulateIncomingMessage(NtfyMessageDto message) { | ||
| if (messageHandler != null) { | ||
| messageHandler.accept(message); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Returns a copy of all sent messages for verification. | ||
| * | ||
| * @return list of sent messages | ||
| */ | ||
| public List<String> getSentMessages() { | ||
| return new ArrayList<>(sentMessages); | ||
| } | ||
|
|
||
| /** | ||
| * Returns a copy of all sent files for verification. | ||
| * | ||
| * @return list of sent files | ||
| */ | ||
| public List<File> getSentFiles() { | ||
| return new ArrayList<>(sentFiles); | ||
| } | ||
|
|
||
| /** | ||
| * Configures whether operations should succeed. | ||
| * | ||
| * @param shouldSucceed true for success, false for failure | ||
| */ | ||
| public void setShouldSucceed(boolean shouldSucceed) { | ||
| this.shouldSucceed = shouldSucceed; | ||
| } | ||
|
|
||
| /** | ||
| * Clears all stored messages, files, and the message handler. | ||
| */ | ||
| public void clear() { | ||
| sentMessages.clear(); | ||
| sentFiles.clear(); | ||
| messageHandler = null; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using .env.example instead of committing .env.
Committing the
.envfile with hardcoded values can lead to issues:.envfiles typically contain environment-specific or sensitive configuration and should be in.gitignoreRecommendation:
.env.examplewith placeholder values.envto.gitignore.env.exampleto.envand customize theNTFY_TOPICvalueAlso, add a blank line at the end of the file as indicated by the linter.
🧰 Tools
🪛 dotenv-linter (4.0.0)
[warning] 2-2: [EndingBlankLine] No blank line at the end of the file
(EndingBlankLine)
🤖 Prompt for AI Agents