diff --git a/Amplify/Categories/Auth/Models/AccessGroup.swift b/Amplify/Categories/Auth/Models/AccessGroup.swift new file mode 100644 index 0000000000..5842598910 --- /dev/null +++ b/Amplify/Categories/Auth/Models/AccessGroup.swift @@ -0,0 +1,51 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import Foundation + +/// A structure representing an access group for managing keychain items. +public struct AccessGroup { + /// The name of the access group. + public let name: String? + + /// A flag indicating whether to migrate keychain items. + public let migrateKeychainItems: Bool + + /** + Initializes an `AccessGroup` with the specified name and migration option. + + - Parameter name: The name of the access group. + - Parameter migrateKeychainItemsOfUserSession: A flag indicating whether to migrate keychain items. Defaults to `false`. + */ + public init(name: String, migrateKeychainItemsOfUserSession: Bool = false) { + self.init(name: name, migrateKeychainItems: migrateKeychainItemsOfUserSession) + } + + /** + Creates an `AccessGroup` instance with no specified name. + + - Parameter migrateKeychainItemsOfUserSession: A flag indicating whether to migrate keychain items. + - Returns: An `AccessGroup` instance with the migration option set. + */ + public static func none(migrateKeychainItemsOfUserSession: Bool) -> AccessGroup { + return .init(migrateKeychainItems: migrateKeychainItemsOfUserSession) + } + + /** + A static property representing an `AccessGroup` with no name and no migration. + + - Returns: An `AccessGroup` instance with no name and the migration option set to `false`. + */ + public static var none: AccessGroup { + return .none(migrateKeychainItemsOfUserSession: false) + } + + private init(name: String? = nil, migrateKeychainItems: Bool) { + self.name = name + self.migrateKeychainItems = migrateKeychainItems + } +} diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift index 482d266575..8c26cb155e 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift @@ -186,7 +186,11 @@ extension AWSCognitoAuthPlugin { } private func makeCredentialStore() -> AmplifyAuthCredentialStoreBehavior { - AWSCognitoAuthCredentialStore(authConfiguration: authConfiguration) + return AWSCognitoAuthCredentialStore( + authConfiguration: authConfiguration, + accessGroup: secureStoragePreferences?.accessGroup?.name, + migrateKeychainItemsOfUserSession: secureStoragePreferences?.accessGroup?.migrateKeychainItems ?? false + ) } private func makeLegacyKeychainStore(service: String) -> KeychainStoreBehavior { diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin.swift index f32209ba9c..59f224dc26 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin.swift @@ -35,6 +35,9 @@ public final class AWSCognitoAuthPlugin: AWSCognitoAuthPluginBehavior { /// The user network preferences for timeout and retry let networkPreferences: AWSCognitoNetworkPreferences? + /// The user secure storage preferences for access group + let secureStoragePreferences: AWSCognitoSecureStoragePreferences? + @_spi(InternalAmplifyConfiguration) internal(set) public var jsonConfiguration: JSONValue? @@ -43,15 +46,14 @@ public final class AWSCognitoAuthPlugin: AWSCognitoAuthPluginBehavior { return "awsCognitoAuthPlugin" } - /// Instantiates an instance of the AWSCognitoAuthPlugin. - public init() { - self.networkPreferences = nil - } - - /// Instantiates an instance of the AWSCognitoAuthPlugin with custom network preferences + /// Instantiates an instance of the AWSCognitoAuthPlugin with optional custom network + /// preferences and optional custom secure storage preferences /// - Parameters: /// - networkPreferences: network preferences - public init(networkPreferences: AWSCognitoNetworkPreferences) { + /// - secureStoragePreferences: secure storage preferences + public init(networkPreferences: AWSCognitoNetworkPreferences? = nil, + secureStoragePreferences: AWSCognitoSecureStoragePreferences = AWSCognitoSecureStoragePreferences()) { self.networkPreferences = networkPreferences + self.secureStoragePreferences = secureStoragePreferences } } diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/ClientBehavior/AWSCognitoAuthPlugin+ClientBehavior.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/ClientBehavior/AWSCognitoAuthPlugin+ClientBehavior.swift index 3e7dc8628c..e5c0500043 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/ClientBehavior/AWSCognitoAuthPlugin+ClientBehavior.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/ClientBehavior/AWSCognitoAuthPlugin+ClientBehavior.swift @@ -114,7 +114,11 @@ extension AWSCognitoAuthPlugin: AuthCategoryBehavior { public func fetchAuthSession(options: AuthFetchSessionRequest.Options?) async throws -> AuthSession { let options = options ?? AuthFetchSessionRequest.Options() let request = AuthFetchSessionRequest(options: options) - let task = AWSAuthFetchSessionTask(request, authStateMachine: authStateMachine) + let forceReconfigure = secureStoragePreferences?.accessGroup?.name != nil + let task = AWSAuthFetchSessionTask(request, + authStateMachine: authStateMachine, + configuration: authConfiguration, + forceReconfigure: forceReconfigure) return try await taskQueue.sync { return try await task.value } as! AuthSession diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/CredentialStorage/AWSCognitoAuthCredentialStore.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/CredentialStorage/AWSCognitoAuthCredentialStore.swift index dd55162b57..fa897dde68 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/CredentialStorage/AWSCognitoAuthCredentialStore.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/CredentialStorage/AWSCognitoAuthCredentialStore.swift @@ -13,6 +13,7 @@ struct AWSCognitoAuthCredentialStore { // Credential store constants private let service = "com.amplify.awsCognitoAuthPlugin" + private let sharedService = "com.amplify.awsCognitoAuthPluginShared" private let sessionKey = "session" private let deviceMetadataKey = "deviceMetadata" private let deviceASFKey = "deviceASF" @@ -25,14 +26,40 @@ struct AWSCognitoAuthCredentialStore { private var isKeychainConfiguredKey: String { "\(userDefaultsNameSpace).isKeychainConfigured" } + /// This UserDefaults Key is use to retrieve the stored access group to determine + /// which access group the migration should happen from + /// If none is found, the unshared service is used for migration and all items + /// under that service are queried + private var accessGroupKey: String { + "\(userDefaultsNameSpace).accessGroup" + } private let authConfiguration: AuthConfiguration private let keychain: KeychainStoreBehavior private let userDefaults = UserDefaults.standard + private let accessGroup: String? - init(authConfiguration: AuthConfiguration, accessGroup: String? = nil) { + init( + authConfiguration: AuthConfiguration, + accessGroup: String? = nil, + migrateKeychainItemsOfUserSession: Bool = false + ) { self.authConfiguration = authConfiguration - self.keychain = KeychainStore(service: service, accessGroup: accessGroup) + self.accessGroup = accessGroup + if let accessGroup { + self.keychain = KeychainStore(service: sharedService, accessGroup: accessGroup) + } else { + self.keychain = KeychainStore(service: service) + } + + let oldAccessGroup = retrieveStoredAccessGroup() + if migrateKeychainItemsOfUserSession { + try? migrateKeychainItemsToAccessGroup() + } else if oldAccessGroup == nil && oldAccessGroup != accessGroup { + try? KeychainStore(service: service)._removeAll() + } + + saveStoredAccessGroup() if !userDefaults.bool(forKey: isKeychainConfiguredKey) { try? clearAllCredentials() @@ -181,6 +208,39 @@ extension AWSCognitoAuthCredentialStore: AmplifyAuthCredentialStoreBehavior { private func clearAllCredentials() throws { try keychain._removeAll() } + + private func retrieveStoredAccessGroup() -> String? { + return userDefaults.string(forKey: accessGroupKey) + } + + private func saveStoredAccessGroup() { + if let accessGroup { + userDefaults.set(accessGroup, forKey: accessGroupKey) + } else { + userDefaults.removeObject(forKey: accessGroupKey) + } + } + + private func migrateKeychainItemsToAccessGroup() throws { + let oldAccessGroup = retrieveStoredAccessGroup() + + if oldAccessGroup == accessGroup { + log.info("[AWSCognitoAuthCredentialStore] Stored access group is the same as current access group, aborting migration") + return + } + + let oldService = oldAccessGroup != nil ? sharedService : service + let newService = accessGroup != nil ? sharedService : service + + do { + try KeychainStoreMigrator(oldService: oldService, newService: newService, oldAccessGroup: oldAccessGroup, newAccessGroup: accessGroup).migrate() + } catch { + log.error("[AWSCognitoAuthCredentialStore] Migration has failed") + return + } + + log.verbose("[AWSCognitoAuthCredentialStore] Migration of keychain items from old access group to new access group successful") + } } @@ -204,3 +264,5 @@ private extension AWSCognitoAuthCredentialStore { } } + +extension AWSCognitoAuthCredentialStore: DefaultLogger { } diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AWSCognitoSecureStoragePreferences.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AWSCognitoSecureStoragePreferences.swift new file mode 100644 index 0000000000..3ee17a804c --- /dev/null +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AWSCognitoSecureStoragePreferences.swift @@ -0,0 +1,23 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import Foundation +import Amplify + +/// A struct to store preferences for how the plugin uses storage +public struct AWSCognitoSecureStoragePreferences { + + /// The access group that the keychain will use for auth items + public let accessGroup: AccessGroup? + + /// Creates an intstance of AWSCognitoSecureStoragePreferences + /// - Parameters: + /// - accessGroup: access group to be used + public init(accessGroup: AccessGroup? = nil) { + self.accessGroup = accessGroup + } +} diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Task/AWSAuthFetchSessionTask.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Task/AWSAuthFetchSessionTask.swift index f39263578d..808363e6ee 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Task/AWSAuthFetchSessionTask.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Task/AWSAuthFetchSessionTask.swift @@ -13,19 +13,34 @@ class AWSAuthFetchSessionTask: AuthFetchSessionTask, DefaultLogger { private let authStateMachine: AuthStateMachine private let fetchAuthSessionHelper: FetchAuthSessionOperationHelper private let taskHelper: AWSAuthTaskHelper + private let configuration: AuthConfiguration + private let forceReconfigure: Bool var eventName: HubPayloadEventName { HubPayload.EventName.Auth.fetchSessionAPI } - init(_ request: AuthFetchSessionRequest, authStateMachine: AuthStateMachine) { + init( + _ request: AuthFetchSessionRequest, + authStateMachine: AuthStateMachine, + configuration: AuthConfiguration, + forceReconfigure: Bool = false + ) { self.request = request self.authStateMachine = authStateMachine self.fetchAuthSessionHelper = FetchAuthSessionOperationHelper() self.taskHelper = AWSAuthTaskHelper(authStateMachine: authStateMachine) + self.configuration = configuration + self.forceReconfigure = forceReconfigure } func execute() async throws -> AuthSession { + log.verbose("Starting execution") + if forceReconfigure { + log.verbose("Reconfiguring auth state machine for keychain sharing") + let event = AuthEvent(eventType: .reconfigure(configuration)) + await authStateMachine.send(event) + } await taskHelper.didStateMachineConfigured() let doesNeedForceRefresh = request.options.forceRefresh return try await fetchAuthSessionHelper.fetch(authStateMachine, diff --git a/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginAmplifyOutputsConfigTests.swift b/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginAmplifyOutputsConfigTests.swift index 85eba053d7..23ecfae901 100644 --- a/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginAmplifyOutputsConfigTests.swift +++ b/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginAmplifyOutputsConfigTests.swift @@ -123,4 +123,84 @@ class AWSCognitoAuthPluginAmplifyOutputsConfigTests: XCTestCase { XCTFail("Should not throw error. \(error)") } } + + /// Test Auth configuration with valid config for user pool and identity pool, with secure storage preferences + /// + /// - Given: Given valid config for user pool and identity pool with secure storage preferences + /// - When: + /// - I configure auth with the given configuration and secure storage preferences + /// - Then: + /// - I should not get any error while configuring auth + /// + func testConfigWithUserPoolAndIdentityPoolWithSecureStoragePreferences() throws { + let plugin = AWSCognitoAuthPlugin( + secureStoragePreferences: .init( + accessGroup: AccessGroup(name: "xx") + ) + ) + try Amplify.add(plugin: plugin) + + let amplifyConfig = AmplifyOutputsData(auth: .init( + awsRegion: "us-east-1", + userPoolId: "xx", + userPoolClientId: "xx", + identityPoolId: "xx")) + + do { + try Amplify.configure(amplifyConfig) + + let escapeHatch = plugin.getEscapeHatch() + guard case .userPoolAndIdentityPool(let userPoolClient, let identityPoolClient) = escapeHatch else { + XCTFail("Expected .userPool, got \(escapeHatch)") + return + } + XCTAssertNotNil(userPoolClient) + XCTAssertNotNil(identityPoolClient) + + } catch { + XCTFail("Should not throw error. \(error)") + } + } + + /// Test Auth configuration with valid config for user pool and identity pool, with network preferences and secure storage preferences + /// + /// - Given: Given valid config for user pool and identity pool, network preferences, and secure storage preferences + /// - When: + /// - I configure auth with the given configuration, network preferences, and secure storage preferences + /// - Then: + /// - I should not get any error while configuring auth + /// + func testConfigWithUserPoolAndIdentityPoolWithNetworkPreferencesAndSecureStoragePreferences() throws { + let plugin = AWSCognitoAuthPlugin( + networkPreferences: .init( + maxRetryCount: 2, + timeoutIntervalForRequest: 60, + timeoutIntervalForResource: 60), + secureStoragePreferences: .init( + accessGroup: AccessGroup(name: "xx") + ) + ) + try Amplify.add(plugin: plugin) + + let amplifyConfig = AmplifyOutputsData(auth: .init( + awsRegion: "us-east-1", + userPoolId: "xx", + userPoolClientId: "xx", + identityPoolId: "xx")) + + do { + try Amplify.configure(amplifyConfig) + + let escapeHatch = plugin.getEscapeHatch() + guard case .userPoolAndIdentityPool(let userPoolClient, let identityPoolClient) = escapeHatch else { + XCTFail("Expected .userPool, got \(escapeHatch)") + return + } + XCTAssertNotNil(userPoolClient) + XCTAssertNotNil(identityPoolClient) + + } catch { + XCTFail("Should not throw error. \(error)") + } + } } diff --git a/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginConfigTests.swift b/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginConfigTests.swift index 553406fbe6..a14fecf891 100644 --- a/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginConfigTests.swift +++ b/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/ConfigurationTests/AWSCognitoAuthPluginConfigTests.swift @@ -235,6 +235,102 @@ class AWSCognitoAuthPluginConfigTests: XCTestCase { XCTFail("Should not throw error. \(error)") } } + + /// Test Auth configuration with valid config for user pool and identity pool, with secure storage preferences + /// + /// - Given: Given valid config for user pool and identity pool, and secure storage preferences + /// - When: + /// - I configure auth with the given configuration and secure storage preferences + /// - Then: + /// - I should not get any error while configuring auth + /// + func testConfigWithUserPoolAndIdentityPoolWithSecureStoragePreferences() throws { + let plugin = AWSCognitoAuthPlugin( + secureStoragePreferences: .init( + accessGroup: AccessGroup(name: "xx") + ) + ) + try Amplify.add(plugin: plugin) + + let categoryConfig = AuthCategoryConfiguration(plugins: [ + "awsCognitoAuthPlugin": [ + "CredentialsProvider": ["CognitoIdentity": ["Default": + ["PoolId": "xx", + "Region": "us-east-1"] + ]], + "CognitoUserPool": ["Default": [ + "PoolId": "xx", + "Region": "us-east-1", + "AppClientId": "xx", + "AppClientSecret": "xx"]] + ] + ]) + let amplifyConfig = AmplifyConfiguration(auth: categoryConfig) + do { + try Amplify.configure(amplifyConfig) + + let escapeHatch = plugin.getEscapeHatch() + guard case .userPoolAndIdentityPool(let userPoolClient, let identityPoolClient) = escapeHatch else { + XCTFail("Expected .userPool, got \(escapeHatch)") + return + } + XCTAssertNotNil(userPoolClient) + XCTAssertNotNil(identityPoolClient) + + } catch { + XCTFail("Should not throw error. \(error)") + } + } + + /// Test Auth configuration with valid config for user pool and identity pool, with network preferences and secure storage preferences + /// + /// - Given: Given valid config for user pool and identity pool, network preferences, and secure storage preferences + /// - When: + /// - I configure auth with the given configuration, network preferences, and secure storage preferences + /// - Then: + /// - I should not get any error while configuring auth + /// + func testConfigWithUserPoolAndIdentityPoolWithNetworkPreferencesAndSecureStoragePreferences() throws { + let plugin = AWSCognitoAuthPlugin( + networkPreferences: .init( + maxRetryCount: 2, + timeoutIntervalForRequest: 60, + timeoutIntervalForResource: 60), + secureStoragePreferences: .init( + accessGroup: AccessGroup(name: "xx") + ) + ) + try Amplify.add(plugin: plugin) + + let categoryConfig = AuthCategoryConfiguration(plugins: [ + "awsCognitoAuthPlugin": [ + "CredentialsProvider": ["CognitoIdentity": ["Default": + ["PoolId": "xx", + "Region": "us-east-1"] + ]], + "CognitoUserPool": ["Default": [ + "PoolId": "xx", + "Region": "us-east-1", + "AppClientId": "xx", + "AppClientSecret": "xx"]] + ] + ]) + let amplifyConfig = AmplifyConfiguration(auth: categoryConfig) + do { + try Amplify.configure(amplifyConfig) + + let escapeHatch = plugin.getEscapeHatch() + guard case .userPoolAndIdentityPool(let userPoolClient, let identityPoolClient) = escapeHatch else { + XCTFail("Expected .userPool, got \(escapeHatch)") + return + } + XCTAssertNotNil(userPoolClient) + XCTAssertNotNil(identityPoolClient) + + } catch { + XCTFail("Should not throw error. \(error)") + } + } /// Test that the Auth plugin emits `InternalConfigureAuth` that is used by the Logging Category /// diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj index 89765429fc..6e4b1e59a8 100644 --- a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj @@ -245,6 +245,8 @@ B43C26C827BC9D54003F3BF7 /* AuthConfirmSignUpTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthConfirmSignUpTests.swift; sourceTree = ""; }; B43C26C927BC9D54003F3BF7 /* AuthResendSignUpCodeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthResendSignUpCodeTests.swift; sourceTree = ""; }; B4B9F45628F47B7B004F346F /* amplify-ios */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "amplify-ios"; path = ../../../..; sourceTree = ""; }; + E2A7D1732C5D76CB00B06999 /* AuthHostApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AuthHostApp.entitlements; sourceTree = ""; }; + E2A7D1742C5D774200B06999 /* AuthWatchApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AuthWatchApp.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -342,6 +344,7 @@ 485CB53127B614CE006CCEC7 = { isa = PBXGroup; children = ( + E2A7D1742C5D774200B06999 /* AuthWatchApp.entitlements */, 485CB5C627B62C5C006CCEC7 /* Packages */, 485CB53C27B614CE006CCEC7 /* AuthHostApp */, 485CB5A027B61E04006CCEC7 /* AuthIntegrationTests */, @@ -367,7 +370,7 @@ 485CB53C27B614CE006CCEC7 /* AuthHostApp */ = { isa = PBXGroup; children = ( - 907EA7602A4B6F56005E3AA8 /* AuthHostApp.entitlements */, + E2A7D1732C5D76CB00B06999 /* AuthHostApp.entitlements */, 681DFEA728E747B80000C36A /* AsyncTesting */, 485CB53D27B614CE006CCEC7 /* AuthHostAppApp.swift */, 485CB53F27B614CE006CCEC7 /* ContentView.swift */, @@ -1335,6 +1338,7 @@ buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_ENTITLEMENTS = AuthWatchApp.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = ""; @@ -1365,6 +1369,7 @@ buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_ENTITLEMENTS = AuthWatchApp.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = ""; diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp/AuthHostApp.entitlements b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp/AuthHostApp.entitlements index 63b56fc678..81bb6f8b5b 100644 --- a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp/AuthHostApp.entitlements +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp/AuthHostApp.entitlements @@ -5,6 +5,8 @@ keychain-access-groups $(AppIdentifierPrefix)com.aws.amplify.auth.AuthHostApp + $(AppIdentifierPrefix)com.aws.amplify.auth.AuthHostAppShared + $(AppIdentifierPrefix)com.aws.amplify.auth.AuthHostAppShared2 diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/AWSAuthBaseTest.swift b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/AWSAuthBaseTest.swift index 0e8ffceb84..ee145052d1 100644 --- a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/AWSAuthBaseTest.swift +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/AWSAuthBaseTest.swift @@ -32,6 +32,10 @@ class AWSAuthBaseTest: XCTestCase { var amplifyOutputsFile = "testconfiguration/AWSCognitoAuthPluginIntegrationTests-amplify_outputs" let credentialsFile = "testconfiguration/AWSCognitoAuthPluginIntegrationTests-credentials" + let keychainAccessGroup = "94KV3E626L.com.aws.amplify.auth.AuthHostAppShared" + let keychainAccessGroup2 = "94KV3E626L.com.aws.amplify.auth.AuthHostAppShared2" + let keychainAccessGroupWatch = "W3DRXD72QU.com.amazon.aws.amplify.swift.AuthWatchAppShared" + let keychainAccessGroupWatch2 = "W3DRXD72QU.com.amazon.aws.amplify.swift.AuthWatchAppShared2" var amplifyConfiguration: AmplifyConfiguration! var amplifyOutputs: AmplifyOutputsData! diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/CredentialStore/CredentialStoreConfigurationTests.swift b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/CredentialStore/CredentialStoreConfigurationTests.swift index 8efbebdefd..68e3d53d2f 100644 --- a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/CredentialStore/CredentialStoreConfigurationTests.swift +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/CredentialStore/CredentialStoreConfigurationTests.swift @@ -218,4 +218,315 @@ class CredentialStoreConfigurationTests: AWSAuthBaseTest { let credentials = try? newCredentialStore.retrieveCredential() XCTAssertNil(credentials) } + + /// Test migrating to a shared access group keeps credentials + /// + /// - Given: A user registered is configured + /// - When: + /// - The credential store is re-initialized with shared access group and migration set to true + /// - Then: + /// - The old credentials should still persist + /// + func testCredentialsRemainOnMigrationToSharedAccessGroup() { + // Given + let identityId = "identityId" + // Migration only happens if credentials are not expired, hence + // the need for nonimmediate expiration test data + let awsCredentials = AuthAWSCognitoCredentials.nonimmediateExpiryTestData + let initialCognitoCredentials = AmplifyCredentials.userPoolAndIdentityPool( + signedInData: .testData, + identityID: identityId, + credentials: awsCredentials) + let initialAuthConfig = AuthConfiguration.userPoolsAndIdentityPools( + Defaults.makeDefaultUserPoolConfigData(), + Defaults.makeIdentityConfigData()) + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig) + do { + try credentialStore.saveCredential(initialCognitoCredentials) + } catch { + XCTFail("Unable to save credentials") + } + + // When migrating to shared access group with same configuration + #if os(watchOS) + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch, migrateKeychainItemsOfUserSession: true) + #else + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup, migrateKeychainItemsOfUserSession: true) + #endif + + // Then + guard let credentials = try? newCredentialStore.retrieveCredential(), + case .userPoolAndIdentityPool(let retrievedTokens, + let retrievedIdentityID, + let retrievedCredentials) = credentials else { + XCTFail("Unable to retrieve Credentials") + return + } + XCTAssertNotNil(credentials) + XCTAssertNotNil(retrievedTokens) + XCTAssertNotNil(retrievedIdentityID) + XCTAssertNotNil(retrievedCredentials) + XCTAssertEqual(retrievedIdentityID, identityId) + XCTAssertEqual(retrievedCredentials, awsCredentials) + } + + /// Test migrating from a shared access group to an unshared access group keeps credentials + /// + /// - Given: A user registered is configured + /// - When: + /// - The credential store is re-initialized with unshared access group and migration set to true + /// - Then: + /// - The old credentials should still persist + /// + func testCredentialsRemainOnMigrationFromSharedAccessGroup() { + // Given + let identityId = "identityId" + let awsCredentials = AuthAWSCognitoCredentials.nonimmediateExpiryTestData + // Migration only happens if credentials are not expired, hence + // the need for nonimmediate expiration test data + let initialCognitoCredentials = AmplifyCredentials.userPoolAndIdentityPool( + signedInData: .testData, + identityID: identityId, + credentials: awsCredentials) + let initialAuthConfig = AuthConfiguration.userPoolsAndIdentityPools( + Defaults.makeDefaultUserPoolConfigData(), + Defaults.makeIdentityConfigData()) + #if os(watchOS) + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch) + #else + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup) + #endif + do { + try credentialStore.saveCredential(initialCognitoCredentials) + } catch { + XCTFail("Unable to save credentials") + } + + // When migrating to unshared access group with same configuration + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, migrateKeychainItemsOfUserSession: true) + + // Then + guard let credentials = try? newCredentialStore.retrieveCredential(), + case .userPoolAndIdentityPool(let retrievedTokens, + let retrievedIdentityID, + let retrievedCredentials) = credentials else { + XCTFail("Unable to retrieve Credentials") + return + } + XCTAssertNotNil(credentials) + XCTAssertNotNil(retrievedTokens) + XCTAssertNotNil(retrievedIdentityID) + XCTAssertNotNil(retrievedCredentials) + XCTAssertEqual(retrievedIdentityID, identityId) + XCTAssertEqual(retrievedCredentials, awsCredentials) + } + + /// Test migrating from a shared access group to another shared access group keeps credentials + /// + /// - Given: A user registered is configured + /// - When: + /// - The credential store is re-initialized with another shared access group and migration set to true + /// - Then: + /// - The old credentials should still persist + /// + func testCredentialsRemainOnMigrationFromSharedAccessGroupToAnotherSharedAccessGroup() { + // Given + let identityId = "identityId" + let awsCredentials = AuthAWSCognitoCredentials.nonimmediateExpiryTestData + // Migration only happens if credentials are not expired, hence + // the need for nonimmediate expiration test data + let initialCognitoCredentials = AmplifyCredentials.userPoolAndIdentityPool( + signedInData: .testData, + identityID: identityId, + credentials: awsCredentials) + let initialAuthConfig = AuthConfiguration.userPoolsAndIdentityPools( + Defaults.makeDefaultUserPoolConfigData(), + Defaults.makeIdentityConfigData()) + #if os(watchOS) + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch) + #else + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup) + #endif + do { + try credentialStore.saveCredential(initialCognitoCredentials) + } catch { + XCTFail("Unable to save credentials") + } + + // When migrating to another shared access group with same configuration + #if os(watchOS) + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch2, migrateKeychainItemsOfUserSession: true) + #else + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup2, migrateKeychainItemsOfUserSession: true) + #endif + + // Then + guard let credentials = try? newCredentialStore.retrieveCredential(), + case .userPoolAndIdentityPool(let retrievedTokens, + let retrievedIdentityID, + let retrievedCredentials) = credentials else { + XCTFail("Unable to retrieve Credentials") + return + } + XCTAssertNotNil(credentials) + XCTAssertNotNil(retrievedTokens) + XCTAssertNotNil(retrievedIdentityID) + XCTAssertNotNil(retrievedCredentials) + XCTAssertEqual(retrievedIdentityID, identityId) + XCTAssertEqual(retrievedCredentials, awsCredentials) + } + + /// Test moving to a shared access group without migration should not keep credentials + /// + /// - Given: A user registered is configured + /// - When: + /// - The credential store is re-initialized with shared access group and migration set to false + /// - Then: + /// - The old credentials should not persist + /// + func testCredentialsDoNotRemainOnNonMigrationToSharedAccessGroup() { + // Given + let identityId = "identityId" + let awsCredentials = AuthAWSCognitoCredentials.nonimmediateExpiryTestData + let initialCognitoCredentials = AmplifyCredentials.userPoolAndIdentityPool( + signedInData: .testData, + identityID: identityId, + credentials: awsCredentials) + let initialAuthConfig = AuthConfiguration.userPoolsAndIdentityPools( + Defaults.makeDefaultUserPoolConfigData(), + Defaults.makeIdentityConfigData()) + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig) + do { + try credentialStore.saveCredential(initialCognitoCredentials) + } catch { + XCTFail("Unable to save credentials") + } + + // When moving to shared access group with same configuration but without migration + #if os(watchOS) + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch, migrateKeychainItemsOfUserSession: false) + #else + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup, migrateKeychainItemsOfUserSession: false) + #endif + + // Then + guard let credentials = try? newCredentialStore.retrieveCredential(), + case .userPoolAndIdentityPool(let retrievedTokens, + let retrievedIdentityID, + let retrievedCredentials) = credentials else { + // Expected + return + } + + // If credentials are present, they should not be the same as those that were not migrated + XCTAssertNotNil(credentials) + XCTAssertNotNil(retrievedTokens) + XCTAssertNotNil(retrievedIdentityID) + XCTAssertNotNil(retrievedCredentials) + XCTAssertNotEqual(retrievedCredentials, awsCredentials) + } + + /// Test moving from a shared access group to an unshared access group without migration should not keep credentials + /// + /// - Given: A user registered is configured + /// - When: + /// - The credential store is re-initialized with unshared access group and migration set to false + /// - Then: + /// - The old credentials should not persist + /// + func testCredentialsDoNotRemainOnNonMigrationFromSharedAccessGroup() { + // Given + let identityId = "identityId" + let awsCredentials = AuthAWSCognitoCredentials.nonimmediateExpiryTestData + let initialCognitoCredentials = AmplifyCredentials.userPoolAndIdentityPool( + signedInData: .testData, + identityID: identityId, + credentials: awsCredentials) + let initialAuthConfig = AuthConfiguration.userPoolsAndIdentityPools( + Defaults.makeDefaultUserPoolConfigData(), + Defaults.makeIdentityConfigData()) + #if os(watchOS) + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch) + #else + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup) + #endif + do { + try credentialStore.saveCredential(initialCognitoCredentials) + } catch { + XCTFail("Unable to save credentials") + } + + // When moving to unshared access group with same configuration but without migration + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, migrateKeychainItemsOfUserSession: false) + + // Then + guard let credentials = try? newCredentialStore.retrieveCredential(), + case .userPoolAndIdentityPool(let retrievedTokens, + let retrievedIdentityID, + let retrievedCredentials) = credentials else { + // Expected + return + } + + // If credentials are present, they should not be the same as those that were not migrated + XCTAssertNotNil(credentials) + XCTAssertNotNil(retrievedTokens) + XCTAssertNotNil(retrievedIdentityID) + XCTAssertNotNil(retrievedCredentials) + XCTAssertNotEqual(retrievedCredentials, awsCredentials) + } + + /// Test moving from a shared access group to another shared access group without migration should not keep credentials + /// + /// - Given: A user registered is configured + /// - When: + /// - The credential store is re-initialized with another shared access group and migration set to false + /// - Then: + /// - The old credentials should not persist + /// + func testCredentialsDoNotRemainOnNonMigrationFromSharedAccessGroupToAnotherSharedAccessGroup() { + // Given + let identityId = "identityId" + let awsCredentials = AuthAWSCognitoCredentials.nonimmediateExpiryTestData + let initialCognitoCredentials = AmplifyCredentials.userPoolAndIdentityPool( + signedInData: .testData, + identityID: identityId, + credentials: awsCredentials) + let initialAuthConfig = AuthConfiguration.userPoolsAndIdentityPools( + Defaults.makeDefaultUserPoolConfigData(), + Defaults.makeIdentityConfigData()) + #if os(watchOS) + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch) + #else + let credentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup) + #endif + do { + try credentialStore.saveCredential(initialCognitoCredentials) + } catch { + XCTFail("Unable to save credentials") + } + + // When moving to another shared access group with same configuration but without migration + #if os(watchOS) + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroupWatch2, migrateKeychainItemsOfUserSession: false) + #else + let newCredentialStore = AWSCognitoAuthCredentialStore(authConfiguration: initialAuthConfig, accessGroup: keychainAccessGroup2, migrateKeychainItemsOfUserSession: false) + #endif + + // Then + guard let credentials = try? newCredentialStore.retrieveCredential(), + case .userPoolAndIdentityPool(let retrievedTokens, + let retrievedIdentityID, + let retrievedCredentials) = credentials else { + // Expected + return + } + + // If credentials are present, they should not be the same as those that were not migrated + XCTAssertNotNil(credentials) + XCTAssertNotNil(retrievedTokens) + XCTAssertNotNil(retrievedIdentityID) + XCTAssertNotNil(retrievedCredentials) + XCTAssertNotEqual(retrievedCredentials, awsCredentials) + } } diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/Helpers/AuthEnvironmentHelper.swift b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/Helpers/AuthEnvironmentHelper.swift index cf495aa7fb..dbe55e8d23 100644 --- a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/Helpers/AuthEnvironmentHelper.swift +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/Helpers/AuthEnvironmentHelper.swift @@ -40,6 +40,14 @@ extension AuthAWSCognitoCredentials { sessionToken: "xx", expiration: Date()) } + + static var nonimmediateExpiryTestData: AuthAWSCognitoCredentials { + return AuthAWSCognitoCredentials( + accessKeyId: "xx", + secretAccessKey: "xx", + sessionToken: "xx", + expiration: Date() + TimeInterval(200)) + } } extension AWSCognitoUserPoolTokens { diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthWatchApp.entitlements b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthWatchApp.entitlements new file mode 100644 index 0000000000..5658c2919e --- /dev/null +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthWatchApp.entitlements @@ -0,0 +1,11 @@ + + + + + keychain-access-groups + + $(AppIdentifierPrefix)com.amazon.aws.amplify.swift.AuthWatchAppShared + $(AppIdentifierPrefix)com.amazon.aws.amplify.swift.AuthWatchAppShared2 + + + diff --git a/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStore.swift b/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStore.swift index b82d0c434b..4d1063c44c 100644 --- a/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStore.swift +++ b/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStore.swift @@ -52,6 +52,7 @@ public protocol KeychainStoreBehavior { /// Removes all key-value pair in the Keychain. /// This System Programming Interface (SPI) may have breaking changes in future updates. func _removeAll() throws + } public struct KeychainStore: KeychainStoreBehavior { @@ -74,10 +75,12 @@ public struct KeychainStore: KeychainStoreBehavior { } public init(service: String, accessGroup: String? = nil) { - var attributes = KeychainStoreAttributes(service: service) - attributes.accessGroup = accessGroup - self.init(attributes: attributes) - log.verbose("[KeychainStore] Initialized keychain with service=\(service), attributes=\(attributes), accessGroup=\(accessGroup ?? "")") + attributes = KeychainStoreAttributes(service: service, accessGroup: accessGroup) + log.verbose( + "[KeychainStore] Initialized keychain with service=\(service), " + + "attributes=\(attributes), " + + "accessGroup=\(attributes.accessGroup ?? "No access group specified")" + ) } @_spi(KeychainStore) @@ -258,6 +261,7 @@ extension KeychainStore { /** Return Type Key Constants */ static let ReturnData = String(kSecReturnData) static let ReturnAttributes = String(kSecReturnAttributes) + static let ReturnRef = String(kSecReturnRef) /** Value Type Key Constants */ static let ValueData = String(kSecValueData) diff --git a/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStoreAttributes.swift b/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStoreAttributes.swift index a638b2879b..bbbab1d275 100644 --- a/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStoreAttributes.swift +++ b/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStoreAttributes.swift @@ -24,7 +24,7 @@ extension KeychainStoreAttributes { KeychainStore.Constants.UseDataProtectionKeyChain: kCFBooleanTrue ] - if let accessGroup = accessGroup { + if let accessGroup { query[KeychainStore.Constants.AttributeAccessGroup] = accessGroup } return query diff --git a/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStoreMigrator.swift b/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStoreMigrator.swift new file mode 100644 index 0000000000..580366c519 --- /dev/null +++ b/AmplifyPlugins/Core/AWSPluginsCore/Keychain/KeychainStoreMigrator.swift @@ -0,0 +1,56 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import Foundation +import Amplify + +public struct KeychainStoreMigrator { + let oldAttributes: KeychainStoreAttributes + let newAttributes: KeychainStoreAttributes + + public init(oldService: String, newService: String, oldAccessGroup: String?, newAccessGroup: String?) { + self.oldAttributes = KeychainStoreAttributes(service: oldService, accessGroup: oldAccessGroup) + self.newAttributes = KeychainStoreAttributes(service: newService, accessGroup: newAccessGroup) + } + + public func migrate() throws { + log.verbose("[KeychainStoreMigrator] Starting to migrate items") + + // Check if there are any existing items under the new service and access group + let existingItemsQuery = newAttributes.defaultGetQuery() + let existingItemsStatus = SecItemCopyMatching(existingItemsQuery as CFDictionary, nil) + + if existingItemsStatus == errSecSuccess { + // Remove existing items to avoid duplicate item error + try? KeychainStore(service: newAttributes.service, accessGroup: newAttributes.accessGroup)._removeAll() + } + + var updateQuery = oldAttributes.defaultGetQuery() + + var updateAttributes = [String: Any]() + updateAttributes[KeychainStore.Constants.AttributeService] = newAttributes.service + updateAttributes[KeychainStore.Constants.AttributeAccessGroup] = newAttributes.accessGroup + + let updateStatus = SecItemUpdate(updateQuery as CFDictionary, updateAttributes as CFDictionary) + switch updateStatus { + case errSecSuccess: + break + case errSecItemNotFound: + log.verbose("[KeychainStoreMigrator] No items to migrate, keychain under new access group is cleared") + case errSecDuplicateItem: + log.verbose("[KeychainStoreMigrator] Duplicate items found, could not migrate") + return + default: + log.error("[KeychainStoreMigrator] Error of status=\(updateStatus) occurred when attempting to migrate items in keychain") + throw KeychainStoreError.securityError(updateStatus) + } + + log.verbose("[KeychainStoreMigrator] Successfully migrated items to new service and access group") + } +} + +extension KeychainStoreMigrator: DefaultLogger { } diff --git a/AmplifyPlugins/Core/AWSPluginsCoreTests/Keychain/KeychainStoreAttributesTests.swift b/AmplifyPlugins/Core/AWSPluginsCoreTests/Keychain/KeychainStoreAttributesTests.swift index 9c474d3a4f..501d8c8c37 100644 --- a/AmplifyPlugins/Core/AWSPluginsCoreTests/Keychain/KeychainStoreAttributesTests.swift +++ b/AmplifyPlugins/Core/AWSPluginsCoreTests/Keychain/KeychainStoreAttributesTests.swift @@ -45,10 +45,28 @@ class KeychainStoreAttributesTests: XCTestCase { XCTAssertNil(defaultGetAttributes[KeychainStore.Constants.AttributeAccessible] as? String) XCTAssertNil(defaultGetAttributes[KeychainStore.Constants.UseDataProtectionKeyChain] as? String) } + + /// Given: an instance of `KeychainStoreAttributes` + /// When: `keychainStoreAttribute.defaultSetQuery()` is invoked with a required service param + /// Then: Validate if the attributes contain the correct set query params + /// - AttributeService + /// - Class + /// - AttributeAccessible + /// - UseDataProtectionKeyChain + func testDefaultSetQuery() { + keychainStoreAttribute = KeychainStoreAttributes(service: "someService") + + let defaultSetAttributes = keychainStoreAttribute.defaultSetQuery() + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.AttributeService] as? String, "someService") + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.Class] as? String, KeychainStore.Constants.ClassGenericPassword) + XCTAssertNil(defaultSetAttributes[KeychainStore.Constants.AttributeAccessGroup] as? String) + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.AttributeAccessible] as? String, KeychainStore.Constants.AttributeAccessibleAfterFirstUnlockThisDeviceOnly) + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.UseDataProtectionKeyChain] as? Bool, true) + } /// Given: an instance of `KeychainStoreAttributes` /// When: `keychainStoreAttribute.defaultSetQuery()` is invoked with a required service param and access group - /// Then: Validate if the attributes contain the correct get query params + /// Then: Validate if the attributes contain the correct set query params /// - AttributeService /// - Class /// - AttributeAccessGroup @@ -57,12 +75,12 @@ class KeychainStoreAttributesTests: XCTestCase { func testDefaultSetQueryWithAccessGroup() { keychainStoreAttribute = KeychainStoreAttributes(service: "someService", accessGroup: "someAccessGroup") - let defaultGetAttributes = keychainStoreAttribute.defaultSetQuery() - XCTAssertEqual(defaultGetAttributes[KeychainStore.Constants.AttributeService] as? String, "someService") - XCTAssertEqual(defaultGetAttributes[KeychainStore.Constants.Class] as? String, KeychainStore.Constants.ClassGenericPassword) - XCTAssertEqual(defaultGetAttributes[KeychainStore.Constants.AttributeAccessGroup] as? String, "someAccessGroup") - XCTAssertEqual(defaultGetAttributes[KeychainStore.Constants.AttributeAccessible] as? String, KeychainStore.Constants.AttributeAccessibleAfterFirstUnlockThisDeviceOnly) - XCTAssertEqual(defaultGetAttributes[KeychainStore.Constants.UseDataProtectionKeyChain] as? Bool, true) + let defaultSetAttributes = keychainStoreAttribute.defaultSetQuery() + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.AttributeService] as? String, "someService") + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.Class] as? String, KeychainStore.Constants.ClassGenericPassword) + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.AttributeAccessGroup] as? String, "someAccessGroup") + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.AttributeAccessible] as? String, KeychainStore.Constants.AttributeAccessibleAfterFirstUnlockThisDeviceOnly) + XCTAssertEqual(defaultSetAttributes[KeychainStore.Constants.UseDataProtectionKeyChain] as? Bool, true) } override func tearDown() { diff --git a/api-dump/AWSDataStorePlugin.json b/api-dump/AWSDataStorePlugin.json index 6666c984bf..ff0535af91 100644 --- a/api-dump/AWSDataStorePlugin.json +++ b/api-dump/AWSDataStorePlugin.json @@ -8205,7 +8205,7 @@ "-module", "AWSDataStorePlugin", "-o", - "\/var\/folders\/k7\/4hy4p20s2rv4clw77d3qcl380000gr\/T\/tmp.nF2YaRsn2M\/AWSDataStorePlugin.json", + "\/var\/folders\/hw\/1f0gcr8d6kn9ms0_wn0_57qc0000gn\/T\/tmp.7FvtSuhXB9\/AWSDataStorePlugin.json", "-I", ".build\/debug", "-sdk-version", diff --git a/api-dump/AWSPluginsCore.json b/api-dump/AWSPluginsCore.json index b9e3b9e454..4aade42a2d 100644 --- a/api-dump/AWSPluginsCore.json +++ b/api-dump/AWSPluginsCore.json @@ -136,196 +136,6 @@ "mangledName": "$s14AWSPluginsCore21AWSAPIAuthInformationP", "moduleName": "AWSPluginsCore" }, - { - "kind": "TypeDecl", - "name": "AWSAppSyncConfiguration", - "printedName": "AWSAppSyncConfiguration", - "children": [ - { - "kind": "Var", - "name": "region", - "printedName": "region", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV6regionSSvp", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV6regionSSvp", - "moduleName": "AWSPluginsCore", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV6regionSSvg", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV6regionSSvg", - "moduleName": "AWSPluginsCore", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "endpoint", - "printedName": "endpoint", - "children": [ - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - } - ], - "declKind": "Var", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV8endpoint10Foundation3URLVvp", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV8endpoint10Foundation3URLVvp", - "moduleName": "AWSPluginsCore", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - } - ], - "declKind": "Accessor", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV8endpoint10Foundation3URLVvg", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV8endpoint10Foundation3URLVvg", - "moduleName": "AWSPluginsCore", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "apiKey", - "printedName": "apiKey", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV6apiKeySSSgvp", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV6apiKeySSSgvp", - "moduleName": "AWSPluginsCore", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV6apiKeySSSgvg", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV6apiKeySSSgvg", - "moduleName": "AWSPluginsCore", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(with:)", - "children": [ - { - "kind": "TypeNominal", - "name": "AWSAppSyncConfiguration", - "printedName": "AWSPluginsCore.AWSAppSyncConfiguration", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV" - }, - { - "kind": "TypeNominal", - "name": "AmplifyOutputs", - "printedName": "Amplify.AmplifyOutputs", - "usr": "s:7Amplify0A7OutputsV" - } - ], - "declKind": "Constructor", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV4withAC7Amplify0G7OutputsV_tKcfc", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV4withAC7Amplify0G7OutputsV_tKcfc", - "moduleName": "AWSPluginsCore", - "throwing": true, - "init_kind": "Designated" - } - ], - "declKind": "Struct", - "usr": "s:14AWSPluginsCore23AWSAppSyncConfigurationV", - "mangledName": "$s14AWSPluginsCore23AWSAppSyncConfigurationV", - "moduleName": "AWSPluginsCore" - }, { "kind": "TypeDecl", "name": "AppSyncErrorType", @@ -3834,13 +3644,13 @@ }, { "kind": "TypeDecl", - "name": "AWSCredentials", - "printedName": "AWSCredentials", + "name": "AWSTemporaryCredentials", + "printedName": "AWSTemporaryCredentials", "children": [ { "kind": "Var", - "name": "accessKeyId", - "printedName": "accessKeyId", + "name": "sessionToken", + "printedName": "sessionToken", "children": [ { "kind": "TypeNominal", @@ -3850,8 +3660,8 @@ } ], "declKind": "Var", - "usr": "s:14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvp", - "mangledName": "$s14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvp", + "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvp", + "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvp", "moduleName": "AWSPluginsCore", "protocolReq": true, "accessors": [ @@ -3868,10 +3678,10 @@ } ], "declKind": "Accessor", - "usr": "s:14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvg", - "mangledName": "$s14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvg", + "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvg", + "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvg", "moduleName": "AWSPluginsCore", - "genericSig": "", + "genericSig": "", "protocolReq": true, "reqNewWitnessTableEntry": true, "accessorKind": "get" @@ -3880,19 +3690,19 @@ }, { "kind": "Var", - "name": "secretAccessKey", - "printedName": "secretAccessKey", + "name": "expiration", + "printedName": "expiration", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Date", + "printedName": "Foundation.Date", + "usr": "s:10Foundation4DateV" } ], "declKind": "Var", - "usr": "s:14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvp", - "mangledName": "$s14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvp", + "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvp", + "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvp", "moduleName": "AWSPluginsCore", "protocolReq": true, "accessors": [ @@ -3903,16 +3713,16 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Date", + "printedName": "Foundation.Date", + "usr": "s:10Foundation4DateV" } ], "declKind": "Accessor", - "usr": "s:14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvg", - "mangledName": "$s14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvg", + "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvg", + "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvg", "moduleName": "AWSPluginsCore", - "genericSig": "", + "genericSig": "", "protocolReq": true, "reqNewWitnessTableEntry": true, "accessorKind": "get" @@ -3921,19 +3731,29 @@ } ], "declKind": "Protocol", - "usr": "s:14AWSPluginsCore14AWSCredentialsP", - "mangledName": "$s14AWSPluginsCore14AWSCredentialsP", - "moduleName": "AWSPluginsCore" + "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP", + "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP", + "moduleName": "AWSPluginsCore", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "AWSCredentials", + "printedName": "AWSCredentials", + "usr": "s:14AWSPluginsCore14AWSCredentialsP", + "mangledName": "$s14AWSPluginsCore14AWSCredentialsP" + } + ] }, { "kind": "TypeDecl", - "name": "AWSTemporaryCredentials", - "printedName": "AWSTemporaryCredentials", + "name": "AWSCredentials", + "printedName": "AWSCredentials", "children": [ { "kind": "Var", - "name": "sessionToken", - "printedName": "sessionToken", + "name": "accessKeyId", + "printedName": "accessKeyId", "children": [ { "kind": "TypeNominal", @@ -3943,8 +3763,8 @@ } ], "declKind": "Var", - "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvp", - "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvp", + "usr": "s:14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvp", + "mangledName": "$s14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvp", "moduleName": "AWSPluginsCore", "protocolReq": true, "accessors": [ @@ -3961,10 +3781,10 @@ } ], "declKind": "Accessor", - "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvg", - "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP12sessionTokenSSvg", + "usr": "s:14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvg", + "mangledName": "$s14AWSPluginsCore14AWSCredentialsP11accessKeyIdSSvg", "moduleName": "AWSPluginsCore", - "genericSig": "", + "genericSig": "", "protocolReq": true, "reqNewWitnessTableEntry": true, "accessorKind": "get" @@ -3973,19 +3793,19 @@ }, { "kind": "Var", - "name": "expiration", - "printedName": "expiration", + "name": "secretAccessKey", + "printedName": "secretAccessKey", "children": [ { "kind": "TypeNominal", - "name": "Date", - "printedName": "Foundation.Date", - "usr": "s:10Foundation4DateV" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "declKind": "Var", - "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvp", - "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvp", + "usr": "s:14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvp", + "mangledName": "$s14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvp", "moduleName": "AWSPluginsCore", "protocolReq": true, "accessors": [ @@ -3996,16 +3816,16 @@ "children": [ { "kind": "TypeNominal", - "name": "Date", - "printedName": "Foundation.Date", - "usr": "s:10Foundation4DateV" - } + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } ], "declKind": "Accessor", - "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvg", - "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP10expiration10Foundation4DateVvg", + "usr": "s:14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvg", + "mangledName": "$s14AWSPluginsCore14AWSCredentialsP15secretAccessKeySSvg", "moduleName": "AWSPluginsCore", - "genericSig": "", + "genericSig": "", "protocolReq": true, "reqNewWitnessTableEntry": true, "accessorKind": "get" @@ -4014,19 +3834,9 @@ } ], "declKind": "Protocol", - "usr": "s:14AWSPluginsCore23AWSTemporaryCredentialsP", - "mangledName": "$s14AWSPluginsCore23AWSTemporaryCredentialsP", - "moduleName": "AWSPluginsCore", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "AWSCredentials", - "printedName": "AWSCredentials", - "usr": "s:14AWSPluginsCore14AWSCredentialsP", - "mangledName": "$s14AWSPluginsCore14AWSCredentialsP" - } - ] + "usr": "s:14AWSPluginsCore14AWSCredentialsP", + "mangledName": "$s14AWSPluginsCore14AWSCredentialsP", + "moduleName": "AWSPluginsCore" }, { "kind": "TypeDecl", @@ -5377,6 +5187,55 @@ "throwing": true, "reqNewWitnessTableEntry": true, "funcSelfKind": "NonMutating" + }, + { + "kind": "Function", + "name": "_getAll", + "printedName": "_getAll()", + "children": [ + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[(key: Swift.String, value: Foundation.Data)]", + "children": [ + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(key: Swift.String, value: Foundation.Data)", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "Data", + "printedName": "Foundation.Data", + "usr": "s:10Foundation4DataV" + } + ] + } + ], + "usr": "s:Sa" + } + ], + "declKind": "Func", + "usr": "s:14AWSPluginsCore21KeychainStoreBehaviorP7_getAllSaySS3key_10Foundation4DataV5valuetGyKF", + "mangledName": "$s14AWSPluginsCore21KeychainStoreBehaviorP7_getAllSaySS3key_10Foundation4DataV5valuetGyKF", + "moduleName": "AWSPluginsCore", + "genericSig": "", + "protocolReq": true, + "declAttributes": [ + "SPIAccessControl" + ], + "spi_group_names": [ + "KeychainStore" + ], + "throwing": true, + "reqNewWitnessTableEntry": true, + "funcSelfKind": "NonMutating" } ], "declKind": "Protocol", @@ -5658,6 +5517,52 @@ "throwing": true, "funcSelfKind": "NonMutating" }, + { + "kind": "Function", + "name": "_getAll", + "printedName": "_getAll()", + "children": [ + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[(key: Swift.String, value: Foundation.Data)]", + "children": [ + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(key: Swift.String, value: Foundation.Data)", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "Data", + "printedName": "Foundation.Data", + "usr": "s:10Foundation4DataV" + } + ] + } + ], + "usr": "s:Sa" + } + ], + "declKind": "Func", + "usr": "s:14AWSPluginsCore13KeychainStoreV7_getAllSaySS3key_10Foundation4DataV5valuetGyKF", + "mangledName": "$s14AWSPluginsCore13KeychainStoreV7_getAllSaySS3key_10Foundation4DataV5valuetGyKF", + "moduleName": "AWSPluginsCore", + "declAttributes": [ + "SPIAccessControl" + ], + "spi_group_names": [ + "KeychainStore" + ], + "throwing": true, + "funcSelfKind": "NonMutating" + }, { "kind": "Var", "name": "log", @@ -6493,6 +6398,185 @@ } ] }, + { + "kind": "TypeDecl", + "name": "KeychainStoreMigrator", + "printedName": "KeychainStoreMigrator", + "children": [ + { + "kind": "Constructor", + "name": "init", + "printedName": "init(oldService:newService:oldAccessGroup:newAccessGroup:)", + "children": [ + { + "kind": "TypeNominal", + "name": "KeychainStoreMigrator", + "printedName": "AWSPluginsCore.KeychainStoreMigrator", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV" + }, + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + } + ], + "declKind": "Constructor", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV10oldService03newG00F11AccessGroup0hiJ0ACSS_S2SSgAHtcfc", + "mangledName": "$s14AWSPluginsCore21KeychainStoreMigratorV10oldService03newG00F11AccessGroup0hiJ0ACSS_S2SSgAHtcfc", + "moduleName": "AWSPluginsCore", + "init_kind": "Designated" + }, + { + "kind": "Function", + "name": "migrate", + "printedName": "migrate()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ], + "declKind": "Func", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV7migrateyyKF", + "mangledName": "$s14AWSPluginsCore21KeychainStoreMigratorV7migrateyyKF", + "moduleName": "AWSPluginsCore", + "throwing": true, + "funcSelfKind": "NonMutating" + }, + { + "kind": "Var", + "name": "log", + "printedName": "log", + "children": [ + { + "kind": "TypeNominal", + "name": "Logger", + "printedName": "any Amplify.Logger", + "usr": "s:7Amplify6LoggerP" + } + ], + "declKind": "Var", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvpZ", + "mangledName": "$s14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvpZ", + "moduleName": "AWSPluginsCore", + "static": true, + "isFromExtension": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Logger", + "printedName": "any Amplify.Logger", + "usr": "s:7Amplify6LoggerP" + } + ], + "declKind": "Accessor", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvgZ", + "mangledName": "$s14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvgZ", + "moduleName": "AWSPluginsCore", + "static": true, + "isFromExtension": true, + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "log", + "printedName": "log", + "children": [ + { + "kind": "TypeNominal", + "name": "Logger", + "printedName": "any Amplify.Logger", + "usr": "s:7Amplify6LoggerP" + } + ], + "declKind": "Var", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvp", + "mangledName": "$s14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvp", + "moduleName": "AWSPluginsCore", + "declAttributes": [ + "Nonisolated" + ], + "isFromExtension": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Logger", + "printedName": "any Amplify.Logger", + "usr": "s:7Amplify6LoggerP" + } + ], + "declKind": "Accessor", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvg", + "mangledName": "$s14AWSPluginsCore21KeychainStoreMigratorV3log7Amplify6Logger_pvg", + "moduleName": "AWSPluginsCore", + "isFromExtension": true, + "accessorKind": "get" + } + ] + } + ], + "declKind": "Struct", + "usr": "s:14AWSPluginsCore21KeychainStoreMigratorV", + "mangledName": "$s14AWSPluginsCore21KeychainStoreMigratorV", + "moduleName": "AWSPluginsCore", + "conformances": [ + { + "kind": "Conformance", + "name": "DefaultLogger", + "printedName": "DefaultLogger", + "usr": "s:7Amplify13DefaultLoggerP", + "mangledName": "$s7Amplify13DefaultLoggerP" + } + ] + }, { "kind": "TypeDecl", "name": "AnyModel", @@ -24463,7 +24547,7 @@ "-module", "AWSPluginsCore", "-o", - "\/var\/folders\/k7\/4hy4p20s2rv4clw77d3qcl380000gr\/T\/tmp.nF2YaRsn2M\/AWSPluginsCore.json", + "\/var\/folders\/hw\/1f0gcr8d6kn9ms0_wn0_57qc0000gn\/T\/tmp.7FvtSuhXB9\/AWSPluginsCore.json", "-I", ".build\/debug", "-sdk-version", diff --git a/api-dump/Amplify.json b/api-dump/Amplify.json index 9fad52bcce..c2ea2e6a85 100644 --- a/api-dump/Amplify.json +++ b/api-dump/Amplify.json @@ -18636,6 +18636,220 @@ } ] }, + { + "kind": "TypeDecl", + "name": "AccessGroup", + "printedName": "AccessGroup", + "children": [ + { + "kind": "Var", + "name": "name", + "printedName": "name", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + } + ], + "declKind": "Var", + "usr": "s:7Amplify11AccessGroupV4nameSSSgvp", + "mangledName": "$s7Amplify11AccessGroupV4nameSSSgvp", + "moduleName": "Amplify", + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + } + ], + "declKind": "Accessor", + "usr": "s:7Amplify11AccessGroupV4nameSSSgvg", + "mangledName": "$s7Amplify11AccessGroupV4nameSSSgvg", + "moduleName": "Amplify", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "migrateKeychainItems", + "printedName": "migrateKeychainItems", + "children": [ + { + "kind": "TypeNominal", + "name": "Bool", + "printedName": "Swift.Bool", + "usr": "s:Sb" + } + ], + "declKind": "Var", + "usr": "s:7Amplify11AccessGroupV20migrateKeychainItemsSbvp", + "mangledName": "$s7Amplify11AccessGroupV20migrateKeychainItemsSbvp", + "moduleName": "Amplify", + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Bool", + "printedName": "Swift.Bool", + "usr": "s:Sb" + } + ], + "declKind": "Accessor", + "usr": "s:7Amplify11AccessGroupV20migrateKeychainItemsSbvg", + "mangledName": "$s7Amplify11AccessGroupV20migrateKeychainItemsSbvg", + "moduleName": "Amplify", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Constructor", + "name": "init", + "printedName": "init(name:migrateKeychainItemsOfUserSession:)", + "children": [ + { + "kind": "TypeNominal", + "name": "AccessGroup", + "printedName": "Amplify.AccessGroup", + "usr": "s:7Amplify11AccessGroupV" + }, + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "Bool", + "printedName": "Swift.Bool", + "hasDefaultArg": true, + "usr": "s:Sb" + } + ], + "declKind": "Constructor", + "usr": "s:7Amplify11AccessGroupV4name33migrateKeychainItemsOfUserSessionACSS_Sbtcfc", + "mangledName": "$s7Amplify11AccessGroupV4name33migrateKeychainItemsOfUserSessionACSS_Sbtcfc", + "moduleName": "Amplify", + "init_kind": "Designated" + }, + { + "kind": "Function", + "name": "none", + "printedName": "none(migrateKeychainItemsOfUserSession:)", + "children": [ + { + "kind": "TypeNominal", + "name": "AccessGroup", + "printedName": "Amplify.AccessGroup", + "usr": "s:7Amplify11AccessGroupV" + }, + { + "kind": "TypeNominal", + "name": "Bool", + "printedName": "Swift.Bool", + "usr": "s:Sb" + } + ], + "declKind": "Func", + "usr": "s:7Amplify11AccessGroupV4none33migrateKeychainItemsOfUserSessionACSb_tFZ", + "mangledName": "$s7Amplify11AccessGroupV4none33migrateKeychainItemsOfUserSessionACSb_tFZ", + "moduleName": "Amplify", + "static": true, + "funcSelfKind": "NonMutating" + }, + { + "kind": "Var", + "name": "none", + "printedName": "none", + "children": [ + { + "kind": "TypeNominal", + "name": "AccessGroup", + "printedName": "Amplify.AccessGroup", + "usr": "s:7Amplify11AccessGroupV" + } + ], + "declKind": "Var", + "usr": "s:7Amplify11AccessGroupV4noneACvpZ", + "mangledName": "$s7Amplify11AccessGroupV4noneACvpZ", + "moduleName": "Amplify", + "static": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "AccessGroup", + "printedName": "Amplify.AccessGroup", + "usr": "s:7Amplify11AccessGroupV" + } + ], + "declKind": "Accessor", + "usr": "s:7Amplify11AccessGroupV4noneACvgZ", + "mangledName": "$s7Amplify11AccessGroupV4noneACvgZ", + "moduleName": "Amplify", + "static": true, + "accessorKind": "get" + } + ] + } + ], + "declKind": "Struct", + "usr": "s:7Amplify11AccessGroupV", + "mangledName": "$s7Amplify11AccessGroupV", + "moduleName": "Amplify" + }, { "kind": "TypeAlias", "name": "AdditionalInfo", @@ -138551,84 +138765,6 @@ } ] }, - { - "kind": "Var", - "name": "bucket", - "printedName": "bucket", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify26StorageDownloadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "mangledName": "$s7Amplify26StorageDownloadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify26StorageDownloadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "mangledName": "$s7Amplify26StorageDownloadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "pluginOptions", @@ -138778,43 +138914,6 @@ "mangledName": "$s7Amplify26StorageDownloadDataRequestV7OptionsV06pluginF0AEypSg_tcfc", "moduleName": "Amplify", "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(bucket:pluginOptions:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Options", - "printedName": "Amplify.StorageDownloadDataRequest.Options", - "usr": "s:7Amplify26StorageDownloadDataRequestV7OptionsV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "some Amplify.StorageBucket" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify26StorageDownloadDataRequestV7OptionsV6bucket06pluginF0AEx_ypSgtcAA0B6BucketRzlufc", - "mangledName": "$s7Amplify26StorageDownloadDataRequestV7OptionsV6bucket06pluginF0AEx_ypSgtcAA0B6BucketRzlufc", - "moduleName": "Amplify", - "init_kind": "Designated" } ], "declKind": "Struct", @@ -139269,84 +139368,6 @@ } ] }, - { - "kind": "Var", - "name": "bucket", - "printedName": "bucket", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify26StorageDownloadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "mangledName": "$s7Amplify26StorageDownloadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify26StorageDownloadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "mangledName": "$s7Amplify26StorageDownloadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "pluginOptions", @@ -139495,43 +139516,10 @@ "usr": "s:7Amplify26StorageDownloadFileRequestV7OptionsV06pluginF0AEypSg_tcfc", "mangledName": "$s7Amplify26StorageDownloadFileRequestV7OptionsV06pluginF0AEypSg_tcfc", "moduleName": "Amplify", - "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(bucket:pluginOptions:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Options", - "printedName": "Amplify.StorageDownloadFileRequest.Options", - "usr": "s:7Amplify26StorageDownloadFileRequestV7OptionsV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "some Amplify.StorageBucket" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - } + "deprecated": true, + "declAttributes": [ + "Available" ], - "declKind": "Constructor", - "usr": "s:7Amplify26StorageDownloadFileRequestV7OptionsV6bucket06pluginF0AEx_ypSgtcAA0B6BucketRzlufc", - "mangledName": "$s7Amplify26StorageDownloadFileRequestV7OptionsV6bucket06pluginF0AEx_ypSgtcAA0B6BucketRzlufc", - "moduleName": "Amplify", "init_kind": "Designated" } ], @@ -140024,84 +140012,6 @@ } ] }, - { - "kind": "Var", - "name": "bucket", - "printedName": "bucket", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify20StorageGetURLRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "mangledName": "$s7Amplify20StorageGetURLRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify20StorageGetURLRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "mangledName": "$s7Amplify20StorageGetURLRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "pluginOptions", @@ -140265,50 +140175,6 @@ "mangledName": "$s7Amplify20StorageGetURLRequestV7OptionsV7expires06pluginE0AESi_ypSgtcfc", "moduleName": "Amplify", "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(expires:bucket:pluginOptions:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Options", - "printedName": "Amplify.StorageGetURLRequest.Options", - "usr": "s:7Amplify20StorageGetURLRequestV7OptionsV" - }, - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "hasDefaultArg": true, - "usr": "s:Si" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "some Amplify.StorageBucket" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify20StorageGetURLRequestV7OptionsV7expires6bucket06pluginE0AESi_xypSgtcAA0B6BucketRzlufc", - "mangledName": "$s7Amplify20StorageGetURLRequestV7OptionsV7expires6bucket06pluginE0AESi_xypSgtcAA0B6BucketRzlufc", - "moduleName": "Amplify", - "init_kind": "Designated" } ], "declKind": "Struct", @@ -140807,84 +140673,6 @@ } ] }, - { - "kind": "Var", - "name": "bucket", - "printedName": "bucket", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify18StorageListRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "mangledName": "$s7Amplify18StorageListRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify18StorageListRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "mangledName": "$s7Amplify18StorageListRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "nextToken", @@ -141105,72 +140893,6 @@ "moduleName": "Amplify", "init_kind": "Designated" }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(subpathStrategy:pageSize:bucket:nextToken:pluginOptions:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Options", - "printedName": "Amplify.StorageListRequest.Options", - "usr": "s:7Amplify18StorageListRequestV7OptionsV" - }, - { - "kind": "TypeNominal", - "name": "SubpathStrategy", - "printedName": "Amplify.StorageListRequest.Options.SubpathStrategy", - "hasDefaultArg": true, - "usr": "s:7Amplify18StorageListRequestV7OptionsV15SubpathStrategyO" - }, - { - "kind": "TypeNominal", - "name": "UInt", - "printedName": "Swift.UInt", - "hasDefaultArg": true, - "usr": "s:Su" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "some Amplify.StorageBucket" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify18StorageListRequestV7OptionsV15subpathStrategy8pageSize6bucket9nextToken06pluginE0A2E07SubpathG0O_SuxSSSgypSgtcAA0B6BucketRzlufc", - "mangledName": "$s7Amplify18StorageListRequestV7OptionsV15subpathStrategy8pageSize6bucket9nextToken06pluginE0A2E07SubpathG0O_SuxSSSgypSgtcAA0B6BucketRzlufc", - "moduleName": "Amplify", - "init_kind": "Designated" - }, { "kind": "TypeDecl", "name": "SubpathStrategy", @@ -141662,84 +141384,6 @@ } ] }, - { - "kind": "Var", - "name": "bucket", - "printedName": "bucket", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify20StorageRemoveRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "mangledName": "$s7Amplify20StorageRemoveRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify20StorageRemoveRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "mangledName": "$s7Amplify20StorageRemoveRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "pluginOptions", @@ -141838,43 +141482,6 @@ "mangledName": "$s7Amplify20StorageRemoveRequestV7OptionsV11accessLevel06pluginE0AeA0b6AccessG0O_ypSgtcfc", "moduleName": "Amplify", "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(bucket:pluginOptions:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Options", - "printedName": "Amplify.StorageRemoveRequest.Options", - "usr": "s:7Amplify20StorageRemoveRequestV7OptionsV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "some Amplify.StorageBucket" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify20StorageRemoveRequestV7OptionsV6bucket06pluginE0AEx_ypSgtcAA0B6BucketRzlufc", - "mangledName": "$s7Amplify20StorageRemoveRequestV7OptionsV6bucket06pluginE0AEx_ypSgtcAA0B6BucketRzlufc", - "moduleName": "Amplify", - "init_kind": "Designated" } ], "declKind": "Struct", @@ -142419,84 +142026,6 @@ } ] }, - { - "kind": "Var", - "name": "bucket", - "printedName": "bucket", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify24StorageUploadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "mangledName": "$s7Amplify24StorageUploadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify24StorageUploadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "mangledName": "$s7Amplify24StorageUploadDataRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "contentType", @@ -142796,87 +142325,6 @@ "mangledName": "$s7Amplify24StorageUploadDataRequestV7OptionsV8metadata11contentType06pluginF0AESDyS2SGSg_SSSgypSgtcfc", "moduleName": "Amplify", "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(metadata:bucket:contentType:pluginOptions:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Options", - "printedName": "Amplify.StorageUploadDataRequest.Options", - "usr": "s:7Amplify24StorageUploadDataRequestV7OptionsV" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "[Swift.String : Swift.String]?", - "children": [ - { - "kind": "TypeNominal", - "name": "Dictionary", - "printedName": "[Swift.String : Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:SD" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "some Amplify.StorageBucket" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify24StorageUploadDataRequestV7OptionsV8metadata6bucket11contentType06pluginF0AESDyS2SGSg_xSSSgypSgtcAA0B6BucketRzlufc", - "mangledName": "$s7Amplify24StorageUploadDataRequestV7OptionsV8metadata6bucket11contentType06pluginF0AESDyS2SGSg_xSSSgypSgtcAA0B6BucketRzlufc", - "moduleName": "Amplify", - "init_kind": "Designated" } ], "declKind": "Struct", @@ -143421,84 +142869,6 @@ } ] }, - { - "kind": "Var", - "name": "bucket", - "printedName": "bucket", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify24StorageUploadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "mangledName": "$s7Amplify24StorageUploadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "(any Amplify.StorageBucket)?", - "children": [ - { - "kind": "TypeNominal", - "name": "Paren", - "printedName": "(any Amplify.StorageBucket)", - "children": [ - { - "kind": "TypeNominal", - "name": "StorageBucket", - "printedName": "any Amplify.StorageBucket", - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:7Amplify13StorageBucketP" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify24StorageUploadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "mangledName": "$s7Amplify24StorageUploadFileRequestV7OptionsV6bucketAA0B6Bucket_pSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "contentType", @@ -143798,87 +143168,6 @@ "mangledName": "$s7Amplify24StorageUploadFileRequestV7OptionsV8metadata11contentType06pluginF0AESDyS2SGSg_SSSgypSgtcfc", "moduleName": "Amplify", "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(metadata:bucket:contentType:pluginOptions:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Options", - "printedName": "Amplify.StorageUploadFileRequest.Options", - "usr": "s:7Amplify24StorageUploadFileRequestV7OptionsV" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "[Swift.String : Swift.String]?", - "children": [ - { - "kind": "TypeNominal", - "name": "Dictionary", - "printedName": "[Swift.String : Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:SD" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "some Amplify.StorageBucket" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify24StorageUploadFileRequestV7OptionsV8metadata6bucket11contentType06pluginF0AESDyS2SGSg_xSSSgypSgtcAA0B6BucketRzlufc", - "mangledName": "$s7Amplify24StorageUploadFileRequestV7OptionsV8metadata6bucket11contentType06pluginF0AESDyS2SGSg_xSSSgypSgtcAA0B6BucketRzlufc", - "moduleName": "Amplify", - "init_kind": "Designated" } ], "declKind": "Struct", @@ -145341,446 +144630,6 @@ } ] }, - { - "kind": "TypeDecl", - "name": "StorageBucket", - "printedName": "StorageBucket", - "children": [ - { - "kind": "Function", - "name": "fromOutputs", - "printedName": "fromOutputs(name:)", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Func", - "usr": "s:7Amplify13StorageBucketPA2A07OutputsbC0VRszrlE04fromD04nameAESS_tFZ", - "mangledName": "$s7Amplify13StorageBucketPA2A07OutputsbC0VRszrlE04fromD04nameAESS_tFZ", - "moduleName": "Amplify", - "genericSig": "", - "static": true, - "isFromExtension": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "fromBucketInfo", - "printedName": "fromBucketInfo(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" - }, - { - "kind": "TypeNominal", - "name": "BucketInfo", - "printedName": "Amplify.BucketInfo", - "usr": "s:7Amplify10BucketInfoV" - } - ], - "declKind": "Func", - "usr": "s:7Amplify13StorageBucketPA2A08ResolvedbC0VRszrlE04fromC4InfoyAeA0cF0VFZ", - "mangledName": "$s7Amplify13StorageBucketPA2A08ResolvedbC0VRszrlE04fromC4InfoyAeA0cF0VFZ", - "moduleName": "Amplify", - "genericSig": "", - "static": true, - "isFromExtension": true, - "funcSelfKind": "NonMutating" - } - ], - "declKind": "Protocol", - "usr": "s:7Amplify13StorageBucketP", - "mangledName": "$s7Amplify13StorageBucketP", - "moduleName": "Amplify" - }, - { - "kind": "TypeDecl", - "name": "BucketInfo", - "printedName": "BucketInfo", - "children": [ - { - "kind": "Var", - "name": "bucketName", - "printedName": "bucketName", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:7Amplify10BucketInfoV10bucketNameSSvp", - "mangledName": "$s7Amplify10BucketInfoV10bucketNameSSvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify10BucketInfoV10bucketNameSSvg", - "mangledName": "$s7Amplify10BucketInfoV10bucketNameSSvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "region", - "printedName": "region", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:7Amplify10BucketInfoV6regionSSvp", - "mangledName": "$s7Amplify10BucketInfoV6regionSSvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify10BucketInfoV6regionSSvg", - "mangledName": "$s7Amplify10BucketInfoV6regionSSvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(bucketName:region:)", - "children": [ - { - "kind": "TypeNominal", - "name": "BucketInfo", - "printedName": "Amplify.BucketInfo", - "usr": "s:7Amplify10BucketInfoV" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify10BucketInfoV10bucketName6regionACSS_SStcfc", - "mangledName": "$s7Amplify10BucketInfoV10bucketName6regionACSS_SStcfc", - "moduleName": "Amplify", - "init_kind": "Designated" - }, - { - "kind": "Function", - "name": "hash", - "printedName": "hash(into:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Hasher", - "printedName": "Swift.Hasher", - "paramValueOwnership": "InOut", - "usr": "s:s6HasherV" - } - ], - "declKind": "Func", - "usr": "s:7Amplify10BucketInfoV4hash4intoys6HasherVz_tF", - "mangledName": "$s7Amplify10BucketInfoV4hash4intoys6HasherVz_tF", - "moduleName": "Amplify", - "implicit": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "__derived_struct_equals", - "printedName": "__derived_struct_equals(_:_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "BucketInfo", - "printedName": "Amplify.BucketInfo", - "usr": "s:7Amplify10BucketInfoV" - }, - { - "kind": "TypeNominal", - "name": "BucketInfo", - "printedName": "Amplify.BucketInfo", - "usr": "s:7Amplify10BucketInfoV" - } - ], - "declKind": "Func", - "usr": "s:7Amplify10BucketInfoV23__derived_struct_equalsySbAC_ACtFZ", - "mangledName": "$s7Amplify10BucketInfoV23__derived_struct_equalsySbAC_ACtFZ", - "moduleName": "Amplify", - "static": true, - "implicit": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Var", - "name": "hashValue", - "printedName": "hashValue", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Var", - "usr": "s:7Amplify10BucketInfoV9hashValueSivp", - "mangledName": "$s7Amplify10BucketInfoV9hashValueSivp", - "moduleName": "Amplify", - "implicit": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify10BucketInfoV9hashValueSivg", - "mangledName": "$s7Amplify10BucketInfoV9hashValueSivg", - "moduleName": "Amplify", - "implicit": true, - "accessorKind": "get" - } - ] - } - ], - "declKind": "Struct", - "usr": "s:7Amplify10BucketInfoV", - "mangledName": "$s7Amplify10BucketInfoV", - "moduleName": "Amplify", - "conformances": [ - { - "kind": "Conformance", - "name": "Hashable", - "printedName": "Hashable", - "usr": "s:SH", - "mangledName": "$sSH" - }, - { - "kind": "Conformance", - "name": "Equatable", - "printedName": "Equatable", - "usr": "s:SQ", - "mangledName": "$sSQ" - } - ] - }, - { - "kind": "TypeDecl", - "name": "OutputsStorageBucket", - "printedName": "OutputsStorageBucket", - "children": [ - { - "kind": "Var", - "name": "name", - "printedName": "name", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:7Amplify20OutputsStorageBucketV4nameSSvp", - "mangledName": "$s7Amplify20OutputsStorageBucketV4nameSSvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify20OutputsStorageBucketV4nameSSvg", - "mangledName": "$s7Amplify20OutputsStorageBucketV4nameSSvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - } - ], - "declKind": "Struct", - "usr": "s:7Amplify20OutputsStorageBucketV", - "mangledName": "$s7Amplify20OutputsStorageBucketV", - "moduleName": "Amplify", - "conformances": [ - { - "kind": "Conformance", - "name": "StorageBucket", - "printedName": "StorageBucket", - "usr": "s:7Amplify13StorageBucketP", - "mangledName": "$s7Amplify13StorageBucketP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "ResolvedStorageBucket", - "printedName": "ResolvedStorageBucket", - "children": [ - { - "kind": "Var", - "name": "bucketInfo", - "printedName": "bucketInfo", - "children": [ - { - "kind": "TypeNominal", - "name": "BucketInfo", - "printedName": "Amplify.BucketInfo", - "usr": "s:7Amplify10BucketInfoV" - } - ], - "declKind": "Var", - "usr": "s:7Amplify21ResolvedStorageBucketV10bucketInfoAA0dF0Vvp", - "mangledName": "$s7Amplify21ResolvedStorageBucketV10bucketInfoAA0dF0Vvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "BucketInfo", - "printedName": "Amplify.BucketInfo", - "usr": "s:7Amplify10BucketInfoV" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify21ResolvedStorageBucketV10bucketInfoAA0dF0Vvg", - "mangledName": "$s7Amplify21ResolvedStorageBucketV10bucketInfoAA0dF0Vvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - } - ], - "declKind": "Struct", - "usr": "s:7Amplify21ResolvedStorageBucketV", - "mangledName": "$s7Amplify21ResolvedStorageBucketV", - "moduleName": "Amplify", - "conformances": [ - { - "kind": "Conformance", - "name": "StorageBucket", - "printedName": "StorageBucket", - "usr": "s:7Amplify13StorageBucketP", - "mangledName": "$s7Amplify13StorageBucketP" - } - ] - }, { "kind": "TypeDecl", "name": "StorageCategory", @@ -155209,350 +154058,6 @@ } ] }, - { - "kind": "Var", - "name": "buckets", - "printedName": "buckets", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "[Amplify.AmplifyOutputsData.Storage.Bucket]?", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Amplify.AmplifyOutputsData.Storage.Bucket]", - "children": [ - { - "kind": "TypeNominal", - "name": "Bucket", - "printedName": "Amplify.AmplifyOutputsData.Storage.Bucket", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV" - } - ], - "usr": "s:Sa" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:7Amplify0A11OutputsDataV7StorageV7bucketsSayAE6BucketVGSgvp", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV7bucketsSayAE6BucketVGSgvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "[Amplify.AmplifyOutputsData.Storage.Bucket]?", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Amplify.AmplifyOutputsData.Storage.Bucket]", - "children": [ - { - "kind": "TypeNominal", - "name": "Bucket", - "printedName": "Amplify.AmplifyOutputsData.Storage.Bucket", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV" - } - ], - "usr": "s:Sa" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify0A11OutputsDataV7StorageV7bucketsSayAE6BucketVGSgvg", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV7bucketsSayAE6BucketVGSgvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "TypeDecl", - "name": "Bucket", - "printedName": "Bucket", - "children": [ - { - "kind": "Var", - "name": "name", - "printedName": "name", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV4nameSSvp", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV4nameSSvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV4nameSSvg", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV4nameSSvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "bucketName", - "printedName": "bucketName", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV10bucketNameSSvp", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV10bucketNameSSvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV10bucketNameSSvg", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV10bucketNameSSvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "awsRegion", - "printedName": "awsRegion", - "children": [ - { - "kind": "TypeNameAlias", - "name": "AWSRegion", - "printedName": "Amplify.AmplifyOutputsData.AWSRegion", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ] - } - ], - "declKind": "Var", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV9awsRegionSSvp", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV9awsRegionSSvp", - "moduleName": "Amplify", - "declAttributes": [ - "HasStorage" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNameAlias", - "name": "AWSRegion", - "printedName": "Amplify.AmplifyOutputsData.AWSRegion", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ] - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV9awsRegionSSvg", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV9awsRegionSSvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Function", - "name": "encode", - "printedName": "encode(to:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Encoder", - "printedName": "any Swift.Encoder", - "usr": "s:s7EncoderP" - } - ], - "declKind": "Func", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV6encode2toys7Encoder_p_tKF", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV6encode2toys7Encoder_p_tKF", - "moduleName": "Amplify", - "implicit": true, - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "throwing": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(from:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bucket", - "printedName": "Amplify.AmplifyOutputsData.Storage.Bucket", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV" - }, - { - "kind": "TypeNominal", - "name": "Decoder", - "printedName": "any Swift.Decoder", - "usr": "s:s7DecoderP" - } - ], - "declKind": "Constructor", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV4fromAGs7Decoder_p_tKcfc", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV4fromAGs7Decoder_p_tKcfc", - "moduleName": "Amplify", - "implicit": true, - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "throwing": true, - "init_kind": "Designated" - } - ], - "declKind": "Struct", - "usr": "s:7Amplify0A11OutputsDataV7StorageV6BucketV", - "mangledName": "$s7Amplify0A11OutputsDataV7StorageV6BucketV", - "moduleName": "Amplify", - "declAttributes": [ - "SPIAccessControl" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "conformances": [ - { - "kind": "Conformance", - "name": "Decodable", - "printedName": "Decodable", - "usr": "s:Se", - "mangledName": "$sSe" - }, - { - "kind": "Conformance", - "name": "Encodable", - "printedName": "Encodable", - "usr": "s:SE", - "mangledName": "$sSE" - } - ] - }, { "kind": "Function", "name": "encode", @@ -157701,80 +156206,6 @@ "name": "AmplifyOutputs", "printedName": "AmplifyOutputs", "children": [ - { - "kind": "Var", - "name": "resolveConfiguration", - "printedName": "resolveConfiguration", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "() throws -> Amplify.AmplifyOutputsData", - "children": [ - { - "kind": "TypeNominal", - "name": "AmplifyOutputsData", - "printedName": "Amplify.AmplifyOutputsData", - "usr": "s:7Amplify0A11OutputsDataV" - }, - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - } - ] - } - ], - "declKind": "Var", - "usr": "s:7Amplify0A7OutputsV20resolveConfigurationAA0aB4DataVyKcvp", - "mangledName": "$s7Amplify0A7OutputsV20resolveConfigurationAA0aB4DataVyKcvp", - "moduleName": "Amplify", - "declAttributes": [ - "SPIAccessControl", - "HasStorage" - ], - "spi_group_names": [ - "InternalAmplifyConfiguration" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "() throws -> Amplify.AmplifyOutputsData", - "children": [ - { - "kind": "TypeNominal", - "name": "AmplifyOutputsData", - "printedName": "Amplify.AmplifyOutputsData", - "usr": "s:7Amplify0A11OutputsDataV" - }, - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - } - ] - } - ], - "declKind": "Accessor", - "usr": "s:7Amplify0A7OutputsV20resolveConfigurationAA0aB4DataVyKcvg", - "mangledName": "$s7Amplify0A7OutputsV20resolveConfigurationAA0aB4DataVyKcvg", - "moduleName": "Amplify", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "amplifyOutputs", @@ -180497,7 +178928,7 @@ ], "declKind": "Struct", "usr": "c:@S@CLLocationCoordinate2D", - "location": "\/Applications\/Xcode-15.4.0.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk\/System\/Library\/Frameworks\/CoreLocation.framework\/Headers\/CLLocation.h:79:8", + "location": "\/Applications\/Xcode_15.4.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk\/System\/Library\/Frameworks\/CoreLocation.framework\/Headers\/CLLocation.h:79:8", "moduleName": "CoreLocation", "isExternal": true }, @@ -181157,7 +179588,7 @@ ], "declKind": "Class", "usr": "c:objc(cs)OS_dispatch_source", - "location": "\/Applications\/Xcode-15.4.0.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk\/usr\/include\/dispatch\/source.h:58:1", + "location": "\/Applications\/Xcode_15.4.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk\/usr\/include\/dispatch\/source.h:58:1", "moduleName": "Dispatch", "isOpen": true, "objc_name": "OS_dispatch_source", @@ -181437,7 +179868,7 @@ ], "declKind": "Protocol", "usr": "c:objc(pl)NSLocking", - "location": "\/Applications\/Xcode-15.4.0.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk\/System\/Library\/Frameworks\/Foundation.framework\/Headers\/NSLock.h:11:11", + "location": "\/Applications\/Xcode_15.4.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk\/System\/Library\/Frameworks\/Foundation.framework\/Headers\/NSLock.h:11:11", "moduleName": "Foundation", "genericSig": "", "objc_name": "NSLocking", @@ -181513,12 +179944,12 @@ "json_format_version": 8, "tool_arguments": [ "-sdk", - "\/Applications\/Xcode-15.4.0.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk", + "\/Applications\/Xcode_15.4.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk", "-dump-sdk", "-module", "Amplify", "-o", - "\/var\/folders\/k7\/4hy4p20s2rv4clw77d3qcl380000gr\/T\/tmp.nF2YaRsn2M\/Amplify.json", + "\/var\/folders\/hw\/1f0gcr8d6kn9ms0_wn0_57qc0000gn\/T\/tmp.7FvtSuhXB9\/Amplify.json", "-I", ".build\/debug", "-sdk-version", diff --git a/api-dump/CoreMLPredictionsPlugin.json b/api-dump/CoreMLPredictionsPlugin.json index f3073090da..739ae56260 100644 --- a/api-dump/CoreMLPredictionsPlugin.json +++ b/api-dump/CoreMLPredictionsPlugin.json @@ -430,7 +430,7 @@ "-module", "CoreMLPredictionsPlugin", "-o", - "\/var\/folders\/k7\/4hy4p20s2rv4clw77d3qcl380000gr\/T\/tmp.nF2YaRsn2M\/CoreMLPredictionsPlugin.json", + "\/var\/folders\/hw\/1f0gcr8d6kn9ms0_wn0_57qc0000gn\/T\/tmp.7FvtSuhXB9\/CoreMLPredictionsPlugin.json", "-I", ".build\/debug", "-sdk-version",