feat: Upgrade Auth0.swift to v3.0.2 - #909
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bumps the native iOS/macOS SDK dependency from 2.23.0 to 3.0.1 across the podspecs, Package.swift, and Package.resolved lockfiles, and updates every native call site for the v3 breaking changes: the Authentication -> MFAClient split for OTP login/MFA challenge, WebAuth.clearSession -> logout, CredentialsManager.store/clear becoming throwing calls, CredentialsManager.user -> userProfile(), UserInfo -> UserProfile, and Credentials.expiresIn -> expiresAt. Also updates the Dart-facing multifactorChallenge API: authenticatorId is now required and the types parameter is removed, since Auth0.swift v3's MFAClient.challenge(with:mfaToken:) has no equivalent for challenge-type filtering.
…test suite Fixes a remaining compile error in WebAuthLoginMethodHandler.swift: Auth0.swift v3 made WebAuthentication.safariProvider @MainActor-isolated, which broke the default-argument closure and its call site. Also adds UIScene support (SceneDelegate.swift + Info.plist manifest) and bumps the example app's CocoaPods deployment target to 15.0, both needed to actually launch the example app on current Xcode/iOS Simulator versions. Migrates the darwin plugin's XCTest suite (previously untouched by the v3 dependency bump) to the new SDK shape: Telemetry -> Auth0ClientInfo, UserInfo -> UserProfile, expiresIn -> expiresAt, throwing CredentialsStorage, Request<T,E> -> any Requestable/TokenRequestable (via new MockRequest/MockTokenRequest test doubles), the Authentication -> MFAClient split for OTP login and MFA challenge, and the new WebAuthError cases. All 358 RunnerTests unit tests pass.
The macOS test target was missing 8 MFA-related test files that are referenced by other test files. This caused compilation errors in GitHub Actions when building macOS tests, specifically: - SpyMFAClient not found (defined in MfaSpies.swift) - Other MFA test infrastructure missing Added the following test files to the macOS RunnerTests target: - MfaSpies.swift - MfaGetAuthenticatorsMethodHandlerTests.swift - MfaEnrollTotpMethodHandlerTests.swift - MfaEnrollPhoneMethodHandlerTests.swift - MfaEnrollEmailMethodHandlerTests.swift - MfaEnrollPushMethodHandlerTests.swift - MfaChallengeMethodHandlerTests.swift - MfaVerifyMethodHandlerTests.swift These files already existed in the iOS test target and are shared via relative path (../ios/Tests/Mfa/).
9c259b3 to
b78b3a2
Compare
| final String mfaToken; | ||
| final List<ChallengeType>? types; | ||
| final String? authenticatorId; | ||
| final String authenticatorId; |
There was a problem hiding this comment.
authenticatorId is now required and types removed on the shared platform-interface, but only the Swift native side is updated to match. Android's MultifactorChallengeApiRequestHandler.kt still reads request.data["types"] and treats authenticatorId as optional — after this merges, every Android multifactorChallenge call receives types == null and a shape it doesn't expect. The Dart signature change and the Android handler need to move together.
There was a problem hiding this comment.
this is used in deprecated mfa present in authenticationclient which was removed in auth0.android v4. Will revert the change on dart side but this will go away when we will removed authclient mfa apis altogether as part of v3
…andlers now return flutter result on storing and clearing
4bfffce to
8d62a3c
Compare
Summary
Key Changes
Dependency Updates
API Migration
.webAuthError()to.authenticationError()for WebAuth errorsTest Suite Updates
Test Plan