feat(account): add managed credits and cloud gateway

Introduce optional Apple account-backed credits with scoped gateway access while preserving local and BYOK paths. Refresh assistant behavior, tests, privacy disclosures, docs, and the website for the 2.0 experience.
This commit is contained in:
Rocky
2026-08-20 11:43:21 +08:00
parent 0f9280bd00
commit 498f407585
301 changed files with 19221 additions and 10891 deletions
+6 -6
View File
@@ -116,7 +116,7 @@ public enum Keychain: @unchecked Sendable {
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: service,
kSecAttrAccount as String: account(for: providerId),
kSecAttrSynchronizable as String: synchronizable ? kCFBooleanTrue! : kCFBooleanFalse!,
kSecAttrSynchronizable as String: synchronizable ? kCFBooleanTrue! : kCFBooleanFalse!
]
#if os(macOS)
query[kSecUseDataProtectionKeychain as String] = true
@@ -252,7 +252,7 @@ public enum Keychain: @unchecked Sendable {
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: service,
kSecAttrAccount as String: asrAccount(for: providerId),
kSecAttrSynchronizable as String: synchronizable ? kCFBooleanTrue! : kCFBooleanFalse!,
kSecAttrSynchronizable as String: synchronizable ? kCFBooleanTrue! : kCFBooleanFalse!
]
#if os(macOS)
query[kSecUseDataProtectionKeychain as String] = true
@@ -393,7 +393,7 @@ public enum Keychain: @unchecked Sendable {
kSecAttrService as String: service,
kSecAttrAccount as String: legacyAccount,
kSecReturnData as String: true,
kSecMatchLimit as String: kSecMatchLimitOne,
kSecMatchLimit as String: kSecMatchLimitOne
]
#if os(macOS)
query[kSecUseDataProtectionKeychain as String] = true
@@ -513,7 +513,7 @@ public enum Keychain: @unchecked Sendable {
var query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: service,
kSecAttrAccount as String: legacyAccount,
kSecAttrAccount as String: legacyAccount
]
#if os(macOS)
query[kSecUseDataProtectionKeychain as String] = true
@@ -933,7 +933,7 @@ public enum Keychain: @unchecked Sendable {
kSecAttrService as String: onboardingService,
kSecAttrAccount as String: onboardingAccount,
kSecReturnData as String: true,
kSecMatchLimit as String: kSecMatchLimitOne,
kSecMatchLimit as String: kSecMatchLimitOne
]
#if os(macOS)
query[kSecUseDataProtectionKeychain as String] = true
@@ -962,7 +962,7 @@ public enum Keychain: @unchecked Sendable {
var baseQuery: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: onboardingService,
kSecAttrAccount as String: onboardingAccount,
kSecAttrAccount as String: onboardingAccount
]
#if os(macOS)
baseQuery[kSecUseDataProtectionKeychain as String] = true