Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/frontend/src/components/ui/connection-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function ConnectionForm({ onClose }: ConnectionFormProps) {
port: "6379",
username: "",
password: "",
tls: false,
verifyTlsCertificate: false,
tls: true,
verifyTlsCertificate: true,
alias: "",
})
const [connectionId, setConnectionId] = useState<string | null>(null)
Expand Down
53 changes: 35 additions & 18 deletions apps/frontend/src/components/ui/connection-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,25 +162,42 @@ export function ConnectionModal({
{showVerifyTlsCertificate ? "Use TLS" : "TLS"}
</Label>
</div>

{!connectionDetails.tls && (
<Alert variant="warning">
<AlertTriangle className="h-4 w-4" />
<AlertDescription>
Disabling TLS means your connection will not be encrypted.
</AlertDescription>
</Alert>
)}
{showVerifyTlsCertificate && (
<div className="flex items-center gap-2">
<input
checked={connectionDetails.verifyTlsCertificate}
className="h-4 w-4"
id="verifycert"
onChange={(e) =>
onConnectionDetailsChange({
...connectionDetails,
verifyTlsCertificate: e.target.checked,
})
}
type="checkbox"
/>
<Label className="select-none" htmlFor="verifycert">
Verify TLS Certificate
</Label>
</div>
<>
<div className="flex items-center gap-2">
<input
checked={connectionDetails.verifyTlsCertificate}
className="h-4 w-4"
id="verifycert"
onChange={(e) =>
onConnectionDetailsChange({
...connectionDetails,
verifyTlsCertificate: e.target.checked,
})
}
type="checkbox"
/>
<Label className="select-none" htmlFor="verifycert">
Verify TLS Certificate
</Label>
</div>
{connectionDetails.tls && !connectionDetails.verifyTlsCertificate && (
<Alert variant="warning">
<AlertTriangle className="h-4 w-4" />
<AlertDescription>
Disabling certificate verification makes the connection vulnerable to man-in-the-middle attacks.
</AlertDescription>
</Alert>
)}
</>
)}

{showConnectionLimitWarning && (
Expand Down
8 changes: 4 additions & 4 deletions apps/frontend/src/components/ui/edit-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function EditForm({ onClose, connectionId }: EditFormProps) {
port: "6379",
username: "",
password: "",
tls: false,
verifyTlsCertificate: false,
tls: true,
verifyTlsCertificate: true,
alias: "",
})
const [passwordDirty, setPasswordDirty] = useState(false)
Expand All @@ -49,7 +49,7 @@ function EditForm({ onClose, connectionId }: EditFormProps) {
username: currentConnection.username ?? "",
password: currentConnection.password ?? "",
alias: currentConnection.alias ?? "",
tls: currentConnection.tls ?? false,
tls: currentConnection.tls ?? true,
verifyTlsCertificate: currentConnection.verifyTlsCertificate ?? false,
//TODO: Add handling and UI for uploading cert
caCertPath: currentConnection.caCertPath ?? "",
Expand Down Expand Up @@ -142,7 +142,7 @@ function EditForm({ onClose, connectionId }: EditFormProps) {
onSubmit={handleSubmit}
open
showConnectionLimitWarning={shouldShowConnectionLimitWarning}
showVerifyTlsCertificate={false}
showVerifyTlsCertificate={true}
submitButtonText="Apply Changes"
title="Edit Connection"
/>
Expand Down
Loading