Repository navigation
feat(auth): add admin updateFactor for MFA factors - #1965
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Follow-up to #1965 (SDK-2256), whose last commit landed after it was merged. ## What - Corrects the `AuthAdminMFAApi.updateFactor` dartdoc: the server treats an empty string as not given, so a friendly name cannot be cleared, and it ignores `phone` on factors that are not phone factors. - Adds an integration test that sends a phone number to the seeded TOTP factor and checks that the call succeeds and leaves the factor unchanged, as the capability spec describes. ## Verification The `auth_admin_mfa_api_test.dart` suite passes against the local stack. Format and DCM are clean. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified that an empty friendly name is treated as not provided and that phone numbers are ignored for non-phone factors. * **Tests** * Added coverage confirming that supplying a phone number when updating a TOTP factor does not change its ID, type, or friendly name. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Linear: SDK-2256
Why
auth.admin.update_mfa_factorwas added to the capability matrix in supabase/sdk#255 and released in capability-matrix v1.15.0. It is the only way to change a factor's friendly name, or a phone factor's number, after enrollment.What
AuthAdminMFAApi.updateFactor({userId, factorId, friendlyName, phone}), which sendsPUT /admin/users/{userId}/factors/{factorId}. Only the fields that are given go into the body, so the server's partial-update semantics carry through. Both ids are checked withvalidateUuidbefore any request is sent, likelistFactorsanddeleteFactor.AuthMFAAdminUpdateFactorResponse, holding the updatedFactor.auth.admin.update_mfa_factorasimplementedinsdk-compliance.yaml.validate-capabilities.ymlandsync-compliance.ymlfrom capability-matrix v1.14.0 to v1.15.0, the first tag that defines the id. The reusable Dart workflow is unchanged between the two tags.Verification
admin_test.dart.check-api-symbols,check-driftandvalidate-complianceall pass.Summary by CodeRabbit