Remove Ki-Moderator add more backlist
This commit is contained in:
@@ -1019,7 +1019,6 @@ router.post('/v1/private/users/find', requireApiKey, async (req, res) => {
|
||||
|
||||
// Import blacklist module
|
||||
const { checkNameAgainstBlacklist, addToBlacklist, removeFromBlacklist, getBlacklist } = require('../config/blacklist-db');
|
||||
const { checkNameWithLLM, checkNameWithContext, testLLMConnection } = require('../config/llm-blacklist');
|
||||
|
||||
// Create new player with RFID and blacklist validation (no auth required for dashboard)
|
||||
router.post('/v1/public/players/create-with-rfid', async (req, res) => {
|
||||
@@ -1034,27 +1033,13 @@ router.post('/v1/public/players/create-with-rfid', async (req, res) => {
|
||||
}
|
||||
|
||||
try {
|
||||
// LLM-basierte Blacklist-Prüfung
|
||||
const llmCheck = await checkNameWithLLM(firstname, lastname);
|
||||
if (llmCheck.isBlocked) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
message: `Name nicht zulässig: ${llmCheck.reason}`,
|
||||
details: llmCheck
|
||||
});
|
||||
}
|
||||
|
||||
// Fallback: Traditionelle Blacklist-Prüfung (optional)
|
||||
// Blacklist-Prüfung mit Levenshtein-Algorithmus
|
||||
const blacklistCheck = await checkNameAgainstBlacklist(firstname, lastname);
|
||||
if (blacklistCheck.isBlocked) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
message: `Name nicht zulässig: ${blacklistCheck.reason}`,
|
||||
details: {
|
||||
reason: blacklistCheck.reason,
|
||||
category: blacklistCheck.category,
|
||||
matchedTerm: blacklistCheck.matchedTerm
|
||||
}
|
||||
details: blacklistCheck
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1618,22 +1603,16 @@ router.post('/v1/admin/blacklist/test', requireAdminAuth, async (req, res) => {
|
||||
}
|
||||
|
||||
try {
|
||||
// LLM-Prüfung
|
||||
const llmResult = await checkNameWithLLM(firstname, lastname);
|
||||
|
||||
// Traditionelle Blacklist-Prüfung
|
||||
// Blacklist-Prüfung mit Levenshtein-Algorithmus
|
||||
const blacklistResult = await checkNameAgainstBlacklist(firstname, lastname);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
llm: llmResult,
|
||||
blacklist: blacklistResult,
|
||||
combined: {
|
||||
isBlocked: llmResult.isBlocked || blacklistResult.isBlocked,
|
||||
reason: llmResult.isBlocked ? llmResult.reason : blacklistResult.reason,
|
||||
source: llmResult.isBlocked ? 'llm' : (blacklistResult.isBlocked ? 'blacklist' : 'none')
|
||||
}
|
||||
isBlocked: blacklistResult.isBlocked,
|
||||
reason: blacklistResult.reason,
|
||||
source: blacklistResult.isBlocked ? 'blacklist' : 'none'
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user