diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2023-11-14 13:42:40 +0100 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2023-11-14 13:42:40 +0100 |
| commit | 5dcf9e3dd16f7982a034de98b30546ea91f15b2d (patch) | |
| tree | c5cdf1070a2d6cd370eb47fcc890a1a2163003e2 | |
| parent | d1d78d7a193b7d25c42ae5199f84082e183c329e (diff) | |
| parent | 05d3361e53cd7051605d50d10622290878ab147e (diff) | |
| download | mullvadvpn-5dcf9e3dd16f7982a034de98b30546ea91f15b2d.tar.xz mullvadvpn-5dcf9e3dd16f7982a034de98b30546ea91f15b2d.zip | |
Merge branch 'remove_partially_importing_namespaces'
33 files changed, 35 insertions, 55 deletions
diff --git a/ios/MullvadREST/RESTAPIProxy.swift b/ios/MullvadREST/RESTAPIProxy.swift index 70522f8b03..8594297410 100644 --- a/ios/MullvadREST/RESTAPIProxy.swift +++ b/ios/MullvadREST/RESTAPIProxy.swift @@ -8,8 +8,7 @@ import Foundation import MullvadTypes -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes public protocol APIQuerying { func getAddressList( diff --git a/ios/MullvadREST/RESTDevicesProxy.swift b/ios/MullvadREST/RESTDevicesProxy.swift index 6ec8e299e5..7047f3acd4 100644 --- a/ios/MullvadREST/RESTDevicesProxy.swift +++ b/ios/MullvadREST/RESTDevicesProxy.swift @@ -8,8 +8,7 @@ import Foundation import MullvadTypes -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes public protocol DeviceHandling { func getDevice( diff --git a/ios/MullvadREST/ServerRelaysResponse.swift b/ios/MullvadREST/ServerRelaysResponse.swift index 7241d0271f..63f0822e63 100644 --- a/ios/MullvadREST/ServerRelaysResponse.swift +++ b/ios/MullvadREST/ServerRelaysResponse.swift @@ -8,8 +8,7 @@ import Foundation import MullvadTypes -import struct Network.IPv4Address -import struct Network.IPv6Address +import Network extension REST { public struct ServerLocation: Codable, Equatable { diff --git a/ios/MullvadSettings/DNSSettings.swift b/ios/MullvadSettings/DNSSettings.swift index 3885b01502..4b7a3ae7cb 100644 --- a/ios/MullvadSettings/DNSSettings.swift +++ b/ios/MullvadSettings/DNSSettings.swift @@ -8,7 +8,7 @@ import Foundation import MullvadTypes -import struct Network.IPv4Address +import Network /// A struct describing Mullvad DNS blocking options. public struct DNSBlockingOptions: OptionSet, Codable { diff --git a/ios/MullvadSettings/TunnelSettingsV1.swift b/ios/MullvadSettings/TunnelSettingsV1.swift index 1d7301a910..21c28164c8 100644 --- a/ios/MullvadSettings/TunnelSettingsV1.swift +++ b/ios/MullvadSettings/TunnelSettingsV1.swift @@ -9,10 +9,8 @@ import Foundation import MullvadREST import MullvadTypes -import struct Network.IPv4Address -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PrivateKey -import class WireGuardKitTypes.PublicKey +import Network +import WireGuardKitTypes /// A struct that holds the configuration passed via `NETunnelProviderProtocol`. public struct TunnelSettingsV1: Codable, Equatable, TunnelSettings { diff --git a/ios/MullvadTypes/IPv4Endpoint.swift b/ios/MullvadTypes/IPv4Endpoint.swift index 2a6f0ef414..c0ed1e4771 100644 --- a/ios/MullvadTypes/IPv4Endpoint.swift +++ b/ios/MullvadTypes/IPv4Endpoint.swift @@ -7,7 +7,7 @@ // import Foundation -import struct Network.IPv4Address +import Network public struct IPv4Endpoint: Hashable, Equatable, Codable, CustomStringConvertible { public let ip: IPv4Address diff --git a/ios/MullvadTypes/IPv6Endpoint.swift b/ios/MullvadTypes/IPv6Endpoint.swift index d6fb323455..5dd56a4982 100644 --- a/ios/MullvadTypes/IPv6Endpoint.swift +++ b/ios/MullvadTypes/IPv6Endpoint.swift @@ -7,7 +7,7 @@ // import Foundation -import struct Network.IPv6Address +import Network public struct IPv6Endpoint: Hashable, Equatable, Codable, CustomStringConvertible { public let ip: IPv6Address diff --git a/ios/MullvadTypes/Location.swift b/ios/MullvadTypes/Location.swift index f324acb410..13cf935425 100644 --- a/ios/MullvadTypes/Location.swift +++ b/ios/MullvadTypes/Location.swift @@ -6,7 +6,7 @@ // Copyright © 2020 Mullvad VPN AB. All rights reserved. // -import struct CoreLocation.CLLocationCoordinate2D +import CoreLocation import Foundation public struct Location: Codable, Equatable { diff --git a/ios/MullvadTypes/MullvadEndpoint.swift b/ios/MullvadTypes/MullvadEndpoint.swift index 82e122a32f..9c05111c8c 100644 --- a/ios/MullvadTypes/MullvadEndpoint.swift +++ b/ios/MullvadTypes/MullvadEndpoint.swift @@ -7,8 +7,7 @@ // import Foundation -import struct Network.IPv4Address -import struct Network.IPv6Address +import Network /// Contains server data needed to connect to a single mullvad endpoint. public struct MullvadEndpoint: Equatable, Codable { diff --git a/ios/MullvadTypes/RESTTypes.swift b/ios/MullvadTypes/RESTTypes.swift index 68ffcbf683..bb5c270022 100644 --- a/ios/MullvadTypes/RESTTypes.swift +++ b/ios/MullvadTypes/RESTTypes.swift @@ -7,8 +7,7 @@ // import Foundation -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes public struct Account: Codable, Equatable { public let id: String diff --git a/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProviderHost.swift b/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProviderHost.swift index eb3e590fbe..bac002e436 100644 --- a/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProviderHost.swift +++ b/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProviderHost.swift @@ -14,7 +14,7 @@ import MullvadREST import MullvadSettings import MullvadTransport import MullvadTypes -import enum NetworkExtension.NEProviderStopReason +import NetworkExtension import PacketTunnelCore import RelayCache import RelaySelector diff --git a/ios/MullvadVPN/TunnelManager/RotateKeyOperation.swift b/ios/MullvadVPN/TunnelManager/RotateKeyOperation.swift index 46b340ec9d..0176f02b39 100644 --- a/ios/MullvadVPN/TunnelManager/RotateKeyOperation.swift +++ b/ios/MullvadVPN/TunnelManager/RotateKeyOperation.swift @@ -12,7 +12,7 @@ import MullvadREST import MullvadSettings import MullvadTypes import Operations -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes class RotateKeyOperation: ResultOperation<Void> { private let logger = Logger(label: "RotateKeyOperation") diff --git a/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift b/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift index 97a9c6d75b..d59beef368 100644 --- a/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift +++ b/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift @@ -12,8 +12,7 @@ import MullvadREST import MullvadSettings import MullvadTypes import Operations -import class WireGuardKitTypes.PrivateKey -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes enum SetAccountAction { /// Set new account. diff --git a/ios/MullvadVPN/TunnelManager/TunnelManager.swift b/ios/MullvadVPN/TunnelManager/TunnelManager.swift index 415f7be2ea..c49eaed3d2 100644 --- a/ios/MullvadVPN/TunnelManager/TunnelManager.swift +++ b/ios/MullvadVPN/TunnelManager/TunnelManager.swift @@ -18,7 +18,7 @@ import RelayCache import RelaySelector import StoreKit import UIKit -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes /// Interval used for periodic polling of tunnel relay status when tunnel is establishing /// connection. diff --git a/ios/MullvadVPN/TunnelManager/UpdateDeviceDataOperation.swift b/ios/MullvadVPN/TunnelManager/UpdateDeviceDataOperation.swift index 6803dd7d87..341af90806 100644 --- a/ios/MullvadVPN/TunnelManager/UpdateDeviceDataOperation.swift +++ b/ios/MullvadVPN/TunnelManager/UpdateDeviceDataOperation.swift @@ -12,7 +12,7 @@ import MullvadREST import MullvadSettings import MullvadTypes import Operations -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes class UpdateDeviceDataOperation: ResultOperation<StoredDeviceData> { private let interactor: TunnelInteractor diff --git a/ios/MullvadVPN/TunnelManager/WgKeyRotation.swift b/ios/MullvadVPN/TunnelManager/WgKeyRotation.swift index 89e6ae6891..bca8bb0b33 100644 --- a/ios/MullvadVPN/TunnelManager/WgKeyRotation.swift +++ b/ios/MullvadVPN/TunnelManager/WgKeyRotation.swift @@ -9,8 +9,7 @@ import Foundation import MullvadSettings import MullvadTypes -import class WireGuardKitTypes.PrivateKey -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes /** Implements manipulations related to marking the beginning and the completion of key rotation, private key creation and other tasks relevant to handling the state of diff --git a/ios/MullvadVPNScreenshots/SnapshotHelper.swift b/ios/MullvadVPNScreenshots/SnapshotHelper.swift index da063ba1c7..0b8a4c53eb 100644 --- a/ios/MullvadVPNScreenshots/SnapshotHelper.swift +++ b/ios/MullvadVPNScreenshots/SnapshotHelper.swift @@ -200,7 +200,7 @@ open class Snapshot: NSObject { let format = UIGraphicsImageRendererFormat() format.scale = image.scale let renderer = UIGraphicsImageRenderer(size: image.size, format: format) - return renderer.image { context in + return renderer.image { _ in image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) } } else { diff --git a/ios/MullvadVPNTests/AddressCacheTests.swift b/ios/MullvadVPNTests/AddressCacheTests.swift index a42aa3b8dd..0a7843551f 100644 --- a/ios/MullvadVPNTests/AddressCacheTests.swift +++ b/ios/MullvadVPNTests/AddressCacheTests.swift @@ -8,7 +8,7 @@ @testable import MullvadREST import MullvadTypes -import struct Network.IPv4Address +import Network import XCTest final class AddressCacheTests: XCTestCase { diff --git a/ios/MullvadVPNTests/WgKeyRotationTests.swift b/ios/MullvadVPNTests/WgKeyRotationTests.swift index 764886f372..2be36c6fdd 100644 --- a/ios/MullvadVPNTests/WgKeyRotationTests.swift +++ b/ios/MullvadVPNTests/WgKeyRotationTests.swift @@ -8,8 +8,7 @@ import MullvadSettings import MullvadTypes -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes import XCTest final class WgKeyRotationTests: XCTestCase { diff --git a/ios/PacketTunnel/DeviceCheck/DeviceCheckOperation.swift b/ios/PacketTunnel/DeviceCheck/DeviceCheckOperation.swift index ce6913b5cc..f3270c8a8d 100644 --- a/ios/PacketTunnel/DeviceCheck/DeviceCheckOperation.swift +++ b/ios/PacketTunnel/DeviceCheck/DeviceCheckOperation.swift @@ -13,8 +13,7 @@ import MullvadSettings import MullvadTypes import Operations import PacketTunnelCore -import class WireGuardKitTypes.PrivateKey -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes /** An operation that is responsible for performing account and device diagnostics and key rotation from within packet diff --git a/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteService.swift b/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteService.swift index bbefc30215..2bae95fe3c 100644 --- a/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteService.swift +++ b/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteService.swift @@ -9,7 +9,7 @@ import Foundation import MullvadREST import MullvadTypes -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes /// An object that implements remote service used by `DeviceCheckOperation`. struct DeviceCheckRemoteService: DeviceCheckRemoteServiceProtocol { diff --git a/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift b/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift index faf22e3680..0cab26654f 100644 --- a/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift +++ b/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift @@ -8,7 +8,7 @@ import Foundation import MullvadTypes -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes /// A protocol that formalizes remote service dependency used by `DeviceCheckOperation`. protocol DeviceCheckRemoteServiceProtocol { diff --git a/ios/PacketTunnelCore/Actor/ConfigurationBuilder.swift b/ios/PacketTunnelCore/Actor/ConfigurationBuilder.swift index 6ba03db89b..1b06f39366 100644 --- a/ios/PacketTunnelCore/Actor/ConfigurationBuilder.swift +++ b/ios/PacketTunnelCore/Actor/ConfigurationBuilder.swift @@ -8,10 +8,8 @@ import Foundation import MullvadTypes -import protocol Network.IPAddress -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PrivateKey -import class WireGuardKitTypes.PublicKey +import Network +import WireGuardKitTypes /// Error returned when there is an endpoint but its public key is invalid. public struct PublicKeyError: LocalizedError { diff --git a/ios/PacketTunnelCore/Actor/PacketTunnelActor+ErrorState.swift b/ios/PacketTunnelCore/Actor/PacketTunnelActor+ErrorState.swift index b95e0c8d5e..71afd7cdfd 100644 --- a/ios/PacketTunnelCore/Actor/PacketTunnelActor+ErrorState.swift +++ b/ios/PacketTunnelCore/Actor/PacketTunnelActor+ErrorState.swift @@ -7,7 +7,7 @@ // import Foundation -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes extension PacketTunnelActor { /** diff --git a/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift b/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift index 6f72ef9085..9e3598db65 100644 --- a/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift +++ b/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift @@ -10,7 +10,7 @@ import Foundation import MullvadLogging import MullvadTypes import NetworkExtension -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes /** Packet tunnel state machine implemented as an actor. diff --git a/ios/PacketTunnelCore/Actor/Protocols/TunnelAdapterProtocol.swift b/ios/PacketTunnelCore/Actor/Protocols/TunnelAdapterProtocol.swift index c4c499f83e..b50ab4a7ad 100644 --- a/ios/PacketTunnelCore/Actor/Protocols/TunnelAdapterProtocol.swift +++ b/ios/PacketTunnelCore/Actor/Protocols/TunnelAdapterProtocol.swift @@ -10,9 +10,7 @@ import Foundation import MullvadTypes import Network -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PrivateKey -import class WireGuardKitTypes.PublicKey +import WireGuardKitTypes /// Protocol describing interface for any kind of adapter implementing a VPN tunnel. public protocol TunnelAdapterProtocol { diff --git a/ios/PacketTunnelCore/Actor/State+Extensions.swift b/ios/PacketTunnelCore/Actor/State+Extensions.swift index 402938da8f..dc7580fdf1 100644 --- a/ios/PacketTunnelCore/Actor/State+Extensions.swift +++ b/ios/PacketTunnelCore/Actor/State+Extensions.swift @@ -8,7 +8,7 @@ import Foundation import MullvadTypes -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes extension State { /// Returns the target state to which the actor state should transition when requested to reconnect. diff --git a/ios/PacketTunnelCore/Actor/State.swift b/ios/PacketTunnelCore/Actor/State.swift index 0ae7b22de1..0314908137 100644 --- a/ios/PacketTunnelCore/Actor/State.swift +++ b/ios/PacketTunnelCore/Actor/State.swift @@ -9,7 +9,7 @@ import Foundation import MullvadTypes import TunnelObfuscation -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes /** Tunnel actor state with metadata describing the current phase of packet tunnel lifecycle. diff --git a/ios/PacketTunnelCore/Pinger/Pinger.swift b/ios/PacketTunnelCore/Pinger/Pinger.swift index f5a0cee0b5..1cc9ccea41 100644 --- a/ios/PacketTunnelCore/Pinger/Pinger.swift +++ b/ios/PacketTunnelCore/Pinger/Pinger.swift @@ -7,9 +7,7 @@ // import Foundation -import protocol Network.IPAddress -import struct Network.IPv4Address -import struct Network.IPv6Address +import Network /// ICMP client. public final class Pinger: PingerProtocol { diff --git a/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift b/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift index 195a8acde8..16ab1d0698 100644 --- a/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift +++ b/ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift @@ -9,8 +9,7 @@ import Foundation import MullvadLogging import MullvadTypes -import protocol Network.IPAddress -import struct Network.IPv4Address +import Network /// Tunnel monitor. public final class TunnelMonitor: TunnelMonitorProtocol { diff --git a/ios/PacketTunnelCoreTests/Mocks/RelaySelectorStub.swift b/ios/PacketTunnelCoreTests/Mocks/RelaySelectorStub.swift index 8c69404bdc..c601c860d4 100644 --- a/ios/PacketTunnelCoreTests/Mocks/RelaySelectorStub.swift +++ b/ios/PacketTunnelCoreTests/Mocks/RelaySelectorStub.swift @@ -9,7 +9,7 @@ import Foundation import MullvadTypes import PacketTunnelCore -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes /// Relay selector stub that accepts a block that can be used to provide custom implementation. struct RelaySelectorStub: RelaySelectorProtocol { diff --git a/ios/PacketTunnelCoreTests/Mocks/SettingsReaderStub.swift b/ios/PacketTunnelCoreTests/Mocks/SettingsReaderStub.swift index 7679b11ac8..1893f4363d 100644 --- a/ios/PacketTunnelCoreTests/Mocks/SettingsReaderStub.swift +++ b/ios/PacketTunnelCoreTests/Mocks/SettingsReaderStub.swift @@ -9,8 +9,7 @@ import Foundation import MullvadTypes import PacketTunnelCore -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes /// Settings reader stub that can be configured with a block to provide the desired behavior when testing. struct SettingsReaderStub: SettingsReaderProtocol { diff --git a/ios/PacketTunnelCoreTests/PacketTunnelActorTests.swift b/ios/PacketTunnelCoreTests/PacketTunnelActorTests.swift index 34a6fe3478..50145b3935 100644 --- a/ios/PacketTunnelCoreTests/PacketTunnelActorTests.swift +++ b/ios/PacketTunnelCoreTests/PacketTunnelActorTests.swift @@ -12,8 +12,7 @@ import MullvadTypes import Network @testable import PacketTunnelCore @testable import RelaySelector -import struct WireGuardKitTypes.IPAddressRange -import class WireGuardKitTypes.PrivateKey +import WireGuardKitTypes import XCTest final class PacketTunnelActorTests: XCTestCase { |
