Skip to content

Use tdbr claim to route telemetry traffic to EU region, Fixes AB#3200872 #2679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

fadidurah
Copy link
Contributor

@fadidurah fadidurah commented Jun 18, 2025

Introduce Tracking for a new TDBR Claim that ESTS will send as part of ClientInfo to denote EU Home tenants, then fetch the claim to route telemetry to EU when applicable. This will be used to better comply with European Data laws

AB#3200872

Copy link

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

@fadidurah fadidurah marked this pull request as ready for review June 27, 2025 00:45
@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 00:45
@fadidurah fadidurah requested a review from a team as a code owner June 27, 2025 00:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for persisting and tracking the telemetry region (TDBR claim) by tenant across the Android platform layers.

  • Defines a new storeTelemetryRegionByTenant API in IPlatformUtil and implements it in AndroidPlatformUtil
  • Extends ClientInfo to parse and expose the TDBR claim
  • Hooks into broker flows in BrokerMsalController to extract, persist, and attach region telemetry

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
common4j/src/main/com/microsoft/identity/common/java/util/IPlatformUtil.java Added storeTelemetryRegionByTenant method signature
common4j/src/main/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/ClientInfo.java Introduced TDBR_CLAIM constant, field, constructor parsing, and getter
common4j/src/main/com/microsoft/identity/common/java/opentelemetry/AttributeName.java Added tenant_id enum entry
common/src/main/java/com/microsoft/identity/common/internal/platform/AndroidPlatformUtil.java Implemented storeTelemetryRegionByTenant logic and span tagging
common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java Integrated trackTelemetryRegionFromResultBundle into broker flows and initial save
Comments suppressed due to low confidence (2)

common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java:1430

  • The new trackTelemetryRegionFromResultBundle method contains multiple branches (success, missing clientInfo, exception path) but lacks dedicated unit tests. Consider adding tests to cover each branch.
    private void trackTelemetryRegionFromResultBundle(@NonNull final Bundle resultBundle) throws BaseException {

common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java:620

  • Calling trackTelemetryRegionFromResultBundle, which declares throws BaseException, inside extractResultBundle (which likely doesn't declare this exception) can lead to a compile error or unintended exception propagation. Wrap this call in a try-catch or adjust the method signature to handle the exception explicitly.
                            trackTelemetryRegionFromResultBundle(resultBundle);

Copy link

✅ Work item link check complete. Description contains link AB#3200872 to an Azure Boards work item.

@github-actions github-actions bot changed the title merge initial changes merge initial changes, Fixes AB#3200872 Jun 27, 2025
@fadidurah fadidurah requested a review from a team as a code owner June 27, 2025 04:59
@fadidurah fadidurah changed the title merge initial changes, Fixes AB#3200872 Use tdbr claim to route telemetry traffic to EU region, Fixes AB#3200872 Jun 27, 2025
@fadidurah fadidurah added the Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR label Jun 27, 2025
…tion-library-common-for-android into fadi/EUClaim

t add# Please enter a commit message to explain why this merge is necessary,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants