Migrate Native Auth test email provider to Mail.tm, Fixes AB#3720943 - #3219
Conversation
828e850 to
ddb306a
Compare
There was a problem hiding this comment.
Pull request overview
This pull request migrates Native Auth end-to-end test email handling from the unauthenticated 1secmail integration to Mail.tm, aligning the testutils infrastructure with workflows that require authenticated and persistent inbox access while keeping secrets out of source control via the existing Gradle BuildConfig/BuildValues pattern.
Changes:
- Replaced the temporary email provider implementation with a Mail.tm-backed transport + API wrapper, including authenticated inbox creation, OTP polling/checkpointing, and MIME-aware OTP extraction.
- Removed obsolete 1secmail response models and added unit tests covering Mail.tm transport behavior and inbox/OTP retrieval logic.
- Wired the email provider password through Gradle build config and CI pipeline parameters.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| testutils/src/test/java/com/microsoft/identity/internal/testutils/nativeauth/api/TemporaryEmailServiceTest.kt | Adds focused unit tests for Mail.tm transport, checkpointed polling, OTP extraction, and retry behavior. |
| testutils/src/main/java/com/microsoft/identity/internal/testutils/nativeauth/api/TemporaryEmailService.kt | Replaces the 1secmail implementation with authenticated Mail.tm inbox lifecycle, polling logic, and an OkHttp-based transport forced to HTTP/1.1. |
| testutils/src/main/java/com/microsoft/identity/internal/testutils/nativeauth/api/models/InboxContent.kt | Removes obsolete 1secmail inbox response model. |
| testutils/src/main/java/com/microsoft/identity/internal/testutils/nativeauth/api/models/EmailContent.kt | Removes obsolete 1secmail email response model. |
| common4j/src/testFixtures/java/com/microsoft/identity/common/nativeauth/ApiConstants.kt | Updates the temporary mail service base URL to Mail.tm. |
| common4j/src/main/com/microsoft/identity/common/java/nativeauth/BuildValues.java | Exposes the Mail.tm password via BuildValues.getEmailProviderPassword(). |
| common4j/build.gradle | Adds the emailProviderPassword Gradle property and surfaces it via generated BuildConfig. |
| changelog.txt | Records the migration in vNext. |
| azure-pipelines/pull-request-validation/build-consumers.yml | Passes EMAIL_PROVIDER_PASSWORD into the Gradle invocation for consumer validation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace the 1secmail test integration with authenticated Mail.tm inboxes, checkpoint-aware OTP polling, compatibility APIs, and regression coverage. Pass the provider password through the existing secured build configuration path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ddb306a to
40ad51c
Compare
Point the Common submodule at the latest commit from AzureAD/microsoft-authentication-library-common-for-android#3219. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fadidurah
left a comment
There was a problem hiding this comment.
LGTM, special emphasis on porting the build.gradle property to our weekly and monthly pipeline
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 83947e30-5bc9-4ec7-a8ed-c03d4415da92
|
Copilot resolve the merge conflicts in this pull request |
…ive-auth-e2e-clean Co-authored-by: djanardhan98 <307255345+djanardhan98@users.noreply.github.com>
Head branch was pushed to by a user without write access
Resolved by merging |
|
Copilot resolve the merge conflicts in this pull request |
…ive-auth-e2e-clean Co-authored-by: djanardhan98 <307255345+djanardhan98@users.noreply.github.com>
Head branch was pushed to by a user without write access
Resolved by merging |
Summary
BuildConfig/BuildValuespattern without committing credentials.Motivation
Native Auth end-to-end tests need both dynamically created signup inboxes and an authenticated persistent inbox for SSPR. Mail.tm supports both workflows, while the previous unauthenticated 1secmail integration cannot support the persistent SSPR mailbox used by the re-enabled tests.
Validation
.\gradlew.bat :testutils:clean :testutils:assembleDebug :testutils:testDebugUnitTest --no-daemon: passed locally.ddb306a3884f9621e53b6eb3256fc14ea1497c7c.Pipeline configuration
EMAIL_PROVIDER_PASSWORDfrom the pipeline's linked variable groups to Common as-PemailProviderPassword=$(EMAIL_PROVIDER_PASSWORD); Common exposes it through generatedBuildConfigandBuildValueswithout committing the secret.Related work
Merge sequencing
This PR is the expand step of a cross-repository migration: it temporarily retains
generateRandomEmailAddressLocally()so bothdevbranches remain buildable. After AzureAD/microsoft-authentication-library-for-android#2553 migrates callers tocreateRandomEmailAddress()orgenerateRandomUnregisteredEmailAddress()and merges, the compatibility method will be removed in a Common follow-up.