Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trusted app UI from connections pages #6909

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -102,15 +102,15 @@
OTP_LENGTH_MIN_LENGTH: number;
OTP_LENGTH_MIN_VALUE: number;
} = {
EXPIRY_TIME_MAX_LENGTH: 10000,

Check warning on line 105 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
EXPIRY_TIME_MAX_VALUE: 1440,

Check warning on line 106 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
EXPIRY_TIME_MIN_LENGTH: 1,

Check warning on line 107 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
EXPIRY_TIME_MIN_VALUE: 1,

Check warning on line 108 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
OTP_LENGTH_MAX_LENGTH: 2,

Check warning on line 109 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
OTP_LENGTH_MAX_VALUE: 10,

Check warning on line 110 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
OTP_LENGTH_MIN_LENGTH: 1,

Check warning on line 111 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
OTP_LENGTH_MIN_VALUE: 4

Check warning on line 112 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
};

Check warning on line 113 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 4 spaces but found 8

/**
* SMS OTP Authenticator Settings Form element constraints.
Expand Down Expand Up @@ -158,7 +158,7 @@
TEAM_ID_MAX_LENGTH: number,
TEAM_ID_MIN_LENGTH: number
} = {
ADDITIONAL_QUERY_PARAMS_MAX_LENGTH: 1000,

Check warning on line 161 in features/admin.connections.v1/constants/connection-ui-constants.ts

View workflow job for this annotation

GitHub Actions / ⬣ ESLint (STATIC ANALYSIS) (lts/*, 8.7.4)

Expected indentation of 8 spaces but found 12
ADDITIONAL_QUERY_PARAMS_MIN_LENGTH: 0,
KEY_ID_MAX_LENGTH: 10,
KEY_ID_MIN_LENGTH: 10,
Expand Down Expand Up @@ -215,8 +215,6 @@
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 @@
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
Loading