Auth UX: force password change, UI login + user management, full docker stack, ADMIN-role RBAC - #46
Merged
Merged
Conversation
- V10 migration: must_change_password on app_users - UserEntity/UserService: new accounts set mustChangePassword; changePassword() re-encodes and clears the flag - AuthService.login returns LoginResult(token, mustChangePassword) - AuthController: /login returns mustChangePassword; POST /auth/change-password sets a new password for the authenticated caller - PolicyResolver: grant full perms for the ADMIN role as well as the 'admin' username (overload accepts roles; AuthorizationService passes ctx.roles()) - RbacUnitTest: adminRoleGrantsAllPermissions; AuthServiceTest/UserServiceTest cover the flag and change flow
…ting - AuthContext: token in localStorage, bearer injection via setAuthToken, /auth/me hydration, roles/isAdmin derived from the user's roles - LoginPage: JWT login form - ChangePasswordPage: first-login password change for provisioned accounts - UsersPage: user list (roles/enabled), create modal, toggle, delete - authApi/userApi services + User/Login types - App.tsx: auth guard (login/change-password/loading gates), AdminRoute wrapper; AppLayout: adminOnly nav items hidden for non-ADMIN roles - main.tsx: wrap in AuthProvider
- postgres + app (required): app on 25-jre-alpine with JWT secret, healthchecks, start_period, ddl validate (drops the missing docker profile) - connector profile: mysql (binlog ROW for Debezium CDC), mongodb, redis - kafka profile: zookeeper + kafka wired to the app - header documents required vs opt-in profiles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the auth experience end-to-end: first-login password change, a login + user-management UI, role-gated admin pages, the full local docker stack, and ADMIN-role RBAC. Builds on PR #45 (JWT auth).
Changes
Backend — first-login password change
must_change_passwordonapp_usersUserService.createsets the flag (admin-provisioned accounts must set their own password);changePassword()re-encodes + clears itAuthService.loginreturnsLoginResult(token, mustChangePassword)AuthController:/loginreturns the flag; new authenticatedPOST /auth/change-passwordBackend — ADMIN-role RBAC
PolicyResolver: grant full permissions for theADMINrole in addition to theadminusername;AuthorizationServicepassesctx.roles()ADMINrole; the backend now honors it too (not just the username)UI
AuthContext(token in localStorage, bearer injection,/auth/mehydration, roles/isAdmin),LoginPage,ChangePasswordPageUsersPage(list, roles, enable toggle, create modal, delete) +userApi/authApiAdminRoutewrapper +adminOnlynav items so non-ADMIN users see neither the nav nor the routes (/users,/agents,/admin)Docker
ddl validate)connectorsprofile: mysql (binlog ROW for Debezium), mongodb, rediskafkaprofile: zookeeper + kafka wired to the appValidation
./gradlew testgreentsc --noEmit,vite build,eslintclean (0 errors)docker compose configvalid