Merge upstream aws-amplify/amplify-swift main (through 2.58.4) - #2
Merged
Conversation
…twork path change (aws-amplify#4202)" (aws-amplify#4228) This reverts commit be0a214.
aws-amplify#4231) * fix(auth): defer keychain-sharing reconfigure during in-flight sign-in When AWSCognitoAuthPlugin is configured with a shared keychain access group, every fetchAuthSession unconditionally sent a .reconfigure event to the auth state machine. If a fetchAuthSession landed between a sign-in step that returned .confirmSignInWithCustomChallenge and the caller's confirmSignIn, the reconfigure tore down the .signingIn substate and the next confirmSignIn threw AuthError.invalidState("User is not attempting signIn operation"). Replace the unconditional reconfigure with a reconcile that: - Reads the shared keychain credentials, compares against the local state machine's authZ credentials, and skips reconfigure when they match — eliminating wasted reconfigures on every fetch. - Defers reconfigure during locally-originated in-flight flows (.signingIn, .signingOut, .deletingUser, .federatingToIdentityPool, .clearingFederation) when the keychain has no signed-in credentials. - Adopts a sibling app's sign-in by reconfiguring even during .signingIn when the remote keychain has user-pool tokens. Relax the AWSAuthConfirmSignInTask top-level guard to accept .signedIn and return .done so the pending confirmSignIn resolves cleanly. Fixes aws-amplify#4224. * refactor(auth): consolidate confirmSignIn state dispatch into a switch Fold the .signedIn early-return into the same switch that handles .signingIn dispatch. The listener loop already returns .done on .signedIn(.sessionEstablished), so the early return was redundant — the only thing the .signedIn branch needs to do is skip the event dispatch that's specific to the .signingIn path. * refactor(auth): inline .signedIn handling into analyzeCurrentStateAndCreateEvent and clarify keychain/state-machine fetch helper names Move the .signedIn early-return for shared-keychain adoption into analyzeCurrentStateAndCreateEvent so execute() has a single guard + single dispatch. Rename fetchRemoteCredentials and the local-state snapshot helper to fetchCredentialsFromKeychain and fetchCredentialsFromStateMachine to make the source-of-truth pairing explicit at the call site.
…#4238) The FoundationClientEngine is the base HTTP client used by the AWS SDK service clients (Cognito Identity / Identity Provider, etc.) for credential and token exchange. It previously used URLSession.shared, whose default configuration includes an on-disk URLCache. As a result, responses carrying Cognito tokens and AWS credentials were persisted to the app container's Cache.db, where they could be recovered by inspecting the device. Use a dedicated URLSession with urlCache = nil and a reloadIgnoringLocalCacheData policy so these responses are never written to disk. This mirrors the cache-disabling behavior already applied to the Hosted UI URLSession in AWSCognitoAuthPlugin+Configure.
Bumps [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) from 1.3.6 to 1.3.7. - [Release notes](https://github.com/ruby-concurrency/concurrent-ruby/releases) - [Changelog](https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md) - [Commits](ruby-concurrency/concurrent-ruby@v1.3.6...v1.3.7) --- updated-dependencies: - dependency-name: concurrent-ruby dependency-version: 1.3.7 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ws-amplify#4239) Bumps [faraday](https://github.com/lostisland/faraday) from 1.10.5 to 1.10.6. - [Release notes](https://github.com/lostisland/faraday/releases) - [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md) - [Commits](lostisland/faraday@v1.10.5...v1.10.6) --- updated-dependencies: - dependency-name: faraday dependency-version: 1.10.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps): bump aws-sdk-swift from 1.6.71 to 1.7.27 Updates the aws-sdk-swift dependency to 1.7.27, which moves the transitive dependencies: aws-crt-swift 0.58.1 -> 0.63.0 smithy-swift 0.191.0 -> 0.223.0 swift-http-types 1.5.1 -> 1.6.0 aws-sdk-swift 1.7.21+ relaxes its aws-crt-swift constraint from exact: "0.61.1" to from: "0.63.0", so Amplify Swift and the AWS IoT Device SDK for Swift can now coexist in the same project without an aws-crt-swift version conflict. swift-http-types is bumped to 1.6.0 because the transitively-updated swift-nio-extras enables its new FoundationURL trait, which only exists as of swift-http-types 1.6.0. 1.7.27 (smithy-swift 0.223.0) is required: smithy-swift's schema-based JSON deserializer (introduced in 0.206.0) regressed null-value handling for non-sparse maps, which broke deserialization of Cognito RespondToAuthChallenge responses whose ChallengeParameters contain a null value (e.g. "FRIENDLY_DEVICE_NAME": null in the SELECT_MFA_TYPE challenge). smithy-swift 0.223.0 restores the prior behavior of tolerating null values in non-sparse maps. Resolves aws-amplify#4233 * ci: fix xcodebuild for smithy-swift build-tool plugin smithy-swift 0.219.0 (pulled transitively by aws-sdk-swift 1.7.21) ships the SmithyCodeGeneratorPlugin build-tool plugin, which aws-sdk-swift attaches to every service target. Two independent issues broke CI builds on the embedded simulator platforms (watchOS/tvOS): 1. Xcode requires package build-tool plugins to be trusted before use, which can't happen non-interactively in CI: Validate plug-in "SmithyCodeGeneratorPlugin" ... ** BUILD FAILED ** Fixed by passing -skipPackagePluginValidation. 2. Passing -sdk <simulator> forces xcodebuild to build the plugin's host tool (SmithyCodegenCLI, an executableTarget) for the simulator SDK, where it can't link: Build input file cannot be found: '.../SmithyCodegenCLI' The -destination already specifies the platform, so -sdk is redundant. Removed it; the host tool now builds for macOS and the library for the target. (The sdk input is retained for the coverage-export path.) Both changes are required; dropping either re-breaks the watchOS/tvOS builds for a different reason. * test(auth): depend integration test bundles on a single host app AuthIntegrationTests and AuthGen2IntegrationTests declared target dependencies on BOTH AuthHostApp and AuthWatchApp. That pulled both apps into a single build graph, and since both link Amplify / AWSCognitoAuthPlugin (and transitively aws-sdk-swift), the new SmithyCodeGeneratorPlugin ran twice for each SDK service target, writing to the same aws-sdk-swift.output/<target>/ path: Multiple commands produce '.../AWSCognitoIdentitySchemas.swift' Every other plugin's host-app project depends each test bundle on a single app (e.g. Geo -> GeoHostApp), which builds cleanly. Match that structure: the iOS test bundles now depend only on AuthHostApp, and the watch test bundle on AuthWatchApp. Verified locally: 'xcodebuild build-for-testing -scheme AuthIntegrationTests' now reports TEST BUILD SUCCEEDED. * test: stop integration test bundles from re-linking SDK products The integration XCTest bundles for Predictions, Kinesis/Firehose, and the Analytics watchOS target linked the Amplify/aws-sdk-swift package products directly (in both packageProductDependencies and the Frameworks build phase), in addition to their host app linking them. With smithy-swift 0.219.0's SmithyCodeGeneratorPlugin (pulled in by aws-sdk-swift 1.7.21), this makes the build-tool plugin run twice for each aws-sdk-swift service target — host app build + test bundle build — both writing to the same package-keyed output directory: Multiple commands produce '.../AWSCognitoIdentitySchemas.swift' Build input files cannot be found: '.../InternalAWSCognitoIdentity...' Passing projects (Geo, Storage, Logging, Analytics iOS/tvOS) link the SDK products only from the app targets; their test bundles rely on the host app via TEST_HOST. Match that: remove the redundant product links from the affected test bundles. Verified locally: AWSPredictionsPluginIntegrationTests and AmplifyKinesisClientIntegrationTests now build with no plugin-output collision (TEST BUILD SUCCEEDED).
Bumps [faraday](https://github.com/lostisland/faraday) from 1.10.5 to 1.10.6. - [Release notes](https://github.com/lostisland/faraday/releases) - [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md) - [Commits](lostisland/faraday@v1.10.5...v1.10.6) --- updated-dependencies: - dependency-name: faraday dependency-version: 1.10.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ws-amplify#4246) --- updated-dependencies: - dependency-name: excon dependency-version: 1.5.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Update fastlane from 2.235.0 to ~> 2.237 to relax the excon version constraint (< 1.0.0 -> < 2.0.0), allowing excon to be bumped from 0.112.0 to 1.5.0.
…tion (aws-amplify#4250) excludedCredentials comes from the ASAuthorizationWebBrowserPlatformPublicKeyCredentialRegistrationRequest protocol, which AuthenticationServices marks unavailable on visionOS, so any visionOS build of AWSCognitoAuthPlugin fails to compile. Guard the assignment with #if !os(visionOS). Fixes aws-amplify#4237
…Servers (aws-amplify#4252) The LocalServer test utilities built shell command strings by interpolating the request-body `deviceId` (and, for push, notification fields) and ran them via child_process.exec, which spawns /bin/sh. A crafted deviceId such as "booted; <cmd>" sent to the localhost endpoints achieved arbitrary shell command execution as the developer's user. Fixes both test servers (AuthWebAuthnApp and PushNotificationHostApp): - Replace exec() with execFile(), passing arguments as an array so no shell is invoked and user input is never interpreted as shell syntax. - /enroll: split the '&&'-chained command into two sequential execFile calls. - /notifications: write the APNS JSON payload to the process stdin instead of piping it through 'echo | ...' in a shell. - Add UUID/"booted" validation on deviceId as defense-in-depth. Impact is limited to developer workstations manually running these localhost-only test servers; no shipped SDK code is affected.
andrewclements
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs the fork with
aws-amplify/amplify-swiftmain, up to release 2.58.4. Our own commits are preserved — this is a merge, not a reset.Upstream changes pulled in (24 commits)
Notable:
fix(auth): defer keychain-sharing reconfigure during in-flight sign-in(fix(auth): defer keychain-sharing reconfigure during in-flight sign-in aws-amplify/amplify-swift#4231)fix(auth): disable URL caching in FoundationClientEngine(fix(auth): disable URL caching in FoundationClientEngine to prevent credentials being persisted to Cache.db aws-amplify/amplify-swift#4238)fix(auth): fix visionOS build failure in WebAuthn credential registration(fix(auth): fix visionOS build failure in WebAuthn credential registration aws-amplify/amplify-swift#4250)fix(auth,push): prevent command injection in WebAuthn/Push test LocalServers(fix: prevent command injection in WebAuthn/Push test LocalServers aws-amplify/amplify-swift#4252)Revert "fix(api): recycle WebSocket and resubscribe on same-online network path change"(Revert "fix(api): recycle WebSocket and resubscribe on same-online network path change (#4202)" aws-amplify/amplify-swift#4228)chore(deps): bump aws-sdk-swift from 1.6.71 to 1.7.27(chore(deps): bump aws-sdk-swift from 1.6.71 to 1.7.27 aws-amplify/amplify-swift#4234), plus excon/faraday/qs/ruby-jwt/fastlane bumpsMerge notes
No conflicts — the set of files upstream touched and the set our fork has modified since the merge base are disjoint.
Fork customizations verified present after the merge:
AWSCognitoAuthPlugin.setTokens(...)(used by the app's AppAuth SSO flow)inputUsernamehandling inConfirmDevice.github/workflowsstill removedTesting
Not built or tested here — CI/consumer verification pending.
🤖 Generated with Claude Code