Skip to content

Commit

Permalink
Create admin-server component
Browse files Browse the repository at this point in the history
* Added Spring boot with status API

* chores: PR feedback

* Updated the server name in gradle module
  • Loading branch information
robertmathew authored Jul 1, 2024
1 parent 4fb1b70 commit aaf4c43
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .fleet/run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"configurations": [
{
"name": "OpenID-Federation [:server:build]",
"type": "gradle",
"workingDir": "$PROJECT_DIR$",
"tasks": [
":server:build"
],
"args": [
""
],
"initScripts": {
"flmapper": "ext.mapPath = { path -> null }"
}
},
{
"name": "OpenID-Federation [build]",
"type": "gradle",
"workingDir": "$PROJECT_DIR$",
"tasks": [
"build"
],
"args": [
""
],
"initScripts": {
"flmapper": "ext.mapPath = { path -> null }"
}
}
]
}
12 changes: 12 additions & 0 deletions .fleet/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
{
"type": "add",
"pluginName": "fleet.spring.boot"
},
{
"type": "add",
"pluginName": "fleet.mercury"
}
]
}
34 changes: 34 additions & 0 deletions admin-server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
alias(libs.plugins.springboot)
alias(libs.plugins.springDependencyManagement)
alias(libs.plugins.kotlinJvm)
alias(libs.plugins.kotlinPluginSpring)
application
}

group = "com.sphereon.oid.fed"
version = "1.0.0"

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

dependencies {
implementation(libs.springboot.actuator)
implementation(libs.springboot.web)
implementation(libs.kotlin.reflect)

runtimeOnly(libs.springboot.devtools)
}

kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
11 changes: 11 additions & 0 deletions admin-server/src/main/kotlin/com/sphereon/oid/fed/Application.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.sphereon.oid.fed

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class Application

fun main(args: Array<String>) {
runApplication<Application>(*args)
}
5 changes: 5 additions & 0 deletions admin-server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
spring.application.name=OpenID Federation

# Mapping /actuator/health to /status
management.endpoints.web.base-path=/
management.endpoints.web.path-mapping.health=status
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ plugins {
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.springboot) apply false
alias(libs.plugins.springDependencyManagement) apply false
alias(libs.plugins.kotlinPluginSpring) apply false
}
17 changes: 10 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ compose-plugin = "1.6.10"
junit = "4.13.2"
kotlin = "2.0.0"
kotlinxSerializationJson = "1.7.0-RC"
ktor = "2.3.11"
logback = "1.5.6"
springboot = "3.3.1"
springDependencyManagement = "1.1.5"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand All @@ -29,16 +29,19 @@ androidx-material = { group = "com.google.android.material", name = "material",
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
ktor-server-core = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
ktor-server-netty = { module = "io.ktor:ktor-server-netty-jvm", version.ref = "ktor" }
ktor-server-tests = { module = "io.ktor:ktor-server-tests-jvm", version.ref = "ktor" }

kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" }
springboot-actuator = { group = "org.springframework.boot", name = "spring-boot-starter-actuator" }
springboot-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" }
springboot-devtools = { group = "org.springframework.boot", name = "spring-boot-devtools" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ktor = { id = "io.ktor.plugin", version.ref = "ktor" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
springboot = { id = "org.springframework.boot", version.ref = "springboot" }
springDependencyManagement = { id = "io.spring.dependency-management", version.ref = "springDependencyManagement" }
kotlinPluginSpring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ dependencyResolutionManagement {
}

include(":modules:openid-federation-common")
include(":admin-server")

0 comments on commit aaf4c43

Please sign in to comment.