Import profiles with on-demand disabled (#641)
Make it friendly to Shortcuts automation by default.
This commit is contained in:
parent
aead866275
commit
0e4dd086ef
|
@ -32,7 +32,7 @@
|
|||
"kind" : "remoteSourceControl",
|
||||
"location" : "git@github.com:passepartoutvpn/passepartoutkit",
|
||||
"state" : {
|
||||
"revision" : "3d1a60be9722861f9de45e355d520bae33ac87a9"
|
||||
"revision" : "fd4fe153c17a33d43a2e75d58512194ac3588eba"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ let package = Package(
|
|||
],
|
||||
dependencies: [
|
||||
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit", from: "0.7.0"),
|
||||
.package(url: "git@github.com:passepartoutvpn/passepartoutkit", revision: "3d1a60be9722861f9de45e355d520bae33ac87a9"),
|
||||
.package(url: "git@github.com:passepartoutvpn/passepartoutkit", revision: "fd4fe153c17a33d43a2e75d58512194ac3588eba"),
|
||||
// .package(path: "../../../passepartoutkit"),
|
||||
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-openvpn-openssl", from: "0.6.0"),
|
||||
// .package(path: "../../../passepartoutkit-openvpn-openssl"),
|
||||
|
|
|
@ -125,11 +125,14 @@ private extension ProfileImporter {
|
|||
}
|
||||
|
||||
let module = try registry.module(fromURL: url, object: passphrase)
|
||||
var onDemandModuleBuilder = OnDemandModule.Builder()
|
||||
onDemandModuleBuilder.isEnabled = false
|
||||
let onDemandModule = onDemandModuleBuilder.tryBuild()
|
||||
|
||||
var builder = Profile.Builder()
|
||||
builder.name = url.lastPathComponent
|
||||
builder.modules = [module]
|
||||
builder.activeModulesIds = [module.id]
|
||||
builder.modules = [module, onDemandModule]
|
||||
builder.activeModulesIds = Set(builder.modules.map(\.id))
|
||||
let profile = try builder.tryBuild()
|
||||
|
||||
try await profileManager.save(profile)
|
||||
|
|
|
@ -61,8 +61,9 @@ extension ProfileImporterTests {
|
|||
.sink {
|
||||
switch $0 {
|
||||
case .save(let profile):
|
||||
XCTAssertEqual(profile.modules.count, 1)
|
||||
XCTAssertEqual(profile.modules.count, 2)
|
||||
XCTAssertTrue(profile.modules.first is SomeModule)
|
||||
XCTAssertTrue(profile.modules.last is OnDemandModule)
|
||||
exp.fulfill()
|
||||
|
||||
default:
|
||||
|
@ -92,8 +93,9 @@ extension ProfileImporterTests {
|
|||
.sink {
|
||||
switch $0 {
|
||||
case .save(let profile):
|
||||
XCTAssertEqual(profile.modules.count, 1)
|
||||
XCTAssertEqual(profile.modules.count, 2)
|
||||
XCTAssertTrue(profile.modules.first is SomeModule)
|
||||
XCTAssertTrue(profile.modules.last is OnDemandModule)
|
||||
exp.fulfill()
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue