This is an automated email from the ASF dual-hosted git repository.

arshad pushed a commit to branch frontend-refactor
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/frontend-refactor by this push:
     new 40aefd8d57 AMBARI-26384: Ambari Web React: Disable kerberos (#4064)
40aefd8d57 is described below

commit 40aefd8d57d3b5c19113c542041e4c693d13306f
Author: Sandeep  Kumar <[email protected]>
AuthorDate: Sat Sep 13 22:44:54 2025 +0530

    AMBARI-26384: Ambari Web React: Disable kerberos (#4064)
---
 ambari-web/latest/src/components/AssignMasters.tsx |   2 +-
 .../src/screens/Kerberos/DisableKerberos.tsx       | 188 +++++++++++++++++++++
 2 files changed, 189 insertions(+), 1 deletion(-)

diff --git a/ambari-web/latest/src/components/AssignMasters.tsx 
b/ambari-web/latest/src/components/AssignMasters.tsx
index e651265b7a..fdb89f39c5 100644
--- a/ambari-web/latest/src/components/AssignMasters.tsx
+++ b/ambari-web/latest/src/components/AssignMasters.tsx
@@ -465,7 +465,7 @@ export default function AssignMasters({
                             <Select
                               id={`select-${component}`}
                               value={{ label: hostname, value: hostname }}
-                              onChange={(selectedOption) => {
+                              onChange={(selectedOption: any) => {
                                 if (selectedOption) {
                                   handleComponentChange(
                                     component,
diff --git a/ambari-web/latest/src/screens/Kerberos/DisableKerberos.tsx 
b/ambari-web/latest/src/screens/Kerberos/DisableKerberos.tsx
new file mode 100644
index 0000000000..3de90ec980
--- /dev/null
+++ b/ambari-web/latest/src/screens/Kerberos/DisableKerberos.tsx
@@ -0,0 +1,188 @@
+/**
+ * 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 { useContext, useEffect, useState } from "react";
+import { AppContext } from "../../store/context";
+import { map } from "lodash";
+import { translate } from "../../Utils/Utility";
+import { RequestApi } from "../../api/requestApi";
+import OperationsProgress from "../../components/OperationProgress";
+
+type disableKerberosProps = {
+  setDisableKerberosInProgress: any;
+};
+
+export default function disableKerberos({
+  setDisableKerberosInProgress,
+}: disableKerberosProps) {
+  const [completionStatus, setCompletionStatus] = useState(false);
+  const { clusterName, services } = useContext(AppContext);
+  // TODO: use useKDCSessionState whenever available
+
+  useEffect(() => {
+    setDisableKerberosInProgress(!completionStatus);
+  }, [completionStatus]);
+
+  const operations = [
+    {
+      id: "1",
+      label: "Start Zookeeper",
+      skippable: false,
+      context: "Start required services",
+      callback: async () => {
+        const zookeeperPayload = {
+          RequestInfo: {
+            context: "Start required services",
+            operation_level: {
+              level: "CLUSTER",
+              cluster_name: `${clusterName}`,
+            },
+          },
+          Body: {
+            ServiceInfo: {
+              state: "STARTED",
+            },
+          },
+        };
+        const params = "ServiceInfo/service_name.in(ZOOKEEPER)";
+        const requestData = await RequestApi.getServicesWithStatus(
+          clusterName,
+          zookeeperPayload,
+          params
+        );
+        return requestData;
+      },
+    },
+    {
+      id: "2",
+      label: "Stop Required Services",
+      skippable: false,
+      context: "Stop required services",
+      callback: async () => {
+        const servicesPayload = {
+          RequestInfo: {
+            context: "Stop required services",
+            operation_level: {
+              level: "CLUSTER",
+              cluster_name: `${clusterName}`,
+            },
+          },
+          Body: {
+            ServiceInfo: {
+              state: "INSTALLED",
+            },
+          },
+        };
+        const serviceNames = map(
+          services.filter(
+            (service) => service.ServiceInfo.service_name !== "ZOOKEEPER"
+          ),
+          "ServiceInfo.service_name"
+        ).join(",");
+
+        const params = `ServiceInfo/service_name.in(${serviceNames})`;
+        const requestData = await RequestApi.getServicesWithStatus(
+          clusterName,
+          servicesPayload,
+          params
+        );
+        return requestData;
+      },
+    },
+    {
+      id: "3",
+      label: "Unkerberize Cluster",
+      skippable: false,
+      context: "Unkerbize cluster",
+      callback: async () => {
+        const payload = {
+          Clusters: {
+            security_type: "NONE",
+          },
+        };
+        const requestData = await RequestApi.preparingOperations(
+          clusterName,
+          payload
+        );
+        return requestData;
+      },
+    },
+    {
+      id: "4",
+      label: "Remove Kerberos",
+      skippable: false,
+      context: "remove kerberos",
+      callback: async () => {
+        const payload = {
+          Clusters: {
+            security_type: "NONE",
+          },
+        };
+        const params = "manage_kerberos_identities=false";
+        const requestData = await RequestApi.preparingOperations(
+          clusterName,
+          payload,
+          params
+        );
+        return requestData;
+      },
+    },
+    {
+      id: "5",
+      label: "Start Services",
+      skippable: false,
+      context: "Start services",
+      callback: async () => {
+        const startAndTestServicesPayload = {
+          RequestInfo: {
+            context: "Start services",
+            operation_level: {
+              level: "CLUSTER",
+              cluster_name: `${clusterName}`,
+            },
+          },
+          Body: {
+            ServiceInfo: {
+              state: "STARTED",
+            },
+          },
+        };
+        const requestData = await RequestApi.startServices(
+          clusterName,
+          startAndTestServicesPayload,
+          ""
+        );
+        return requestData;
+      },
+    },
+  ];
+  return (
+    <>
+      {completionStatus && (
+        <div className="alert alert-success">
+          {translate("admin.security.disable.body.success.header")}
+        </div>
+      )}
+      <OperationsProgress
+        operations={operations as any}
+        title="Disable kerberos"
+        description="Disable Kerberos"
+        setCompletionStatus={setCompletionStatus}
+      />
+    </>
+  );
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to