Skip to content

Merge upstream aws-amplify/amplify-swift main (through 2.58.4) - #2

Merged
andrewclements merged 25 commits into
mainfrom
dm/merge-upstream-2.58.4
Jul 22, 2026
Merged

Merge upstream aws-amplify/amplify-swift main (through 2.58.4)#2
andrewclements merged 25 commits into
mainfrom
dm/merge-upstream-2.58.4

Conversation

@dmorrow

@dmorrow dmorrow commented Jul 22, 2026

Copy link
Copy Markdown
Member

Syncs the fork with aws-amplify/amplify-swift main, 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:

Merge 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)
  • device-metadata inputUsername handling in ConfirmDevice
  • .github/workflows still removed

Testing

Not built or tested here — CI/consumer verification pending.

🤖 Generated with Claude Code

jvh-aws and others added 25 commits June 1, 2026 09:47
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
andrewclements merged commit 3124948 into main Jul 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants