From 030187ece649f3a6e28b298126884602aef16cf0 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sat, 25 Jul 2026 11:59:44 -0500 Subject: chore: add DEBUG reveal of the CloudKit owner record ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Groundwork for the owner Pro+ allowlist. Adds OwnerAccess, which identifies the app owner by their CloudKit user-record ID (a stable, opaque per-Apple-ID value that cannot be guessed or spoofed), plus a DEBUG-only "Developer" row in Settings → App Info that fetches and copies the current iCloud user's record ID for the app's container. OwnerAccess.ownerUserRecordID is empty, so isOwner() is inert until the real value is filled in. A follow-up will hardcode the owner ID, wire isOwner() into PurchaseService to grant .proPlus on a match, remove this reveal, and cut 5.0.1. DEBUG-only UI; release builds are unaffected. --- DomainDig/AppInfoView.swift | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'DomainDig/AppInfoView.swift') diff --git a/DomainDig/AppInfoView.swift b/DomainDig/AppInfoView.swift index 055fe46..f3a0765 100644 --- a/DomainDig/AppInfoView.swift +++ b/DomainDig/AppInfoView.swift @@ -8,6 +8,9 @@ struct AppInfoView: View { @Environment(\.openURL) private var openURL @State private var cloudSyncService = CloudSyncService.shared @State private var activeSheet: AppInfoSheet? + #if DEBUG + @State private var developerRecordName: String? + #endif var body: some View { Form { @@ -44,6 +47,27 @@ struct AppInfoView: View { Text(AppLinks.copyright) .frame(maxWidth: .infinity, alignment: .center) } + + #if DEBUG + Section { + HStack(alignment: .top, spacing: 8) { + Text(developerRecordName ?? "Fetching…") + .font(.system(.footnote, design: .monospaced)) + .textSelection(.enabled) + Spacer(minLength: 8) + if let developerRecordName { + AppCopyButton(value: developerRecordName, label: "Copy iCloud record ID") + } + } + } header: { + Text("Developer") + } footer: { + Text("Your CloudKit user-record ID for this app, used to configure the owner allowlist. DEBUG builds only.") + } + .task { + developerRecordName = await OwnerAccess.currentUserRecordName() ?? "Unavailable (sign into iCloud)" + } + #endif } .navigationTitle("App Info") .task { -- cgit v1.2.3