From 8d613056a6579504396d2184683aa17b2d260c6c Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Sun, 11 May 2025 15:53:53 +0530 Subject: [PATCH] Only revoke certificates if on a free team --- ...perServicesFetchCertificateOperation.swift | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift b/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift index fd0e97f6..26ae405a 100644 --- a/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift +++ b/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift @@ -72,19 +72,21 @@ public struct DeveloperServicesFetchCertificateOperation: DeveloperServicesOpera _ certificates: [DeveloperServicesCertificate], requireConfirmation: Bool ) async throws -> SigningInfo { - if !certificates.isEmpty, requireConfirmation { - guard await confirmRevocation(certificates) - else { throw CancellationError() } - } - try await withThrowingTaskGroup(of: Void.self) { group in - for certificate in certificates { - group.addTask { - _ = try await context.developerAPIClient - .certificatesDeleteInstance(path: .init(id: certificate.id)) - .noContent - } + if try await context.auth.team()?.isFree == true { + if !certificates.isEmpty, requireConfirmation { + guard await confirmRevocation(certificates) + else { throw CancellationError() } + } + try await withThrowingTaskGroup(of: Void.self) { group in + for certificate in certificates { + group.addTask { + _ = try await context.developerAPIClient + .certificatesDeleteInstance(path: .init(id: certificate.id)) + .noContent + } + } + try await group.waitForAll() } - try await group.waitForAll() } let signingInfo = try await createCertificate() signingInfoManager[self.context.auth.identityID] = signingInfo