44b8326e96
- Add JwtUtils for token generation and validation using jjwt - Refactor AuthService.login to return User instead of Boolean - Add jjwt dependencies and integrate JWT into login flow - Externalize JWT secret, expiration, and log level as configurable env vars with defaults
54 lines
1.7 KiB
Kotlin
54 lines
1.7 KiB
Kotlin
plugins {
|
|
kotlin("jvm") version "2.2.21"
|
|
kotlin("plugin.spring") version "2.2.21"
|
|
id("org.springframework.boot") version "4.0.6"
|
|
id("io.spring.dependency-management") version "1.1.7"
|
|
}
|
|
|
|
group = "com.msksbr"
|
|
version = "0.0.1-SNAPSHOT"
|
|
description = "bookMgr"
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation("org.springframework.boot:spring-boot-starter")
|
|
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
|
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
implementation("org.springframework.security:spring-security-crypto")
|
|
implementation("org.bouncycastle:bcprov-jdk18on:1.84")
|
|
implementation("com.mysql:mysql-connector-j")
|
|
implementation("com.baomidou:mybatis-plus-spring-boot4-starter:3.5.15")
|
|
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
|
implementation("org.springframework.boot:spring-boot-starter-validation")
|
|
implementation("io.github.oshai:kotlin-logging-jvm:7.0.0")
|
|
implementation("io.jsonwebtoken:jjwt-api:0.13.0")
|
|
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.13.0")
|
|
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.13.0")
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
|
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
freeCompilerArgs.addAll("-Xjsr305=strict", "-Xannotation-default-target=param-property")
|
|
}
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
// 打包时排除dev环境配置
|
|
tasks.named<ProcessResources>("processResources") {
|
|
exclude("application-dev.yaml")
|
|
} |