Skip to content

Commit

Permalink
Merge pull request #6909 from ImalshaG/remove-ta
Browse files Browse the repository at this point in the history
Remove trusted app UI from connections pages
  • Loading branch information
ImalshaG authored Sep 24, 2024
2 parents 352e90e + 1bd5448 commit 35be862
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 1,502 deletions.
9 changes: 9 additions & 0 deletions .changeset/spotty-apples-cry.md
Original file line number Diff line number Diff line change
@@ -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 trusted app related UI from connection pages
1 change: 0 additions & 1 deletion features/admin.connections.v1/configs/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ export class ConnectionUIConstants {
CONNECTION_JIT_PROVISIONING_UPDATE_ERROR: string;
FIDO_AUTHENTICATOR_CONFIG_UPDATE_ERROR: string;
FIDO_AUTHENTICATOR_CONFIG_UPDATE_INVALID_STATUS_CODE_ERROR: string;
FIDO_TRUSTED_APPS_UPDATE_ERROR: string;
FIDO_TRUSTED_APPS_UPDATE_INVALID_STATUS_CODE_ERROR: string;
IDENTITY_PROVIDER_TEMPLATES_LIST_FETCH_ERROR: string;
IDENTITY_PROVIDER_TEMPLATES_LIST_FETCH_INVALID_STATUS_CODE_ERROR: string;
LOCAL_AUTHENTICATORS_FETCH_ERROR: string;
Expand All @@ -239,8 +237,6 @@ export class ConnectionUIConstants {
CONNECTION_JIT_PROVISIONING_UPDATE_ERROR: "An error occurred while updating the JIT provisioning configurations of the connection.",
FIDO_AUTHENTICATOR_CONFIG_UPDATE_ERROR: "An error occurred while updating the Passkey connector configs.",
FIDO_AUTHENTICATOR_CONFIG_UPDATE_INVALID_STATUS_CODE_ERROR: "Received an invalid status code while updating the Passkey connector configs.",
FIDO_TRUSTED_APPS_UPDATE_ERROR: "An error occurred while updating the Passkey trusted apps.",
FIDO_TRUSTED_APPS_UPDATE_INVALID_STATUS_CODE_ERROR: "Received an invalid status code while updating the Passkey trusted apps.",
IDENTITY_PROVIDER_TEMPLATES_LIST_FETCH_ERROR: "An error occurred while fetching the required connection templates list.",
IDENTITY_PROVIDER_TEMPLATES_LIST_FETCH_INVALID_STATUS_CODE_ERROR: "Received an invalid status code while fetching connection templates list.",
LOCAL_AUTHENTICATORS_FETCH_ERROR: "An error occurred while fetching the local authenticators.",
Expand Down
1 change: 0 additions & 1 deletion features/admin.connections.v1/models/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export interface ConnectionResourceEndpointsInterface {
authenticatorTags: string;
extensions: string;
fidoConfigs: string;
fidoTrustedApps: string;
identityProviders: string;
localAuthenticators: string;
multiFactorAuthenticators: string;
Expand Down
1 change: 0 additions & 1 deletion features/admin.core.v1/store/reducers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export const commonConfigReducerInitialState: CommonConfigReducerStateInterface<
extensions: "",
externalClaims: "",
fidoConfigs: "",
fidoTrustedApps: "",
getSecret: "",
getSecretList: "",
getSecretType: "",
Expand Down
1 change: 0 additions & 1 deletion features/admin.extensions.v1/configs/identity-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export interface ExtendedSamlConfigInterface {

export interface IdentityProviderConfig {
editIdentityProvider: {
enableFIDOTrustedAppsConfiguration: boolean;
showAdvancedSettings: boolean;
showIssuerSettings: boolean;
showJitProvisioning: boolean;
Expand Down
110 changes: 0 additions & 110 deletions features/admin.identity-providers.v1/api/fido-trusted-apps.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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";
Expand All @@ -32,8 +32,6 @@ 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 {
CommonAuthenticatorFormFieldMetaInterface,
CommonAuthenticatorFormInitialValuesInterface,
Expand All @@ -44,7 +42,7 @@ import {
FIDOAuthenticatorFormPropsInterface,
FIDOConfigsInterface,
FIDOConnectorConfigsAttributeInterface
} from "../../../../models";
} from "../../../models";

const FORM_ID: string = "fido-authenticator-form";

Expand Down Expand Up @@ -81,7 +79,6 @@ export const FIDOAuthenticatorForm: FunctionComponent<FIDOAuthenticatorFormProps
] = useState<boolean>(undefined);
const [ isReadOnly ] = useState<boolean>(isSubOrganization() || readOnly);
const [ isFIDOConfigsSubmitting, setIsFIDOConfigsSubmitting ] = useState<boolean>(false);
const [ isFIDOTrustedAppsSubmitting, setIsFIDOTrustedAppsSubmitting ] = useState<boolean>(false);
const [ FIDOTrustedOrigins, setFIDOTrustedOrigins ] = useState<string>("");

const {
Expand Down Expand Up @@ -245,8 +242,6 @@ export const FIDOAuthenticatorForm: FunctionComponent<FIDOAuthenticatorFormProps
.finally(() => setIsFIDOConfigsSubmitting(false));
};

let updateTrustedApps: (callback: () => void) => void;

/**
* Prepare form values for submitting.
*
Expand All @@ -260,11 +255,6 @@ export const FIDOAuthenticatorForm: FunctionComponent<FIDOAuthenticatorFormProps
updateFIDOConnectorConfigs();
}

if (identityProviderConfig?.editIdentityProvider?.enableFIDOTrustedAppsConfiguration) {
setIsFIDOTrustedAppsSubmitting(true);
updateTrustedApps(() => setIsFIDOTrustedAppsSubmitting(false));
}

const properties: CommonPluggableComponentPropertyInterface[] = [];

for (const [ name, value ] of Object.entries(values)) {
Expand Down Expand Up @@ -408,28 +398,15 @@ export const FIDOAuthenticatorForm: FunctionComponent<FIDOAuthenticatorFormProps
readOnly={ isReadOnly }
/>)
}

{
identityProviderConfig?.editIdentityProvider?.enableFIDOTrustedAppsConfiguration && !isSubOrganization()
? (
<FIDOTrustedApps
readOnly={ isReadOnly }
triggerSubmission={ (submitFunction: (callback: () => void) => void) => {
updateTrustedApps = submitFunction;
} }
/>
)
: null
}
<Field.Button
form={ FORM_ID }
size="small"
buttonType="primary_btn"
ariaLabel="FIDO authenticator update button"
name="update-button"
data-testid={ `${ testId }-submit-button` }
disabled={ isSubmitting || isFIDOConfigsSubmitting || isFIDOTrustedAppsSubmitting }
loading={ isSubmitting || isFIDOConfigsSubmitting || isFIDOTrustedAppsSubmitting }
disabled={ isSubmitting || isFIDOConfigsSubmitting }
loading={ isSubmitting || isFIDOConfigsSubmitting }
label={ t("common:update") }
hidden={ isReadOnly }
/>
Expand Down

This file was deleted.

Loading

0 comments on commit 35be862

Please sign in to comment.