Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UXE-6411] refactor: add null value to cipher suite option and minimum tls version #2191

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
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
8 changes: 5 additions & 3 deletions src/services/domains-services/v4/edit-domain-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const adapt = (payload) => {
alternate_domains: payload.cnames.split('\n').filter((item) => item !== ''),
active: payload.active,
tls: {
minimum_version: null
minimum_version: null,
ciphers: null
},
protocols: {
http: {
Expand All @@ -60,10 +61,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
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ describe('DomainsServicesV4', () => {
active: fixtures.domainMock.active,
tls: {
certificate: fixtures.domainMock.edgeCertificate,
minimum_version: null
minimum_version: null,
ciphers: null
},
protocols: {
http: {
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
Loading