feat: migrate VTA backend to Core JWT authentication (Phases 1-6)#289
Closed
nbhansen wants to merge 7 commits intoaau-giraf:dev-mainfrom
Closed
feat: migrate VTA backend to Core JWT authentication (Phases 1-6)#289nbhansen wants to merge 7 commits intoaau-giraf:dev-mainfrom
nbhansen wants to merge 7 commits intoaau-giraf:dev-mainfrom
Conversation
…lient (Phases 1-2) Replace VTA-issued JWT validation with Core-issued token validation: - Remove issuer/audience validation (Core doesn't set VTA-specific values) - Add JwtOrgRoleHandler with org_roles claim-based authorization - Add OrganizationMember/Admin/Owner policy requirements - Add ICoreClient/GirafCoreClient for validating citizens/orgs in Core - Remove SecretsProvider singleton, IUserService, IRelationService registrations
- Change UserId from string to int in Artefact, Category, SavedBoard, Session - Delete User, Relation, UserRole models (Core owns these now) - Create UserSettings model (VTA-specific prefs keyed by Core int user ID) - Remove User/Relation EF configurations and navigation properties - Add UserSettingsConfiguration - Update mysql_schema.sql: drop user/relation tables, add user_settings/sessions
…er (Phase 4) Delete (delegated to Core): - UsersController, AdminController, ContactsController, RelationController - UserService, IUserService, RelationService, IRelationService - SecretsProvider, UserCleanupHelper - UserDTO, RelationDTO, AdminDTO - User mapping methods from DTOConverter - Test user seeding from WebApplicationExtensions Add: - UserSettingsController (GET/PATCH for VTA-specific user preferences) Update: - ArtefactDTO/CategoryDTO UserId fields from string to int
…ases 5-6)
- Change all controllers from User.FindFirst("id") to User.FindFirst("sub") with int parsing
- Update all service interfaces/implementations from string userId to int userId
- Convert userId to string only at filesystem utility boundaries (ImageUtilities, SoundUtilities)
- Update BoardHub to parse string SignalR params to int for Session model
…uth tests - Replace login-based test helpers with JWT generation using sub/org_roles claims - Delete UsersControllerTests (tested deleted login/signup endpoints) - Delete UserServiceTests (tested deleted local auth logic) - Update all remaining tests for int user IDs - Update SyncService tests to remove User model references
Remove assumptions about a default "Board1" existing for each user, since the old SignUpAsync that auto-created it was deleted in Phase 4. Tests now explicitly create boards before asserting.
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
Migrates the VTA backend (VTA.API + SyncService) from local authentication to giraf-core JWT-based authentication, completing Phases 1-6 of the Core integration plan.
70 files changed, ~810 insertions, ~2740 deletions (net ~1900 lines deleted)
What changed
JWT_SECRET,OrganizationMember/Admin/Ownerauthorization policies based onorg_rolesclaim,ICoreClient/GirafCoreClientfor validating entities in Coreintuser IDs (matching Core), updatedmysql_schema.sqlUserSettingsControllerfor VTA-specific preferencessubclaim for user identityBreaking changes
int(previously string UUIDs)/api/Account/*,/api/Role/*How to test
cd giraf-core && docker compose up)POST /api/v1/token/pair)dotnet testRelated PRs
Builds on cleanup work from PRs #282-#288 (Phases 1-4.5 prep work).
Test plan
dotnet test— updated for Core JWT auth)