Files
MeshPort/apps/meshport_lab/test/runtime_diagnostics_test.dart
T
shenandshen c7cc2aa865 Fix VPN internet connectivity and simplify client setup
Initialize Android physical interfaces and preserve macOS scoped routes. Add redacted diagnostics, default DNS, ordered auto-save, simplified controls, scanner rotation settings, and native regression coverage. Restore vendored build sources and document validation and stability checks.
2026-10-12 06:51:25 -07:00

41 lines
1.2 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:meshport_lab/features/runtime_diagnostics.dart';
void main() {
test('diagnostics redact nested credentials and retain replaced secrets', () {
final redactor = DiagnosticRedactor();
redactor.remember({
'network_secret': 'mesh-secret',
'nodes': [
{
'options': {
'username': 'proxy-user',
'password': 'proxy-password',
'uuid': '00000000-0000-0000-0000-000000000001',
},
},
],
});
redactor.remember({'password': 'replacement-password'});
final text = redactor.sanitize(
'mesh-secret proxy-user proxy-password replacement-password '
'00000000-0000-0000-0000-000000000001 '
'socks://other-user:other-pass@proxy.example:1080 '
'https://example.test/sub?token=subscription-secret',
);
for (final secret in [
'mesh-secret',
'proxy-user',
'proxy-password',
'replacement-password',
'00000000-0000-0000-0000-000000000001',
'other-user',
'other-pass',
'subscription-secret',
]) {
expect(text, isNot(contains(secret)));
}
expect(text, contains('proxy.example:1080'));
});
}