Repository navigation
TPT-4739: Add MFA enforcement support - #751
Open
zliang-akamai wants to merge 1 commit into
Open
zliang-akamai wants to merge 1 commit into
zliang-akamai wants to merge 1 commit into
Conversation
zliang-akamai
requested review from
jriddle-linode and
mawilk90
and
a balanced review from Copilot
and removed request for
a team
October 24, 2026 20:19
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused additions follow existing SDK patterns, include relevant test coverage, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
Adds account-wide MFA enforcement and per-user exemption management to the SDK’s existing account and profile APIs.
Changes:
- Exposes mutable account enforcement settings and read-only user/profile status, including user filtering.
- Adds paginated exemption listing and replacement or clearing of exemptions.
- Adds fixtures, unit coverage, and state-preserving integration checks.
| File | Description |
|---|---|
test/unit/objects/profile_test.py |
Tests enforcement status, read-only behavior, and MFA-disable responses. |
test/unit/objects/account_test.py |
Tests account enforcement updates and read-only user status. |
test/unit/linode_client_test.py |
Tests filtering, exemption pagination, updates, and error handling. |
test/integration/models/profile/test_profile.py |
Checks profile enforcement status. |
test/integration/models/account/test_account.py |
Adds enforcement and exemption integration checks. |
test/fixtures/profile.json |
Adds profile enforcement status. |
test/fixtures/account_users_test-user.json |
Adds user enforcement status. |
test/fixtures/account_tfa-optional-users.json |
Adds a paginated exemption response fixture. |
test/fixtures/account_settings.json |
Adds the account enforcement setting. |
linode_api4/objects/profile.py |
Exposes enforcement status and documents MFA-disable restrictions. |
linode_api4/objects/account.py |
Adds enforcement properties and the exemption reference model. |
linode_api4/groups/account.py |
Adds exemption listing and update methods. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add SDK support for account-wide MFA enforcement and per-user exemptions. Expose mutable
AccountSettings.tfa_enforced, read-only enforcement status onUserandProfile, and filtering users by enforcement status.Add
account.tfa_optional_users()for paginated exemption listing andaccount.tfa_optional_users_update(usernames)for replacing or clearing the exemption list, with unit coverage and state-preserving integration tests.✔️ How to Test