diff --git a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx index 67b8b7e202..7a98e49fd0 100644 --- a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx +++ b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx @@ -283,8 +283,7 @@ const ConnectorParametersForm: React.FC = ({ const handleAuthorizeConnectionClick = async ( values: ConnectionConfigFormValues, - // @ts-ignore - props: FormikProps + props: FormikProps ) => { const errors = await props.validateForm(); @@ -296,8 +295,9 @@ const ConnectorParametersForm: React.FC = ({ onAuthorizeConnectionClick(processedValues); }; - // @ts-ignore - const handleTestConnectionClick = async (props: FormikProps) => { + const handleTestConnectionClick = async ( + props: FormikProps + ) => { const errors = await props.validateForm(); if (Object.keys(errors).length > 0) { @@ -318,8 +318,7 @@ const ConnectorParametersForm: React.FC = ({ validateOnBlur={false} validateOnChange={false} > - {/* @ts-ignore */} - {(props: FormikProps) => { + {(props: FormikProps) => { const authorized = !props.dirty && connectionConfig?.authorized; return (
@@ -353,7 +352,9 @@ const ConnectorParametersForm: React.FC = ({ display="flex" isRequired isInvalid={ - props.errors.instance_key && props.touched.instance_key + !!( + props.errors.instance_key && props.touched.instance_key + ) } > {getFormLabel("instance_key", "Integration Identifier")} diff --git a/clients/admin-ui/src/pages/systems/configure/[id].tsx b/clients/admin-ui/src/pages/systems/configure/[id].tsx index d8bb737cdb..c6c4ee970e 100644 --- a/clients/admin-ui/src/pages/systems/configure/[id].tsx +++ b/clients/admin-ui/src/pages/systems/configure/[id].tsx @@ -22,6 +22,8 @@ import { } from "~/features/system"; import EditSystemFlow from "~/features/system/EditSystemFlow"; +const INTEGRATION_TAB_INDEX = 3; // this needs to be updated if the order of the tabs changes + const ConfigureSystem: NextPage = () => { const toast = useToast(); const router = useRouter(); @@ -62,7 +64,7 @@ const ConfigureSystem: NextPage = () => { // replace the current history entry router.replace(newUrl, undefined, { shallow: true }); - setInitialTabIndex(3); + setInitialTabIndex(INTEGRATION_TAB_INDEX); } }, [router, toast]); diff --git a/src/fides/api/api/v1/endpoints/system.py b/src/fides/api/api/v1/endpoints/system.py index cca0a42677..44da346365 100644 --- a/src/fides/api/api/v1/endpoints/system.py +++ b/src/fides/api/api/v1/endpoints/system.py @@ -28,7 +28,7 @@ upsert_system, validate_privacy_declarations, ) -from fides.api.models.connectionconfig import ConnectionConfig +from fides.api.models.connectionconfig import ConnectionConfig, ConnectionType from fides.api.models.sql_models import System # type: ignore[attr-defined] from fides.api.oauth.system_manager_oauth_util import ( verify_oauth_client_for_system_from_fides_key, @@ -160,7 +160,7 @@ def patch_connection_secrets( """ system = get_system(db, fides_key) - connection_config = get_connection_config_or_error( + connection_config: ConnectionConfig = get_connection_config_or_error( db, system.connection_configs.key ) # Inserts unchanged sensitive values. The FE does not send masked values sensitive secrets. @@ -181,7 +181,10 @@ def patch_connection_secrets( # Deauthorize an OAuth connection when the secrets are updated. This is necessary because # the existing access tokens may not be valid anymore. This only applies to SaaS connection # configurations that use the "oauth2_authorization_code" authentication strategy. - if connection_config.authorized: + if ( + connection_config.authorized + and connection_config.connection_type == ConnectionType.saas + ): del connection_config.secrets["access_token"] # Save validated secrets, regardless of whether they've been verified. diff --git a/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py b/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py index 53431b597b..636dc0acef 100644 --- a/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py +++ b/tests/ops/api/v1/endpoints/test_connection_config_endpoints.py @@ -781,7 +781,7 @@ def test_get_connection_configs( "created_at", "disabled", "description", - "authorized" + "authorized", } assert connection["key"] == "my_postgres_db_1" @@ -1193,7 +1193,7 @@ def test_get_connection_config( "description", "saas_config", "secrets", - "authorized" + "authorized", } assert response_body["key"] == "my_postgres_db_1"