Skip to content

Commit

Permalink
#38949 removed function key
Browse files Browse the repository at this point in the history
  • Loading branch information
Lesrac committed Jan 6, 2025
1 parent e37d2ac commit 227a6bf
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ data class CdrClientConfig(
val customer: List<Connector>,
val endpoint: Endpoint,
val filesInProgressCacheSize: DataSize,
val functionKey: String,
val idpCredentials: IdpCredentials,
val idpEndpoint: URL,
val localFolder: Path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import java.nio.file.Files
import java.nio.file.Path

private val logger: KLogger = KotlinLogging.logger {}
internal const val FUNCTION_KEY_HEADER = "x-functions-key"
internal const val CONNECTOR_ID_HEADER = "cdr-connector-id"
internal const val CDR_PROCESSING_MODE_HEADER = "cdr-processing-mode"
internal const val AZURE_TRACE_ID_HEADER = "x-ms-request-id"
Expand Down Expand Up @@ -85,7 +84,6 @@ abstract class FileHandlingBase(
}
return Headers.Builder().run {
this[CONNECTOR_ID_HEADER] = connectorId
this[FUNCTION_KEY_HEADER] = cdrClientConfig.functionKey
this[CDR_PROCESSING_MODE_HEADER] = mode.value
this[AZURE_TRACE_ID_HEADER] = traceId
if (accessToken != null) {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/config/application-client.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
client:
function-key: ${cdrClient.functionKey:}
local-folder: ${cdrClient.localFolder:${java.io.tmpdir}/cdr_download}
idp-credentials:
tenant-id: ${CDR_B2C_TENANT_ID:no-token}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ internal class PullDocumentDownloadSchedulerAndFileHandlerMultipleConnectorTest
every { config.customer } returns listOf(connector1, connector2)
every { config.endpoint } returns endpoint
every { config.localFolder } returns localFolder
every { config.functionKey } returns "1"
every { config.idpCredentials.tenantId } returns "something"

every { retryIoErrorsThrice.execute(any<RetryCallback<String, Exception>>()) } answers { "Mocked Result" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.swisscom.health.des.cdr.client.config

import com.swisscom.health.des.cdr.client.config.CdrClientConfig.IdpCredentials
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertDoesNotThrow
import org.junit.jupiter.api.assertThrows
Expand Down Expand Up @@ -92,7 +91,6 @@ class CdrClientConfigTest {
)

assertDoesNotThrow { cdrClientConfig.checkAndReport() }
assertFalse(cdrClientConfig.toString().contains(FUNCTION_KEY))
}

@Test
Expand Down Expand Up @@ -123,7 +121,6 @@ class CdrClientConfigTest {

private fun createCdrClientConfig(customers: List<CdrClientConfig.Connector>): CdrClientConfig {
return CdrClientConfig(
functionKey = FUNCTION_KEY,
scheduleDelay = Duration.ofSeconds(1),
localFolder = localFolder,
endpoint = CdrClientConfig.Endpoint(
Expand Down Expand Up @@ -282,11 +279,8 @@ class CdrClientConfigTest {
)

companion object {
const val FUNCTION_KEY = "functionKey123"

@JvmStatic
val FORUM_DATENAUSTAUSCH_MEDIA_TYPE = MediaType.parseMediaType("application/forumdatenaustausch+xml;charset=UTF-8")

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ internal class PullFileHandlingTest {

every { config.endpoint } returns endpoint
every { config.localFolder } returns inflightDir
every { config.functionKey } returns "1"
every { config.idpCredentials.tenantId } returns "something"

every { retryIoErrorsThrice.execute(any<RetryCallback<String, Exception>>()) } returns "Mocked Result"
Expand Down

0 comments on commit 227a6bf

Please sign in to comment.