From 6d26ecfa4ddf32e63d4103bcb04994bc0e18c43d Mon Sep 17 00:00:00 2001 From: sahandilshan Date: Thu, 14 Nov 2024 19:19:54 +0530 Subject: [PATCH 1/3] Ingore regex pattern matching for inbound OAuth apps --- .../components/forms/inbound-oidc-form.tsx | 2 +- .../oauth-protocol-settings-wizard-form.tsx | 10 ++----- modules/core/src/utils/url-utils.ts | 30 ++++++++++--------- .../src/components/input/url-input.tsx | 4 +-- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx b/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx index b21044de0ff..77e76c956b7 100644 --- a/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx +++ b/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx @@ -1962,7 +1962,7 @@ export const InboundOIDCForm: FunctionComponent = return false; } if (URLUtils.isURLValid(value)) { - if (URLUtils.isHttpUrl(value) || URLUtils.isHttpsUrl(value)) { + if (URLUtils.isHttpUrl(value, false) || URLUtils.isHttpsUrl(value, false)) { setCallbackURLsErrorLabel(null); return true; diff --git a/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx b/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx index 87cf3db023d..68c40bba2e6 100644 --- a/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx +++ b/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx @@ -543,14 +543,8 @@ export const OauthProtocolSettingsWizardForm: FunctionComponent = ( const resolveCORSStatusLabel = (url: string) => { const { origin, href } = URLUtils.urlComponents(url); const positive: boolean = isOriginIsKnownAndAllowed(url); - const isValid: boolean = (URLUtils.isURLValid(url, true) && (URLUtils.isHttpUrl(url) || - URLUtils.isHttpsUrl(url))); + const isValid: boolean = (URLUtils.isURLValid(url, true) && (URLUtils.isHttpUrl(url, false) || + URLUtils.isHttpsUrl(url, false))); /** * TODO : React Components should not depend on the product From 0aa67a3a27a278b5f323d669baa6729c9905c33a Mon Sep 17 00:00:00 2001 From: sahandilshan Date: Thu, 14 Nov 2024 19:31:19 +0530 Subject: [PATCH 2/3] Fix lint issues --- .../components/wizard/oauth-protocol-settings-wizard-form.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx b/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx index 68c40bba2e6..2229b6ff8d5 100644 --- a/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx +++ b/features/admin.applications.v1/components/wizard/oauth-protocol-settings-wizard-form.tsx @@ -21,7 +21,6 @@ import { TestableComponentInterface } from "@wso2is/core/models"; import { URLUtils } from "@wso2is/core/utils"; import { Field, FormValue, Forms } from "@wso2is/forms"; import { ContentLoader, Hint, LinkButton, Message, URLInput } from "@wso2is/react-components"; -import { FormValidation } from "@wso2is/validation"; import intersection from "lodash-es/intersection"; import isEmpty from "lodash-es/isEmpty"; import React, { FunctionComponent, ReactElement, useEffect, useState } from "react"; From 0aca53b8d7f18b9d8488911500b86c7178eb9be6 Mon Sep 17 00:00:00 2001 From: sahandilshan Date: Fri, 15 Nov 2024 13:46:29 +0530 Subject: [PATCH 3/3] =?UTF-8?q?Add=20changeset=20=F0=9F=A6=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/cold-doors-brush.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/cold-doors-brush.md diff --git a/.changeset/cold-doors-brush.md b/.changeset/cold-doors-brush.md new file mode 100644 index 00000000000..0d18bc4ea52 --- /dev/null +++ b/.changeset/cold-doors-brush.md @@ -0,0 +1,7 @@ +--- +"@wso2is/admin.applications.v1": patch +"@wso2is/react-components": patch +"@wso2is/core": patch +--- + +Ingore regex pattern matching for inbound OAuth apps