Skip to content

Add meta component definitions to bootstrap auth flows#2002

Open
ThaminduR wants to merge 1 commit intoasgardeo:mainfrom
ThaminduR:fix/auth-flow-meta-components
Open

Add meta component definitions to bootstrap auth flows#2002
ThaminduR wants to merge 1 commit intoasgardeo:mainfrom
ThaminduR:fix/auth-flow-meta-components

Conversation

@ThaminduR
Copy link
Copy Markdown
Contributor

@ThaminduR ThaminduR commented Mar 28, 2026

Purpose

Add structured UI meta component definitions to all bootstrap authentication flow JSON files. This adds form layout metadata (input fields, buttons, dividers, text elements) to the PROMPT steps, enabling the frontend to render login forms from the flow definitions.

Approach

Added meta.components sections to each PROMPT step in the following bootstrap auth flows:

  • auth_flow_basic_github.json
  • auth_flow_basic_google.json
  • auth_flow_basic_google_github.json
  • auth_flow_basic_google_github_sms.json
  • auth_flow_google_github.json
  • auth_flow_sms.json

Each meta section defines the UI structure including app logo, heading text, input fields (username, password, OTP), action buttons, dividers, and social login blocks with proper i18n template references.

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features
    • Enhanced authentication forms with visual components including app logos, headings, and improved input field layouts across multiple authentication flows.
    • Added authorization verification step in the authentication process.
    • Updated authentication flow routing with clearer action references and improved control paths for basic authentication scenarios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 28, 2026 04:38
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

📝 Walkthrough

Walkthrough

Six authentication flow configuration files were enhanced with UI component definitions for visual elements (logos, headings, input fields, action buttons) and updated action routing. A new authorization_check task execution node using AuthorizationExecutor was inserted between basic authentication and assertion steps, introducing an additional validation layer in the authentication flow.

Changes

Cohort / File(s) Summary
Basic + Social Auth Flows
backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_github.json, auth_flow_basic_google.json, auth_flow_basic_google_github.json
Added UI meta.components to choose_auth prompt with logo, heading, input fields (username/password), and semantic action buttons. Updated prompt action routing with named action IDs (action_basic, action_google, action_github). Inserted new authorization_check node using AuthorizationExecutor between basic_auth and auth_assert. Updated basic_auth outcomes to route success to authorization_check and incomplete back to choose_auth.
Multi-Factor Auth Flow
auth_flow_basic_google_github_sms.json
Enhanced choose_auth, prompt_mobile, and prompt_otp nodes with meta.components UI (logo, headings, labeled inputs, submit actions with localization strings). Renamed action/input refs from generic IDs to semantic names (action_basic, action_sms, input_mobile, input_otp). Added authorization_check node routing basic auth success through authorization validation before SMS flow. Updated SMS/OTP prompt mappings to use new semantic component references.
Social Only Auth Flow
auth_flow_google_github.json
Added meta.components UI definition to choose_auth prompt with logo, heading, and Google/GitHub submit action buttons. Updated prompt action refs to semantic IDs (action_google, action_github) matching control flow targets.
SMS Only Auth Flow
auth_flow_sms.json
Added meta.components to prompt_mobile and prompt_otp nodes with logo, heading, and input/submit action blocks. Updated prompt input and action refs from generic IDs to semantic names (input_mobile, input_otp, action_send_sms, action_verify_otp).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • darshanasbg
  • senthalan
  • ThaminduDilshan

Poem

🐰 Hops through auth flows, both old and new,
Adding checks and UI components too!
Where logos shine and inputs align,
Authorization guards the precious sign!
A safer path through GitHub and SMS divine,
All wrapped in flows so beautifully fine!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding meta component definitions to bootstrap authentication flow files.
Description check ✅ Passed The description covers the purpose, approach, and addresses most required checklist items, though some testing and documentation checkboxes remain unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

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 updates the bootstrap authentication flow definitions to include structured meta.components for PROMPT nodes so the frontend can render form layouts directly from flow JSON.

Changes:

  • Added meta.components UI definitions (image/text/blocks/actions/dividers) to PROMPT nodes in multiple bootstrap auth flows.
  • Updated PROMPT input/action ref values to align with the newly introduced component IDs.
  • Introduced an AuthorizationExecutor step after BasicAuthExecutor in some “basic + social” bootstrap flows.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backend/cmd/server/bootstrap/flows/authentication/auth_flow_sms.json Adds meta-driven UI layout for mobile number + OTP prompt steps.
backend/cmd/server/bootstrap/flows/authentication/auth_flow_google_github.json Adds meta-driven UI layout for choosing between Google/GitHub auth actions.
backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github_sms.json Adds meta-driven UI layout for choose-auth + SMS prompts; also adjusts execution graph with an authorization step.
backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github.json Adds meta-driven UI layout and aligns prompt refs; adds authorization step after basic auth.
backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google.json Adds meta-driven UI layout and aligns prompt refs; adds authorization step after basic auth.
backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_github.json Adds meta-driven UI layout and aligns prompt refs; adds authorization step after basic auth.

"executor": {
"name": "AuthorizationExecutor"
},
"onSuccess": "send_sms"
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

In this flow, authorization_check routes to send_sms, which makes the BasicAuth path trigger the SMS OTP send step (and potentially require a mobile number) instead of proceeding to auth_assert like the other authentication options. If SMS is meant to be an optional auth method (selected via action_sms), authorization_check.onSuccess should point to auth_assert (or, if SMS is intended as a second factor, route to the correct PROMPT node and ensure task onIncomplete is configured).

Suggested change
"onSuccess": "send_sms"
"onSuccess": "auth_assert"

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +102
"type": "ACTION",
"id": "action_google",
"label": "{{ t(signin:forms.choose_auth_method.actions.google.label) }}",
"variant": "SECONDARY",
"eventType": "SUBMIT"
}
]
},
{
"type": "BLOCK",
"id": "block_github",
"components": [
{
"type": "ACTION",
"id": "action_github",
"label": "{{ t(signin:forms.choose_auth_method.actions.github.label) }}",
"variant": "SECONDARY",
"eventType": "SUBMIT"
}
]
},
{
"type": "BLOCK",
"id": "block_sms",
"components": [
{
"type": "ACTION",
"id": "action_sms",
"label": "{{ t(signin:forms.choose_auth_method.actions.sms.label) }}",
"variant": "SECONDARY",
"eventType": "SUBMIT"
}
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The new i18n keys used for the social login button labels (e.g., signin:forms.choose_auth_method.actions.google.label / ...actions.github.label / ...actions.sms.label) are not present in the bootstrap translations (backend/cmd/server/bootstrap/i18n/en-US.json). Add these translation entries or adjust the template references to existing keys, otherwise the UI will render missing/fallback text.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +32
"align": "center",
"type": "TEXT",
"id": "text_mobile",
"label": "{{ t(signin:forms.mobile_number.title) }}",
"variant": "HEADING_1"
},
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The SMS prompt meta uses i18n keys like signin:forms.mobile_number.* / signin:forms.otp.*, but these keys are not present in the bootstrap translations (backend/cmd/server/bootstrap/i18n/en-US.json). Add the missing translations or change the template references so the UI doesn't render fallback/missing text.

Copilot uses AI. Check for mistakes.
Comment on lines +37 to +56
{
"type": "ACTION",
"id": "action_google",
"label": "{{ t(signin:forms.choose_auth_method.actions.google.label) }}",
"variant": "PRIMARY",
"eventType": "SUBMIT"
}
]
},
{
"type": "BLOCK",
"id": "block_github",
"components": [
{
"type": "ACTION",
"id": "action_github",
"label": "{{ t(signin:forms.choose_auth_method.actions.github.label) }}",
"variant": "SECONDARY",
"eventType": "SUBMIT"
}
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The meta button labels reference i18n keys signin:forms.choose_auth_method.actions.google.label and ...actions.github.label, but those keys are not defined in the bootstrap translations (backend/cmd/server/bootstrap/i18n/en-US.json). Add these translation entries or adjust to existing keys to avoid missing/fallback labels in the rendered UI.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.77%. Comparing base (1b7a0eb) to head (e7ebaa1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2002   +/-   ##
=======================================
  Coverage   89.77%   89.77%           
=======================================
  Files         867      867           
  Lines       57471    57471           
=======================================
+ Hits        51592    51593    +1     
+ Misses       4347     4345    -2     
- Partials     1532     1533    +1     
Flag Coverage Δ
backend-integration-postgres 48.91% <ø> (ø)
backend-integration-sqlite 48.86% <ø> (ø)
backend-unit 84.95% <ø> (+<0.01%) ⬆️
frontend-apps-console-unit 91.11% <ø> (-0.01%) ⬇️
frontend-apps-gate-unit 97.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_github.json`:
- Around line 116-126: The "authorization_check" TASK_EXECUTION node only
defines "onSuccess" but needs an explicit failure transition so transient
AuthorizationExecutor failures don't halt the flow; add an "onFailure" field to
the node with a target (e.g., "choose_auth") so failures route back to the
authentication choice/retry path instead of stopping the flow, leaving
"onSuccess": "auth_assert" and the executor name "AuthorizationExecutor"
unchanged.

In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github_sms.json`:
- Around line 154-164: The "authorization_check" TASK_EXECUTION using
AuthorizationExecutor only defines "onSuccess": "send_sms" and lacks an explicit
failure path, so add an "onFailure" field on the "authorization_check" node that
routes to a proper failure node (either an existing error/rollback node in the
flow such as "choose_auth" or create a new
"authorization_failed"/"authentication_failed" node) so the flow does not halt
on task failure; update the "authorization_check" entry to include the
"onFailure" mapping and implement the new failure node if needed to handle
cleanup/logging and user feedback.

In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github.json`:
- Around line 135-145: The flow node "authorization_check" that executes
AuthorizationExecutor lacks an onFailure path, so failures halt the flow; update
the "authorization_check" node to include an "onFailure" property pointing to a
dedicated failure handler (e.g., "authorization_failed" or "auth_failure") and
ensure that target node exists (create a TASK/ERROR node like
"authorization_failed" that handles logging, cleanup, and transitions to a
user-facing error or retry step). Ensure the executor remains
"AuthorizationExecutor" and only add the "onFailure" mapping so failures follow
a controlled path.

In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google.json`:
- Around line 116-126: The authorization_check TASK_EXECUTION node using
AuthorizationExecutor lacks a failure path; update the node (id
"authorization_check", executor "AuthorizationExecutor") to include explicit
branches for failure conditions (e.g., add "onFailure" and/or "onError") that
route to an appropriate recovery or view state such as "choose_auth" or a new
"auth_failure" node so unauthenticated or service-failure results are handled
instead of terminating the flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ef6ee9b4-5cc9-4c10-9095-7efe4a9bca10

📥 Commits

Reviewing files that changed from the base of the PR and between 1b7a0eb and e7ebaa1.

📒 Files selected for processing (6)
  • backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_github.json
  • backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google.json
  • backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github.json
  • backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github_sms.json
  • backend/cmd/server/bootstrap/flows/authentication/auth_flow_google_github.json
  • backend/cmd/server/bootstrap/flows/authentication/auth_flow_sms.json

Comment on lines +116 to 126
"onSuccess": "authorization_check",
"onIncomplete": "choose_auth"
},
{
"id": "authorization_check",
"type": "TASK_EXECUTION",
"executor": {
"name": "AuthorizationExecutor"
},
"onSuccess": "auth_assert"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add an explicit failure path for authorization_check.

This new node only handles onSuccess, but AuthorizationExecutor can fail. Without an onFailure route, transient authz errors turn into a hard stop in the authentication flow.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_github.json`
around lines 116 - 126, The "authorization_check" TASK_EXECUTION node only
defines "onSuccess" but needs an explicit failure transition so transient
AuthorizationExecutor failures don't halt the flow; add an "onFailure" field to
the node with a target (e.g., "choose_auth") so failures route back to the
authentication choice/retry path instead of stopping the flow, leaving
"onSuccess": "auth_assert" and the executor name "AuthorizationExecutor"
unchanged.

Comment on lines +154 to 164
"onSuccess": "authorization_check",
"onIncomplete": "choose_auth"
},
{
"id": "authorization_check",
"type": "TASK_EXECUTION",
"executor": {
"name": "AuthorizationExecutor"
},
"onSuccess": "send_sms"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add an explicit failure path for authorization_check.

The new AuthorizationExecutor step only wires onSuccess. If authorization lookup fails, this branch has no configured failure node and the authentication flow stops on the failed task.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github_sms.json`
around lines 154 - 164, The "authorization_check" TASK_EXECUTION using
AuthorizationExecutor only defines "onSuccess": "send_sms" and lacks an explicit
failure path, so add an "onFailure" field on the "authorization_check" node that
routes to a proper failure node (either an existing error/rollback node in the
flow such as "choose_auth" or create a new
"authorization_failed"/"authentication_failed" node) so the flow does not halt
on task failure; update the "authorization_check" entry to include the
"onFailure" mapping and implement the new failure node if needed to handle
cleanup/logging and user feedback.

Comment on lines +135 to 145
"onSuccess": "authorization_check",
"onIncomplete": "choose_auth"
},
{
"id": "authorization_check",
"type": "TASK_EXECUTION",
"executor": {
"name": "AuthorizationExecutor"
},
"onSuccess": "auth_assert"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add an explicit failure path for authorization_check.

AuthorizationExecutor is not success-only. If it returns FAILURE, this node has no onFailure target, so the flow stops on a failed task instead of taking a controlled error path.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google_github.json`
around lines 135 - 145, The flow node "authorization_check" that executes
AuthorizationExecutor lacks an onFailure path, so failures halt the flow; update
the "authorization_check" node to include an "onFailure" property pointing to a
dedicated failure handler (e.g., "authorization_failed" or "auth_failure") and
ensure that target node exists (create a TASK/ERROR node like
"authorization_failed" that handles logging, cleanup, and transitions to a
user-facing error or retry step). Ensure the executor remains
"AuthorizationExecutor" and only add the "onFailure" mapping so failures follow
a controlled path.

Comment on lines +116 to 126
"onSuccess": "authorization_check",
"onIncomplete": "choose_auth"
},
{
"id": "authorization_check",
"type": "TASK_EXECUTION",
"executor": {
"name": "AuthorizationExecutor"
},
"onSuccess": "auth_assert"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add an explicit failure path for authorization_check.

AuthorizationExecutor can return FAILURE when the user is unauthenticated or the authz service call fails. This node only handles onSuccess, so those cases currently end as a failed task with no configured branch or recovery view.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@backend/cmd/server/bootstrap/flows/authentication/auth_flow_basic_google.json`
around lines 116 - 126, The authorization_check TASK_EXECUTION node using
AuthorizationExecutor lacks a failure path; update the node (id
"authorization_check", executor "AuthorizationExecutor") to include explicit
branches for failure conditions (e.g., add "onFailure" and/or "onError") that
route to an appropriate recovery or view state such as "choose_auth" or a new
"auth_failure" node so unauthenticated or service-failure results are handled
instead of terminating the flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants