Skip to content

feat: add remove_mfa_by_public_address to User resource#136

Merged
oxyn-magic merged 3 commits into
masterfrom
feat/remove-mfa-by-public-address
Jun 24, 2026
Merged

feat: add remove_mfa_by_public_address to User resource#136
oxyn-magic merged 3 commits into
masterfrom
feat/remove-mfa-by-public-address

Conversation

@bo-magic

Copy link
Copy Markdown
Contributor

Summary

Adds User.remove_mfa_by_public_address(public_address) to the Magic Python Admin SDK, letting developers remove (deactivate) all MFA for one of their app's users, identified by the user's public address. Useful for support flows where a user is locked out of their authenticator.

  • New User.remove_mfa_by_public_address(public_address) method + v1_user_remove_mfa = "/v1/admin/user/remove_mfa" endpoint constant — mirrors the existing logout_by_* plumbing, deriving the issuer via the existing construct_issuer_with_public_address helper and POSTing {"issuer": ...}.
  • Version bump 2.4.02.5.0 (version.py + pyproject.toml) and a 2.5.0 CHANGELOG entry.

Dependency / rollout

Important

Do not publish/release the package until the toaster backend endpoint POST /v1/admin/user/remove_mfa is deployed. This PR is the SDK client side only; unit tests mock the request layer, so it builds and tests independently.

The user must belong to the app associated with the configured X-Magic-Secret-Key; otherwise the backend rejects the request.

Test Plan

  • test_remove_mfa_by_public_address added — asserts the request is made to v1_user_remove_mfa with the real derived issuer
  • Full unit suite passes locally (112 passed, Python 3.11)
  • CI tox matrix (py311/py312/py313) + lint green on this PR

🤖 Generated with Claude Code

bomliu and others added 2 commits June 19, 2026 13:47
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bo-magic bo-magic requested a review from a team as a code owner June 19, 2026 18:01
@datadog-magiclabs

datadog-magiclabs Bot commented Jun 19, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 2 Pipeline jobs failed

Test | Run tests   View in Datadog   GitHub Actions

pre-commit | pre-commit   View in Datadog   GitHub Actions

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9414815 | Docs | Give us feedback!

@oxyn-magic oxyn-magic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oxyn-magic oxyn-magic merged commit b4bfa71 into master Jun 24, 2026
2 checks passed
@oxyn-magic oxyn-magic deleted the feat/remove-mfa-by-public-address branch June 24, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants