Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jalbinson committed Sep 6, 2024
1 parent 56ffab0 commit b8d8bd7
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 26 deletions.
8 changes: 2 additions & 6 deletions auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down Expand Up @@ -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")
}
}

Expand Down
3 changes: 0 additions & 3 deletions auth/gradle.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import kotlin.time.TimeSource
*/
@Configuration
@EnableConfigurationProperties(ProxyConfigurationProperties::class)
class ApplicationConfig @Autowired constructor(
class ApplicationConfig(
val proxyConfig: ProxyConfigurationProperties,
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RestController
import kotlin.time.TimeSource

@RestController
class HealthController @Autowired constructor(
class HealthController(
timeSource: TimeSource,
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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}")
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions auth/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit b8d8bd7

Please sign in to comment.