feat(telegram): Zugriffskontrolle mit Chat-ID-Whitelist
- TelegramService: IsChatIdAllowed() prüft Owner + Whitelist - /start von unbekannter ChatId: Zugriff verweigert + ChatId angezeigt - Owner wird bei Zugriffsanfrage benachrichtigt (Username + ChatId) - Alle Commands/Messages prüfen Whitelist vor Verarbeitung - Neues Feld telegram_allowed_chat_ids in sessions-Tabelle - Frontend: Input für erlaubte Chat-IDs in Session-Telegram-Settings - API: allowedChatIds in Save/Get durchgereicht
This commit is contained in:
1 parent
5661e55898
commit
011b26c37f
7 files changed
+91
-10
No files matched your search
+2
-2
@@ -271,11 +271,11 @@ async function apiSessionTelegramGet(sessionId) {
|
||||
return resp.json();
|
||||
}
|
||||
|
||||
async function apiSessionTelegramSave(sessionId, botToken, webhookSecret) {
|
||||
async function apiSessionTelegramSave(sessionId, botToken, webhookSecret, allowedChatIds) {
|
||||
const resp = await fetch(`/api/sessions/${sessionId}/telegram`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ botToken, webhookSecret })
|
||||
body: JSON.stringify({ botToken, webhookSecret, allowedChatIds })
|
||||
});
|
||||
if (!resp.ok) {
|
||||
const err = await resp.json().catch(() => ({}));
|
||||
|
||||
Reference in new issue
Block a user