mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-29 15:09:07 +01:00
Show protected when using mtls
This commit is contained in:
@@ -99,6 +99,7 @@ export default async function ProxyResourcesPage(
|
||||
resource.pincodeId !== null ||
|
||||
resource.passwordId !== null ||
|
||||
resource.whitelist ||
|
||||
resource.mtls ||
|
||||
resource.headerAuthId
|
||||
? "protected"
|
||||
: "not_protected",
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
import { useTranslations } from "next-intl";
|
||||
import CertificateStatus from "@app/components/CertificateStatus";
|
||||
import { toUnicode } from "punycode";
|
||||
import { build } from "@server/build";
|
||||
|
||||
type ResourceInfoBoxType = {};
|
||||
|
||||
@@ -118,7 +117,8 @@ export default function ResourceInfoBox({}: ResourceInfoBoxType) {
|
||||
authInfo.pincode ||
|
||||
authInfo.sso ||
|
||||
authInfo.whitelist ||
|
||||
authInfo.headerAuth ? (
|
||||
authInfo.headerAuth ||
|
||||
authInfo.mtls ? (
|
||||
<div className="flex items-center space-x-2">
|
||||
<ShieldCheck className="w-4 h-4 flex-shrink-0 text-green-500" />
|
||||
<span>{t("protected")}</span>
|
||||
|
||||
@@ -454,15 +454,22 @@ export function PolicyAuthStackSectionEdit({
|
||||
|
||||
updatePolicy(policyUpdates);
|
||||
|
||||
// Traefik only enforces mTLS with a trusted CA and SSL.
|
||||
const mtlsEnforced =
|
||||
mtls.supported &&
|
||||
mtls.enabled &&
|
||||
mtls.hasCertificates &&
|
||||
mtls.sslEnabled;
|
||||
resourceContext?.updateAuthInfo(
|
||||
isInferenceResource
|
||||
? { sso: true }
|
||||
? { sso: true, mtls: mtlsEnforced }
|
||||
: {
|
||||
sso: payload.sso,
|
||||
whitelist: payload.emailWhitelistEnabled,
|
||||
password: passcodeOnServerRef.current,
|
||||
pincode: pincodeOnServerRef.current,
|
||||
headerAuth: headerAuthOnServerRef.current
|
||||
headerAuth: headerAuthOnServerRef.current,
|
||||
mtls: mtlsEnforced
|
||||
}
|
||||
);
|
||||
|
||||
@@ -831,9 +838,12 @@ export function PolicyAuthStackSectionEdit({
|
||||
resourcePolicyId={policy.resourcePolicyId}
|
||||
certificates={mtls.certificates}
|
||||
isLoading={mtls.isLoadingCertificates}
|
||||
onMtlsDisabled={() =>
|
||||
updatePolicy({ mtlsEnabled: false })
|
||||
}
|
||||
onMtlsDisabled={() => {
|
||||
updatePolicy({ mtlsEnabled: false });
|
||||
resourceContext?.updateAuthInfo({
|
||||
mtls: false
|
||||
});
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</SettingsSectionBody>
|
||||
|
||||
Reference in New Issue
Block a user