diff --git a/src/main/kotlin/com/test/rest/TestController.kt b/src/main/kotlin/com/test/rest/TestController.kt index 70a191f..b659d7a 100644 --- a/src/main/kotlin/com/test/rest/TestController.kt +++ b/src/main/kotlin/com/test/rest/TestController.kt @@ -1,6 +1,7 @@ package com.test.rest import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Value import org.springframework.security.access.prepost.PreAuthorize import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController @@ -11,6 +12,9 @@ open class TestController { private val logger = LoggerFactory.getLogger(TestController::class.java) + @Value("\${SPRING_DATASOURCE_PASSWORD}") + private val password: String? = null + @PreAuthorize("hasRole('ADMIN')") @GetMapping("/test") fun test(): String { @@ -29,4 +33,9 @@ open class TestController { return "Home page" } + @GetMapping("/scret") + fun secret(): String { + return "password" + } + } \ No newline at end of file