diff --git a/auth/build.gradle.kts b/auth/build.gradle.kts index b6f692140f2..66c9e1b4fd1 100644 --- a/auth/build.gradle.kts +++ b/auth/build.gradle.kts @@ -10,10 +10,6 @@ plugins { group = "gov.cdc.prime" version = "0.0.1-SNAPSHOT" -val ktorVersion: String by project.properties -val springCloudVersion: String by project.properties -val springCloudAzureVersion: String by project.properties - dependencies { implementation(project(":shared")) @@ -46,8 +42,8 @@ configurations.all { dependencyManagement { imports { - mavenBom("com.azure.spring:spring-cloud-azure-dependencies:$springCloudAzureVersion") - mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion") + mavenBom("com.azure.spring:spring-cloud-azure-dependencies:5.14.0") + mavenBom("org.springframework.cloud:spring-cloud-dependencies:2023.0.3") } } diff --git a/auth/gradle.properties b/auth/gradle.properties deleted file mode 100644 index 77e7944441a..00000000000 --- a/auth/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -ktorVersion=2.3.12 -springCloudVersion=2023.0.3 -springCloudAzureVersion=5.14.0 \ No newline at end of file diff --git a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/config/ApplicationConfig.kt b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/config/ApplicationConfig.kt index 861cbfbb3d5..6d81ecbfe38 100644 --- a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/config/ApplicationConfig.kt +++ b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/config/ApplicationConfig.kt @@ -12,7 +12,7 @@ import kotlin.time.TimeSource */ @Configuration @EnableConfigurationProperties(ProxyConfigurationProperties::class) -class ApplicationConfig @Autowired constructor( +class ApplicationConfig( val proxyConfig: ProxyConfigurationProperties, ) { diff --git a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthController.kt b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthController.kt index afb6d6797de..b69f1dd2d0a 100644 --- a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthController.kt +++ b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthController.kt @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController import org.springframework.web.server.ServerWebExchange @RestController -class AuthController @Autowired constructor( +class AuthController( private val proxyURIStrategy: ProxyURIStrategy, ) : Logging { diff --git a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/HealthController.kt b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/HealthController.kt index ca7fcefb468..e06306ebab2 100644 --- a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/HealthController.kt +++ b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/controller/HealthController.kt @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RestController import kotlin.time.TimeSource @RestController -class HealthController @Autowired constructor( +class HealthController( timeSource: TimeSource, ) { diff --git a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/service/ProxyURIStrategy.kt b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/service/ProxyURIStrategy.kt index c57be1ae871..b8089de1eee 100644 --- a/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/service/ProxyURIStrategy.kt +++ b/auth/src/main/kotlin/gov/cdc/prime/reportstream/auth/service/ProxyURIStrategy.kt @@ -23,7 +23,7 @@ interface ProxyURIStrategy { */ @Component @Profile("local") -class PathPrefixProxyURIStrategy @Autowired constructor( +class PathPrefixProxyURIStrategy( private val applicationConfig: ApplicationConfig, ) : ProxyURIStrategy { override fun getTargetURI(incomingUri: URI): URI { @@ -42,7 +42,7 @@ class PathPrefixProxyURIStrategy @Autowired constructor( incomingUri.fragment ) } else { - throw IllegalStateException("no configured proxy target in path mappings") + throw IllegalStateException("no configured proxy target in path mappings for path=${incomingUri.path}") } } } diff --git a/auth/src/main/resources/application.yml b/auth/src/main/resources/application.yml index ccc652e4272..fa484028c9a 100644 --- a/auth/src/main/resources/application.yml +++ b/auth/src/main/resources/application.yml @@ -22,7 +22,8 @@ proxy.pathMappings: - pathPrefix: /submissions baseUrl: http://localhost:8880 -logging: - level: - web: debug - org.springframework.web: debug +#Uncomment for verbose logging +#logging: +# level: +# web: debug +# org.springframework.web: debug diff --git a/auth/src/test/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthControllerTest.kt b/auth/src/test/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthControllerTest.kt index 56d406e8163..d6ba9e3a95b 100644 --- a/auth/src/test/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthControllerTest.kt +++ b/auth/src/test/kotlin/gov/cdc/prime/reportstream/auth/controller/AuthControllerTest.kt @@ -26,13 +26,10 @@ import kotlin.test.assertEquals @ExtendWith(SpringExtension::class) @SpringBootTest @AutoConfigureWebTestClient -class AuthControllerTest { - - @Autowired - lateinit var webTestClient: WebTestClient - - @MockBean - lateinit var mockedUriStrategy: ProxyURIStrategy +class AuthControllerTest @Autowired constructor( + private val webTestClient: WebTestClient, + @MockBean private val mockedUriStrategy: ProxyURIStrategy +) { private val server: MockWebServer = MockWebServer() diff --git a/submissions/src/main/kotlin/gov/cdc/prime/reportstream/submissions/controllers/HealthController.kt b/submissions/src/main/kotlin/gov/cdc/prime/reportstream/submissions/controllers/HealthController.kt index 067a171213d..b51bdb4f72d 100644 --- a/submissions/src/main/kotlin/gov/cdc/prime/reportstream/submissions/controllers/HealthController.kt +++ b/submissions/src/main/kotlin/gov/cdc/prime/reportstream/submissions/controllers/HealthController.kt @@ -1,6 +1,5 @@ package gov.cdc.prime.reportstream.submissions.controllers -import org.springframework.security.access.prepost.PreAuthorize import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController