Address code review feedback: use dedicated executor, improve logging, add security notes

Co-authored-by: funkemunky <30784509+funkemunky@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-04 04:51:31 +00:00
parent ba9ab6fb31
commit 9fac54fe0b
3 changed files with 5 additions and 2 deletions
@@ -294,6 +294,8 @@ public class VPNConfig {
/**
* The authentication token to use for webhook requests.
* Note: Token is stored in memory as plaintext. Ensure proper file system
* permissions are set on config.yml to protect sensitive authentication tokens.
* @return String
*/
public String webhookAuthToken() {
@@ -44,7 +44,7 @@ public class WebhookNotifier {
} catch (Exception e) {
AntiVPN.getInstance().getExecutor().logException("Failed to send webhook notification", e);
}
});
}, dev.brighten.antivpn.api.VPNExecutor.threadExecutor);
}
/**
@@ -91,7 +91,7 @@ public class WebhookNotifier {
// Check response
int responseCode = connection.getResponseCode();
if (responseCode >= 200 && responseCode < 300) {
AntiVPN.getInstance().getExecutor().log(Level.FINE,
AntiVPN.getInstance().getExecutor().log(Level.INFO,
"Successfully sent webhook notification for player %s (response: %d)",
player.getName(), responseCode);
} else {
@@ -49,6 +49,7 @@ webhooks:
# Optional: Set to true to include authentication header (Authorization: Bearer <token>)
useAuthentication: false
# The authentication token to use when useAuthentication is true
# Security Note: Token is stored in plaintext. Ensure proper file permissions on this file.
authToken: ''
# Timeout in seconds for webhook requests (default: 5)
timeout: 5