From 82b1ca0843409f4b1b03aff7328a59848bca13f5 Mon Sep 17 00:00:00 2001 From: Harsh <6162866+harsh62@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:16:13 -0500 Subject: [PATCH 1/5] fix(amplify-xode): updated to support Xcode 16 (#3925) --- .../project.pbxproj | 365 ------------------ .../AmplifyXcode/BuildTools/Package.resolved | 88 ----- .../AmplifyXcode/BuildTools/Package.swift | 14 - AmplifyTools/AmplifyXcode/Package.resolved | 73 +--- AmplifyTools/AmplifyXcode/Package.swift | 5 +- 5 files changed, 6 insertions(+), 539 deletions(-) delete mode 100644 AmplifySwiftXcode/AmplifySwiftXcode.xcodeproj/project.pbxproj delete mode 100644 AmplifyTools/AmplifyXcode/BuildTools/Package.resolved delete mode 100644 AmplifyTools/AmplifyXcode/BuildTools/Package.swift diff --git a/AmplifySwiftXcode/AmplifySwiftXcode.xcodeproj/project.pbxproj b/AmplifySwiftXcode/AmplifySwiftXcode.xcodeproj/project.pbxproj deleted file mode 100644 index e6758ea6a5..0000000000 --- a/AmplifySwiftXcode/AmplifySwiftXcode.xcodeproj/project.pbxproj +++ /dev/null @@ -1,365 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 56; - objects = { - -/* Begin PBXFileReference section */ - 7383B19E2B471BF900EF62D0 /* AmplifySwiftXcode.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AmplifySwiftXcode.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7383B1A82B471C1D00EF62D0 /* amplify-swift */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "amplify-swift"; path = ..; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 7383B19B2B471BF900EF62D0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 7383B1942B471BF900EF62D0 = { - isa = PBXGroup; - children = ( - 7383B1A82B471C1D00EF62D0 /* amplify-swift */, - 7383B19F2B471BF900EF62D0 /* Products */, - ); - sourceTree = ""; - }; - 7383B19F2B471BF900EF62D0 /* Products */ = { - isa = PBXGroup; - children = ( - 7383B19E2B471BF900EF62D0 /* AmplifySwiftXcode.framework */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 7383B1992B471BF900EF62D0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 7383B19D2B471BF900EF62D0 /* AmplifySwiftXcode */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7383B1A52B471BF900EF62D0 /* Build configuration list for PBXNativeTarget "AmplifySwiftXcode" */; - buildPhases = ( - 7383B1992B471BF900EF62D0 /* Headers */, - 7383B19A2B471BF900EF62D0 /* Sources */, - 7383B19B2B471BF900EF62D0 /* Frameworks */, - 7383B19C2B471BF900EF62D0 /* Resources */, - 733C6C2D2B471D63001939F8 /* Run SwiftLint */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AmplifySwiftXcode; - productName = AmplifySwiftXcode; - productReference = 7383B19E2B471BF900EF62D0 /* AmplifySwiftXcode.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 7383B1952B471BF900EF62D0 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastUpgradeCheck = 1500; - TargetAttributes = { - 7383B19D2B471BF900EF62D0 = { - CreatedOnToolsVersion = 15.0; - }; - }; - }; - buildConfigurationList = 7383B1982B471BF900EF62D0 /* Build configuration list for PBXProject "AmplifySwiftXcode" */; - compatibilityVersion = "Xcode 14.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 7383B1942B471BF900EF62D0; - productRefGroup = 7383B19F2B471BF900EF62D0 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 7383B19D2B471BF900EF62D0 /* AmplifySwiftXcode */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 7383B19C2B471BF900EF62D0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 733C6C2D2B471D63001939F8 /* Run SwiftLint */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Run SwiftLint"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which swiftlint > /dev/null; then\n cd .. \n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 7383B19A2B471BF900EF62D0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 7383B1A32B471BF900EF62D0 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 7383B1A42B471BF900EF62D0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SWIFT_COMPILATION_MODE = wholemodule; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 7383B1A62B471BF900EF62D0 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_MODULE_VERIFIER = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; - LD_RUNPATH_SEARCH_PATHS = ( - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 13.6; - MARKETING_VERSION = 1.0; - MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; - MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; - PRODUCT_BUNDLE_IDENTIFIER = com.aws.amplify.AmplifySwiftXcode; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = auto; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 7383B1A72B471BF900EF62D0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_MODULE_VERIFIER = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; - LD_RUNPATH_SEARCH_PATHS = ( - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 13.6; - MARKETING_VERSION = 1.0; - MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; - MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; - PRODUCT_BUNDLE_IDENTIFIER = com.aws.amplify.AmplifySwiftXcode; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = auto; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 7383B1982B471BF900EF62D0 /* Build configuration list for PBXProject "AmplifySwiftXcode" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7383B1A32B471BF900EF62D0 /* Debug */, - 7383B1A42B471BF900EF62D0 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7383B1A52B471BF900EF62D0 /* Build configuration list for PBXNativeTarget "AmplifySwiftXcode" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7383B1A62B471BF900EF62D0 /* Debug */, - 7383B1A72B471BF900EF62D0 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 7383B1952B471BF900EF62D0 /* Project object */; -} diff --git a/AmplifyTools/AmplifyXcode/BuildTools/Package.resolved b/AmplifyTools/AmplifyXcode/BuildTools/Package.resolved deleted file mode 100644 index b6abac7e9d..0000000000 --- a/AmplifyTools/AmplifyXcode/BuildTools/Package.resolved +++ /dev/null @@ -1,88 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Commandant", - "repositoryURL": "https://github.com/Carthage/Commandant.git", - "state": { - "branch": null, - "revision": "ab68611013dec67413628ac87c1f29e8427bc8e4", - "version": "0.17.0" - } - }, - { - "package": "Nimble", - "repositoryURL": "https://github.com/Quick/Nimble.git", - "state": { - "branch": null, - "revision": "7a46a5fc86cb917f69e3daf79fcb045283d8f008", - "version": "8.1.2" - } - }, - { - "package": "Quick", - "repositoryURL": "https://github.com/Quick/Quick.git", - "state": { - "branch": null, - "revision": "09b3becb37cb2163919a3842a4c5fa6ec7130792", - "version": "2.2.1" - } - }, - { - "package": "SourceKitten", - "repositoryURL": "https://github.com/jpsim/SourceKitten.git", - "state": { - "branch": null, - "revision": "c0f960f72fa1e6151695074ffa696e4da6c45ce8", - "version": "0.30.1" - } - }, - { - "package": "SwiftFormat", - "repositoryURL": "https://github.com/nicklockwood/SwiftFormat", - "state": { - "branch": null, - "revision": "3a131ff347e1c220251f4e315935684af821d3b8", - "version": "0.44.17" - } - }, - { - "package": "SwiftLint", - "repositoryURL": "https://github.com/realm/SwiftLint", - "state": { - "branch": null, - "revision": "d91c2179bb55111790e7053c039d5d7a600dfa3d", - "version": "0.41.0" - } - }, - { - "package": "SwiftyTextTable", - "repositoryURL": "https://github.com/scottrhoyt/SwiftyTextTable.git", - "state": { - "branch": null, - "revision": "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", - "version": "0.9.0" - } - }, - { - "package": "SWXMLHash", - "repositoryURL": "https://github.com/drmohundro/SWXMLHash.git", - "state": { - "branch": null, - "revision": "a4931e5c3bafbedeb1601d3bb76bbe835c6d475a", - "version": "5.0.1" - } - }, - { - "package": "Yams", - "repositoryURL": "https://github.com/jpsim/Yams.git", - "state": { - "branch": null, - "revision": "138cf1b701cf825233b92ceac919152d5aba8a3f", - "version": "4.0.1" - } - } - ] - }, - "version": 1 -} diff --git a/AmplifyTools/AmplifyXcode/BuildTools/Package.swift b/AmplifyTools/AmplifyXcode/BuildTools/Package.swift deleted file mode 100644 index 39b2a7263d..0000000000 --- a/AmplifyTools/AmplifyXcode/BuildTools/Package.swift +++ /dev/null @@ -1,14 +0,0 @@ -// swift-tools-version:5.3 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "BuildTools", - platforms: [.macOS(.v10_11)], - dependencies: [ - .package(url: "https://github.com/nicklockwood/SwiftFormat", .upToNextMinor(from: "0.44.17")), - .package(url: "https://github.com/realm/SwiftLint", .upToNextMinor(from: "0.41.0")) - ], - targets: [.target(name: "BuildTools", path: "")] -) diff --git a/AmplifyTools/AmplifyXcode/Package.resolved b/AmplifyTools/AmplifyXcode/Package.resolved index dbb6701c41..38fa1fb8c1 100644 --- a/AmplifyTools/AmplifyXcode/Package.resolved +++ b/AmplifyTools/AmplifyXcode/Package.resolved @@ -3,31 +3,13 @@ "pins": [ { "package": "AEXML", - "repositoryURL": "https://github.com/tadija/AEXML", + "repositoryURL": "https://github.com/tadija/AEXML.git", "state": { "branch": null, "revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", "version": "4.6.1" } }, - { - "package": "GraphViz", - "repositoryURL": "https://github.com/SwiftDocOrg/GraphViz.git", - "state": { - "branch": null, - "revision": "70bebcf4597b9ce33e19816d6bbd4ba9b7bdf038", - "version": "0.2.0" - } - }, - { - "package": "JSONUtilities", - "repositoryURL": "https://github.com/yonaskolb/JSONUtilities.git", - "state": { - "branch": null, - "revision": "128d2ffc22467f69569ef8ff971683e2393191a0", - "version": "4.2.0" - } - }, { "package": "PathKit", "repositoryURL": "https://github.com/kylef/PathKit", @@ -37,15 +19,6 @@ "version": "1.0.1" } }, - { - "package": "Rainbow", - "repositoryURL": "https://github.com/onevcat/Rainbow.git", - "state": { - "branch": null, - "revision": "626c3d4b6b55354b4af3aa309f998fae9b31a3d9", - "version": "3.2.0" - } - }, { "package": "Spectre", "repositoryURL": "https://github.com/kylef/Spectre.git", @@ -60,35 +33,8 @@ "repositoryURL": "https://github.com/apple/swift-argument-parser", "state": { "branch": null, - "revision": "92646c0cdbaca076c8d3d0207891785b3379cbff", - "version": "0.3.1" - } - }, - { - "package": "SwiftCLI", - "repositoryURL": "https://github.com/jakeheis/SwiftCLI.git", - "state": { - "branch": null, - "revision": "2e949055d9797c1a6bddcda0e58dada16cc8e970", - "version": "6.0.3" - } - }, - { - "package": "Version", - "repositoryURL": "https://github.com/mxcl/Version", - "state": { - "branch": null, - "revision": "a94b48f36763c05629fc102837398505032dead9", - "version": "2.0.0" - } - }, - { - "package": "XcodeGen", - "repositoryURL": "https://github.com/yonaskolb/XcodeGen", - "state": { - "branch": null, - "revision": "ee60884b132078035d30f9892eb8e3e91ba2382c", - "version": "2.35.0" + "revision": "6b2aa2748a7881eebb9f84fb10c01293e15b52ca", + "version": "0.5.0" } }, { @@ -96,17 +42,8 @@ "repositoryURL": "https://github.com/tuist/xcodeproj", "state": { "branch": null, - "revision": "5fdac93cb4a7fd4bad5ac2da34e5bc878263043f", - "version": "8.10.0" - } - }, - { - "package": "Yams", - "repositoryURL": "https://github.com/jpsim/Yams.git", - "state": { - "branch": null, - "revision": "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", - "version": "5.0.6" + "revision": "9f26d78d72ef40dd2e35f624bbcde1e3b28762cf", + "version": "8.24.11" } } ] diff --git a/AmplifyTools/AmplifyXcode/Package.swift b/AmplifyTools/AmplifyXcode/Package.swift index 6f79f34bf4..11a42b65ad 100644 --- a/AmplifyTools/AmplifyXcode/Package.swift +++ b/AmplifyTools/AmplifyXcode/Package.swift @@ -13,8 +13,7 @@ let package = Package( .executable(name: "amplify-xcode", targets: ["AmplifyXcode"]) ], dependencies: [ - .package(name: "XcodeProj", url: "https://github.com/tuist/xcodeproj", .upToNextMinor(from: "8.10.0")), - .package(url: "https://github.com/yonaskolb/XcodeGen", from: "2.35.0"), + .package(name: "XcodeProj", url: "https://github.com/tuist/xcodeproj", from: "8.24.0"), .package(url: "https://github.com/kylef/PathKit", from: "1.0.0"), .package(url: "https://github.com/apple/swift-argument-parser", from: "0.3.0") ], @@ -23,8 +22,6 @@ let package = Package( name: "AmplifyXcodeCore", dependencies: [ "XcodeProj", - .product(name: "XcodeGenKit", package: "XcodeGen"), - .product(name: "ProjectSpec", package: "XcodeGen"), "PathKit" ]), .testTarget( From a2dfdf0ed075995712d760127b989fe2e155301c Mon Sep 17 00:00:00 2001 From: Harsh <6162866+harsh62@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:27:13 -0500 Subject: [PATCH 2/5] fix(auth): use auth flow type correctly from amplifyconfiguraiton.json (#3928) --- .../Models/AuthFlowType.swift | 15 +++++++++++++++ .../Support/Helpers/ConfigurationHelper.swift | 9 ++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AuthFlowType.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AuthFlowType.swift index 0229bd5285..46b701bcd3 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AuthFlowType.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AuthFlowType.swift @@ -34,6 +34,21 @@ public enum AuthFlowType { /// - `preferredFirstFactor`: the auth factor type the user should begin signing with if available. If the preferred first factor is not available, the flow would fallback to provide available first factors. case userAuth(preferredFirstFactor: AuthFactorType?) + internal init?(rawValue: String) { + switch rawValue { + case "CUSTOM_AUTH": + self = .customWithSRP + case "USER_SRP_AUTH": + self = .userSRP + case "USER_PASSWORD_AUTH": + self = .userPassword + case "USER_AUTH": + self = .userAuth + default: + return nil + } + } + var rawValue: String { switch self { case .custom, .customWithSRP, .customWithoutSRP: diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Support/Helpers/ConfigurationHelper.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Support/Helpers/ConfigurationHelper.swift index ae6d367070..6baadb7269 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Support/Helpers/ConfigurationHelper.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Support/Helpers/ConfigurationHelper.swift @@ -47,14 +47,17 @@ struct ConfigurationHelper { // parse `authFlowType` var authFlowType: AuthFlowType + + // If Migration path is enabled, auth flow type should always be set to USER_PASSWORD_AUTH if case .boolean(let isMigrationEnabled) = cognitoUserPoolJSON.value(at: "MigrationEnabled"), isMigrationEnabled == true { authFlowType = .userPassword } else if let authJson = config.value(at: "Auth.Default"), - case .string(let authFlowTypeJSON) = authJson.value(at: "authenticationFlowType"), - authFlowTypeJSON == "CUSTOM_AUTH" { - authFlowType = .customWithSRP + case .string(let authFlowTypeConfigValue) = authJson.value(at: "authenticationFlowType"), + let authFlowTypeFromConfig = AuthFlowType(rawValue: authFlowTypeConfigValue) { + authFlowType = authFlowTypeFromConfig } else { + // if the auth flow type is not found from config, default to SRP authFlowType = .userSRP } From e0aabadc546e936179c2d282510e3de57c37579d Mon Sep 17 00:00:00 2001 From: Harsh <6162866+harsh62@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:45:27 -0500 Subject: [PATCH 3/5] chore(auth): add passwordless integration test (#3930) --- .../PasswordlessSignInTests.swift | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/PasswordlessTests/PasswordlessSignInTests.swift b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/PasswordlessTests/PasswordlessSignInTests.swift index 3d95e20d8b..b2a15274c7 100644 --- a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/PasswordlessTests/PasswordlessSignInTests.swift +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/PasswordlessTests/PasswordlessSignInTests.swift @@ -167,6 +167,95 @@ class PasswordlessSignInTests: AWSAuthBaseTest { } } + /// Test successful signIn of a valid user + /// + /// - Given: A user registered in Cognito user pool + /// - When: + /// - I invoke Amplify.Auth.signIn with the username and password, using userAuth flow + /// - Retry confirm sign in after a wrong password attempt is not supposed to work in `userAuth` flow. Cognito doesn't support this flow. + /// - Re-initiation of sign in should work correctly after a incorrect attempt + /// - Then: + /// - I should get a completed signIn flow. + /// + func testSignInWithPasswordSRP_givenValidUser_expectErrorOnWrongPassword() async throws { + + let username = "integTest\(UUID().uuidString)" + let password = "Pp123@\(UUID().uuidString)" + + try await signUp(username: username, password: password) + + do { + let pluginOptions = AWSAuthSignInOptions( + authFlowType: .userAuth) + var signInResult = try await Amplify.Auth.signIn( + username: username, + password: password, + options: .init(pluginOptions: pluginOptions)) + guard case .continueSignInWithFirstFactorSelection(let availableFactors) = signInResult.nextStep else { + XCTFail("SignIn should return a .continueSignInWithFirstFactorSelection") + return + } + XCTAssert(availableFactors.contains(.passwordSRP)) + var confirmSignInResult = try await Amplify.Auth.confirmSignIn( + challengeResponse: AuthFactorType.passwordSRP.challengeResponse) + + guard case .confirmSignInWithPassword = confirmSignInResult.nextStep else { + XCTFail("ConfirmSignIn should return a .confirmSignInWithPassword") + return + } + + // Try confirming with wrong password and it should fail + + do { + confirmSignInResult = try await Amplify.Auth.confirmSignIn( + challengeResponse: "wrong-password") + } catch { + guard let error = error as? AuthError else { + XCTFail("Error should be of type AuthError instead got: \(error)") + return + } + guard case .notAuthorized = error else { + XCTFail("Error should be .notAuthorized instead got: \(error)") + return + } + } + + // Try confirming with password again and it should fail saying that re-initiation is needed + + do { + confirmSignInResult = try await Amplify.Auth.confirmSignIn( + challengeResponse: password) + } catch { + guard let error = error as? AuthError else { + XCTFail("Error should be of type AuthError instead got: \(error)") + return + } + guard case .invalidState = error else { + XCTFail("Error should be .invalidState instead got: \(error)") + return + } + } + + // After all the errors re-initiation of sign in should work + + // Sign in + _ = try await Amplify.Auth.signIn( + username: username, + password: password, + options: .init(pluginOptions: pluginOptions)) + // Select passwordSRP + _ = try await Amplify.Auth.confirmSignIn( + challengeResponse: AuthFactorType.passwordSRP.challengeResponse) + // Complete sign in + confirmSignInResult = try await Amplify.Auth.confirmSignIn( + challengeResponse: password) + + XCTAssertTrue(confirmSignInResult.isSignedIn, "SignIn should be complete") + } catch { + XCTFail("SignIn with a valid username/password should not fail \(error)") + } + } + /// Test successful signIn of a valid user /// /// - Given: A user registered in Cognito user pool From 89d3b72f23ba327c3d7346684514213585475d59 Mon Sep 17 00:00:00 2001 From: Harsh <6162866+harsh62@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:46:05 -0500 Subject: [PATCH 4/5] fix(auth): add localized description to AWSCognitoAuthError (#3929) * fix(auth): add localized description to AWSCognitoAuthError * update * update messages --- .../Models/Errors/AWSCognitoAuthError.swift | 89 +++++++++++++++++-- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/Errors/AWSCognitoAuthError.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/Errors/AWSCognitoAuthError.swift index ffa1315432..5f3553979c 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/Errors/AWSCognitoAuthError.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/Errors/AWSCognitoAuthError.swift @@ -5,6 +5,8 @@ // SPDX-License-Identifier: Apache-2.0 // +import Foundation + public enum AWSCognitoAuthError: Error { /// User not found in the system. @@ -13,7 +15,7 @@ public enum AWSCognitoAuthError: Error { /// User not confirmed in the system. case userNotConfirmed - /// Username does not exists in the system. + /// Username already exists in the system. case usernameExists /// Alias already exists in the system. @@ -40,7 +42,7 @@ public enum AWSCognitoAuthError: Error { /// Amazon Cognito cannot find a multi-factor authentication (MFA) method. case mfaMethodNotFound - /// Software token TOTP multi-factor authentication (MFA) is not enabled for the user pool. + /// Software token (TOTP) multi-factor authentication (MFA) is not enabled for the user pool. case softwareTokenMFANotEnabled /// Required to reset the password of the user. @@ -55,7 +57,7 @@ public enum AWSCognitoAuthError: Error { /// The user has made too many requests for a given operation. case requestLimitExceeded - /// Amazon Cognito service encounters an invalid AWS Lambda response or encounters an + /// Amazon Cognito service encountered an invalid AWS Lambda response or encountered an /// unexpected exception with the AWS Lambda service. case lambda @@ -71,7 +73,7 @@ public enum AWSCognitoAuthError: Error { /// Requested resource is not available with the current account setup. case invalidAccountTypeException - /// Request was not completed because of any network related issue + /// Request was not completed because of a network related issue case network /// SMS role related issue @@ -107,6 +109,83 @@ public enum AWSCognitoAuthError: Error { /// The relying party ID doesn't match case webAuthnRelyingPartyMismatch - /// The WebAuthm configuration is missing or incomplete + /// The WebAuthn configuration is missing or incomplete case webAuthnConfigurationMissing } + +extension AWSCognitoAuthError: LocalizedError { + public var errorDescription: String? { + var message: String = "" + switch self { + case .userNotFound: + message = "User not found in the system." + case .userNotConfirmed: + message = "User not confirmed in the system." + case .usernameExists: + message = "Username already exists in the system." + case .aliasExists: + message = "Alias already exists in the system." + case .codeDelivery: + message = "Error in delivering the confirmation code." + case .codeMismatch: + message = "Confirmation code entered is not correct." + case .codeExpired: + message = "Confirmation code has expired." + case .invalidParameter: + message = "One or more parameters are incorrect." + case .invalidPassword: + message = "Password given is invalid." + case .limitExceeded: + message = "Limit exceeded for the requested AWS resource." + case .mfaMethodNotFound: + message = "Amazon Cognito cannot find a multi-factor authentication (MFA) method." + case .softwareTokenMFANotEnabled: + message = "Software token (TOTP) multi-factor authentication (MFA) is not enabled for the user pool." + case .passwordResetRequired: + message = "Required to reset the password of the user." + case .resourceNotFound: + message = "Amazon Cognito service cannot find the requested resource." + case .failedAttemptsLimitExceeded: + message = "The user has made too many failed attempts for a given action." + case .requestLimitExceeded: + message = "The user has made too many requests for a given operation." + case .lambda: + message = "Amazon Cognito service encountered an invalid AWS Lambda response or encountered an unexpected exception with the AWS Lambda service." + case .deviceNotTracked: + message = "Device is not tracked." + case .errorLoadingUI: + message = "Error in loading the web UI." + case .userCancelled: + message = "User cancelled the step." + case .invalidAccountTypeException: + message = "Requested resource is not available with the current account setup." + case .network: + message = "Request was not completed because of a network related issue." + case .smsRole: + message = "SMS role related issue." + case .emailRole: + message = "Email role related issue." + case .externalServiceException: + message = "An external service like facebook/twitter threw an error." + case .limitExceededException: + message = "Limit exceeded exception. Thrown when the total number of user pools has exceeded a preset limit." + case .resourceConflictException: + message = "Thrown when a user tries to use a login which is already linked to another account." + case .webAuthnChallengeNotFound: + message = "The WebAuthn credentials don't match an existing request." + case .webAuthnClientMismatch: + message = "The client doesn't support WebAuhn authentication." + case .webAuthnNotSupported: + message = "WebAuthn is not supported on this device." + case .webAuthnNotEnabled: + message = "WebAuthn is not enabled." + case .webAuthnOriginNotAllowed: + message = "The device origin is not registered as an allowed origin." + case .webAuthnRelyingPartyMismatch: + message = "The relying party ID doesn't match." + case .webAuthnConfigurationMissing: + message = "The WebAuthn configuration is missing or incomplete." + } + return "\(String(describing: Self.self)).\(self): \(message)" + } +} From b31292a1ff8856ac8882680b0ea63002806c7f9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:12:30 -0500 Subject: [PATCH 5/5] chore(deps): bump path-to-regexp and express (#3931) Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `path-to-regexp` from 0.1.10 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12) Updates `express` from 4.21.1 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../LocalServer/package-lock.json | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/package-lock.json b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/package-lock.json index 53b4a8975e..b44254b0a8 100644 --- a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/package-lock.json +++ b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/package-lock.json @@ -197,9 +197,9 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -220,7 +220,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -235,6 +235,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/finalhandler": { @@ -488,9 +492,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "node_modules/proxy-addr": { "version": "2.0.7",