From 7cf39926d786fa6f6988f6a8de4696ca1a2b1b45 Mon Sep 17 00:00:00 2001 From: Swordsteel Date: Fri, 17 Jan 2025 13:38:37 +0100 Subject: [PATCH] set up hlaeja account registry --- README.md | 1 + build.gradle.kts | 1 + src/main/kotlin/ltd/hlaeja/Application.kt | 5 +++++ .../kotlin/ltd/hlaeja/property/AccountRegistryProperty.kt | 8 ++++++++ src/main/resources/application.yml | 6 ++++++ src/test/resources/application.yml | 2 ++ 6 files changed, 23 insertions(+) create mode 100644 src/main/kotlin/ltd/hlaeja/property/AccountRegistryProperty.kt diff --git a/README.md b/README.md index 269ddd0..3b97d95 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ In realms of connectedness, where devices roam free, A nexus of management, harm |------------------------|:--------:|-------------------------| | spring.profiles.active | ✓ | Spring Boot environment | | jwt.public-key | ✓ | JWT public key file | +| account-registry.url | ✓ | Account Register URL | *Required: ✓ can be stored as text, and ✗ need to be stored as secret.* diff --git a/build.gradle.kts b/build.gradle.kts index a4fcda2..3d783ce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,6 +13,7 @@ dependencies { implementation(hlaeja.kotlin.logging) implementation(hlaeja.kotlin.reflect) implementation(hlaeja.kotlinx.coroutines) + implementation(hlaeja.library.hlaeja.common.messages) implementation(hlaeja.library.hlaeja.jwt) implementation(hlaeja.projectreactor.kotlin.reactor.extensions) implementation(hlaeja.springboot.starter.actuator) diff --git a/src/main/kotlin/ltd/hlaeja/Application.kt b/src/main/kotlin/ltd/hlaeja/Application.kt index 42eea90..dfbffee 100644 --- a/src/main/kotlin/ltd/hlaeja/Application.kt +++ b/src/main/kotlin/ltd/hlaeja/Application.kt @@ -1,8 +1,13 @@ package ltd.hlaeja +import ltd.hlaeja.property.AccountRegistryProperty import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.runApplication +@EnableConfigurationProperties( + AccountRegistryProperty::class, +) @SpringBootApplication class Application diff --git a/src/main/kotlin/ltd/hlaeja/property/AccountRegistryProperty.kt b/src/main/kotlin/ltd/hlaeja/property/AccountRegistryProperty.kt new file mode 100644 index 0000000..a36dd50 --- /dev/null +++ b/src/main/kotlin/ltd/hlaeja/property/AccountRegistryProperty.kt @@ -0,0 +1,8 @@ +package ltd.hlaeja.property + +import org.springframework.boot.context.properties.ConfigurationProperties + +@ConfigurationProperties(prefix = "account-registry") +data class AccountRegistryProperty( + val url: String, +) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b593733..8916164 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -43,6 +43,9 @@ spring: resources: static-locations: file:src/main/resources/static/ +account-registry: + url: http://localhost:9050 + --- ########################## ### Docker environment ### @@ -52,6 +55,9 @@ spring: activate: on-profile: docker +account-registry: + url: http://AccountRegistry:8080 + --- ############################## ### Production environment ### diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index ba1905e..5085ef8 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -1,2 +1,4 @@ jwt: public-key: cert/valid-public-key.pem +account-registry: + url: http://localhost