Publish reviewed history-free open-source snapshot (2026-10-12)

This commit is contained in:
Zonghengjia Open Source
2026-10-11 23:23:20 +00:00
commit 901f27baf5
301 changed files with 32378 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import Foundation
enum ConnectionAttemptDecision: Equatable {
case retryNode
case stop
case revokeAuthorization
}
enum ConnectionAttemptPolicy {
static func decide(error: Error, hasAssignedNode: Bool) -> ConnectionAttemptDecision {
if error is CancellationError { return .stop }
if let failure = error as? UCVLError {
switch failure {
case .api(let status, _):
return status == 401 || status == 403 ? .revokeAuthorization : .stop
case .vpnPermission, .invalidConfiguration, .invalidResponse:
// Permission, malformed local configuration and control-plane
// failures must not mark every otherwise healthy node as failed.
return .stop
case .connection:
break
}
}
return hasAssignedNode ? .retryNode : .stop
}
}