Add device registration flow support to flow management API - #1151
Draft
kaviska wants to merge 1 commit into
Draft
Add device registration flow support to flow management API#1151kaviska wants to merge 1 commit into
kaviska wants to merge 1 commit into
Conversation
Introduce DEVICE_REGISTRATION as a supported flow type in the flow management API. - Add DeviceRegistrationFlowMetaHandler to supply meta information for the device registration flow (endUser attribute profile, username as the required input field, and the DeviceRegistration, EmailOTP, SMSOTP and UserResolve executors). - Register the handler in ServerFlowMgtService.resolveHandler. - Add the DEVICE_REGISTRATION_EXECUTOR constant and allow it in the registration and ask password flows. - Validate that a device registration flow contains the DeviceRegistrationExecutor. - Add DEVICE_REGISTRATION to the flowType enums in flow.yaml. Requires a carbon-identity-framework release containing Constants.FlowTypes.DEVICE_REGISTRATION; this does not compile against the currently referenced framework version.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Purpose
This PR adds
DEVICE_REGISTRATIONas a supported flow type in the Flow Management API (/api/server/v1/flow). It allows tenant administrators to design, retrieve, and manage a device registration flow through the same endpoints already used for registration, password recovery, and ask password flows.Goals
The flow type is supported across the existing Flow Management operations:
GET /flow/meta).GET /flow,PUT /flow,DELETE /flow).GET /flow/config).DeviceRegistrationExecutorto be used as a step within the registration and ask password flows.Implementation
The change follows the existing meta response handler pattern in
org.wso2.carbon.identity.api.server.flow.management.v1, so no new Maven component is introduced.Changes
response/handlersDeviceRegistrationFlowMetaHandleris a new handler extendingAbstractMetaResponseHandler, supplying the meta information for the device registration flow.endUserattribute profile, the username claim as the required input field, and theDeviceRegistrationExecutor,EmailOTPExecutor,SMSOTPExecutorandUserResolveExecutorexecutors.RegistrationFlowMetaHandlerandAskPasswordFlowMetaHandlernow includeDeviceRegistrationExecutorin their supported executors, so device registration can be composed into those flows as a step.coreandconstantsServerFlowMgtService.resolveHandlermaps theDEVICE_REGISTRATIONflow type to the new handler.FlowEndpointConstantsdefines theDEVICE_REGISTRATION_EXECUTORconstant.utilsUtils.validateExecutorsrejects a device registration flow that does not contain theDeviceRegistrationExecutor, mirroring the existing validation for the password recovery flow.flow.yamlDEVICE_REGISTRATIONis added to theflowTypeenum on all endpoints that accept it.The
endUserattribute profile is used because the device registration flow operates on an existing user who is resolved by username and verified before the device is registered, which matches how the password recovery flow resolves its attribute set. Flow type validation and flow completion configuration resolution are already driven by theConstants.FlowTypesenum, so no changes were required there.No changes are required in the Flow Execution API. It validates the flow type against the same enum and gates execution on the flow configuration, without any per-flow-type handling.
User stories
Developer Checklist (Mandatory)
product-isissue to capture any behavioral changes or migration impacts.Release note
N/A
Documentation
N/A
Training
N/A
Certification
N/A
Marketing
N/A
Automation tests
N/A
Security checks
Samples
N/A
Related PRs
This PR depends on a
carbon-identity-frameworkrelease that includesConstants.FlowTypes.DEVICE_REGISTRATION.Migrations
N/A – This adds a new flow type to an existing API and does not require any migration.
Test environment
N/A
Learning
N/A