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 timezone offset from the VPN server object #767

Merged
merged 2 commits into from
Apr 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ public struct NetworkProtectionServerInfo: Codable, Equatable, Sendable {
public let city: String
public let country: String
public let state: String
public let timezoneOffset: Int

enum CodingKeys: String, CodingKey {
case city
case country
case state
case timezoneOffset = "tzOffset"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ extension NetworkProtectionServerInfo {
ips: ["192.168.1.1"],
internalIP: "10.11.12.1",
port: 443,
attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0))
attributes: .init(city: "City", country: "Country", state: "State"))

static let hostNameOnly = NetworkProtectionServerInfo(name: "Mock Server",
publicKey: "ovn9RpzUuvQ4XLQt6B3RKuEXGIxa5QpTnehjduZlcSE=",
hostNames: ["duckduckgo.com"],
ips: [],
internalIP: "10.11.12.1",
port: 443,
attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0))
attributes: .init(city: "City", country: "Country", state: "State"))

static let ipAddressOnly = NetworkProtectionServerInfo(name: "Mock Server",
publicKey: "ovn9RpzUuvQ4XLQt6B3RKuEXGIxa5QpTnehjduZlcSE=",
hostNames: [],
ips: ["192.168.1.1"],
internalIP: "10.11.12.1",
port: 443,
attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0))
attributes: .init(city: "City", country: "Country", state: "State"))

static func make(named name: String, withPublicKey publicKey: String = "") -> Self {
NetworkProtectionServerInfo(name: name,
Expand All @@ -60,7 +60,7 @@ extension NetworkProtectionServerInfo {
ips: ["192.168.1.1"],
internalIP: "10.11.12.1",
port: 443,
attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0))
attributes: .init(city: "City", country: "Country", state: "State"))
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class NetworkProtectionServerInfoTests: XCTestCase {
ips: [],
internalIP: "10.11.12.1",
port: 42,
attributes: .init(city: "Amsterdam", country: "nl", state: "na", timezoneOffset: 3600))
attributes: .init(city: "Amsterdam", country: "nl", state: "na"))

XCTAssertEqual(serverInfo.serverLocation, "Amsterdam, NL")
}
Expand All @@ -41,7 +41,7 @@ final class NetworkProtectionServerInfoTests: XCTestCase {
ips: [],
internalIP: "10.11.12.1",
port: 42,
attributes: .init(city: "New York", country: "us", state: "ny", timezoneOffset: 3600))
attributes: .init(city: "New York", country: "us", state: "ny"))

XCTAssertEqual(serverInfo.serverLocation, "New York, NY")
}
Expand Down
Loading