Construct commonauth URL with tenant qualified organization path in the sub organization connection creation#10094
Conversation
📝 WalkthroughWalkthroughAdds a new Changes
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
99e6827 to
69c52f2
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/console/src/init/app-utils.ts (1)
269-269: Add a defensive default fororganizationsin the exported config.This field can be
undefinedon older/custom deployment configs. Defaulting it here avoids downstream null-access risk in consumers ofdeployment.organizations.connections.♻️ Suggested patch
- organizations: _config.organizations, + organizations: _config.organizations ?? { + connections: { + useTenantQualifiedOrgPatternCommonauth: false + } + },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/console/src/init/app-utils.ts` at line 269, Exported config's organizations can be undefined on older deployments; change the assignment for organizations in the exported config (the line currently "organizations: _config.organizations") to provide a defensive default (e.g., use nullish coalescing to default to an empty object) so downstream access like deployment.organizations.connections won't throw.features/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsx (1)
303-310: Consider extracting common URL construction to a shared utility.The tenant-qualified commonauth URL construction logic is duplicated between this wizard and the SAML authenticator form (
saml-authenticator-form.tsx:250-254). Consider extracting this to a shared utility function inconnection-utils.tsto maintain consistency and reduce duplication.// Example utility function signature export const getCommonAuthUrl = ( config: ConfigReducerStateInterface, currentOrganizationId: string, isSubOrg: boolean ): string => { return isSubOrg && config?.deployment?.organizations?.connections?.useTenantQualifiedOrgPatternCommonauth ? `${config?.deployment?.serverOrigin}/t/${config?.deployment?.tenant}/${config?.deployment?.organizationPrefix}/${currentOrganizationId}/commonauth` : `${config?.deployment?.customServerHost}/commonauth`; };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@features/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsx` around lines 303 - 310, The callbackUrl construction is duplicated (in enterprise-connection-create-wizard.tsx and saml-authenticator-form.tsx); extract the logic into a shared utility (e.g., add getCommonAuthUrl in connection-utils.ts) that accepts (config, currentOrganizationId, isSubOrg) and returns the tenant-qualified or customServerHost commonauth URL, then replace the inline ternary in enterpriseConnectionCreateWizard (and the SAML form) to call getCommonAuthUrl to remove duplication and ensure consistent URL formation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/console/src/init/app-utils.ts`:
- Line 269: Exported config's organizations can be undefined on older
deployments; change the assignment for organizations in the exported config (the
line currently "organizations: _config.organizations") to provide a defensive
default (e.g., use nullish coalescing to default to an empty object) so
downstream access like deployment.organizations.connections won't throw.
In
`@features/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsx`:
- Around line 303-310: The callbackUrl construction is duplicated (in
enterprise-connection-create-wizard.tsx and saml-authenticator-form.tsx);
extract the logic into a shared utility (e.g., add getCommonAuthUrl in
connection-utils.ts) that accepts (config, currentOrganizationId, isSubOrg) and
returns the tenant-qualified or customServerHost commonauth URL, then replace
the inline ternary in enterpriseConnectionCreateWizard (and the SAML form) to
call getCommonAuthUrl to remove duplication and ensure consistent URL formation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: b1a906c9-25a2-417a-8024-2ede8b3e68f8
📒 Files selected for processing (7)
apps/console/java/org.wso2.identity.apps.console.server.feature/resources/deployment.config.json.j2apps/console/src/init/app-utils.tsapps/console/src/public/deployment.config.jsonfeatures/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsxfeatures/admin.connections.v1/components/edit/forms/authenticators/saml-authenticator-form.tsxfeatures/admin.core.v1/configs/app.tsmodules/core/src/models/config.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/large-toys-whisper.md:
- Line 7: Update the release-note sentence that currently reads "Construct
commonauth URL with tenant qualified organization path in the sub organization
connection creation" to use hyphenated compounds for clarity: change it to
"Construct commonauth URL with tenant-qualified organization path in the
sub-organization connection creation" so both "tenant-qualified" and
"sub-organization" are hyphenated; edit the phrase in
.changeset/large-toys-whisper.md accordingly.
🪄 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: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 4e4da61e-cb4c-44cf-9e44-c68b3f4dc424
📒 Files selected for processing (8)
.changeset/large-toys-whisper.mdapps/console/java/org.wso2.identity.apps.console.server.feature/resources/deployment.config.json.j2apps/console/src/init/app-utils.tsapps/console/src/public/deployment.config.jsonfeatures/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsxfeatures/admin.connections.v1/components/edit/forms/authenticators/saml-authenticator-form.tsxfeatures/admin.core.v1/configs/app.tsmodules/core/src/models/config.ts
✅ Files skipped from review due to trivial changes (1)
- apps/console/src/public/deployment.config.json
🚧 Files skipped from review as they are similar to previous changes (5)
- apps/console/src/init/app-utils.ts
- apps/console/java/org.wso2.identity.apps.console.server.feature/resources/deployment.config.json.j2
- modules/core/src/models/config.ts
- features/admin.connections.v1/components/edit/forms/authenticators/saml-authenticator-form.tsx
- features/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsx
| "@wso2is/admin.core.v1": patch | ||
| --- | ||
|
|
||
| Construct commonauth URL with tenant qualified organization path in the sub organization connection creation |
There was a problem hiding this comment.
Polish release-note wording with hyphenation.
Line 7 should use hyphenated compounds for readability: tenant-qualified and sub-organization.
✍️ Suggested text tweak
-Construct commonauth URL with tenant qualified organization path in the sub organization connection creation
+Construct commonauth URL with tenant-qualified organization path in the sub-organization connection creation📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Construct commonauth URL with tenant qualified organization path in the sub organization connection creation | |
| Construct commonauth URL with tenant-qualified organization path in the sub-organization connection creation |
🧰 Tools
🪛 LanguageTool
[grammar] ~7-~7: Use a hyphen to join words.
Context: ...t qualified organization path in the sub organization connection creation
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.changeset/large-toys-whisper.md at line 7, Update the release-note sentence
that currently reads "Construct commonauth URL with tenant qualified
organization path in the sub organization connection creation" to use hyphenated
compounds for clarity: change it to "Construct commonauth URL with
tenant-qualified organization path in the sub-organization connection creation"
so both "tenant-qualified" and "sub-organization" are hyphenated; edit the
phrase in .changeset/large-toys-whisper.md accordingly.
69c52f2 to
6cfc6b9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10094 +/- ##
=======================================
Coverage 56.05% 56.05%
=======================================
Files 42 42
Lines 1024 1024
Branches 254 247 -7
=======================================
Hits 574 574
+ Misses 450 416 -34
- Partials 0 34 +34
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| "organizations": { | ||
| "connections": { | ||
| "useTenantQualifiedOrgPatternCommonauth": {{ console.organizations.connections.use_tenant_qualified_org_pattern_commonauth | default(false) }} |
There was a problem hiding this comment.
Let's add this under organizations feature config as properties.
…he sub organization connection creation
6cfc6b9 to
18633df
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.changeset/large-toys-whisper.md (1)
7-7:⚠️ Potential issue | 🟡 MinorHyphenate compound terms in the release note.
Please use
tenant-qualifiedandsub-organizationfor readability and consistency.✍️ Suggested edit
-Construct commonauth URL with tenant qualified organization path in the sub organization connection creation +Construct commonauth URL with tenant-qualified organization path in the sub-organization connection creation🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.changeset/large-toys-whisper.md at line 7, Update the release note sentence that starts with "Construct commonauth URL with tenant qualified organization path in the sub organization connection creation" to hyphenate compound terms for consistency: change "tenant qualified" to "tenant-qualified" and "sub organization" to "sub-organization" so the text reads "Construct commonauth URL with tenant-qualified organization path in the sub-organization connection creation".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.changeset/large-toys-whisper.md:
- Line 7: Update the release note sentence that starts with "Construct
commonauth URL with tenant qualified organization path in the sub organization
connection creation" to hyphenate compound terms for consistency: change "tenant
qualified" to "tenant-qualified" and "sub organization" to "sub-organization" so
the text reads "Construct commonauth URL with tenant-qualified organization path
in the sub-organization connection creation".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 48c18487-8c1f-4520-bc69-39495a3ced2b
📒 Files selected for processing (7)
.changeset/large-toys-whisper.mdapps/console/java/org.wso2.identity.apps.console.server.feature/resources/deployment.config.json.j2apps/console/src/init/app-utils.tsapps/console/src/public/deployment.config.jsonfeatures/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsxfeatures/admin.connections.v1/components/edit/forms/authenticators/saml-authenticator-form.tsxfeatures/admin.core.v1/configs/app.ts
✅ Files skipped from review due to trivial changes (3)
- apps/console/java/org.wso2.identity.apps.console.server.feature/resources/deployment.config.json.j2
- apps/console/src/public/deployment.config.json
- features/admin.connections.v1/components/create/enterprise-connection-create-wizard.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/console/src/init/app-utils.ts
- features/admin.connections.v1/components/edit/forms/authenticators/saml-authenticator-form.tsx


Purpose
Related Issues
Related PRs
Checklist
Security checks
Developer Checklist (Mandatory)
product-isissue to track any behavioral change or migration impact.