Repository navigation
test(branch): log in with MFA_SECRET when the test account has two-factor on (DX-31560) - #281
Merged
Conversation
…ctor on (DX-31560) BranchAPITest logs in with a plain email and password, so it cannot run on an account with two-factor on: the API answers 401 error 294. Add an optional MFA_SECRET to TestClient and pass it to client.login as mfaSecret when set, so the SDK generates the one-time code. Without MFA_SECRET the plain login is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
netrajpatel
approved these changes
Nov 12, 2026
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.
What
BranchAPITest(the live check forpublish_config.environmentson branch create, DX-31564) logs in with a plain email and password. On an account with two-factor on, the API answers 401 with error 294, so the whole class fails at login and Java has no live branch-create result.This adds an optional
MFA_SECRETtoTestClientand, when it is set, passes it toclient.login(email, password, params)asmfaSecret. The SDK already supports this and generates the one-time code, so no TOTP code is added. WhenMFA_SECRETis not set, the plain login is unchanged. The test javadoc documents the new variable.Test code only. No change to the SDK.
Verified
Full suite on
developmentplus this change, against api.contentstack.io (NA prod), account with two-factor on:BranchAPITest: 7 of 7 pass (two names, fetch read-back, empty list, nopublish_config, unknown name 422, mixed names 422, wrong-case name 422).Notes
skipTeststrue in the pom, somvn clean test -DskipTests=false(asAGENTS.mdsays) runs zero tests. I set it to false locally to run the suite; that is not in this PR. Worth fixing separately.mvn test -Dtest=BranchAPITestalso selects no tests in this setup; the class runs through the suite.🤖 Generated with Claude Code