Files
weblog-springboot/weblog-module-admin/build.gradle.kts
Hanserwei 0a126eb520 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
2025-11-29 15:19:35 +08:00

15 lines
361 B
Plaintext

plugins {
`java-library`
}
dependencies {
api("org.springframework.boot:spring-boot-starter-security")
implementation(project(":weblog-module-common"))
api(project(":weblog-module-jwt"))
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
}