From 50065cba779c64f0c84a621b7ed0c6deb14f38da Mon Sep 17 00:00:00 2001 From: Loes Immens Date: Thu, 5 Sep 2024 11:45:37 +0200 Subject: [PATCH] FDP-1968: property directly mapped to object Signed-off-by: Loes Immens --- .../coaphttpproxy/IntegrationTestCoapClient.kt | 4 ++-- .../coaphttpproxy/coap/configuration/CoapConfiguration.kt | 2 +- .../coap/configuration/properties/CoapProperties.kt | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/application/src/integrationTest/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/IntegrationTestCoapClient.kt b/application/src/integrationTest/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/IntegrationTestCoapClient.kt index 740ed71..395987b 100644 --- a/application/src/integrationTest/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/IntegrationTestCoapClient.kt +++ b/application/src/integrationTest/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/IntegrationTestCoapClient.kt @@ -30,7 +30,7 @@ class IntegrationTestCoapClient { @Value("\${config.psk.default-key}") private lateinit var defaultKey: String - @Value("\${config.coap.cipher-suites}") private lateinit var cipherSuites: List + @Value("\${config.coap.cipher-suites}") private lateinit var cipherSuites: List init { DtlsConfig.register() @@ -58,7 +58,7 @@ class IntegrationTestCoapClient { .set(DtlsConfig.DTLS_ROLE, DtlsConfig.DtlsRole.CLIENT_ONLY) .set( DtlsConfig.DTLS_CIPHER_SUITES, - cipherSuites.map { name -> CipherSuite.getTypeByName(name) }) + cipherSuites) } private fun getUri(): String = diff --git a/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/CoapConfiguration.kt b/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/CoapConfiguration.kt index 3294ce7..ed464ef 100644 --- a/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/CoapConfiguration.kt +++ b/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/CoapConfiguration.kt @@ -80,7 +80,7 @@ class CoapConfiguration( listOf(TLS_PSK_WITH_AES_128_CBC_SHA256, TLS_PSK_WITH_AES_128_GCM_SHA256)) .set( DtlsConfig.DTLS_CIPHER_SUITES, - coapProps.cipherSuites.map { name -> CipherSuite.getTypeByName(name) }) + coapProps.cipherSuites) .set(DtlsConfig.DTLS_CLIENT_AUTHENTICATION_MODE, CertificateAuthenticationMode.NONE) } diff --git a/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/properties/CoapProperties.kt b/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/properties/CoapProperties.kt index 1e4045c..7de2697 100644 --- a/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/properties/CoapProperties.kt +++ b/application/src/main/kotlin/org/gxf/standalonenotifyinggateway/coaphttpproxy/coap/configuration/properties/CoapProperties.kt @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 package org.gxf.standalonenotifyinggateway.coaphttpproxy.coap.configuration.properties +import org.eclipse.californium.scandium.dtls.cipher.CipherSuite import java.time.Duration import org.springframework.boot.context.properties.ConfigurationProperties @@ -16,5 +17,5 @@ class CoapProperties( val maxPeerInactivityPeriod: Duration, val maxResourceBodySize: Int, val preferredBlockSize: Int, - val cipherSuites: List + val cipherSuites: List )