feat: Allow to change SSL verify in HTTP Node

pull/22052/head
Davide Delbianco 11 months ago
parent f925869f61
commit 5a15002dd6
No known key found for this signature in database
GPG Key ID: 3C00412F2A31305E

@ -22,6 +22,7 @@ const nodeDefault: NodeDefault<HttpNodeType> = {
type: BodyType.none, type: BodyType.none,
data: [], data: [],
}, },
ssl_verify: true,
timeout: { timeout: {
max_connect_timeout: 0, max_connect_timeout: 0,
max_read_timeout: 0, max_read_timeout: 0,

@ -10,6 +10,7 @@ import type { HttpNodeType } from './types'
import Timeout from './components/timeout' import Timeout from './components/timeout'
import CurlPanel from './components/curl-panel' import CurlPanel from './components/curl-panel'
import cn from '@/utils/classnames' import cn from '@/utils/classnames'
import Switch from '@/app/components/base/switch'
import Field from '@/app/components/workflow/nodes/_base/components/field' import Field from '@/app/components/workflow/nodes/_base/components/field'
import Split from '@/app/components/workflow/nodes/_base/components/split' import Split from '@/app/components/workflow/nodes/_base/components/split'
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
@ -47,6 +48,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
showCurlPanel, showCurlPanel,
hideCurlPanel, hideCurlPanel,
handleCurlImport, handleCurlImport,
handleSSLVerifyChange,
} = useConfig(id, data) } = useConfig(id, data)
// To prevent prompt editor in body not update data. // To prevent prompt editor in body not update data.
if (!isDataReady) if (!isDataReady)
@ -124,6 +126,17 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
onChange={setBody} onChange={setBody}
/> />
</Field> </Field>
<Field
title={t(`${i18nPrefix}.verifySSL`)}
operations={
<Switch
defaultValue={!!inputs.ssl_verify}
onChange={handleSSLVerifyChange}
size='md'
disabled={readOnly}
/>
}>
</Field>
</div> </div>
<Split /> <Split />
<Timeout <Timeout

@ -81,4 +81,5 @@ export type HttpNodeType = CommonNodeType & {
body: Body body: Body
authorization: Authorization authorization: Authorization
timeout: Timeout timeout: Timeout
ssl_verify?: boolean
} }

@ -141,6 +141,13 @@ const useConfig = (id: string, payload: HttpNodeType) => {
setInputs(newInputs) setInputs(newInputs)
}, [inputs, setInputs]) }, [inputs, setInputs])
const handleSSLVerifyChange = useCallback((checked: boolean) => {
const newInputs = produce(inputs, (draft: HttpNodeType) => {
draft.ssl_verify = checked
})
setInputs(newInputs)
}, [inputs, setInputs])
return { return {
readOnly, readOnly,
isDataReady, isDataReady,
@ -164,6 +171,8 @@ const useConfig = (id: string, payload: HttpNodeType) => {
toggleIsParamKeyValueEdit, toggleIsParamKeyValueEdit,
// body // body
setBody, setBody,
// ssl verify
handleSSLVerifyChange,
// authorization // authorization
isShowAuthorization, isShowAuthorization,
showAuthorization, showAuthorization,

@ -537,6 +537,7 @@ const translation = {
title: 'Importieren von cURL', title: 'Importieren von cURL',
placeholder: 'Fügen Sie hier die cURL-Zeichenfolge ein', placeholder: 'Fügen Sie hier die cURL-Zeichenfolge ein',
}, },
verifySSL: 'SSL-Zertifikat überprüfen',
}, },
code: { code: {
inputVars: 'Eingabevariablen', inputVars: 'Eingabevariablen',

@ -542,6 +542,7 @@ const translation = {
title: 'Import from cURL', title: 'Import from cURL',
placeholder: 'Paste cURL string here', placeholder: 'Paste cURL string here',
}, },
verifySSL: 'Verify SSL Certificate',
}, },
code: { code: {
inputVars: 'Input Variables', inputVars: 'Input Variables',

@ -535,6 +535,7 @@ const translation = {
title: 'Importar desde cURL', title: 'Importar desde cURL',
placeholder: 'Pegar la cadena cURL aquí', placeholder: 'Pegar la cadena cURL aquí',
}, },
verifySSL: 'Verificar el certificado SSL',
}, },
code: { code: {
inputVars: 'Variables de entrada', inputVars: 'Variables de entrada',

@ -537,6 +537,7 @@ const translation = {
title: 'وارد کردن از cURL', title: 'وارد کردن از cURL',
placeholder: 'رشته cURL را اینجا بچسبانید', placeholder: 'رشته cURL را اینجا بچسبانید',
}, },
verifySSL: 'گواهی SSL را تأیید کنید',
}, },
code: { code: {
inputVars: 'متغیرهای ورودی', inputVars: 'متغیرهای ورودی',

@ -537,6 +537,7 @@ const translation = {
placeholder: 'Collez la chaîne cURL ici', placeholder: 'Collez la chaîne cURL ici',
title: 'Importer à partir de cURL', title: 'Importer à partir de cURL',
}, },
verifySSL: 'Vérifier le certificat SSL',
}, },
code: { code: {
inputVars: 'Variables de saisie', inputVars: 'Variables de saisie',

@ -550,6 +550,7 @@ const translation = {
placeholder: 'यहां cURL स्ट्रिंग पेस्ट करें', placeholder: 'यहां cURL स्ट्रिंग पेस्ट करें',
title: 'cURL से आयात करें', title: 'cURL से आयात करें',
}, },
verifySSL: 'SSL प्रमाणपत्र की पुष्टि करें',
}, },
code: { code: {
inputVars: 'इनपुट वेरिएबल्स', inputVars: 'इनपुट वेरिएबल्स',

@ -553,6 +553,7 @@ const translation = {
placeholder: 'Incolla qui la stringa cURL', placeholder: 'Incolla qui la stringa cURL',
title: 'Importazione da cURL', title: 'Importazione da cURL',
}, },
verifySSL: 'Verifica Certificato SSL',
}, },
code: { code: {
inputVars: 'Variabili di Input', inputVars: 'Variabili di Input',

@ -543,6 +543,7 @@ const translation = {
title: 'cURL からインポート', title: 'cURL からインポート',
placeholder: 'ここに cURL 文字列を貼り付けます', placeholder: 'ここに cURL 文字列を貼り付けます',
}, },
verifySSL: 'SSL証明書を確認する',
}, },
code: { code: {
inputVars: '入力変数', inputVars: '入力変数',

@ -565,6 +565,7 @@ const translation = {
title: 'cURL 에서 가져오기', title: 'cURL 에서 가져오기',
placeholder: '여기에 cURL 문자열 붙여 넣기', placeholder: '여기에 cURL 문자열 붙여 넣기',
}, },
verifySSL: 'SSL 인증서 확인',
}, },
code: { code: {
inputVars: '입력 변수', inputVars: '입력 변수',

@ -537,6 +537,7 @@ const translation = {
placeholder: 'Wklej tutaj ciąg cURL', placeholder: 'Wklej tutaj ciąg cURL',
title: 'Importowanie z cURL', title: 'Importowanie z cURL',
}, },
verifySSL: 'Zweryfikuj certyfikat SSL',
}, },
code: { code: {
inputVars: 'Zmienne wejściowe', inputVars: 'Zmienne wejściowe',

@ -537,6 +537,7 @@ const translation = {
placeholder: 'Cole a string cURL aqui', placeholder: 'Cole a string cURL aqui',
title: 'Importar do cURL', title: 'Importar do cURL',
}, },
verifySSL: 'Verificar o certificado SSL',
}, },
code: { code: {
inputVars: 'Variáveis de entrada', inputVars: 'Variáveis de entrada',

@ -537,6 +537,7 @@ const translation = {
placeholder: 'Lipiți șirul cURL aici', placeholder: 'Lipiți șirul cURL aici',
title: 'Importați din cURL', title: 'Importați din cURL',
}, },
verifySSL: 'Verifică certificatul SSL',
}, },
code: { code: {
inputVars: 'Variabile de intrare', inputVars: 'Variabile de intrare',

@ -537,6 +537,7 @@ const translation = {
placeholder: 'Вставьте сюда строку cURL', placeholder: 'Вставьте сюда строку cURL',
title: 'Импорт из cURL', title: 'Импорт из cURL',
}, },
verifySSL: 'Проверить SSL-сертификат',
}, },
code: { code: {
inputVars: 'Входные переменные', inputVars: 'Входные переменные',

@ -539,6 +539,7 @@ const translation = {
value: 'Vrednost', value: 'Vrednost',
params: 'Parametri', params: 'Parametri',
insertVarPlaceholder: 'vnesite \'/\' za vstavljanje spremenljivke', insertVarPlaceholder: 'vnesite \'/\' za vstavljanje spremenljivke',
verifySSL: 'Preverite SSL certifikat',
}, },
code: { code: {
searchDependencies: 'Išči odvisnosti', searchDependencies: 'Išči odvisnosti',

@ -537,6 +537,7 @@ const translation = {
title: 'นําเข้าจาก cURL', title: 'นําเข้าจาก cURL',
placeholder: 'วางสตริง cURL ที่นี่', placeholder: 'วางสตริง cURL ที่นี่',
}, },
verifySSL: 'ตรวจสอบใบรับรอง SSL',
}, },
code: { code: {
inputVars: 'ตัวแปรอินพุต', inputVars: 'ตัวแปรอินพุต',

@ -538,6 +538,7 @@ const translation = {
placeholder: 'cURL dizesini buraya yapıştırın', placeholder: 'cURL dizesini buraya yapıştırın',
title: 'cURL\'den içe aktar', title: 'cURL\'den içe aktar',
}, },
verifySSL: 'SSL Sertifikasını Doğrula',
}, },
code: { code: {
inputVars: 'Giriş Değişkenleri', inputVars: 'Giriş Değişkenleri',

@ -537,6 +537,7 @@ const translation = {
title: 'Імпорт з cURL', title: 'Імпорт з cURL',
placeholder: 'Вставте сюди рядок cURL', placeholder: 'Вставте сюди рядок cURL',
}, },
verifySSL: 'Перевірити SSL сертифікат',
}, },
code: { code: {
inputVars: 'Вхідні змінні', inputVars: 'Вхідні змінні',

@ -537,6 +537,7 @@ const translation = {
title: 'Nhập từ cURL', title: 'Nhập từ cURL',
placeholder: 'Dán chuỗi cURL vào đây', placeholder: 'Dán chuỗi cURL vào đây',
}, },
verifySSL: 'Xác thực chứng chỉ SSL',
}, },
code: { code: {
inputVars: 'Biến đầu vào', inputVars: 'Biến đầu vào',

@ -543,6 +543,7 @@ const translation = {
title: '导入 cURL', title: '导入 cURL',
placeholder: '粘贴 cURL 字符串', placeholder: '粘贴 cURL 字符串',
}, },
verifySSL: '验证 SSL 证书',
}, },
code: { code: {
inputVars: '输入变量', inputVars: '输入变量',

@ -537,6 +537,7 @@ const translation = {
placeholder: '在此處粘貼 cURL 字串', placeholder: '在此處粘貼 cURL 字串',
title: '從 cURL 導入', title: '從 cURL 導入',
}, },
verifySSL: '驗證 SSL 證書',
}, },
code: { code: {
inputVars: '輸入變量', inputVars: '輸入變量',

Loading…
Cancel
Save