Skip to content

Merge upstream aws-amplify/amplify-swift main (through 2.60.1) - #5

Merged
andrewclements merged 20 commits into
mainfrom
dm/merge-upstream-2.60.1
Aug 5, 2026
Merged

Merge upstream aws-amplify/amplify-swift main (through 2.60.1)#5
andrewclements merged 20 commits into
mainfrom
dm/merge-upstream-2.60.1

Conversation

@dmorrow

@dmorrow dmorrow commented Aug 5, 2026

Copy link
Copy Markdown
Member

Brings the fork up to date with aws-amplify/amplify-swift 2.60.1. Merge base was 8741e9058 (aws-amplify#4252); the fork was 17 ahead / 19 behind.

Single merge commit b7f940241 off origin/main (312494826) into upstream/main (827003772, tag 2.60.1).

Upstream changes pulled in

⚠️ fix/device-metadata-alias-username is now redundant

Upstream aws-amplify#4254 is our device-metadata fix — it landed upstream as a squash of the three commits on fix/device-metadata-alias-username (f1f35ae81, e08bbb526, 25e5d1675).

Verified equivalent: git diff origin/fix/device-metadata-alias-username HEAD over the four affected files (VerifyPasswordSRP.swift, VerifySignInChallenge.swift, VerifyDevicePasswordSRP.swift, UserPoolSignInHelper.swift) is empty. That branch can be deleted once this merges — carrying it forward would be a no-op at best.

Conflict resolution

Exactly one conflict:

CONFLICT (modify/delete): .github/workflows/unit_test.yml
  deleted in HEAD and modified in upstream/main

Kept the fork's deletion. 7b90dc628 "getting rid of amplify swift workflows" removed all 70 upstream workflow files; upstream's edit here only added AmplifyConnectClient / AmplifyEventEnrichmentClient scheme rows to a workflow this fork doesn't run.

No other file was touched by both sides.

Extend customizations preserved

git diff --stat upstream/main HEAD over the fork's custom files is unchanged from before the merge (9 files, +215 / −43):

  • AWSCognitoAuthPlugin.swift (+145 — public reset/config methods)
  • AmplifyConfiguration.swift, Amplify+Reset.swift
  • SignedInData.swift, DeviceMetadata.swift, HostedUIOptions.swift, HostedUIProviderInfo.swift, SignInMethod.swift
  • AmplifyTests/CoreTests/ConfigurationTests.swift

All 17 fork commits verified reachable from HEAD, and upstream/main (2.60.1) is now an ancestor.

Note

Upstream added two new workflow files (unit_test_connect.yml, unit_test_event_enrichment.yml) that auto-merged in without conflict. Both are workflow_dispatch-only, so they never trigger automatically. Left as-is.

thisisabhash and others added 19 commits July 27, 2026 09:41
… 26 (URL signing + Sendable credentials) (aws-amplify#4248)

* fix(predictions): fix SigV4 URL signing for iOS 26 and temporary credentials

* fix(auth): make AWSCredentials Sendable (aws-amplify#4253)

Co-authored-by: zhouzihao <zhouzihao@changzhi.top>

---------

Co-authored-by: zhouzihao <nenseso@163.com>
Co-authored-by: zhouzihao <zhouzihao@changzhi.top>
Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.20.5 to 1.20.6.
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](expressjs/body-parser@1.20.5...1.20.6)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-version: 1.20.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [json](https://github.com/ruby/json) from 2.19.7 to 2.19.9.
- [Release notes](https://github.com/ruby/json/releases)
- [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md)
- [Commits](ruby/json@v2.19.7...v2.19.9)

---
updated-dependencies:
- dependency-name: json
  dependency-version: 2.19.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: add connect client

* add unit tests to ci/cd

* fix unit tests

* update amplify outputs configuration parsing

* address review comments

* feat(connect): rework client to Option C API contract

Public surface is now identifyUser(userProfile:), registerDevice(token:),
and removeDevice(). All routes are SigV4-signed (Bearer token path removed;
the backend derives the caller identity from the request signature, so
userId is no longer sent). IdentifyUserOptions and OptOut are removed.
UserProfile now carries email, name, phone, customAttributes, and
location (city, country, postalCode, region). registerDevice resolves
deviceId, platform, appVersion, and channelType internally, with platform
derived from the target OS. Removes the now-unused AuthToken and
AuthTokenProvider protocols from AmplifyFoundation and updates unit and
integration tests to the new contract.

* chore(connect): declare UserDefaults required-reason API in privacy manifest

AmplifyConnectClient persists a device identifier in UserDefaults, so the
privacy manifest now declares NSPrivacyAccessedAPICategoryUserDefaults
with reason CA92.1, and the target is added to the required-reason API
list in the root README.

* fix(connect): declare collected data types in privacy manifest

The client can transmit email address, name, phone number, coarse
location (city, country, postal code, region), and a device identifier
(persistent device id and push token). Each is declared as linked to
identity, not used for tracking, collected for app functionality.
Adds a README note that apps should narrow their app-level privacy
declarations to the optional UserProfile fields they actually send.

* fix(connect): enforce https endpoints and validate input lengths

Endpoint hardening: configuration loading now rejects malformed or
non-https endpoint URLs, and the client re-validates before every
request so manually constructed configurations are covered. The SigV4
signing target (host, port, protocol) is derived from the endpoint URL
instead of hardcoding port 443, so the signature is always computed
over the same authority the request is sent to.

Input bounds: user profile fields (email, name, phone, location
fields), customAttributes keys and values, and the device token are
validated against the backend's 255-character attribute limit before
any network call, throwing the new ConnectError.validation case that
names the offending field.

Also removes the device identifier from log messages.

* fix(connect): count validation lengths in UTF-16 code units to match backend

* address review comments

* update files

* fix swiftformat issue

* fix removeDevice api

---------

Co-authored-by: Ekjot <43255916+ekjotmultani@users.noreply.github.com>
* feat: add event enrichment client

* add more tests

* fix swiftformat issue and run tests on CI/CD

* add appId to client init and persist client id internally

* address review comments

* add missing test scheme

* update tests

* address review comments

* address review comment

* address review comments

* address review changes
Updates the aws-sdk-swift dependency to 1.7.53, which moves the
transitive dependency:

  smithy-swift  0.223.0 -> 0.238.0

aws-crt-swift stays resolved at 0.64.1: smithy-swift raised its floor
from `from: "0.63.0"` to `from: "0.64.0"`, which the already-pinned
0.64.1 satisfies. No other transitive pins change.

The aws-sdk-swift range is almost entirely API and endpoint model
regeneration. For the services Amplify depends on the changes are
additive only: Cognito Identity Provider gains GetProvisionedLimit /
UpdateProvisionedLimit, EumsSms in SmsConfigurationType, and
AdminGetUserAuthFactors; CloudWatch Logs gains storage-tier and
lookup-table APIs; TranscribeStreaming gains an optional
TranscriptFormat parameter. The one breaking entry in the range
(1.7.28 removes SimSpaceWeaver, Panorama, IoT Events, IoT Events Data)
does not touch any Amplify dependency.

smithy-swift's breaking changes in 0.224.0-0.238.0 are confined to the
@_spi(SchemaBasedSerde) codegen surface that only the SDK's own
generated code consumes: ShapeDeserializer.readInteger/readLong
narrowing to Int32/Int64, readDocument returning `any SmithyDocument`,
and ReadStructConsumer being replaced by a deserializeMember
requirement. The modules Amplify imports directly - SmithyIdentity,
SmithyRetries, SmithyHTTPAuth and their API variants - are unchanged.
ClientRuntime's only behavioral delta is percent-encoding moving its
implementation into SmithyHTTPAPI.URLEncodingUtils with the same
allowed character sets.

Verified that the non-sparse-map null regression which gated the
previous bump (aws-amplify#4234) has not returned: SmithyJSON's Deserializer
still compacts UnexpectedNullError out of non-sparse maps and lists,
so Cognito RespondToAuthChallenge responses carrying a null
ChallengeParameters value (e.g. "FRIENDLY_DEVICE_NAME": null in the
SELECT_MFA_TYPE challenge) continue to deserialize.
…s remember devices (aws-amplify#4254)

* fix(auth): read device metadata with the caller's username during sign-in

`ConfirmDevice` stores device metadata under `signedInData.inputUsername`
(the username the caller signed in with), but the sign-in flow read it back
using `parameters["USERNAME"]` — the value Cognito echoes, which is the sub
for pools configured with alias sign-in.

On those pools the read never matched the write, so `DEVICE_KEY` was omitted
from the password-verifier response. Cognito treated every sign-in as a new
device: it returned fresh `NewDeviceMetadata`, `ConfirmDevice` stored it under
the email again, and the next sign-in repeated the cycle — MFA on every
sign-in and a new device record per attempt (one user had accumulated 50).

Pools where the username *is* the email are unaffected, since the two values
coincide there.

Reads now use the same value as the write:
- VerifyPasswordSRP: `inputUsername`
- VerifySignInChallenge (both call sites): `challenge.inputUsername ?? username`

Nothing sent to Cognito changes — `username` still supplies `USERNAME` on
every request; only the keychain lookups moved.

Known gap: the DeviceSRP actions (InitiateAuthDeviceSRP,
VerifyDevicePasswordSRP) still look up by the echoed username. That path only
executes once Cognito starts accepting the device key, so it is now reachable
and tracked separately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(auth): delete device metadata with the same username used to read it

Commit 122689e changed the sign-in flow to read device metadata with the
caller's `inputUsername` (matching how `ConfirmDevice` writes it), but left the
`deviceNotFound` recovery paths deleting under `username` — the value Cognito
echoes, which is the sub for pools with alias sign-in.

When a stored device key is stale, Cognito rejects the password verifier with
`ResourceNotFoundException`. The recovery path then deletes the wrong keychain
entry, leaving the real one in place, so the retry re-reads the same stale key,
Cognito rejects it again, and sign-in loops indefinitely.

Read and delete now use the same value in both actions:
- VerifyPasswordSRP: `inputUsername`
- VerifySignInChallenge: `challenge.inputUsername ?? username`

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(auth): use inputUsername for device metadata in the device SRP flow

Once a device is remembered, Cognito answers the password verifier with
DEVICE_SRP_AUTH instead of an MFA challenge, routing sign-in through
InitiateAuthDeviceSRP / VerifyDevicePasswordSRP. Both looked the stored device
metadata up by the Cognito-echoed username (the sub, on pools with alias
sign-in) rather than the `inputUsername` it was written under, so the lookup
missed and the request omitted DEVICE_KEY — Cognito then rejected sign-in with
"Missing required parameter DEVICE_KEY".

- UserPoolSignInHelper: carry `inputUsername ?? username` into `.initiateDeviceSRP`
  so InitiateAuthDeviceSRP reads (and re-sends) under the right key.
- VerifyDevicePasswordSRP: read metadata with `inputUsername`; the request still
  sends `username` (the echoed value), which is what Cognito expects.

Completes the alias-pool device-remembering fix (see prior two commits); the
DEVICE_SRP_AUTH path is only reachable once DEVICE_KEY is accepted, so it could
not be exercised until the earlier read/delete fixes landed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Harsh <6162866+harsh62@users.noreply.github.com>
Brings the fork up to date with upstream releases 2.58.5, 2.59.0, 2.60.0 and
2.60.1 (19 commits from merge base 8741e90).

Resolved the sole conflict (.github/workflows/unit_test.yml, modify/delete) by
keeping the fork's deletion — all upstream workflows were removed in 7b90dc6.

Note: upstream 2.60.1 includes aws-amplify#4254, which is our device-metadata alias-pool
fix upstreamed. The fix/device-metadata-alias-username branch is now redundant.
@dmorrow
dmorrow force-pushed the dm/merge-upstream-2.60.1 branch from 818da30 to b7f9402 Compare August 5, 2026 03:07
@andrewclements
andrewclements merged commit e2a9b40 into main Aug 5, 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.

4 participants