iOS 1.0.3 source candidate only; no Apple build or installation acceptance

This commit is contained in:
2026-10-27 02:46:08 +00:00
parent 1cf54a46e4
commit 295799b1ab
29 changed files with 1499 additions and 213 deletions
+37
View File
@@ -104,6 +104,18 @@ struct VPNNode: Decodable, Identifiable, Hashable, Sendable {
let region: String
let status: String
enum CodingKeys: String, CodingKey { case slug, name, region, status }
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
slug = try container.decode(String.self, forKey: .slug)
name = try container.decode(String.self, forKey: .name)
region = try container.decode(String.self, forKey: .region)
// Config responses omit the profile-only node status. Absence is not
// evidence of offline/online state and must not break a valid config.
status = try container.decodeIfPresent(String.self, forKey: .status) ?? "unknown"
}
var id: String { slug }
var displayName: String { region.isEmpty ? name : "\(name) · \(region)" }
}
@@ -121,6 +133,8 @@ struct ClientConfigResponse: Decodable, Sendable {
let configContract: Int?
let gateway: Gateway?
let tailscaleEndpoint: ProxyTransportEndpoint?
let connectionScope: String?
let node: VPNNode
let routeMode: String
let config: [String: JSONValue]
@@ -128,11 +142,34 @@ struct ClientConfigResponse: Decodable, Sendable {
enum CodingKeys: String, CodingKey {
case configContract = "config_contract"
case gateway
case tailscaleEndpoint = "tailscale_endpoint"
case connectionScope = "connection_scope"
case node
case routeMode = "route_mode"
case config
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
configContract = try container.decodeIfPresent(Int.self, forKey: .configContract)
gateway = try container.decodeIfPresent(Gateway.self, forKey: .gateway)
node = try container.decode(VPNNode.self, forKey: .node)
routeMode = try container.decode(String.self, forKey: .routeMode)
config = try container.decode([String: JSONValue].self, forKey: .config)
// Optional transport hints never make a valid public configuration fail.
// A malformed scope also disables the hint: it is not a legacy absence.
let scopeIsNull = (try? container.decodeNil(forKey: .connectionScope)) ?? true
let scopePresent = container.contains(.connectionScope) && !scopeIsNull
let decodedScope = try? container.decode(String.self, forKey: .connectionScope)
connectionScope = decodedScope
if scopePresent && decodedScope == nil {
tailscaleEndpoint = nil
} else {
tailscaleEndpoint = try? container.decode(ProxyTransportEndpoint.self, forKey: .tailscaleEndpoint)
}
}
func configJSONString() throws -> String {
let encoder = JSONEncoder()
encoder.outputFormatting = [.sortedKeys, .withoutEscapingSlashes]