fix(housekeeping): audit sensitive actions

Several privileged housekeeping handlers returned success without appending an audit entry, so the action log stayed incomplete even after the log table schema was fixed. Add audit writes for ban, mute, password reset, HC changes, trade lock, item grants, room ownership transfer, and hotel alerts, and cover the expected logging surface with a contract test.
This commit is contained in:
simoleo89
2026-06-13 15:49:35 +02:00
parent 98aab95d58
commit dbcf139a52
9 changed files with 73 additions and 0 deletions
@@ -0,0 +1,33 @@
package com.eu.habbo.messages.incoming.housekeeping;
import org.junit.jupiter.api.Test;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertTrue;
class HousekeepingAuditCoverageContractTest {
private static final List<String> SENSITIVE_HANDLERS = List.of(
"HousekeepingBanUserEvent.java",
"HousekeepingMuteUserEvent.java",
"HousekeepingResetUserPasswordEvent.java",
"HousekeepingSetHcSubscriptionEvent.java",
"HousekeepingTradeLockUserEvent.java",
"HousekeepingGrantItemEvent.java",
"HousekeepingTransferRoomOwnershipEvent.java",
"HousekeepingSendHotelAlertEvent.java"
);
@Test
void sensitiveHousekeepingActionsWriteAuditEntries() throws Exception {
Path base = Path.of("src/main/java/com/eu/habbo/messages/incoming/housekeeping");
for (String handler : SENSITIVE_HANDLERS) {
String source = Files.readString(base.resolve(handler));
assertTrue(source.contains("HousekeepingAuditLog.log"),
handler + " must append a housekeeping audit log entry after successful privileged actions");
}
}
}