diff --git a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift index 2dca4637..1d122548 100644 --- a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift +++ b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift @@ -79,6 +79,22 @@ extension AppGroupEntitlement: EntitlementWithCapability { } } +extension AppleSignInEntitlement: EntitlementWithCapability { + var capability: DeveloperServicesCapability { + // A primary App ID: the app is its own Sign in with Apple group. + DeveloperServicesCapability( + .appleIdAuth, + isFree: false, + settings: [ + .init( + key: .init(.appleIdAuthAppConsent), + options: [.init(key: .init(.primaryAppConsent))] + ) + ] + ) + } +} + extension AssociatedDomainsEntitlement: EntitlementWithCapability { var capability: DeveloperServicesCapability { DeveloperServicesCapability(.associatedDomains, isFree: false) diff --git a/Sources/XKit/Model/Entitlements/EntitlementTypes.swift b/Sources/XKit/Model/Entitlements/EntitlementTypes.swift index 1d65a047..7bc1ea5f 100644 --- a/Sources/XKit/Model/Entitlements/EntitlementTypes.swift +++ b/Sources/XKit/Model/Entitlements/EntitlementTypes.swift @@ -29,6 +29,7 @@ extension EntitlementContainer { WiFiAwareEntitlement.self, HomeKitEntitlement.self, HealthKitEntitlement.self, + AppleSignInEntitlement.self, ] } @@ -99,6 +100,21 @@ public struct AssociatedDomainsEntitlement: Entitlement, RawRepresentable { } } +public struct AppleSignInEntitlement: Entitlement, RawRepresentable { + public static let identifier = "com.apple.developer.applesignin" + + public var rawValue: [String] + public init(rawValue: [String]) { self.rawValue = rawValue } + + public init(from decoder: Decoder) throws { + rawValue = try decoder.singleValueContainer().decode([String].self) + } + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + public enum APSEnvironmentEntitlement: String, Entitlement { public static let identifier = "aps-environment"