mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-20 23:02:14 +00:00
Add ConnectionProfile.serviceDelegate
Requires explicit CodingKey to skip field serialization. Waiting for @transient or the like.
This commit is contained in:
parent
d62570472f
commit
170d089a44
@ -48,6 +48,8 @@ public protocol ConnectionProfile: class, EndpointDataSource, CustomStringConver
|
||||
|
||||
var manualNetworkSettings: ProfileNetworkSettings? { get set }
|
||||
|
||||
var serviceDelegate: ConnectionServiceDelegate? { get set }
|
||||
|
||||
func generate(from configuration: OpenVPNTunnelProvider.Configuration, preferences: Preferences) throws -> OpenVPNTunnelProvider.Configuration
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,28 @@ import Foundation
|
||||
import TunnelKit
|
||||
|
||||
public class HostConnectionProfile: ConnectionProfile, Codable, Equatable {
|
||||
|
||||
// XXX: drop after @transient serviceDelegate
|
||||
public enum CodingKeys: CodingKey {
|
||||
case hostname
|
||||
|
||||
case parameters
|
||||
|
||||
case customAddress
|
||||
|
||||
case customProtocol
|
||||
|
||||
case id
|
||||
|
||||
case username
|
||||
|
||||
case trustedNetworks
|
||||
|
||||
case networkChoices
|
||||
|
||||
case manualNetworkSettings
|
||||
}
|
||||
|
||||
public let hostname: String
|
||||
|
||||
public var parameters: OpenVPNTunnelProvider.Configuration
|
||||
@ -64,6 +86,8 @@ public class HostConnectionProfile: ConnectionProfile, Codable, Equatable {
|
||||
|
||||
public var manualNetworkSettings: ProfileNetworkSettings?
|
||||
|
||||
public weak var serviceDelegate: ConnectionServiceDelegate?
|
||||
|
||||
public func generate(from configuration: OpenVPNTunnelProvider.Configuration, preferences: Preferences) throws -> OpenVPNTunnelProvider.Configuration {
|
||||
guard let endpointProtocols = parameters.sessionConfiguration.endpointProtocols, !endpointProtocols.isEmpty else {
|
||||
preconditionFailure("No endpointProtocols")
|
||||
|
@ -48,6 +48,8 @@ public class PlaceholderConnectionProfile: ConnectionProfile {
|
||||
|
||||
public var manualNetworkSettings: ProfileNetworkSettings?
|
||||
|
||||
public weak var serviceDelegate: ConnectionServiceDelegate?
|
||||
|
||||
public func generate(from configuration: OpenVPNTunnelProvider.Configuration, preferences: Preferences) throws -> OpenVPNTunnelProvider.Configuration {
|
||||
fatalError("Generating configuration from a PlaceholderConnectionProfile")
|
||||
}
|
||||
|
@ -27,6 +27,30 @@ import Foundation
|
||||
import TunnelKit
|
||||
|
||||
public class ProviderConnectionProfile: ConnectionProfile, Codable, Equatable {
|
||||
|
||||
// XXX: drop after @transient serviceDelegate
|
||||
public enum CodingKeys: CodingKey {
|
||||
case name
|
||||
|
||||
case poolId
|
||||
|
||||
case presetId
|
||||
|
||||
case customAddress
|
||||
|
||||
case customProtocol
|
||||
|
||||
case favoriteGroupIds
|
||||
|
||||
case username
|
||||
|
||||
case trustedNetworks
|
||||
|
||||
case networkChoices
|
||||
|
||||
case manualNetworkSettings
|
||||
}
|
||||
|
||||
public let name: Infrastructure.Name
|
||||
|
||||
public var infrastructure: Infrastructure {
|
||||
@ -122,6 +146,8 @@ public class ProviderConnectionProfile: ConnectionProfile, Codable, Equatable {
|
||||
|
||||
public var manualNetworkSettings: ProfileNetworkSettings?
|
||||
|
||||
public weak var serviceDelegate: ConnectionServiceDelegate?
|
||||
|
||||
public func generate(from configuration: OpenVPNTunnelProvider.Configuration, preferences: Preferences) throws -> OpenVPNTunnelProvider.Configuration {
|
||||
guard let pool = pool else {
|
||||
preconditionFailure("Nil pool?")
|
||||
|
Loading…
Reference in New Issue
Block a user