feat: add user authentication and protect endpoints with JWT

Added UsersTable to Exposed database schema

Updated KidioRepository interface and implementations for auth methods

Updated Ktor routing, application setup, and integration tests for JWT auth
This commit is contained in:
aldemirm 2026-09-04 11:35:46 +02:00
parent 05ea5a6cc3
commit cb03279c6d
217 changed files with 1013 additions and 118 deletions

Binary file not shown.

1
.idea/.name Normal file
View file

@ -0,0 +1 @@
Kidio_backend

View file

@ -0,0 +1,10 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

View file

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="" vcs="Git" />
</component> </component>
</project> </project>

View file

@ -19,12 +19,18 @@ dependencies {
implementation(ktorLibs.server.config.yaml) implementation(ktorLibs.server.config.yaml)
implementation(ktorLibs.server.core) implementation(ktorLibs.server.core)
implementation(ktorLibs.server.netty) implementation(ktorLibs.server.netty)
// JWT Authentication (NEU)
implementation("io.ktor:ktor-server-auth")
implementation("io.ktor:ktor-server-auth-jwt")
implementation(libs.logback.classic) implementation(libs.logback.classic)
// JSON-Unterstützung und Serialization // JSON-Unterstützung und Serialization
implementation("io.ktor:ktor-server-content-negotiation-jvm") implementation("io.ktor:ktor-server-content-negotiation-jvm")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm") implementation("io.ktor:ktor-serialization-kotlinx-json-jvm")
//postgres
// postgres
implementation("org.postgresql:postgresql:42.7.3") implementation("org.postgresql:postgresql:42.7.3")
implementation("org.jetbrains.exposed:exposed-core:0.50.0") implementation("org.jetbrains.exposed:exposed-core:0.50.0")
implementation("org.jetbrains.exposed:exposed-dao:0.50.0") implementation("org.jetbrains.exposed:exposed-dao:0.50.0")
@ -32,7 +38,8 @@ dependencies {
testImplementation(kotlin("test")) testImplementation(kotlin("test"))
testImplementation(ktorLibs.server.testHost) testImplementation(ktorLibs.server.testHost)
//redis // redis
implementation("redis.clients:jedis:5.1.2") implementation("redis.clients:jedis:5.1.2")
implementation("org.jetbrains.exposed:exposed-java-time:0.50.0")
} }

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more