diff --git a/src/components/resource-policy/PolicyAuthStackSectionCreate.tsx b/src/components/resource-policy/PolicyAuthStackSectionCreate.tsx index fb5ec9dfa..bc1efa3e6 100644 --- a/src/components/resource-policy/PolicyAuthStackSectionCreate.tsx +++ b/src/components/resource-policy/PolicyAuthStackSectionCreate.tsx @@ -11,7 +11,6 @@ import { import { RolesSelector } from "@app/components/roles-selector"; import { UsersSelector } from "@app/components/users-selector"; import { FormField } from "@app/components/ui/form"; -import { useEnvContext } from "@app/hooks/useEnvContext"; import { toast } from "@app/hooks/useToast"; import { useTranslations } from "next-intl"; import { useState } from "react"; @@ -45,7 +44,6 @@ export function PolicyAuthStackSectionCreate({ emailEnabled }: PolicyAuthStackSectionCreateProps) { const t = useTranslations(); - const { env } = useEnvContext(); const [editingMethod, setEditingMethod] = useState(null); @@ -80,7 +78,6 @@ export function PolicyAuthStackSectionCreate({ const passcodeActive = Boolean(password); const pinActive = Boolean(pincode); const headerAuthActive = Boolean(headerAuth); - const mtlsSupported = !env.flags.disableEnterpriseFeatures; const closeCredenza = () => setEditingMethod(null); @@ -247,34 +244,26 @@ export function PolicyAuthStackSectionCreate({ parentForm.setValue("headerAuth", null) ) } - mtls={ - mtlsSupported - ? { - active: Boolean(mtlsEnabled), - certificateCount: mtlsCertificates.length, - // applies to the policy's resources - // that have SSL enabled - sslEnabled: true, - onConfigure: () => - setEditingMethod("mtls"), - onToggle: (active) => - handleToggle( - "mtls", - active, - () => - parentForm.setValue( - "mtlsEnabled", - false - ), - () => - parentForm.setValue( - "mtlsEnabled", - true - ) - ) - } - : undefined - } + mtls={{ + active: Boolean(mtlsEnabled), + certificateCount: mtlsCertificates.length, + // applies to the policy's resources + // that have SSL enabled + sslEnabled: true, + onConfigure: () => setEditingMethod("mtls"), + onToggle: (active) => + handleToggle( + "mtls", + active, + () => + parentForm.setValue( + "mtlsEnabled", + false + ), + () => + parentForm.setValue("mtlsEnabled", true) + ) + }} /> @@ -328,33 +317,31 @@ export function PolicyAuthStackSectionCreate({ }} /> - {mtlsSupported && ( - { - if (open) return; - closeCredenza(); - // mTLS can't be enabled without a trusted CA. - if (mtlsCertificates.length === 0) { - parentForm.setValue("mtlsEnabled", false); - } - }} - certificates={mtlsCertificates.map((c, index) => ({ - mtlsCertificateId: c.mtlsCertificateId, - name: - c.name ?? - t("mtlsPendingCertificate", { - number: index + 1 - }), - subject: null, - issuer: null, - notAfter: null - }))} - isLoading={false} - onAdd={addMtlsCertificates} - onRemove={removeMtlsCertificate} - /> - )} + { + if (open) return; + closeCredenza(); + // mTLS can't be enabled without a trusted CA. + if (mtlsCertificates.length === 0) { + parentForm.setValue("mtlsEnabled", false); + } + }} + certificates={mtlsCertificates.map((c, index) => ({ + mtlsCertificateId: c.mtlsCertificateId, + name: + c.name ?? + t("mtlsPendingCertificate", { + number: index + 1 + }), + subject: null, + issuer: null, + notAfter: null + }))} + isLoading={false} + onAdd={addMtlsCertificates} + onRemove={removeMtlsCertificate} + /> ); diff --git a/src/hooks/usePolicyMtls.ts b/src/hooks/usePolicyMtls.ts index ba7765654..c4e3b67a6 100644 --- a/src/hooks/usePolicyMtls.ts +++ b/src/hooks/usePolicyMtls.ts @@ -17,9 +17,7 @@ export function usePolicyMtls() { const api = createApiClient({ env }); const resource = resourceContext?.resource; - const supported = - !env.flags.disableEnterpriseFeatures && - (!resource || resourceModeSupportsMtls(resource.mode)); + const supported = !resource || resourceModeSupportsMtls(resource.mode); const { data: certificates = [], isLoading: isLoadingCertificates } = useQuery({