Skip to content

Resource Account API only, Fixes AB#3230428 #2640

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 12 commits into
base: dev
Choose a base branch
from

Conversation

mohitc1
Copy link
Contributor

@mohitc1 mohitc1 commented May 12, 2025

Fixes AB#3230428

Adding method for provisioning resource account in Android Broker. The method is exposed to OneAuth via BrokerMsalController

For details Refer: https://github.com/AzureAD/ad-accounts-for-android/pull/3093

Copy link

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

Click here to Learn more.

Copy link

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

@github-actions github-actions bot changed the title Resource Account API initial Resource Account API initial, Fixes AB#3230428 May 12, 2025
@mohitc1 mohitc1 changed the title Resource Account API initial, Fixes AB#3230428 Resource Account API initial work, Fixes AB#3230428 May 12, 2025
@mohitc1 mohitc1 changed the title Resource Account API initial work, Fixes AB#3230428 Resource Account API only, Fixes AB#3230428 May 12, 2025
@mohitc1 mohitc1 marked this pull request as ready for review May 12, 2025 23:40
@mohitc1 mohitc1 requested review from a team as code owners May 12, 2025 23:40
@mohitc1 mohitc1 requested a review from Copilot May 16, 2025 20:14
Copy link

@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 provisioning resource accounts via the broker by introducing new command parameter classes, updating the MSAL request and result adaptors, and adding corresponding tests.

  • Introduces ResourceAccountCommandParameters and BrokerResourceAccountCommandParameters to encapsulate the new resource account parameters.
  • Updates request and result adapters (MsalBrokerRequestAdapter and MsalBrokerResultAdapter) with methods to build and extract resource account bundles.
  • Adds new tests and extends the BrokerMsalController to support resource account provisioning.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java New parameter class for resource account provisioning.
common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java Extends resource account parameters with broker-specific fields.
common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerResultAdapterTests.kt Tests for resource account record extraction from a bundle.
common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java Test verifying request bundle construction for provisioning a resource account.
common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java Test to simulate a resource account provisioning operation.
common/src/main/java/com/microsoft/identity/common/internal/result/MsalBrokerResultAdapter.java Added resourceAccountRecordFromBundle method to extract a single cache record.
common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java Added getRequestBundleForProvisionResourceAccount method for resource account requests.
common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java Implements provisionResourceAccount and integrates resource account handling.
common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/BrokerOperationBundle.java Adds new operation enum entry for resource account provisioning.
common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java Removes the @nonnull mScope annotation to align with resource account API needs.
common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java Introduces API paths for the new resource account provisioning endpoint.
changelog.txt Documents the new resource account provisioning API.
Comments suppressed due to low confidence (1)

common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java:96

  • The removal of the @nonnull annotation for mScope may allow null values in scenarios where the scope is expected. Please confirm that this change is intentional and that dependent request types are not adversely affected.
@NonNull

Copy link
Contributor

@shahzaibj shahzaibj left a comment

Choose a reason for hiding this comment

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

Responded to few comments, else lgtm

@mohitc1 mohitc1 added the Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR label May 19, 2025
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