fix: MEDIUM+LOW Claude-Audit-Findings (Issues #7-16)
MEDIUM: - #7 API-Key XOR-obfuskiert in app_config.dart (strings zeigen keinen Klartext) - #8 Navidrome-Download: Status-Code-Prüfung + hatValideMagicBytes() + istKorrupt - #9 _sucheYtUrls() sendet jetzt X-API-Key Header an YT-Proxy - #10 Log-Puffer auf 500 Einträge gecappt (älteste verwerfen) - #11 MeloLogger.cloudToken entfernt (war nie gesetzt, toter Code) - #12 TextEditingController-Leaks in 4 Files: ctrl.dispose() nach showDialog - #13 Cloud-Sync: Last-Write-Wins Konfliktauflösung dokumentiert LOW: - #14 API-Versionierung: alle /api/cloud/ → /api/v1/cloud/ - #15 Auto-Scan: nur /Music, /Download, nicht ganz /storage - #16 2 pre-existing flutter analyze Infos behoben (curly_braces, use_build_context_synchronously) flutter analyze: No issues found.
This commit is contained in:
@@ -12,8 +12,7 @@ class MeloLogger {
|
||||
factory MeloLogger() => _instanz;
|
||||
MeloLogger._();
|
||||
|
||||
/// Wird nach Cloud-Login gesetzt, damit Crash-Logs authentifiziert ankommen.
|
||||
static String? cloudToken;
|
||||
static const _maxEintraege = 500;
|
||||
|
||||
bool _initialisiert = false;
|
||||
String _sessionId = '';
|
||||
@@ -53,6 +52,10 @@ class MeloLogger {
|
||||
}
|
||||
|
||||
void _addEintrag(String kategorie, String aktion, [Map<String, dynamic>? details]) {
|
||||
// Cap 500: älteste Einträge verwerfen
|
||||
if (_eintraege.length >= _maxEintraege) {
|
||||
_eintraege.removeAt(0);
|
||||
}
|
||||
_eintraege.add({
|
||||
'id': _logId++,
|
||||
'zeit': DateTime.now().toIso8601String(),
|
||||
@@ -105,10 +108,7 @@ class MeloLogger {
|
||||
try {
|
||||
await http.post(
|
||||
Uri.parse(_serverUrl),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
if (cloudToken != null) 'Authorization': 'Bearer $cloudToken',
|
||||
},
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: jsonEncode({
|
||||
'typ': 'log_batch',
|
||||
'session': _sessionId,
|
||||
|
||||
Reference in New Issue
Block a user