diff --git a/CHANGELOG.md b/CHANGELOG.md index 85b7d21..611fd0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Attach user data to VPN configuration. [#400](https://github.com/passepartoutvpn/tunnelkit/pull/400) + ## 6.2.0 (2023-12-14) ### Changed diff --git a/Package.resolved b/Package.resolved index d411d92..dff149e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/passepartoutvpn/openssl-apple", "state": { "branch": null, - "revision": "c15562540646602300df94540765fbe27b6d5474", - "version": "3.2.0" + "revision": "026702febcaebcbf9ea68f2fa66b017eba998cdf", + "version": "3.2.105" } }, { @@ -24,7 +24,7 @@ "repositoryURL": "https://github.com/passepartoutvpn/wireguard-apple", "state": { "branch": null, - "revision": "57f9babde0fb7567f31a75e943538022f8725f8f", + "revision": "73d9152fa0cb661db0348a1ac11dbbf998422a50", "version": "1.0.17" } } diff --git a/Sources/TunnelKitManager/NetworkExtensionConfiguration.swift b/Sources/TunnelKitManager/NetworkExtensionConfiguration.swift index 6156820..136cc29 100644 --- a/Sources/TunnelKitManager/NetworkExtensionConfiguration.swift +++ b/Sources/TunnelKitManager/NetworkExtensionConfiguration.swift @@ -41,6 +41,9 @@ public struct NetworkExtensionExtra { /// Enables best-effort kill switch. public var killSwitch = false + /// Extra user configuration data. + public var userData: [String: Any]? + public init() { } } diff --git a/Sources/TunnelKitManager/NetworkExtensionVPN.swift b/Sources/TunnelKitManager/NetworkExtensionVPN.swift index 3e59466..29ff4ca 100644 --- a/Sources/TunnelKitManager/NetworkExtensionVPN.swift +++ b/Sources/TunnelKitManager/NetworkExtensionVPN.swift @@ -140,6 +140,10 @@ public class NetworkExtensionVPN: VPN { ) let managers = try await lookupAll() + extra?.userData?.forEach { + proto.providerConfiguration?[$0.key] = $0.value + } + // install (new or existing) then callback let targetManager = managers.first { $0.isTunnel(withIdentifier: tunnelBundleIdentifier)