oops revert
- Commit
cd87b11e70ffbe6e4d8daf8a8c15555b02f3ebf6- Author
- Kabir Oberai <[email protected]>
- When
- 2024-12-23 20:16 UTC (1 year ago)
- Parents
af8d5f5
Diff
Sources/Supersign/DeveloperServices/App IDs/Entitlements/EntitlementWithTeamOrBundleID.swift
diff --git a/Sources/Supersign/DeveloperServices/App IDs/Entitlements/EntitlementWithTeamOrBundleID.swift b/Sources/Supersign/DeveloperServices/App IDs/Entitlements/EntitlementWithTeamOrBundleID.swiftindex 850398c..07572bc 100644--- a/Sources/Supersign/DeveloperServices/App IDs/Entitlements/EntitlementWithTeamOrBundleID.swift +++ b/Sources/Supersign/DeveloperServices/App IDs/Entitlements/EntitlementWithTeamOrBundleID.swift @@ -9,23 +9,23 @@ import Foundation protocol EntitlementWithTeamOrBundleID: Entitlement {- mutating func update(teamID: DeveloperServicesTeam.ID, bundleID: String)+ init(teamID: DeveloperServicesTeam.ID, bundleID: String) } extension ApplicationIdentifierEntitlement: EntitlementWithTeamOrBundleID {- mutating func update(teamID: DeveloperServicesTeam.ID, bundleID: String) {+ init(teamID: DeveloperServicesTeam.ID, bundleID: String) { self.rawValue = "\(teamID.rawValue).\(bundleID)" } } extension TeamIdentifierEntitlement: EntitlementWithTeamOrBundleID {- mutating func update(teamID: DeveloperServicesTeam.ID, bundleID: String) {+ init(teamID: DeveloperServicesTeam.ID, bundleID: String) { self.rawValue = teamID.rawValue } } extension KeychainAccessGroupsEntitlement: EntitlementWithTeamOrBundleID {- mutating func update(teamID: DeveloperServicesTeam.ID, bundleID: String) {+ init(teamID: DeveloperServicesTeam.ID, bundleID: String) { rawValue = ["\(teamID.rawValue).\(bundleID)"] } }@@ -33,13 +33,13 @@ extension KeychainAccessGroupsEntitlement: EntitlementWithTeamOrBundleID { extension Entitlements { public mutating func update(teamID: DeveloperServicesTeam.ID, bundleID: String) throws {+ let teamOrBundleIDTypes = EntitlementContainer.supportedTypes+ .compactMap { $0 as? EntitlementWithTeamOrBundleID.Type }+ let teamOrBundleIDSet = Set(teamOrBundleIDTypes.map(ObjectIdentifier.init))+ try updateEntitlements { entitlements in- for entitlementIndex in entitlements.indices {- if var copy = entitlements[entitlementIndex] as? EntitlementWithTeamOrBundleID {- copy.update(teamID: teamID, bundleID: bundleID)- entitlements[entitlementIndex] = copy- }- }+ entitlements.removeAll { teamOrBundleIDSet.contains(ObjectIdentifier(type(of: $0))) }+ entitlements += teamOrBundleIDTypes.map { $0.init(teamID: teamID, bundleID: bundleID) } } }