feat(security): implement JWT-based authentication and authorization
- Configured JWT token validation filter in security chain - Added user role mapping with new t_user_role table and UserRole entity - Implemented custom authentication entry point and access denied handler - Updated UserDetailService to load user roles from database - Added @PreAuthorize annotation support for method-level security - Refactored build scripts to use java-library plugin and proper dependency scope - Enhanced SQL schema with user role table and improved table comments - Added global exception handler for AccessDeniedException - Introduced ResponseCodeEnum constants for unauthorized and forbidden access - Integrated TokenAuthenticationFilter into Spring Security filter chain
This commit is contained in:
@@ -4,21 +4,18 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
|
||||
// guava
|
||||
implementation("com.google.guava:guava:33.5.0-jre")
|
||||
// commons-lang3
|
||||
implementation("org.apache.commons:commons-lang3:3.20.0")
|
||||
// jpa
|
||||
api("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
// test
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
// jackson
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind")
|
||||
implementation("com.fasterxml.jackson.core:jackson-core")
|
||||
// aop
|
||||
implementation("org.springframework.boot:spring-boot-starter-aop")
|
||||
// web
|
||||
|
||||
api("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
api("org.springframework.boot:spring-boot-starter-web")
|
||||
// postgresql
|
||||
api("org.springframework.boot:spring-boot-starter-security")
|
||||
api("org.springframework.boot:spring-boot-starter-aop")
|
||||
|
||||
runtimeOnly("org.postgresql:postgresql")
|
||||
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("org.springframework.security:spring-security-test")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user