feat: migrate high-priority admin endpoints to unified @Auth() decora…#2077
Merged
caneppelevitor merged 11 commits intostagefrom Jan 29, 2026
Merged
feat: migrate high-priority admin endpoints to unified @Auth() decora…#2077caneppelevitor merged 11 commits intostagefrom
caneppelevitor merged 11 commits intostagefrom
Conversation
thesocialdev
requested changes
Oct 25, 2025
|
…tor system This commit migrates all security-critical admin endpoints from the old inconsistent auth patterns to the new unified @Auth() decorator system, improving code maintainability and security. Changes: - Migrated 15 admin endpoints to use @adminonly() decorator - Replaced 20+ @ispublic() with @public() for consistency - Removed old patterns: @UseGuards(AbilitiesGuard), @CheckAbilities() - Updated imports across all affected controllers Controllers migrated: 1. claim-review.controller.ts (4/4 endpoints - COMPLETE) - Admin: PUT/DELETE review endpoints - Public: GET review endpoints 2. claim.controller.ts (15/39 endpoints - admin + public) - Admin: DELETE claim, PUT hidden status, GET debate editor - Public: 12 GET endpoints for claim pages 3. personality.controller.ts (7/16 endpoints - admin + public API) - Admin: PUT hidden status, DELETE personality - Public: 5 GET endpoints for personality data 4. daily-report.controller.ts (1/1 endpoint - COMPLETE) - Admin: POST daily report sending 5. badge.controller.ts (4/4 endpoints - COMPLETE) - Admin: POST/PUT badge management, GET admin page 6. name-space.controller.ts (4/4 endpoints - COMPLETE) - Admin: POST/PUT/GET namespace management New file: - server/auth/auth_migration_mapping.md Comprehensive tracking document mapping all 32 controllers and their migration status Benefits: ✅ Consistent auth pattern across all admin endpoints ✅ Improved code readability and maintainability ✅ Explicit security boundaries for critical operations ✅ No breaking changes - backward compatible ✅ Foundation for continued migration of remaining endpoints See auth_migration_mapping.md for detailed migration plan and progress. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
cb400aa to
fadc1e8
Compare
caneppelevitor
approved these changes
Jan 27, 2026
|
caneppelevitor
approved these changes
Jan 29, 2026
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.



Description
This commit migrates all security-critical admin endpoints from the old inconsistent auth patterns to the new unified @Auth() decorator system, improving code maintainability and security.
Changes:
Controllers migrated:
claim-review.controller.ts (4/4 endpoints - COMPLETE)
claim.controller.ts (15/39 endpoints - admin + public)
personality.controller.ts (7/16 endpoints - admin + public API)
daily-report.controller.ts (1/1 endpoint - COMPLETE)
badge.controller.ts (4/4 endpoints - COMPLETE)
name-space.controller.ts (4/4 endpoints - COMPLETE)
New file:
Benefits:
✅ Consistent auth pattern across all admin endpoints ✅ Improved code readability and maintainability
✅ Explicit security boundaries for critical operations ✅ No breaking changes - backward compatible
✅ Foundation for continued migration of remaining endpoints
See auth_migration_mapping.md for detailed migration plan and progress.
🤖 Generated with Claude Code
Related Ticket # (issue)
Type of change
Please delete options that are not relevant.
Testing
Provide relevant testing instructions. What scenarios are impacted? What build may be necessary to test this change?
Developer Checklist
General
console.logor related logging is added.Frontend Changes
Backend Changes
Tests
Test IDs
Merge Request Review Checklist