Move device registration protocol infrastructure to common, Fixes AB#3512895#3066
Merged
Move device registration protocol infrastructure to common, Fixes AB#3512895#3066
Conversation
…ommon - Move ~30 protocol files (V0 params, responses, interfaces, serializer, constants) to common4j - Move domain types (IDeviceRegistrationRecord, DeviceRegistrationRecord, exceptions) to common4j - Add Moshi dependency to common4j - Move AndroidDeviceRegistrationClientController + Packer to common - Create DeviceRegistrationIpcStrategiesProvider in common - Create testFixtures for test protocol helpers - Move serializer test, packer test, DrsErrorResponseExceptionTest to common - Add AndroidDeviceRegistrationClientController unit test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ommon - Move ~30 protocol files (V0 params, responses, interfaces, serializer, constants) to common4j - Move domain types (IDeviceRegistrationRecord, DeviceRegistrationRecord, exceptions) to common4j - Add Moshi dependency to common4j - Move AndroidDeviceRegistrationClientController + Packer to common - Create DeviceRegistrationIpcStrategiesProvider in common - Create testFixtures for test protocol helpers - Move serializer test, packer test, DrsErrorResponseExceptionTest to common - Add AndroidDeviceRegistrationClientController unit test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…AD/microsoft-authentication-library-common-for-android into mchand/device-reg-common-1
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
|
✅ Work item link check complete. Description contains link AB#3512895 to an Azure Boards work item. |
Contributor
There was a problem hiding this comment.
Pull request overview
Moves device registration protocol infrastructure from Broker into Common/Common4j so OneAuth (and other non-broker consumers) can execute device registration operations via shared protocol/domain types, packing/serialization, and Android IPC strategy/controller plumbing.
Changes:
- Adds common4j device registration protocol/domain models, Moshi-based protocol serializer, and supporting exceptions/constants.
- Adds Android-side controller, protocol packer, and IPC strategies provider in
common, plus unit tests validating packing and controller strategy fallback behavior. - Updates build + changelog to include Moshi dependencies and document the new capability.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| common4j/src/testFixtures/java/com/microsoft/identity/deviceregistration/testprotocols/TestHappyPathV0Response.java | Adds a test protocol response fixture used for serializer/controller tests. |
| common4j/src/testFixtures/java/com/microsoft/identity/deviceregistration/testprotocols/TestHappyPathV0Parameters.java | Adds a test protocol parameters fixture used for serializer/controller tests. |
| common4j/src/testFixtures/java/com/microsoft/identity/deviceregistration/testprotocols/DeviceRegistrationTestProtocolConstants.java | Centralizes constants for device registration test protocols. |
| common4j/src/test/com/microsoft/identity/deviceregistration/java/packer/DeviceRegistrationProtocolSerializerParameterizedTest.java | Adds common4j parameterized unit test for protocol serialization/deserialization. |
| common4j/src/test/com/microsoft/identity/deviceregistration/java/exception/DrsErrorResponseExceptionTest.kt | Adds unit tests covering DRS error parsing for both JSON formats and invalid inputs. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/UnregisterDeviceV0Response.java | Adds V0 unregister-device response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/ProvisionResourceAccountV0Response.java | Adds V0 provision-resource-account response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/PreProvisionedBlobV0Response.java | Adds V0 pre-provisioned blob response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/InstallCertificateSilentlyV0Response.java | Adds V0 silent cert install response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/IDeviceRegistrationProtocolResponse.java | Defines response marker interface for device registration protocols. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/GetRegistrationStateV0Response.java | Adds V0 get-registration-state response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/GetInstallWpjCertificateIntentRequestV0Response.java | Adds V0 response type for launching WPJ cert install intent. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/GetDeviceTokenV0Response.java | Adds V0 device token response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/GetDeviceRegistrationRecordV0Response.java | Adds V0 single-device-registration-record response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/GetDeviceRegistrationRecordsV0Response.java | Adds V0 list-device-registration-records response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/DeviceRegistrationWithTokensV0Response.java | Adds V0 device-registration-with-tokens response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/DeviceRegistrationPreAuthorizedV0Response.java | Adds V0 pre-authorized device registration response protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/AbstractDeviceRegistrationProtocolResponse.java | Adds response base class providing correlation id plumbing. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/UnregisterDeviceV0Parameters.java | Adds V0 unregister-device parameters protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/ProvisionResourceAccountV0Parameters.java | Adds V0 provision-resource-account parameters protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/PreProvisionedBlobV0Parameters.java | Adds V0 pre-provisioned blob parameters protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/InstallCertificateSilentlyV0Parameters.java | Adds V0 silent cert install parameters protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/IDeviceRegistrationProtocolParameters.java | Defines parameters marker interface for device registration protocols. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/GetRegistrationStateV0Parameters.java | Adds V0 get-registration-state parameters protocol type. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/GetInstallWpjCertificateIntentRequestV0Parameters.java | Adds V0 parameters type for WPJ cert install intent request. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/GetDeviceTokenV0Parameters.java | Adds V0 parameters type for device token acquisition. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/GetDeviceRegistrationRecordV0Parameters.java | Adds V0 parameters type for fetching a single record. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/GetDeviceRegistrationRecordsV0Parameters.java | Adds V0 parameters type for fetching all records. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/DeviceRegistrationWithTokensV0Parameters.java | Adds V0 parameters type for device registration using tokens. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/DeviceRegistrationPreAuthorizedV0Parameters.java | Adds V0 parameters type for pre-authorized device registration. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/AbstractDeviceRegistrationProtocolParameters.java | Adds parameters base class with auto-generated correlation id. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/packer/IDeviceRegistrationProtocolSerializer.java | Adds serializer interface for protocol types. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/packer/IDeviceRegistrationProtocolPacker.java | Adds packer interface for transporting protocol payloads and exceptions. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/packer/DeviceRegistrationProtocolMoshiSerializer.java | Adds Moshi serializer with polymorphic handling for device registration records. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/IDeviceRegistrationProtocol.java | Adds base interface for protocol name/serialization/correlation id. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/DeviceRegistrationProtocolConstants.java | Adds protocol name constants for V0 operations. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/exception/DrsErrorResponseException.kt | Adds DRS error parsing exception handling both legacy and OData formats. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/exception/DeviceRegistrationException.java | Adds base device registration exception + error codes/messages + factories. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/exception/BrokerUpdateRequiredException.java | Adds exception indicating broker upgrade is required. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/exception/ApiUpdateRequiredException.java | Adds exception indicating calling app upgrade is required. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/api/IDeviceRegistrationRecord.java | Adds shared domain interface for device registration record. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/api/IDeviceRegistrationClientController.java | Adds controller interface for executing device registration protocols against broker strategies. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/api/DeviceRegistrationRecordWithAccount.java | Adds record subtype carrying account name for legacy execution paths. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/api/DeviceRegistrationRecord.java | Adds record implementation used on the wire by common4j serializer. |
| common4j/build.gradle | Adds Moshi dependencies required by the new serializer. |
| common/src/test/java/com/microsoft/identity/deviceregistration/AndroidDeviceRegistrationProtocolPackerTest.java | Adds Robolectric tests for Android bundle packing/unpacking and exception propagation. |
| common/src/test/java/com/microsoft/identity/deviceregistration/AndroidDeviceRegistrationClientControllerTest.kt | Adds controller tests validating strategy ordering/fallback and main-thread enforcement behavior. |
| common/src/main/java/com/microsoft/identity/deviceregistration/DeviceRegistrationIpcStrategiesProvider.kt | Adds provider for default ContentProvider + BoundService IPC strategies (extensible by broker). |
| common/src/main/java/com/microsoft/identity/deviceregistration/AndroidDeviceRegistrationProtocolPacker.java | Adds Android Bundle packer for protocol payloads and packed exceptions. |
| common/src/main/java/com/microsoft/identity/deviceregistration/AndroidDeviceRegistrationClientController.java | Adds Android controller executing protocols via broker IPC strategies with OTel instrumentation. |
| changelog.txt | Adds vNext entry documenting the migration to Common. |
p3dr0rv
approved these changes
Apr 6, 2026
Prvnkmr337
approved these changes
Apr 7, 2026
p3dr0rv
approved these changes
Apr 8, 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.
Move device registration protocol types, domain types, controller, packer, and IPC strategies provider from broker to common to enable OneAuth device registration support.
Changes
common4j
common (Android)
Tests moved/added
Companion PR
Broker: https://github.com/identity-authnz-teams/ad-accounts-for-android/pull/138
Fixes AB#3512895