Commit Graph
48 Commits
Author SHA1 Message Date
zihluwang d9b74ae2e3 feat(auth): add email verification codes
- Add POST /auth/verification-code endpoint to email a code
- Store codes in Redis and verify them during registration
- Send verification emails asynchronously via Thymeleaf
- Replace email_verified column with code-based verification
- Group dependencies into version catalogue bundles
2026-08-19 13:39:36 +08:00
zihluwang 8f98d02044 feat(auth): add user registration endpoint
- Validate username, email and password on register
- Reject duplicate usernames and email addresses
- Create user with LOCAL credential and default USER role

Closes #3
2026-08-14 00:27:05 +08:00
zihluwang 1aeefb6733 refactor(auth): centralise cookie building
- Move cookie construction logic into CookieManager
- Remove CookieService
2026-08-11 12:48:20 +08:00
zihluwang dadd9a7221 refactor(auth): mark resolver params non-null
- Annotate resolveArgument parameters with jspecify @NonNull
2026-08-11 12:23:17 +08:00
zihluwang 17b919705e docs(config): document prod config options
- Add comments to datasource, redis, cookie and webhook sections
- Polish existing CORS and springdoc comments
- Enable secure cookie to satisfy same-site none
- Fix token secret and GitHub username typos
2026-08-11 12:07:18 +08:00
zihluwang 0a7882c5ce feat(auth): add configurable token renew threshold
- Add renew-threshold JWT config option with PT5M default
- Default valid-time to PT2H in TokenProperties
- Expand comments in the prod config example
2026-08-11 00:54:46 +08:00
zihluwang a765c705e6 fix(auth): use bare role names in annotations 2026-08-10 15:50:55 +08:00
zihluwang 3f60df9de2 feat(auth): add role-based authorization
- Load the user's role during authentication and expose it as
  a granted authority on the authenticated token
- Add @RequiresAdmin and @RequiresSuperUser method-level
  annotations for role-gated endpoints
- Introduce a shared BaseRepository with specification support
- Replace Example-based credential queries with JPA specifications
2026-08-10 15:49:49 +08:00
zihluwang 471eda5353 refactor(webhook): generalise controller routes
- Rename GitHubWebhookController to WebhookController
- Move class-level mapping from /webhooks/github to /webhooks
- Scope the GitHub endpoint to /webhooks/github via @PostMapping
2026-08-10 14:33:45 +08:00
zihluwang 4aafbaeadc Merge branch 'main' into develop 2026-07-21 14:23:52 +08:00
zihluwang 581634f33a Merge pull request 'feat(auth): add user profile centre and admin role system' (#12) from feature/user-profile-and-roles into develop
Reviewed-on: https://onixbyte.dev/onixbyte/delta-force-guide-server/pulls/12
Reviewed-by: Siu Jam Oh <jamo.siu@gmail.com>
2026-07-21 14:23:02 +08:00
zihluwang c1d893db5f refactor(auth): simplify role enforcement with built-in @PreAuthorize
- remove custom RequiresRole annotation and RoleBasedAuthorizationManager
- replace @RequiresRole with @PreAuthorize("hasRole('SUPER_USER')") in AdminController
- remove requiresRoleAdvisor bean from SecurityConfig
2026-07-21 14:21:13 +08:00
zihluwang db5056e8d5 feat(auth): add user profile centre and admin role system
- add GET/PUT /user/me endpoints for profile viewing and editing
- add PUT /user/me/password endpoint for password changes
- add GET /user/me/builds skeleton endpoint for future CustomModification
- add user_role table with ROLE_USER, ROLE_ADMIN, and ROLE_SUPER_USER roles
- add @RequiresRole annotation with custom AuthorizationManager enforcement
- extend User entity with nickname, avatarUrl, emailVerified, enabled,
  createdAt, and updatedAt columns
- load user roles into SecurityContext authorities via TokenAuthenticationFilter
- add @CurrentUser annotation and argument resolver for controller injection
- add PUT/DELETE /admin/users/{id}/roles for SUPER_USER role management
- add V6 and V7 Flyway migrations for schema changes

Closes #5
Closes #8
2026-07-21 13:44:02 +08:00
zihluwang bb08f1e4b6 Merge pull request 'v1.4.0' (#2) from release/v1.4.0 into main
Reviewed-on: https://git.onixbyte.com/onixbyte/delta-force-guide-server/pulls/2
2026-06-16 01:18:50 +08:00
zihluwang d323e4f8f7 chore: change traffic interceptor log level from info to debug 2026-06-02 01:46:49 +08:00
zihluwang bd4fe65b03 Merge remote-tracking branch 'origin/develop' into develop 2026-05-29 00:42:34 +08:00
zihluwang eb22b3c4bb docs: add Javadocs 2026-05-29 00:42:27 +08:00
zihluwangandClaude Opus 4.7 559ae34966 chore: remove legacy Groovy Gradle files and relocated converter
build.gradle and settings.gradle superseded by build.gradle.kts
and settings.gradle.kts. FirearmTypeConverter moved to
domain/converter/ package.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 23:58:25 +08:00
zihluwangandClaude Opus 4.7 70ae945cd2 chore: add CLAUDE.md with coding standards and build commands
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 23:56:48 +08:00
zihluwang 7fda77370e chore: update artefactVersion to 1.2.0 2026-04-23 16:24:41 +08:00
zihluwang 384e17e79c feat: add AccessoryResponse and TuningResponse DTOs for accessory and tuning data representation 2026-04-23 16:10:05 +08:00
zihluwang 353c05339e feat: refactor batch delete endpoint to use request parameters and update SQL schema for firearm table 2026-04-22 16:35:39 +08:00
zihluwang 5ce8a994a4 feat: add modification creation and deletion endpoints, including batch operations and request DTOs 2026-04-21 23:39:05 +08:00
zihluwang 93dbd857e0 feat: add update and delete operations for Firearm, including error handling 2026-04-21 14:20:45 +08:00
zihluwang dec7f3c7d2 feat: add Accessory and Tuning classes, update Modification to include accessories 2026-04-21 14:07:17 +08:00
zihluwang 17048104d9 feat: add logout operation description and update schema annotations in LoginRequest 2026-04-17 10:57:41 +08:00
zihluwang f0a8006097 feat: add Swagger annotations for user authentication endpoints and update validation in LoginRequest 2026-04-17 10:55:39 +08:00
zihluwang a58fefbd2d feat: add addFirearm endpoint and FirearmRequest DTO for firearm creation 2026-04-16 09:52:55 +08:00
zihluwang cb50892ffe feat: add builder pattern for Firearm, Modification, User, UserCredential, and UserCredentialId classes 2026-04-15 11:14:19 +08:00
zihluwang 1fc7b932bc feat: add logout endpoint and refactor cookie management in AuthController 2026-04-14 12:13:02 +08:00
zihluwang 8fbb73740c feat: implement user authentication with login endpoint and cookie management 2026-04-13 17:25:34 +08:00
zihluwang 75abbb0a2a feat: add Swagger annotations for Firearm, Modification, and Tag controllers 2026-04-13 14:38:50 +08:00
zihluwang 5e9b29c186 feat: implement JWT authentication with TokenClient, TokenAuthenticationFilter, and SecurityConfig 2026-04-13 14:32:34 +08:00
zihluwang 0a6813ceea chore: add Spring Security to library 2026-04-12 05:37:24 +08:00
zihluwang e65df08d1b feat: implement User and UserCredential models with repository and service layers 2026-04-12 05:32:31 +08:00
zihluwang 6e6843c412 Merge pull request #1 from zihluwang/develop
Enhance Firearm model and add tag filtering to queries
2026-04-09 17:53:28 +08:00
zihluwang bd1f2441f3 feat: add calibre, fire rate, armour damage, and body damage fields to Firearm model and update related response and migration scripts 2026-04-09 13:28:28 +08:00
zihluwang 0992635391 feat: add nullability annotations to findById method in ModificationRepository 2026-04-09 11:37:02 +08:00
zihluwang a28033ff4c feat: add tag filtering to modification queries and implement tag retrieval endpoint 2026-04-07 11:58:46 +08:00
zihluwang 1a88cf37bc chore: update artefact version to 1.1.0 2026-04-06 21:03:50 +08:00
zihluwang 3f6d40fba7 feat: migrate database from MySQL to PostgreSQL and update schema 2026-04-06 21:02:56 +08:00
zihluwang 33e29f48b9 feat: add firearm type filtering to page queries in Firearm and Modification services 2026-04-06 14:01:13 +08:00
zihluwang 80dc5170a4 refactor: rename query controllers and services for consistency 2026-04-03 17:47:40 +08:00
zihluwang 20c2da10ab feat: enhance Firearm entity and add query services with controllers 2026-04-03 15:38:24 +08:00
zihluwang 2616e70062 feat: add configurations and utility classes 2026-04-03 14:53:59 +08:00
zihluwang 8053bbb6b6 feat: add Firearm and Modification entities with database schema 2026-04-03 14:29:04 +08:00
zihluwang 7c249ee4be ci: add Dockerfile and .dockerignore for containerisation 2026-04-03 10:51:01 +08:00
zihluwang 06210f22dc feat: initialize project structure with Gradle and Spring Boot setup 2026-04-03 10:45:20 +08:00