Fix extra team prefix in keychain group (#721)

Team ID already included in .xcconfig

Fixes #720
This commit is contained in:
Davide 2024-10-11 03:45:20 +02:00 committed by GitHub
parent 9449a02b77
commit 8f6192c2b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 19 additions and 11 deletions

View File

@ -41,7 +41,7 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source", "location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
"state" : { "state" : {
"revision" : "c859acb74cb50f7ad218265cd3d3eb0eb99ee1c5" "revision" : "de9387965025a1f79e060e6bdc862933fe972598"
} }
}, },
{ {

View File

@ -37,7 +37,8 @@
<true/> <true/>
<key>keychain-access-groups</key> <key>keychain-access-groups</key>
<array> <array>
<string>$(AppIdentifierPrefix)$(CFG_GROUP_ID)</string> <string>$(CFG_KEYCHAIN_GROUP_ID)</string>
<string>$(AppIdentifierPrefix)$(CFG_KEYCHAIN_GROUP_ID)</string>
</array> </array>
</dict> </dict>
</plist> </plist>

View File

@ -13,7 +13,7 @@
<key>iapBundlePrefix</key> <key>iapBundlePrefix</key>
<string>$(CFG_IAP_BUNDLE_PREFIX)</string> <string>$(CFG_IAP_BUNDLE_PREFIX)</string>
<key>keychainGroupId</key> <key>keychainGroupId</key>
<string>$(CFG_TEAM_ID).$(CFG_GROUP_ID)</string> <string>$(CFG_KEYCHAIN_GROUP_ID)</string>
<key>tunnelId</key> <key>tunnelId</key>
<string>$(CFG_TUNNEL_ID)</string> <string>$(CFG_TUNNEL_ID)</string>
<key>legacyV2CloudKitId</key> <key>legacyV2CloudKitId</key>

View File

@ -36,6 +36,7 @@ CFG_GROUP_ID[sdk=appletvsimulator*] = $(CFG_RAW_GROUP_ID)
CFG_GROUP_ID[sdk=iphoneos*] = $(CFG_RAW_GROUP_ID) CFG_GROUP_ID[sdk=iphoneos*] = $(CFG_RAW_GROUP_ID)
CFG_GROUP_ID[sdk=iphonesimulator*] = $(CFG_RAW_GROUP_ID) CFG_GROUP_ID[sdk=iphonesimulator*] = $(CFG_RAW_GROUP_ID)
CFG_GROUP_ID[sdk=macosx*] = $(CFG_TEAM_ID).$(CFG_RAW_GROUP_ID) CFG_GROUP_ID[sdk=macosx*] = $(CFG_TEAM_ID).$(CFG_RAW_GROUP_ID)
CFG_KEYCHAIN_GROUP_ID = $(CFG_TEAM_ID).$(CFG_RAW_GROUP_ID)
CFG_IAP_BUNDLE_PREFIX = com.algoritmico.ios.Passepartout CFG_IAP_BUNDLE_PREFIX = com.algoritmico.ios.Passepartout
CFG_INTENTS_ID = $(CFG_APP_ID).Intents CFG_INTENTS_ID = $(CFG_APP_ID).Intents
CFG_RAW_GROUP_ID = group.com.algoritmico.Passepartout CFG_RAW_GROUP_ID = group.com.algoritmico.Passepartout

View File

@ -8,10 +8,6 @@
<string>$(CFG_APP_ID)</string> <string>$(CFG_APP_ID)</string>
<key>groupId</key> <key>groupId</key>
<string>$(CFG_GROUP_ID)</string> <string>$(CFG_GROUP_ID)</string>
<key>keychainGroupId</key>
<string>$(CFG_TEAM_ID).$(CFG_GROUP_ID)</string>
<key>teamId</key>
<string>$(CFG_TEAM_ID)</string>
<key>tunnelId</key> <key>tunnelId</key>
<string>$(CFG_TUNNEL_ID)</string> <string>$(CFG_TUNNEL_ID)</string>
</dict> </dict>

View File

@ -28,7 +28,7 @@ let package = Package(
], ],
dependencies: [ dependencies: [
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.8.0"), // .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.8.0"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "c859acb74cb50f7ad218265cd3d3eb0eb99ee1c5"), .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "de9387965025a1f79e060e6bdc862933fe972598"),
// .package(path: "../../../passepartoutkit-source"), // .package(path: "../../../passepartoutkit-source"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.8.0"), .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.8.0"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"), // .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"),

View File

@ -46,7 +46,12 @@ public final class NEProfileRepository: ProfileRepository {
.managersPublisher .managersPublisher
.sink { [weak self] allManagers in .sink { [weak self] allManagers in
let profiles = allManagers.values.compactMap { let profiles = allManagers.values.compactMap {
try? repository.profile(from: $0) do {
return try repository.profile(from: $0)
} catch {
pp_log(.app, .error, "Unable to decode profile from NE manager '\($0.localizedDescription ?? "")': \(error)")
return nil
}
} }
self?.profilesSubject.send(profiles) self?.profilesSubject.send(profiles)
} }

View File

@ -24,11 +24,13 @@
// //
import Foundation import Foundation
import NetworkExtension
import PassepartoutKit import PassepartoutKit
public enum AppUI { public enum AppUI {
public static func configure(with context: AppContext) { public static func configure(with context: AppContext) {
assertMissingModuleImplementations() assertMissingModuleImplementations()
cleanUpOrphanedKeychainEntries()
} }
} }
@ -44,4 +46,7 @@ private extension AppUI {
} }
} }
} }
static func cleanUpOrphanedKeychainEntries() {
}
} }

View File

@ -18,7 +18,7 @@
<true/> <true/>
<key>keychain-access-groups</key> <key>keychain-access-groups</key>
<array> <array>
<string>$(AppIdentifierPrefix)$(CFG_GROUP_ID)</string> <string>$(CFG_KEYCHAIN_GROUP_ID)</string>
</array> </array>
</dict> </dict>
</plist> </plist>

View File

@ -7,7 +7,7 @@
<key>groupId</key> <key>groupId</key>
<string>$(CFG_GROUP_ID)</string> <string>$(CFG_GROUP_ID)</string>
<key>keychainGroupId</key> <key>keychainGroupId</key>
<string>$(CFG_TEAM_ID).$(CFG_GROUP_ID)</string> <string>$(CFG_KEYCHAIN_GROUP_ID)</string>
<key>tunnelId</key> <key>tunnelId</key>
<string>$(CFG_TUNNEL_ID)</string> <string>$(CFG_TUNNEL_ID)</string>
</dict> </dict>