feat: refine trust controls and harden BitLogin

This commit is contained in:
thePR0M3TH3AN committed 2026-07-25 22:25:50 -04:00
1 parent f25c2ac242
commit 18e08bf2cb
32 files changed
+1207 -740

No files matched your search

+3 -3
View File
@@ -1910,7 +1910,7 @@ export class ModerationService {
*
* Algorithm:
* 1. Iterate over all reports for the event.
* 2. Check if the reporter is in the `trustedContacts` set (or Admin Whitelist).
* 2. Check if the reporter is in the `trustedContacts` set.
* 3. If trusted, increment the count for that report type (e.g., "nudity").
* 4. Update the summary state and emit change events if thresholds are crossed.
*
@@ -1966,7 +1966,7 @@ export class ModerationService {
continue;
}
const isTrustedReporter = status.whitelisted || this.trustedContacts.has(reporterHex);
const isTrustedReporter = this.trustedContacts.has(reporterHex);
for (const [type, detail] of typeMap.entries()) {
let stats = typeStats.get(type);
@@ -2092,7 +2092,7 @@ export class ModerationService {
continue;
}
const isTrustedReporter = status.whitelisted || this.trustedContacts.has(reporterHex);
const isTrustedReporter = this.trustedContacts.has(reporterHex);
if (!isTrustedReporter) {
continue;
}
+1 -5
View File
@@ -70,7 +70,7 @@ async function waitForAccessControl({ timeoutMs = TRUST_SEED_READY_TIMEOUT_MS }
// Cached admin lists (hydrated synchronously from localStorage at
// construction) are enough to seed trust — don't stall boot behind the relay
// refresh. If the refresh later changes editors/whitelist/blacklist, the
// refresh. If the refresh later changes editors/blacklist, the
// change listeners registered in bootstrapTrustedSeeds re-apply the seeds.
if (
typeof accessControl.isHydrated === "function" &&
@@ -189,10 +189,6 @@ export async function bootstrapTrustedSeeds() {
applySeeds();
};
if (accessControl && typeof accessControl.onWhitelistChange === "function") {
accessControl.onWhitelistChange(applyOnChange);
}
if (accessControl && typeof accessControl.onEditorsChange === "function") {
accessControl.onEditorsChange(applyOnChange);
}