Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove forwarded ports on iOS #5078

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions ios/MullvadTypes/RESTTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ import class WireGuardKitTypes.PublicKey
public struct Account: Codable, Equatable {
public let id: String
public let expiry: Date
public let maxPorts: Int
public let canAddPorts: Bool
public let maxDevices: Int
public let canAddDevices: Bool

public init(id: String, expiry: Date, maxPorts: Int, canAddPorts: Bool, maxDevices: Int, canAddDevices: Bool) {
public init(id: String, expiry: Date, maxDevices: Int, canAddDevices: Bool) {
self.id = id
self.expiry = expiry
self.maxPorts = maxPorts
self.canAddPorts = canAddPorts
self.maxDevices = maxDevices
self.canAddDevices = canAddDevices
}
Expand All @@ -36,11 +32,10 @@ public struct Device: Codable, Equatable {
public let created: Date
public let ipv4Address: IPAddressRange
public let ipv6Address: IPAddressRange
public let ports: [Port]

private enum CodingKeys: String, CodingKey {
case hijackDNS = "hijackDns"
case id, name, pubkey, created, ipv4Address, ipv6Address, ports
case id, name, pubkey, created, ipv4Address, ipv6Address
}

public init(
Expand All @@ -50,8 +45,7 @@ public struct Device: Codable, Equatable {
hijackDNS: Bool,
created: Date,
ipv4Address: IPAddressRange,
ipv6Address: IPAddressRange,
ports: [Port]
ipv6Address: IPAddressRange
) {
self.id = id
self.name = name
Expand All @@ -60,14 +54,5 @@ public struct Device: Codable, Equatable {
self.created = created
self.ipv4Address = ipv4Address
self.ipv6Address = ipv6Address
self.ports = ports
}
}

public struct Port: Codable, Equatable {
public let id: String

public init(id: String) {
self.id = id
}
}
5 changes: 1 addition & 4 deletions ios/MullvadVPNTests/DeviceCheckOperationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,7 @@ private extension Device {
hijackDNS: false,
created: Date(),
ipv4Address: IPAddressRange(from: "127.0.0.1/32")!,
ipv6Address: IPAddressRange(from: "::ff/64")!,
ports: []
ipv6Address: IPAddressRange(from: "::ff/64")!
)
}
}
Expand All @@ -544,8 +543,6 @@ private extension Account {
Account(
id: "account-id",
expiry: expiry,
maxPorts: 5,
canAddPorts: true,
maxDevices: 5,
canAddDevices: true
)
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadVPNTests/WgKeyRotationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ private extension Device {
hijackDNS: false,
created: Date(),
ipv4Address: IPAddressRange(from: "127.0.0.1/32")!,
ipv6Address: IPAddressRange(from: "::ff/64")!,
ports: []
ipv6Address: IPAddressRange(from: "::ff/64")!
)
}
}
Loading