mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-28 22:34:22 +00:00
fix(api): require inline kubeconfig credentials (#12952)
Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com>
This commit is contained in:
1 parent
27c4113d29
commit
f44ea4b6fa
12 files changed
+664
-72
No files matched your search
@@ -5,8 +5,8 @@ import { Control, useWatch } from "react-hook-form";
|
||||
import { WizardTextareaField } from "@/components/providers/workflow/forms/fields";
|
||||
import { KubernetesCredentials } from "@/types";
|
||||
import {
|
||||
KUBECONFIG_UNSUPPORTED_COMMAND_AUTHENTICATION_ERROR,
|
||||
kubeconfigContainsUnsupportedCommandAuthentication,
|
||||
KUBECONFIG_NON_INLINE_CREDENTIALS_ERROR,
|
||||
kubeconfigIsInlineOnlyCredentials,
|
||||
} from "@/types/formSchemas";
|
||||
|
||||
export const KubernetesCredentialsForm = ({
|
||||
@@ -18,8 +18,9 @@ export const KubernetesCredentialsForm = ({
|
||||
control,
|
||||
name: "kubeconfig_content",
|
||||
});
|
||||
const hasUnsupportedCommandAuthentication =
|
||||
kubeconfigContainsUnsupportedCommandAuthentication(kubeconfigContent ?? "");
|
||||
const hasUnsupportedCredentials = !kubeconfigIsInlineOnlyCredentials(
|
||||
kubeconfigContent ?? "",
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -41,9 +42,9 @@ export const KubernetesCredentialsForm = ({
|
||||
minRows={10}
|
||||
isRequired
|
||||
/>
|
||||
{hasUnsupportedCommandAuthentication && (
|
||||
{hasUnsupportedCredentials && (
|
||||
<p className="text-text-error-primary text-xs">
|
||||
{KUBECONFIG_UNSUPPORTED_COMMAND_AUTHENTICATION_ERROR}
|
||||
{KUBECONFIG_NON_INLINE_CREDENTIALS_ERROR}
|
||||
</p>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user