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

#38949 removed function key #25

Merged
merged 1 commit into from
Jan 8, 2025
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
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
Loading