Add Baron Safe app features through session block skeleton
ci / flutter-check (push) Successful in 4s

This commit is contained in:
2026-06-30 17:17:14 +09:00
parent d2f6af7657
commit 7c8e95e0a3
23 changed files with 1531 additions and 5 deletions
@@ -0,0 +1,32 @@
import 'package:baron_safe_app/src/features/webview/baron_safe_webview_policy.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('BaronSafeWebViewPolicy', () {
const policy = BaronSafeWebViewPolicy();
test('allows production and staging HTTPS hosts', () {
expect(policy.allows(Uri.parse('https://safe.baron.hmac.kr')), isTrue);
expect(
policy.allows(Uri.parse('https://safe-staging.baron.hmac.kr/path')),
isTrue,
);
});
test('allows local HTTP development hosts', () {
expect(policy.allows(Uri.parse('http://localhost:8080')), isTrue);
expect(policy.allows(Uri.parse('http://127.0.0.1:8080')), isTrue);
expect(policy.allows(Uri.parse('http://10.0.2.2:8080')), isTrue);
});
test('blocks unknown hosts and insecure remote HTTP', () {
expect(policy.allows(Uri.parse('https://example.com')), isFalse);
expect(policy.allows(Uri.parse('http://safe.baron.hmac.kr')), isFalse);
});
test('blocks non-web schemes and relative URLs', () {
expect(policy.allows(Uri.parse('javascript:alert(1)')), isFalse);
expect(policy.allows(Uri.parse('/relative/path')), isFalse);
});
});
}