mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[embedder] Clean up deprecated secure connection enforcement mechanism.
Addresses https://github.com/flutter/flutter/issues/54448 TEST=ci, flutter Change-Id: If1ea8044cdfa8d593e0cd5b5201c2fbe71dd08ad Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248220 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Michael Thomsen <mit@google.com>
This commit is contained in:
parent
7abfcfb83c
commit
f51149eba3
|
@ -3315,7 +3315,6 @@
|
|||
"../../../tests/standalone/io/many_file_operations_test.dart",
|
||||
"../../../tests/standalone/io/named_pipe_script_test.dart",
|
||||
"../../../tests/standalone/io/network_interface_test.dart",
|
||||
"../../../tests/standalone/io/network_policy_test.dart",
|
||||
"../../../tests/standalone/io/parent_test.dart",
|
||||
"../../../tests/standalone/io/platform_os_version_test.dart",
|
||||
"../../../tests/standalone/io/process_exit_test.dart",
|
||||
|
@ -6637,7 +6636,6 @@
|
|||
"../../../tests/standalone_2/io/many_directory_operations_test.dart",
|
||||
"../../../tests/standalone_2/io/many_file_operations_test.dart",
|
||||
"../../../tests/standalone_2/io/network_interface_test.dart",
|
||||
"../../../tests/standalone_2/io/network_policy_test.dart",
|
||||
"../../../tests/standalone_2/io/parent_test.dart",
|
||||
"../../../tests/standalone_2/io/platform_os_version_test.dart",
|
||||
"../../../tests/standalone_2/io/process_exit_test.dart",
|
||||
|
|
|
@ -36,24 +36,6 @@ abstract class _EmbedderConfig {
|
|||
@pragma('vm:entry-point')
|
||||
static bool _maySleep = true;
|
||||
|
||||
/// Whether the isolate may establish insecure socket connections
|
||||
/// to all domains.
|
||||
///
|
||||
/// This setting can be overridden by per-domain policies.
|
||||
@Deprecated(
|
||||
"To be re-implemented in https://github.com/flutter/flutter/issues/54448")
|
||||
@pragma('vm:entry-point')
|
||||
static bool _mayInsecurelyConnectToAllDomains = true;
|
||||
|
||||
/// Domain network policies set by embedder.
|
||||
@Deprecated(
|
||||
"To be re-implemented in https://github.com/flutter/flutter/issues/54448")
|
||||
@pragma('vm:entry-point')
|
||||
static void _setDomainPolicies(String domainNetworkPolicyJson) {
|
||||
// Doesn't do anything because the implementation has been reverted in
|
||||
// https://github.com/flutter/flutter/issues/72723.
|
||||
}
|
||||
|
||||
// TODO(zra): Consider adding:
|
||||
// - an option to disallow modifying SecurityContext.defaultContext
|
||||
// - an option to disallow closing stdout and stderr.
|
||||
|
|
|
@ -220,7 +220,6 @@ part 'io_sink.dart';
|
|||
part 'io_service.dart';
|
||||
part 'link.dart';
|
||||
part 'namespace_impl.dart';
|
||||
part 'network_policy.dart';
|
||||
part 'network_profiling.dart';
|
||||
part 'overrides.dart';
|
||||
part 'platform.dart';
|
||||
|
|
|
@ -20,7 +20,6 @@ io_sdk_sources = [
|
|||
"io_sink.dart",
|
||||
"link.dart",
|
||||
"namespace_impl.dart",
|
||||
"network_policy.dart",
|
||||
"network_profiling.dart",
|
||||
"overrides.dart",
|
||||
"platform.dart",
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/// Whether insecure connections to [host] are allowed.
|
||||
///
|
||||
/// This API is deprecated and always returns true. See
|
||||
/// https://github.com/flutter/flutter/issues/72723 for more details.
|
||||
///
|
||||
/// [host] must be a [String] or [InternetAddress].
|
||||
///
|
||||
/// If any of the domain policies match [host], the matching policy will make
|
||||
/// the decision. If multiple policies apply, the top matching policy makes the
|
||||
/// decision. If none of the domain policies match, the embedder default is
|
||||
/// used.
|
||||
///
|
||||
/// Loopback addresses are always allowed.
|
||||
@Deprecated("See https://github.com/flutter/flutter/issues/54448 for followup")
|
||||
bool isInsecureConnectionAllowed(dynamic host) {
|
||||
return true;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
void _checkAllows(List<String> domains) {
|
||||
for (final domain in domains) {
|
||||
Expect.isTrue(
|
||||
isInsecureConnectionAllowed(domain), "$domain should be allowed.");
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
// All domains and addresses are allowed.
|
||||
_checkAllows([
|
||||
"mailfoobar.com",
|
||||
"abc.com",
|
||||
"oobar.com",
|
||||
"foobar.co",
|
||||
"128.221.55.31",
|
||||
"fe80::4607:0bff:fea0:7747%invalid",
|
||||
"baz.foobar.com",
|
||||
"foobar.com",
|
||||
"test.baz.foobar.com",
|
||||
"test2.test.baz.foobar.com",
|
||||
"::1",
|
||||
"localhost",
|
||||
]);
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// @dart = 2.9
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
void _checkAllows(List<String> domains) {
|
||||
for (final domain in domains) {
|
||||
Expect.isTrue(
|
||||
isInsecureConnectionAllowed(domain), "$domain should be allowed.");
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
// All domains and addresses are allowed.
|
||||
_checkAllows([
|
||||
"mailfoobar.com",
|
||||
"abc.com",
|
||||
"oobar.com",
|
||||
"foobar.co",
|
||||
"128.221.55.31",
|
||||
"fe80::4607:0bff:fea0:7747%invalid",
|
||||
"baz.foobar.com",
|
||||
"foobar.com",
|
||||
"test.baz.foobar.com",
|
||||
"test2.test.baz.foobar.com",
|
||||
"::1",
|
||||
"localhost",
|
||||
]);
|
||||
}
|
Loading…
Reference in a new issue