Skip to content

Commit

Permalink
refactor: add null value to chiper and tls options
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloSF0 committed Feb 18, 2025
1 parent f8a1ea1 commit f9a25c7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/services/domains-services/v4/create-domain-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ const adapt = (payload) => {
dataRequest.tls.certificate = payload.edgeCertificate
}
if (payload.supportedCiphers && payload.useHttps) {
dataRequest.tls.ciphers = payload.supportedCiphers === 'all' ? null : payload.supportedCiphers
dataRequest.tls.ciphers = payload.supportedCiphers === 'null' ? null : payload.supportedCiphers
}
if (payload.minimumTlsVersion && payload.useHttps) {
dataRequest.tls.minimum_version = payload.minimumTlsVersion
dataRequest.tls.minimum_version =
payload.minimumTlsVersion === 'null' ? null : payload.minimumTlsVersion
}

return dataRequest
Expand Down
5 changes: 3 additions & 2 deletions src/services/domains-services/v4/edit-domain-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ const adapt = (payload) => {
dataRequest.tls.certificate = payload.edgeCertificate
}
if (payload.supportedCiphers && payload.useHttps) {
dataRequest.tls.ciphers = payload.supportedCiphers === 'all' ? null : payload.supportedCiphers
dataRequest.tls.ciphers = payload.supportedCiphers === 'null' ? null : payload.supportedCiphers
}
if (payload.minimumTlsVersion && payload.useHttps) {
dataRequest.tls.minimum_version = payload.minimumTlsVersion
dataRequest.tls.minimum_version =
payload.minimumTlsVersion === 'null' ? null : payload.minimumTlsVersion
}

return dataRequest
Expand Down
4 changes: 2 additions & 2 deletions src/services/domains-services/v4/load-domain-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const adapt = (httpResponse) => {
httpsPort: handlerHttp(body.protocols.http.https_ports, HTTPS_PORT_LIST_OPTIONS),
quicPort: handlerHttp(body.protocols.http.quic_ports, HTTP3_PORT_LIST_OPTIONS),
httpPort: handlerHttp(body.protocols.http.http_ports, HTTP_PORT_LIST_OPTIONS),
supportedCiphers: body.tls.ciphers,
minimumTlsVersion: body.tls.minimum_version
supportedCiphers: String(body.tls.ciphers),
minimumTlsVersion: String(body.tls.minimum_version)
}

return {
Expand Down
4 changes: 2 additions & 2 deletions src/views/Domains/FormFields/FormFieldsCreateDomains.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
{ name: '8090', value: 8090 }
]
const TLS_VERSIONS_OPTIONS = [
{ label: 'None', value: 'none' },
{ label: 'None', value: 'null' },
{ label: 'TLS 1.0', value: 'tls_1_0' },
{ label: 'TLS 1.1', value: 'tls_1_1' },
{ label: 'TLS 1.2', value: 'tls_1_2' },
{ label: 'TLS 1.3', value: 'tls_1_3' }
]
const SUPPORTED_CIPHERS_LIST_OPTIONS = [
{ label: 'All', value: 'all' },
{ label: 'All', value: 'null' },
{ label: 'TLSv1.2_2018', value: 'TLSv1.2_2018' },
{ label: 'TLSv1.2_2019', value: 'TLSv1.2_2019' },
{ label: 'TLSv1.2_2021', value: 'TLSv1.2_2021' },
Expand Down
10 changes: 8 additions & 2 deletions src/views/Domains/FormFields/FormFieldsEditDomains.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
{ name: '8090', value: 8090 }
]
const TLS_VERSIONS_OPTIONS = [
{ label: 'None', value: 'none' },
{ label: 'None', value: 'null' },
{ label: 'TLS 1.0', value: 'tls_1_0' },
{ label: 'TLS 1.1', value: 'tls_1_1' },
{ label: 'TLS 1.2', value: 'tls_1_2' },
{ label: 'TLS 1.3', value: 'tls_1_3' }
]
const SUPPORTED_CIPHERS_LIST_OPTIONS = [
{ label: 'All', value: 'all' },
{ label: 'All', value: 'null' },
{ label: 'TLSv1.2_2018', value: 'TLSv1.2_2018' },
{ label: 'TLSv1.2_2019', value: 'TLSv1.2_2019' },
{ label: 'TLSv1.2_2021', value: 'TLSv1.2_2021' },
Expand Down Expand Up @@ -155,6 +155,12 @@
}
})
watch(useHttps, (newValue) => {
if (newValue && !httpsPort.value) {
httpsPort.value = [HTTPS_PORT_LIST_OPTIONS[0]]
}
})
const digitalCertificateDrawerRef = ref('')
const openDigitalCertificateDrawer = () => {
digitalCertificateDrawerRef.value.openCreateDrawer()
Expand Down

0 comments on commit f9a25c7

Please sign in to comment.