Skip to content

Commit

Permalink
Merge branch 'remove-ports-ios-288'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrej Mihajlov committed Sep 4, 2023
2 parents 20f755e + d1ea221 commit d6e0c53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
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")!
)
}
}

0 comments on commit d6e0c53

Please sign in to comment.