diff --git a/.changeset/tall-beers-press.md b/.changeset/tall-beers-press.md new file mode 100644 index 00000000000..b527e9e2121 --- /dev/null +++ b/.changeset/tall-beers-press.md @@ -0,0 +1,9 @@ +--- +"@wso2is/admin.identity-providers.v1": patch +"@wso2is/admin.connections.v1": patch +"@wso2is/admin.extensions.v1": patch +"@wso2is/admin.core.v1": patch +"@wso2is/i18n": patch +--- + +Remove deprecated trusted apps UI diff --git a/features/admin.connections.v1/configs/endpoints.ts b/features/admin.connections.v1/configs/endpoints.ts index f9d8aaf009f..9df4714d4c9 100644 --- a/features/admin.connections.v1/configs/endpoints.ts +++ b/features/admin.connections.v1/configs/endpoints.ts @@ -32,7 +32,6 @@ export const getConnectionResourceEndpoints = (serverHost: string): ConnectionRe authenticators: `${ serverHost }/api/server/v1/authenticators`, extensions: `${ serverHost }/api/server/v1/extensions`, fidoConfigs: `${ serverHost }/api/identity/config-mgt/v1.0/resource/fido-config`, - fidoTrustedApps: `${ serverHost }/fido/trusted-apps-mgt`, identityProviders: `${ serverHost }/api/server/v1/identity-providers`, localAuthenticators: `${ serverHost }/api/server/v1/configs/authenticators`, multiFactorAuthenticators: `${ serverHost }/api/server/v1/identity-governance/${ diff --git a/features/admin.connections.v1/models/endpoints.ts b/features/admin.connections.v1/models/endpoints.ts index 1e1e68fcd92..89385c3d998 100644 --- a/features/admin.connections.v1/models/endpoints.ts +++ b/features/admin.connections.v1/models/endpoints.ts @@ -24,7 +24,6 @@ export interface ConnectionResourceEndpointsInterface { authenticatorTags: string; extensions: string; fidoConfigs: string; - fidoTrustedApps: string; identityProviders: string; localAuthenticators: string; multiFactorAuthenticators: string; diff --git a/features/admin.core.v1/store/reducers/config.ts b/features/admin.core.v1/store/reducers/config.ts index d87ee6379a3..f15944defae 100644 --- a/features/admin.core.v1/store/reducers/config.ts +++ b/features/admin.core.v1/store/reducers/config.ts @@ -112,7 +112,6 @@ export const commonConfigReducerInitialState: CommonConfigReducerStateInterface< extensions: "", externalClaims: "", fidoConfigs: "", - fidoTrustedApps: "", getSecret: "", getSecretList: "", getSecretType: "", diff --git a/features/admin.extensions.v1/configs/identity-provider.tsx b/features/admin.extensions.v1/configs/identity-provider.tsx index 5b30413583b..66700d2abca 100644 --- a/features/admin.extensions.v1/configs/identity-provider.tsx +++ b/features/admin.extensions.v1/configs/identity-provider.tsx @@ -38,7 +38,6 @@ import SIWEIdPTemplate from "../identity-provider-templates/templates/swe/swe.js export const identityProviderConfig: IdentityProviderConfig = { editIdentityProvider: { - enableFIDOTrustedAppsConfiguration: false, getOverriddenAuthenticatorForm: ( type: string, templateId: string, diff --git a/features/admin.extensions.v1/configs/models/identity-providers.ts b/features/admin.extensions.v1/configs/models/identity-providers.ts index 8de3eceed72..1c6510d7bb6 100644 --- a/features/admin.extensions.v1/configs/models/identity-providers.ts +++ b/features/admin.extensions.v1/configs/models/identity-providers.ts @@ -36,7 +36,6 @@ export interface ExtendedSamlConfigInterface { export interface IdentityProviderConfig { editIdentityProvider: { - enableFIDOTrustedAppsConfiguration: boolean; showAdvancedSettings: boolean; showIssuerSettings: boolean; showJitProvisioning: boolean; diff --git a/features/admin.identity-providers.v1/api/fido-trusted-apps.ts b/features/admin.identity-providers.v1/api/fido-trusted-apps.ts index 306beebe5cf..e69de29bb2d 100644 --- a/features/admin.identity-providers.v1/api/fido-trusted-apps.ts +++ b/features/admin.identity-providers.v1/api/fido-trusted-apps.ts @@ -1,110 +0,0 @@ -/** - * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react"; -import { ConnectionUIConstants } from "@wso2is/admin.connections.v1/constants/connection-ui-constants"; -import { store } from "@wso2is/admin.core.v1"; -import useRequest, { - RequestConfigInterface, - RequestErrorInterface, - RequestResultInterface -} from "@wso2is/admin.core.v1/hooks/use-request"; -import { IdentityAppsApiException } from "@wso2is/core/exceptions"; -import { HttpMethods } from "@wso2is/core/models"; -import { AxiosError, AxiosResponse } from "axios"; -import { FIDOTrustedAppsResponseInterface } from "../models"; - -/** - * Get an axios instance. - */ -const httpClient: HttpClientInstance = - AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - -/** - * Hook to get the FIDO trusted apps. - * - * @param shouldFetch - Should fetch the data. - * - * @returns FIDO trusted apps list. - */ -export const useFIDOTrustedApps = ( - shouldFetch: boolean = true -): RequestResultInterface => { - - const requestConfig: RequestConfigInterface = { - headers: { - "Accept": "application/json", - "Content-Type": "application/json" - }, - method: HttpMethods.GET, - url: store?.getState()?.config?.endpoints?.fidoTrustedApps - }; - - const { data, error, isValidating, mutate } = useRequest(shouldFetch ? requestConfig : null); - - return { - data, - error: error, - isLoading: !error && !data, - isValidating, - mutate - }; -}; - -/** - * Update the FIDO trusted apps. - * - * @param fidoTrustedApps - List of FIDO Trusted Apps. - * - * @returns Updated FIDO trusted apps list. - */ -export const updateFidoTrustedApps = ( - fidoTrustedApps: FIDOTrustedAppsResponseInterface -): Promise => { - - const requestConfig: RequestConfigInterface = { - data: fidoTrustedApps, - headers: { - "Accept": "application/json", - "Content-Type": "application/json" - }, - method: HttpMethods.PUT, - url: store?.getState()?.config?.endpoints?.fidoTrustedApps - }; - - return httpClient(requestConfig) - .then((response: AxiosResponse) => { - if (response?.status !== 200) { - throw new IdentityAppsApiException( - ConnectionUIConstants.ERROR_MESSAGES.FIDO_TRUSTED_APPS_UPDATE_INVALID_STATUS_CODE_ERROR, - null, - response?.status, - response?.request, - response, - response?.config); - } - }).catch((error: AxiosError) => { - throw new IdentityAppsApiException( - ConnectionUIConstants.ERROR_MESSAGES.FIDO_TRUSTED_APPS_UPDATE_ERROR, - error?.stack, - error?.response?.data?.code, - error?.request, - error?.response, - error?.config); - }); -}; diff --git a/features/admin.identity-providers.v1/components/forms/authenticators/fido-authenticator-forms/fido-authenticator-form.tsx b/features/admin.identity-providers.v1/components/forms/authenticators/fido-authenticator-form.tsx similarity index 92% rename from features/admin.identity-providers.v1/components/forms/authenticators/fido-authenticator-forms/fido-authenticator-form.tsx rename to features/admin.identity-providers.v1/components/forms/authenticators/fido-authenticator-form.tsx index a51f96b360f..c7b7971febd 100644 --- a/features/admin.identity-providers.v1/components/forms/authenticators/fido-authenticator-forms/fido-authenticator-form.tsx +++ b/features/admin.identity-providers.v1/components/forms/authenticators/fido-authenticator-form.tsx @@ -19,6 +19,7 @@ import { ConnectionUIConstants } from "@wso2is/admin.connections.v1/constants/connection-ui-constants"; import { LocalAuthenticatorConstants } from "@wso2is/admin.connections.v1/constants/local-authenticator-constants"; import { identityProviderConfig } from "@wso2is/admin.extensions.v1"; +import { updateFidoConfigs, useFIDOConnectorConfigs } from "@wso2is/admin.identity-providers.v1/api/fido-configs"; import { useGetCurrentOrganizationType } from "@wso2is/admin.organizations.v1/hooks/use-get-organization-type"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; import { AlertLevels } from "@wso2is/core/models"; @@ -32,8 +33,7 @@ import React, { FunctionComponent, ReactElement, useEffect, useMemo, useState } import { Trans, useTranslation } from "react-i18next"; import { useDispatch } from "react-redux"; import { Dispatch } from "redux"; -import { FIDOTrustedApps } from "./fido-trusted-apps"; -import { updateFidoConfigs, useFIDOConnectorConfigs } from "../../../../api/fido-configs"; +import { IdentityProviderManagementConstants } from "../../../constants"; import { CommonAuthenticatorFormFieldMetaInterface, CommonAuthenticatorFormInitialValuesInterface, @@ -44,7 +44,7 @@ import { FIDOAuthenticatorFormPropsInterface, FIDOConfigsInterface, FIDOConnectorConfigsAttributeInterface -} from "../../../../models"; +} from "../../../models"; const FORM_ID: string = "fido-authenticator-form"; @@ -81,7 +81,6 @@ export const FIDOAuthenticatorForm: FunctionComponent(undefined); const [ isReadOnly ] = useState(isSubOrganization() || readOnly); const [ isFIDOConfigsSubmitting, setIsFIDOConfigsSubmitting ] = useState(false); - const [ isFIDOTrustedAppsSubmitting, setIsFIDOTrustedAppsSubmitting ] = useState(false); const [ FIDOTrustedOrigins, setFIDOTrustedOrigins ] = useState(""); const { @@ -207,32 +206,32 @@ export const FIDOAuthenticatorForm: FunctionComponent { - dispatch(addAlert({ + addAlert({ description: t("authenticationProvider:" + "notifications.updateFIDOConnectorConfigs." + "success.description"), level: AlertLevels.SUCCESS, message: t("authenticationProvider:notifications." + "updateFIDOConnectorConfigs.success.message") - })); + }); mutateFIDOConnectorConfigs(); }) .catch((error: IdentityAppsApiException) => { if (error?.response?.data?.description) { - dispatch(addAlert({ + addAlert({ description: t("authenticationProvider:" + "notifications.updateFIDOConnectorConfigs." + "error.description", { description: error.response.data.description }), level: AlertLevels.ERROR, message: t("authenticationProvider:notifications." + "updateFIDOConnectorConfigs.error.message") - })); + }); return; } - dispatch(addAlert({ + addAlert({ description: t("authenticationProvider:" + "notifications.updateFIDOConnectorConfigs." + "genericError.description"), @@ -240,13 +239,11 @@ export const FIDOAuthenticatorForm: FunctionComponent setIsFIDOConfigsSubmitting(false)); }; - let updateTrustedApps: (callback: () => void) => void; - /** * Prepare form values for submitting. * @@ -260,11 +257,6 @@ export const FIDOAuthenticatorForm: FunctionComponent setIsFIDOTrustedAppsSubmitting(false)); - } - const properties: CommonPluggableComponentPropertyInterface[] = []; for (const [ name, value ] of Object.entries(values)) { @@ -405,22 +397,9 @@ export const FIDOAuthenticatorForm: FunctionComponent) } - { - identityProviderConfig?.editIdentityProvider?.enableFIDOTrustedAppsConfiguration && !isSubOrganization() - ? ( - void) => void) => { - updateTrustedApps = submitFunction; - } } - /> - ) - : null - }