abhijeets25012-tech commented on code in PR #75097: URL: https://github.com/apache/airflow/pull/75097#discussion_r4315707666
########## airflow-core/src/airflow/ui/src/pages/Connections/DuplicateConnectionButton.tsx: ########## @@ -0,0 +1,87 @@ + +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF 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 { useDisclosure } from "@chakra-ui/react"; +import { useTranslation } from "react-i18next"; +import { FiCopy } from "react-icons/fi"; + +import type { ConnectionResponse } from "openapi/requests/types.gen"; + +import { IconButton, Modal } from "src/system-components"; + +import { useAddConnection } from "src/queries/useAddConnection"; + +import ConnectionForm from "./ConnectionForm"; +import type { ConnectionBody } from "./Connections"; + +type Props = { + readonly connection: ConnectionResponse; + readonly disabled: boolean; +}; + +const DuplicateConnectionButton = ({ connection, disabled }: Props) => { + const { t: translate } = useTranslation("admin"); + const { onClose, onOpen, open } = useDisclosure(); + + const initialConnection: ConnectionBody = { + conn_type: connection.conn_type, + connection_id: "", + description: connection.description ?? "", + extra: connection.extra === "" || connection.extra === null ? "{}" : connection.extra, Review Comment: Thanks for pointing this out. You're right that copying masked values from `extra` could result in `***` being saved as the actual value in the duplicated connection. I'll check how the existing connection edit flow handles masked extra fields and update the duplication flow to avoid copying masked values as real credentials. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
