Skip to content

TPT-4739: Add MFA enforcement support - #751

Open
zliang-akamai wants to merge 1 commit into
devfrom
tpt-4739-mfa-enforcement
Open

zliang-akamai wants to merge 1 commit into
devfrom
tpt-4739-mfa-enforcement

Conversation

@zliang-akamai

@zliang-akamai zliang-akamai commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

📝 Description

Add SDK support for account-wide MFA enforcement and per-user exemptions. Expose mutable AccountSettings.tfa_enforced, read-only enforcement status on User and Profile, and filtering users by enforcement status.

Add account.tfa_optional_users() for paginated exemption listing and account.tfa_optional_users_update(usernames) for replacing or clearing the exemption list, with unit coverage and state-preserving integration tests.

✔️ How to Test

python -m pytest test/integration/models/account/test_account.py test/integration/models/profile/test_profile.py -k 'tfa or test_user_profile'

@zliang-akamai
zliang-akamai requested review from a team as code owners October 24, 2026 20:19
@zliang-akamai
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

Copilot AI 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.

🟢 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

No deployments
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.

2 participants